@event-calendar/build 4.5.2 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"event-calendar.min.js","sources":["../../../node_modules/svelte/src/internal/shared/utils.js","../../../node_modules/svelte/src/internal/client/constants.js","../../../node_modules/svelte/src/internal/shared/errors.js","../../../node_modules/svelte/src/internal/client/errors.js","../../../node_modules/svelte/src/constants.js","../../../node_modules/svelte/src/internal/client/dom/hydration.js","../../../node_modules/svelte/src/internal/client/reactivity/equality.js","../../../node_modules/svelte/src/internal/flags/index.js","../../../node_modules/svelte/src/internal/client/context.js","../../../node_modules/svelte/src/internal/client/error-handling.js","../../../node_modules/svelte/src/internal/client/dom/task.js","../../../node_modules/svelte/src/internal/client/dom/blocks/boundary.js","../../../node_modules/svelte/src/internal/client/reactivity/deriveds.js","../../../node_modules/svelte/src/internal/client/reactivity/async.js","../../../node_modules/svelte/src/internal/client/reactivity/batch.js","../../../node_modules/svelte/src/internal/client/reactivity/sources.js","../../../node_modules/svelte/src/internal/client/proxy.js","../../../node_modules/svelte/src/internal/client/dom/operations.js","../../../node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js","../../../node_modules/svelte/src/internal/client/reactivity/effects.js","../../../node_modules/svelte/src/internal/client/runtime.js","../../../node_modules/svelte/src/utils.js","../../../node_modules/svelte/src/internal/client/dom/elements/events.js","../../../node_modules/svelte/src/internal/client/dom/reconciler.js","../../../node_modules/svelte/src/internal/client/dom/template.js","../../../node_modules/svelte/src/internal/client/render.js","../../../node_modules/svelte/src/internal/client/dom/blocks/if.js","../../../node_modules/svelte/src/internal/client/dom/blocks/each.js","../../../node_modules/svelte/src/internal/client/dom/blocks/snippet.js","../../../node_modules/svelte/src/internal/client/dom/blocks/svelte-component.js","../../../node_modules/svelte/src/internal/client/dom/elements/actions.js","../../../node_modules/clsx/dist/clsx.mjs","../../../node_modules/svelte/src/internal/shared/attributes.js","../../../node_modules/svelte/src/internal/client/dom/elements/class.js","../../../node_modules/svelte/src/internal/client/dom/elements/style.js","../../../node_modules/svelte/src/internal/client/dom/elements/attributes.js","../../../node_modules/svelte/src/internal/client/dom/elements/bindings/props.js","../../../node_modules/svelte/src/internal/client/dom/elements/bindings/this.js","../../../node_modules/svelte/src/internal/client/dom/legacy/lifecycle.js","../../../node_modules/svelte/src/store/utils.js","../../../node_modules/svelte/src/store/shared/index.js","../../../node_modules/svelte/src/internal/client/reactivity/store.js","../../../node_modules/svelte/src/internal/client/reactivity/props.js","../../../node_modules/svelte/src/index-client.js","../../../node_modules/svelte/src/version.js","../../../node_modules/svelte/src/internal/disclose-version.js","../../core/src/lib/a11y.js","../../core/src/lib/actions.js","../../core/src/lib/date.js","../../core/src/lib/utils.js","../../core/src/lib/debounce.js","../../core/src/lib/payload.js","../../core/src/lib/dom.js","../../core/src/lib/view.js","../../core/src/lib/events.js","../../core/src/lib/options.js","../../core/src/lib/range.js","../../core/src/lib/resources.js","../../core/src/lib/stores.js","../../core/src/lib/times.js","../../core/src/storage/options.js","../../core/src/storage/stores.js","../../core/src/storage/state.js","../../../node_modules/svelte/src/internal/flags/legacy.js","../../core/src/Buttons.svelte","../../core/src/Toolbar.svelte","../../core/src/Auxiliary.svelte","../../core/src/Calendar.svelte","../../core/src/plugins/day-grid/stores.js","../../core/src/plugins/day-grid/Header.svelte","../../../node_modules/svelte/src/reactivity/set.js","../../core/src/lib/components/BaseEvent.svelte","../../core/src/lib/components/InteractableEvent.svelte","../../core/src/plugins/day-grid/Event.svelte","../../core/src/plugins/day-grid/Popup.svelte","../../core/src/plugins/day-grid/Day.svelte","../../core/src/plugins/day-grid/Week.svelte","../../core/src/plugins/day-grid/Body.svelte","../../core/src/plugins/day-grid/View.svelte","../../core/src/plugins/day-grid/index.js","../../core/src/plugins/interaction/lib/events.js","../../core/src/plugins/interaction/lib/utils.js","../../core/src/plugins/interaction/Action.svelte","../../core/src/plugins/interaction/Pointer.svelte","../../core/src/plugins/interaction/Resizer.svelte","../../core/src/plugins/interaction/Auxiliary.svelte","../../core/src/plugins/interaction/index.js","../../core/src/plugins/list/Event.svelte","../../core/src/plugins/list/Day.svelte","../../core/src/plugins/list/Body.svelte","../../core/src/plugins/list/View.svelte","../../core/src/plugins/list/index.js","../../core/src/plugins/time-grid/stores.js","../../core/src/plugins/time-grid/utils.js","../../core/src/plugins/time-grid/Section.svelte","../../core/src/plugins/time-grid/Body.svelte","../../core/src/plugins/time-grid/Event.svelte","../../core/src/plugins/time-grid/NowIndicator.svelte","../../core/src/plugins/time-grid/Day.svelte","../../core/src/plugins/time-grid/all-day/Event.svelte","../../core/src/plugins/time-grid/all-day/Day.svelte","../../core/src/plugins/time-grid/all-day/Week.svelte","../../core/src/plugins/time-grid/View.svelte","../../core/src/plugins/time-grid/index.js","../../core/src/plugins/resource-time-grid/Label.svelte","../../core/src/plugins/resource-time-grid/View.svelte","../../core/src/plugins/resource-time-grid/index.js","../../core/src/plugins/resource-timeline/stores.js","../../core/src/plugins/resource-timeline/Label.svelte","../../core/src/plugins/resource-timeline/Expander.svelte","../../core/src/plugins/resource-timeline/Sidebar.svelte","../../core/src/plugins/resource-timeline/Header.svelte","../../core/src/plugins/resource-timeline/lib.js","../../core/src/plugins/resource-timeline/Event.svelte","../../core/src/plugins/resource-timeline/Day.svelte","../../core/src/plugins/resource-timeline/Days.svelte","../../core/src/plugins/resource-timeline/Body.svelte","../../core/src/plugins/resource-timeline/NowIndicator.svelte","../../core/src/plugins/resource-timeline/View.svelte","../../core/src/plugins/resource-timeline/index.js","../../core/src/index.es.js","../../core/src/index.iife.js"],"sourcesContent":["// Store the references to globals in case someone tries to monkey patch these, causing the below\n// to de-opt (this occurs often when using popular extensions).\nexport var is_array = Array.isArray;\nexport var index_of = Array.prototype.indexOf;\nexport var array_from = Array.from;\nexport var object_keys = Object.keys;\nexport var define_property = Object.defineProperty;\nexport var get_descriptor = Object.getOwnPropertyDescriptor;\nexport var get_descriptors = Object.getOwnPropertyDescriptors;\nexport var object_prototype = Object.prototype;\nexport var array_prototype = Array.prototype;\nexport var get_prototype_of = Object.getPrototypeOf;\nexport var is_extensible = Object.isExtensible;\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\nexport const noop = () => {};\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n\n/**\n * @template [T=any]\n * @param {any} value\n * @returns {value is PromiseLike<T>}\n */\nexport function is_promise(value) {\n\treturn typeof value?.then === 'function';\n}\n\n/** @param {Function} fn */\nexport function run(fn) {\n\treturn fn();\n}\n\n/** @param {Array<() => void>} arr */\nexport function run_all(arr) {\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tarr[i]();\n\t}\n}\n\n/**\n * TODO replace with Promise.withResolvers once supported widely enough\n * @template T\n */\nexport function deferred() {\n\t/** @type {(value: T) => void} */\n\tvar resolve;\n\n\t/** @type {(reason: any) => void} */\n\tvar reject;\n\n\t/** @type {Promise<T>} */\n\tvar promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\n\t// @ts-expect-error\n\treturn { promise, resolve, reject };\n}\n\n/**\n * @template V\n * @param {V} value\n * @param {V | (() => V)} fallback\n * @param {boolean} [lazy]\n * @returns {V}\n */\nexport function fallback(value, fallback, lazy = false) {\n\treturn value === undefined\n\t\t? lazy\n\t\t\t? /** @type {() => V} */ (fallback)()\n\t\t\t: /** @type {V} */ (fallback)\n\t\t: value;\n}\n\n/**\n * When encountering a situation like `let [a, b, c] = $derived(blah())`,\n * we need to stash an intermediate value that `a`, `b`, and `c` derive\n * from, in case it's an iterable\n * @template T\n * @param {ArrayLike<T> | Iterable<T>} value\n * @param {number} [n]\n * @returns {Array<T>}\n */\nexport function to_array(value, n) {\n\t// return arrays unchanged\n\tif (Array.isArray(value)) {\n\t\treturn value;\n\t}\n\n\t// if value is not iterable, or `n` is unspecified (indicates a rest\n\t// element, which means we're not concerned about unbounded iterables)\n\t// convert to an array with `Array.from`\n\tif (n === undefined || !(Symbol.iterator in value)) {\n\t\treturn Array.from(value);\n\t}\n\n\t// otherwise, populate an array with `n` values\n\n\t/** @type {T[]} */\n\tconst array = [];\n\n\tfor (const element of value) {\n\t\tarray.push(element);\n\t\tif (array.length === n) break;\n\t}\n\n\treturn array;\n}\n","export const DERIVED = 1 << 1;\nexport const EFFECT = 1 << 2;\nexport const RENDER_EFFECT = 1 << 3;\nexport const BLOCK_EFFECT = 1 << 4;\nexport const BRANCH_EFFECT = 1 << 5;\nexport const ROOT_EFFECT = 1 << 6;\nexport const BOUNDARY_EFFECT = 1 << 7;\nexport const UNOWNED = 1 << 8;\nexport const DISCONNECTED = 1 << 9;\nexport const CLEAN = 1 << 10;\nexport const DIRTY = 1 << 11;\nexport const MAYBE_DIRTY = 1 << 12;\nexport const INERT = 1 << 13;\nexport const DESTROYED = 1 << 14;\nexport const EFFECT_RAN = 1 << 15;\n/** 'Transparent' effects do not create a transition boundary */\nexport const EFFECT_TRANSPARENT = 1 << 16;\nexport const INSPECT_EFFECT = 1 << 17;\nexport const HEAD_EFFECT = 1 << 18;\nexport const EFFECT_PRESERVED = 1 << 19;\nexport const USER_EFFECT = 1 << 20;\n\n// Flags used for async\nexport const REACTION_IS_UPDATING = 1 << 21;\nexport const ASYNC = 1 << 22;\n\nexport const ERROR_VALUE = 1 << 23;\n\nexport const STATE_SYMBOL = Symbol('$state');\nexport const LEGACY_PROPS = Symbol('legacy props');\nexport const LOADING_ATTR_SYMBOL = Symbol('');\nexport const PROXY_PATH_SYMBOL = Symbol('proxy path');\n\n/** allow users to ignore aborted signal errors if `reason.name === 'StaleReactionError` */\nexport const STALE_REACTION = new (class StaleReactionError extends Error {\n\tname = 'StaleReactionError';\n\tmessage = 'The reaction that called `getAbortSignal()` was re-run or destroyed';\n})();\n\nexport const ELEMENT_NODE = 1;\nexport const TEXT_NODE = 3;\nexport const COMMENT_NODE = 8;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\n/**\n * Cannot await outside a `<svelte:boundary>` with a `pending` snippet\n * @returns {never}\n */\nexport function await_outside_boundary() {\n\tif (DEV) {\n\t\tconst error = new Error(`await_outside_boundary\\nCannot await outside a \\`<svelte:boundary>\\` with a \\`pending\\` snippet\\nhttps://svelte.dev/e/await_outside_boundary`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/await_outside_boundary`);\n\t}\n}\n\n/**\n * Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead\n * @returns {never}\n */\nexport function invalid_default_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_default_snippet\\nCannot use \\`{@render children(...)}\\` if the parent component uses \\`let:\\` directives. Consider using a named snippet instead\\nhttps://svelte.dev/e/invalid_default_snippet`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_default_snippet`);\n\t}\n}\n\n/**\n * A snippet function was passed invalid arguments. Snippets should only be instantiated via `{@render ...}`\n * @returns {never}\n */\nexport function invalid_snippet_arguments() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_snippet_arguments\\nA snippet function was passed invalid arguments. Snippets should only be instantiated via \\`{@render ...}\\`\\nhttps://svelte.dev/e/invalid_snippet_arguments`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_snippet_arguments`);\n\t}\n}\n\n/**\n * `%name%(...)` can only be used during component initialisation\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_outside_component(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_outside_component\\n\\`${name}(...)\\` can only be used during component initialisation\\nhttps://svelte.dev/e/lifecycle_outside_component`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_outside_component`);\n\t}\n}\n\n/**\n * Attempted to render a snippet without a `{@render}` block. This would cause the snippet code to be stringified instead of its content being rendered to the DOM. To fix this, change `{snippet}` to `{@render snippet()}`.\n * @returns {never}\n */\nexport function snippet_without_render_tag() {\n\tif (DEV) {\n\t\tconst error = new Error(`snippet_without_render_tag\\nAttempted to render a snippet without a \\`{@render}\\` block. This would cause the snippet code to be stringified instead of its content being rendered to the DOM. To fix this, change \\`{snippet}\\` to \\`{@render snippet()}\\`.\\nhttps://svelte.dev/e/snippet_without_render_tag`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/snippet_without_render_tag`);\n\t}\n}\n\n/**\n * `%name%` is not a store with a `subscribe` method\n * @param {string} name\n * @returns {never}\n */\nexport function store_invalid_shape(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`store_invalid_shape\\n\\`${name}\\` is not a store with a \\`subscribe\\` method\\nhttps://svelte.dev/e/store_invalid_shape`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/store_invalid_shape`);\n\t}\n}\n\n/**\n * The `this` prop on `<svelte:element>` must be a string, if defined\n * @returns {never}\n */\nexport function svelte_element_invalid_this_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`svelte_element_invalid_this_value\\nThe \\`this\\` prop on \\`<svelte:element>\\` must be a string, if defined\\nhttps://svelte.dev/e/svelte_element_invalid_this_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/svelte_element_invalid_this_value`);\n\t}\n}","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\nexport * from '../shared/errors.js';\n\n/**\n * Cannot create a `$derived(...)` with an `await` expression outside of an effect tree\n * @returns {never}\n */\nexport function async_derived_orphan() {\n\tif (DEV) {\n\t\tconst error = new Error(`async_derived_orphan\\nCannot create a \\`$derived(...)\\` with an \\`await\\` expression outside of an effect tree\\nhttps://svelte.dev/e/async_derived_orphan`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/async_derived_orphan`);\n\t}\n}\n\n/**\n * Using `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\n * @returns {never}\n */\nexport function bind_invalid_checkbox_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_checkbox_value\\nUsing \\`bind:value\\` together with a checkbox input is not allowed. Use \\`bind:checked\\` instead\\nhttps://svelte.dev/e/bind_invalid_checkbox_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_checkbox_value`);\n\t}\n}\n\n/**\n * 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%`)\n * @param {string} component\n * @param {string} key\n * @param {string} name\n * @returns {never}\n */\nexport function bind_invalid_export(component, key, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_export\\nComponent ${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}\\`)\\nhttps://svelte.dev/e/bind_invalid_export`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_export`);\n\t}\n}\n\n/**\n * 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()`\n * @param {string} key\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function bind_not_bindable(key, component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_not_bindable\\nA 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()\\`\\nhttps://svelte.dev/e/bind_not_bindable`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_not_bindable`);\n\t}\n}\n\n/**\n * Calling `%method%` on a component instance (of %component%) is no longer valid in Svelte 5\n * @param {string} method\n * @param {string} component\n * @returns {never}\n */\nexport function component_api_changed(method, component) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_changed\\nCalling \\`${method}\\` on a component instance (of ${component}) is no longer valid in Svelte 5\\nhttps://svelte.dev/e/component_api_changed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_changed`);\n\t}\n}\n\n/**\n * 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.\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function component_api_invalid_new(component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_invalid_new\\nAttempted 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.\\nhttps://svelte.dev/e/component_api_invalid_new`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_invalid_new`);\n\t}\n}\n\n/**\n * A derived value cannot reference itself recursively\n * @returns {never}\n */\nexport function derived_references_self() {\n\tif (DEV) {\n\t\tconst error = new Error(`derived_references_self\\nA derived value cannot reference itself recursively\\nhttps://svelte.dev/e/derived_references_self`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/derived_references_self`);\n\t}\n}\n\n/**\n * Keyed each block has duplicate key `%value%` at indexes %a% and %b%\n * @param {string} a\n * @param {string} b\n * @param {string | undefined | null} [value]\n * @returns {never}\n */\nexport function each_key_duplicate(a, b, value) {\n\tif (DEV) {\n\t\tconst error = new Error(`each_key_duplicate\\n${value\n\t\t\t? `Keyed each block has duplicate key \\`${value}\\` at indexes ${a} and ${b}`\n\t\t\t: `Keyed each block has duplicate key at indexes ${a} and ${b}`}\\nhttps://svelte.dev/e/each_key_duplicate`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/each_key_duplicate`);\n\t}\n}\n\n/**\n * `%rune%` cannot be used inside an effect cleanup function\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_in_teardown(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_teardown\\n\\`${rune}\\` cannot be used inside an effect cleanup function\\nhttps://svelte.dev/e/effect_in_teardown`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_teardown`);\n\t}\n}\n\n/**\n * Effect cannot be created inside a `$derived` value that was not itself created inside an effect\n * @returns {never}\n */\nexport function effect_in_unowned_derived() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_unowned_derived\\nEffect cannot be created inside a \\`$derived\\` value that was not itself created inside an effect\\nhttps://svelte.dev/e/effect_in_unowned_derived`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_unowned_derived`);\n\t}\n}\n\n/**\n * `%rune%` can only be used inside an effect (e.g. during component initialisation)\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_orphan(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_orphan\\n\\`${rune}\\` can only be used inside an effect (e.g. during component initialisation)\\nhttps://svelte.dev/e/effect_orphan`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_orphan`);\n\t}\n}\n\n/**\n * `$effect.pending()` can only be called inside an effect or derived\n * @returns {never}\n */\nexport function effect_pending_outside_reaction() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_pending_outside_reaction\\n\\`$effect.pending()\\` can only be called inside an effect or derived\\nhttps://svelte.dev/e/effect_pending_outside_reaction`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_pending_outside_reaction`);\n\t}\n}\n\n/**\n * Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state\n * @returns {never}\n */\nexport function effect_update_depth_exceeded() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_update_depth_exceeded\\nMaximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state\\nhttps://svelte.dev/e/effect_update_depth_exceeded`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);\n\t}\n}\n\n/**\n * Cannot use `flushSync` inside an effect\n * @returns {never}\n */\nexport function flush_sync_in_effect() {\n\tif (DEV) {\n\t\tconst error = new Error(`flush_sync_in_effect\\nCannot use \\`flushSync\\` inside an effect\\nhttps://svelte.dev/e/flush_sync_in_effect`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/flush_sync_in_effect`);\n\t}\n}\n\n/**\n * `getAbortSignal()` can only be called inside an effect or derived\n * @returns {never}\n */\nexport function get_abort_signal_outside_reaction() {\n\tif (DEV) {\n\t\tconst error = new Error(`get_abort_signal_outside_reaction\\n\\`getAbortSignal()\\` can only be called inside an effect or derived\\nhttps://svelte.dev/e/get_abort_signal_outside_reaction`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/get_abort_signal_outside_reaction`);\n\t}\n}\n\n/**\n * Failed to hydrate the application\n * @returns {never}\n */\nexport function hydration_failed() {\n\tif (DEV) {\n\t\tconst error = new Error(`hydration_failed\\nFailed to hydrate the application\\nhttps://svelte.dev/e/hydration_failed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/hydration_failed`);\n\t}\n}\n\n/**\n * Could not `{@render}` snippet due to the expression being `null` or `undefined`. Consider using optional chaining `{@render snippet?.()}`\n * @returns {never}\n */\nexport function invalid_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_snippet\\nCould not \\`{@render}\\` snippet due to the expression being \\`null\\` or \\`undefined\\`. Consider using optional chaining \\`{@render snippet?.()}\\`\\nhttps://svelte.dev/e/invalid_snippet`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_snippet`);\n\t}\n}\n\n/**\n * `%name%(...)` cannot be used in runes mode\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_legacy_only(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_legacy_only\\n\\`${name}(...)\\` cannot be used in runes mode\\nhttps://svelte.dev/e/lifecycle_legacy_only`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_legacy_only`);\n\t}\n}\n\n/**\n * Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value\n * @param {string} key\n * @returns {never}\n */\nexport function props_invalid_value(key) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_invalid_value\\nCannot do \\`bind:${key}={undefined}\\` when \\`${key}\\` has a fallback value\\nhttps://svelte.dev/e/props_invalid_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_invalid_value`);\n\t}\n}\n\n/**\n * Rest element properties of `$props()` such as `%property%` are readonly\n * @param {string} property\n * @returns {never}\n */\nexport function props_rest_readonly(property) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_rest_readonly\\nRest element properties of \\`$props()\\` such as \\`${property}\\` are readonly\\nhttps://svelte.dev/e/props_rest_readonly`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_rest_readonly`);\n\t}\n}\n\n/**\n * The `%rune%` rune is only available inside `.svelte` and `.svelte.js/ts` files\n * @param {string} rune\n * @returns {never}\n */\nexport function rune_outside_svelte(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`rune_outside_svelte\\nThe \\`${rune}\\` rune is only available inside \\`.svelte\\` and \\`.svelte.js/ts\\` files\\nhttps://svelte.dev/e/rune_outside_svelte`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/rune_outside_svelte`);\n\t}\n}\n\n/**\n * `setContext` must be called when a component first initializes, not in a subsequent effect or after an `await` expression\n * @returns {never}\n */\nexport function set_context_after_init() {\n\tif (DEV) {\n\t\tconst error = new Error(`set_context_after_init\\n\\`setContext\\` must be called when a component first initializes, not in a subsequent effect or after an \\`await\\` expression\\nhttps://svelte.dev/e/set_context_after_init`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/set_context_after_init`);\n\t}\n}\n\n/**\n * Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\n * @returns {never}\n */\nexport function state_descriptors_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_descriptors_fixed\\nProperty descriptors defined on \\`$state\\` objects must contain \\`value\\` and always be \\`enumerable\\`, \\`configurable\\` and \\`writable\\`.\\nhttps://svelte.dev/e/state_descriptors_fixed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_descriptors_fixed`);\n\t}\n}\n\n/**\n * Cannot set prototype of `$state` object\n * @returns {never}\n */\nexport function state_prototype_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_prototype_fixed\\nCannot set prototype of \\`$state\\` object\\nhttps://svelte.dev/e/state_prototype_fixed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_prototype_fixed`);\n\t}\n}\n\n/**\n * Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\n * @returns {never}\n */\nexport function state_unsafe_mutation() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_unsafe_mutation\\nUpdating state inside \\`$derived(...)\\`, \\`$inspect(...)\\` or a template expression is forbidden. If the value should not be reactive, declare it without \\`$state\\`\\nhttps://svelte.dev/e/state_unsafe_mutation`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_unsafe_mutation`);\n\t}\n}\n\n/**\n * A `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\n * @returns {never}\n */\nexport function svelte_boundary_reset_onerror() {\n\tif (DEV) {\n\t\tconst error = new Error(`svelte_boundary_reset_onerror\\nA \\`<svelte:boundary>\\` \\`reset\\` function cannot be called while an error is still being handled\\nhttps://svelte.dev/e/svelte_boundary_reset_onerror`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);\n\t}\n}","export const EACH_ITEM_REACTIVE = 1;\nexport const EACH_INDEX_REACTIVE = 1 << 1;\n/** See EachBlock interface metadata.is_controlled for an explanation what this is */\nexport const EACH_IS_CONTROLLED = 1 << 2;\nexport const EACH_IS_ANIMATED = 1 << 3;\nexport const EACH_ITEM_IMMUTABLE = 1 << 4;\n\nexport const PROPS_IS_IMMUTABLE = 1;\nexport const PROPS_IS_RUNES = 1 << 1;\nexport const PROPS_IS_UPDATED = 1 << 2;\nexport const PROPS_IS_BINDABLE = 1 << 3;\nexport const PROPS_IS_LAZY_INITIAL = 1 << 4;\n\nexport const TRANSITION_IN = 1;\nexport const TRANSITION_OUT = 1 << 1;\nexport const TRANSITION_GLOBAL = 1 << 2;\n\nexport const TEMPLATE_FRAGMENT = 1;\nexport const TEMPLATE_USE_IMPORT_NODE = 1 << 1;\nexport const TEMPLATE_USE_SVG = 1 << 2;\nexport const TEMPLATE_USE_MATHML = 1 << 3;\n\nexport const HYDRATION_START = '[';\n/** used to indicate that an `{:else}...` block was rendered */\nexport const HYDRATION_START_ELSE = '[!';\nexport const HYDRATION_END = ']';\nexport const HYDRATION_ERROR = {};\n\nexport const ELEMENT_IS_NAMESPACED = 1;\nexport const ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;\n\nexport const UNINITIALIZED = Symbol();\n\n// Dev-time component properties\nexport const FILENAME = Symbol('filename');\nexport const HMR = Symbol('hmr');\n\nexport const NAMESPACE_HTML = 'http://www.w3.org/1999/xhtml';\nexport const NAMESPACE_SVG = 'http://www.w3.org/2000/svg';\nexport const NAMESPACE_MATHML = 'http://www.w3.org/1998/Math/MathML';\n\n// we use a list of ignorable runtime warnings because not every runtime warning\n// can be ignored and we want to keep the validation for svelte-ignore in place\nexport const IGNORABLE_RUNTIME_WARNINGS = /** @type {const} */ ([\n\t'await_waterfall',\n\t'await_reactivity_loss',\n\t'state_snapshot_uncloneable',\n\t'binding_property_non_reactive',\n\t'hydration_attribute_changed',\n\t'hydration_html_changed',\n\t'ownership_invalid_binding',\n\t'ownership_invalid_mutation'\n]);\n\n/**\n * Whitespace inside one of these elements will not result in\n * a whitespace node being created in any circumstances. (This\n * list is almost certainly very incomplete)\n * TODO this is currently unused\n */\nexport const ELEMENTS_WITHOUT_TEXT = ['audio', 'datalist', 'dl', 'optgroup', 'select', 'video'];\n\nexport const ATTACHMENT_KEY = '@attach';\n","/** @import { TemplateNode } from '#client' */\n\nimport { COMMENT_NODE } from '#client/constants';\nimport {\n\tHYDRATION_END,\n\tHYDRATION_ERROR,\n\tHYDRATION_START,\n\tHYDRATION_START_ELSE\n} from '../../../constants.js';\nimport * as w from '../warnings.js';\nimport { get_next_sibling } from './operations.js';\n\n/**\n * Use this variable to guard everything related to hydration code so it can be treeshaken out\n * if the user doesn't use the `hydrate` method and these code paths are therefore not needed.\n */\nexport let hydrating = false;\n\n/** @param {boolean} value */\nexport function set_hydrating(value) {\n\thydrating = value;\n}\n\n/**\n * The node that is currently being hydrated. This starts out as the first node inside the opening\n * <!--[--> comment, and updates each time a component calls `$.child(...)` or `$.sibling(...)`.\n * When entering a block (e.g. `{#if ...}`), `hydrate_node` is the block opening comment; by the\n * time we leave the block it is the closing comment, which serves as the block's anchor.\n * @type {TemplateNode}\n */\nexport let hydrate_node;\n\n/** @param {TemplateNode} node */\nexport function set_hydrate_node(node) {\n\tif (node === null) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\treturn (hydrate_node = node);\n}\n\nexport function hydrate_next() {\n\treturn set_hydrate_node(/** @type {TemplateNode} */ (get_next_sibling(hydrate_node)));\n}\n\n/** @param {TemplateNode} node */\nexport function reset(node) {\n\tif (!hydrating) return;\n\n\t// If the node has remaining siblings, something has gone wrong\n\tif (get_next_sibling(hydrate_node) !== null) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\thydrate_node = node;\n}\n\n/**\n * @param {HTMLTemplateElement} template\n */\nexport function hydrate_template(template) {\n\tif (hydrating) {\n\t\t// @ts-expect-error TemplateNode doesn't include DocumentFragment, but it's actually fine\n\t\thydrate_node = template.content;\n\t}\n}\n\nexport function next(count = 1) {\n\tif (hydrating) {\n\t\tvar i = count;\n\t\tvar node = hydrate_node;\n\n\t\twhile (i--) {\n\t\t\tnode = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\t}\n\n\t\thydrate_node = node;\n\t}\n}\n\n/**\n * Removes all nodes starting at `hydrate_node` up until the next hydration end comment\n */\nexport function remove_nodes() {\n\tvar depth = 0;\n\tvar node = hydrate_node;\n\n\twhile (true) {\n\t\tif (node.nodeType === COMMENT_NODE) {\n\t\t\tvar data = /** @type {Comment} */ (node).data;\n\n\t\t\tif (data === HYDRATION_END) {\n\t\t\t\tif (depth === 0) return node;\n\t\t\t\tdepth -= 1;\n\t\t\t} else if (data === HYDRATION_START || data === HYDRATION_START_ELSE) {\n\t\t\t\tdepth += 1;\n\t\t\t}\n\t\t}\n\n\t\tvar next = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tnode.remove();\n\t\tnode = next;\n\t}\n}\n\n/**\n *\n * @param {TemplateNode} node\n */\nexport function read_hydration_instruction(node) {\n\tif (!node || node.nodeType !== COMMENT_NODE) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\treturn /** @type {Comment} */ (node).data;\n}\n","/** @import { Equals } from '#client' */\n\n/** @type {Equals} */\nexport function equals(value) {\n\treturn value === this.v;\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function safe_not_equal(a, b) {\n\treturn a != a\n\t\t? b == b\n\t\t: a !== b || (a !== null && typeof a === 'object') || typeof a === 'function';\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function not_equal(a, b) {\n\treturn a !== b;\n}\n\n/** @type {Equals} */\nexport function safe_equals(value) {\n\treturn !safe_not_equal(value, this.v);\n}\n","export let async_mode_flag = false;\nexport let legacy_mode_flag = false;\nexport let tracing_mode_flag = false;\n\nexport function enable_async_mode_flag() {\n\tasync_mode_flag = true;\n}\n\n/** ONLY USE THIS DURING TESTING */\nexport function disable_async_mode_flag() {\n\tasync_mode_flag = false;\n}\n\nexport function enable_legacy_mode_flag() {\n\tlegacy_mode_flag = true;\n}\n\nexport function enable_tracing_mode_flag() {\n\ttracing_mode_flag = true;\n}\n","/** @import { ComponentContext, DevStackEntry, Effect } from '#client' */\nimport { DEV } from 'esm-env';\nimport * as e from './errors.js';\nimport { active_effect, active_reaction } from './runtime.js';\nimport { create_user_effect } from './reactivity/effects.js';\nimport { async_mode_flag, legacy_mode_flag } from '../flags/index.js';\nimport { FILENAME } from '../../constants.js';\nimport { BRANCH_EFFECT, EFFECT_RAN } from './constants.js';\n\n/** @type {ComponentContext | null} */\nexport let component_context = null;\n\n/** @param {ComponentContext | null} context */\nexport function set_component_context(context) {\n\tcomponent_context = context;\n}\n\n/** @type {DevStackEntry | null} */\nexport let dev_stack = null;\n\n/** @param {DevStackEntry | null} stack */\nexport function set_dev_stack(stack) {\n\tdev_stack = stack;\n}\n\n/**\n * Execute a callback with a new dev stack entry\n * @param {() => any} callback - Function to execute\n * @param {DevStackEntry['type']} type - Type of block/component\n * @param {any} component - Component function\n * @param {number} line - Line number\n * @param {number} column - Column number\n * @param {Record<string, any>} [additional] - Any additional properties to add to the dev stack entry\n * @returns {any}\n */\nexport function add_svelte_meta(callback, type, component, line, column, additional) {\n\tconst parent = dev_stack;\n\n\tdev_stack = {\n\t\ttype,\n\t\tfile: component[FILENAME],\n\t\tline,\n\t\tcolumn,\n\t\tparent,\n\t\t...additional\n\t};\n\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tdev_stack = parent;\n\t}\n}\n\n/**\n * The current component function. Different from current component context:\n * ```html\n * <!-- App.svelte -->\n * <Foo>\n * <Bar /> <!-- context == Foo.svelte, function == App.svelte -->\n * </Foo>\n * ```\n * @type {ComponentContext['function']}\n */\nexport let dev_current_component_function = null;\n\n/** @param {ComponentContext['function']} fn */\nexport function set_dev_current_component_function(fn) {\n\tdev_current_component_function = fn;\n}\n\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * @template T\n * @param {any} key\n * @returns {T}\n */\nexport function getContext(key) {\n\tconst context_map = get_or_init_context_map('getContext');\n\tconst result = /** @type {T} */ (context_map.get(key));\n\treturn result;\n}\n\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * @template T\n * @param {any} key\n * @param {T} context\n * @returns {T}\n */\nexport function setContext(key, context) {\n\tconst context_map = get_or_init_context_map('setContext');\n\n\tif (async_mode_flag) {\n\t\tvar flags = /** @type {Effect} */ (active_effect).f;\n\t\tvar valid = !active_reaction && (flags & BRANCH_EFFECT) !== 0 && (flags & EFFECT_RAN) === 0;\n\n\t\tif (!valid) {\n\t\t\te.set_context_after_init();\n\t\t}\n\t}\n\n\tcontext_map.set(key, context);\n\treturn context;\n}\n\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * @param {any} key\n * @returns {boolean}\n */\nexport function hasContext(key) {\n\tconst context_map = get_or_init_context_map('hasContext');\n\treturn context_map.has(key);\n}\n\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * @template {Map<any, any>} [T=Map<any, any>]\n * @returns {T}\n */\nexport function getAllContexts() {\n\tconst context_map = get_or_init_context_map('getAllContexts');\n\treturn /** @type {T} */ (context_map);\n}\n\n/**\n * @param {Record<string, unknown>} props\n * @param {any} runes\n * @param {Function} [fn]\n * @returns {void}\n */\nexport function push(props, runes = false, fn) {\n\tcomponent_context = {\n\t\tp: component_context,\n\t\tc: null,\n\t\te: null,\n\t\ts: props,\n\t\tx: null,\n\t\tl: legacy_mode_flag && !runes ? { s: null, u: null, $: [] } : null\n\t};\n\n\tif (DEV) {\n\t\t// component function\n\t\tcomponent_context.function = fn;\n\t\tdev_current_component_function = fn;\n\t}\n}\n\n/**\n * @template {Record<string, any>} T\n * @param {T} [component]\n * @returns {T}\n */\nexport function pop(component) {\n\tvar context = /** @type {ComponentContext} */ (component_context);\n\tvar effects = context.e;\n\n\tif (effects !== null) {\n\t\tcontext.e = null;\n\n\t\tfor (var fn of effects) {\n\t\t\tcreate_user_effect(fn);\n\t\t}\n\t}\n\n\tif (component !== undefined) {\n\t\tcontext.x = component;\n\t}\n\n\tcomponent_context = context.p;\n\n\tif (DEV) {\n\t\tdev_current_component_function = component_context?.function ?? null;\n\t}\n\n\treturn component ?? /** @type {T} */ ({});\n}\n\n/** @returns {boolean} */\nexport function is_runes() {\n\treturn !legacy_mode_flag || (component_context !== null && component_context.l === null);\n}\n\n/**\n * @param {string} name\n * @returns {Map<unknown, unknown>}\n */\nfunction get_or_init_context_map(name) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component(name);\n\t}\n\n\treturn (component_context.c ??= new Map(get_parent_context(component_context) || undefined));\n}\n\n/**\n * @param {ComponentContext} component_context\n * @returns {Map<unknown, unknown> | null}\n */\nfunction get_parent_context(component_context) {\n\tlet parent = component_context.p;\n\twhile (parent !== null) {\n\t\tconst context_map = parent.c;\n\t\tif (context_map !== null) {\n\t\t\treturn context_map;\n\t\t}\n\t\tparent = parent.p;\n\t}\n\treturn null;\n}\n","/** @import { Derived, Effect } from '#client' */\n/** @import { Boundary } from './dom/blocks/boundary.js' */\nimport { DEV } from 'esm-env';\nimport { FILENAME } from '../../constants.js';\nimport { is_firefox } from './dom/operations.js';\nimport { ERROR_VALUE, BOUNDARY_EFFECT, EFFECT_RAN } from './constants.js';\nimport { define_property, get_descriptor } from '../shared/utils.js';\nimport { active_effect, active_reaction } from './runtime.js';\n\nconst adjustments = new WeakMap();\n\n/**\n * @param {unknown} error\n */\nexport function handle_error(error) {\n\tvar effect = active_effect;\n\n\t// for unowned deriveds, don't throw until we read the value\n\tif (effect === null) {\n\t\t/** @type {Derived} */ (active_reaction).f |= ERROR_VALUE;\n\t\treturn error;\n\t}\n\n\tif (DEV && error instanceof Error && !adjustments.has(error)) {\n\t\tadjustments.set(error, get_adjustments(error, effect));\n\t}\n\n\tif ((effect.f & EFFECT_RAN) === 0) {\n\t\t// if the error occurred while creating this subtree, we let it\n\t\t// bubble up until it hits a boundary that can handle it\n\t\tif ((effect.f & BOUNDARY_EFFECT) === 0) {\n\t\t\tif (!effect.parent && error instanceof Error) {\n\t\t\t\tapply_adjustments(error);\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\n\t\t/** @type {Boundary} */ (effect.b).error(error);\n\t} else {\n\t\t// otherwise we bubble up the effect tree ourselves\n\t\tinvoke_error_boundary(error, effect);\n\t}\n}\n\n/**\n * @param {unknown} error\n * @param {Effect | null} effect\n */\nexport function invoke_error_boundary(error, effect) {\n\twhile (effect !== null) {\n\t\tif ((effect.f & BOUNDARY_EFFECT) !== 0) {\n\t\t\ttry {\n\t\t\t\t/** @type {Boundary} */ (effect.b).error(error);\n\t\t\t\treturn;\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\n\t\teffect = effect.parent;\n\t}\n\n\tif (error instanceof Error) {\n\t\tapply_adjustments(error);\n\t}\n\n\tthrow error;\n}\n\n/**\n * Add useful information to the error message/stack in development\n * @param {Error} error\n * @param {Effect} effect\n */\nfunction get_adjustments(error, effect) {\n\tconst message_descriptor = get_descriptor(error, 'message');\n\n\t// if the message was already changed and it's not configurable we can't change it\n\t// or it will throw a different error swallowing the original error\n\tif (message_descriptor && !message_descriptor.configurable) return;\n\n\tvar indent = is_firefox ? ' ' : '\\t';\n\tvar component_stack = `\\n${indent}in ${effect.fn?.name || '<unknown>'}`;\n\tvar context = effect.ctx;\n\n\twhile (context !== null) {\n\t\tcomponent_stack += `\\n${indent}in ${context.function?.[FILENAME].split('/').pop()}`;\n\t\tcontext = context.p;\n\t}\n\n\treturn {\n\t\tmessage: error.message + `\\n${component_stack}\\n`,\n\t\tstack: error.stack\n\t\t\t?.split('\\n')\n\t\t\t.filter((line) => !line.includes('svelte/src/internal'))\n\t\t\t.join('\\n')\n\t};\n}\n\n/**\n * @param {Error} error\n */\nfunction apply_adjustments(error) {\n\tconst adjusted = adjustments.get(error);\n\n\tif (adjusted) {\n\t\tdefine_property(error, 'message', {\n\t\t\tvalue: adjusted.message\n\t\t});\n\n\t\tdefine_property(error, 'stack', {\n\t\t\tvalue: adjusted.stack\n\t\t});\n\t}\n}\n","import { run_all } from '../../shared/utils.js';\n\n// Fallback for when requestIdleCallback is not available\nconst request_idle_callback =\n\ttypeof requestIdleCallback === 'undefined'\n\t\t? (/** @type {() => void} */ cb) => setTimeout(cb, 1)\n\t\t: requestIdleCallback;\n\n/** @type {Array<() => void>} */\nlet micro_tasks = [];\n\n/** @type {Array<() => void>} */\nlet idle_tasks = [];\n\nfunction run_micro_tasks() {\n\tvar tasks = micro_tasks;\n\tmicro_tasks = [];\n\trun_all(tasks);\n}\n\nfunction run_idle_tasks() {\n\tvar tasks = idle_tasks;\n\tidle_tasks = [];\n\trun_all(tasks);\n}\n\n/**\n * @param {() => void} fn\n */\nexport function queue_micro_task(fn) {\n\tif (micro_tasks.length === 0) {\n\t\tqueueMicrotask(run_micro_tasks);\n\t}\n\n\tmicro_tasks.push(fn);\n}\n\n/**\n * @param {() => void} fn\n */\nexport function queue_idle_task(fn) {\n\tif (idle_tasks.length === 0) {\n\t\trequest_idle_callback(run_idle_tasks);\n\t}\n\n\tidle_tasks.push(fn);\n}\n\n/**\n * Synchronously run any queued tasks.\n */\nexport function flush_tasks() {\n\tif (micro_tasks.length > 0) {\n\t\trun_micro_tasks();\n\t}\n\n\tif (idle_tasks.length > 0) {\n\t\trun_idle_tasks();\n\t}\n}\n","/** @import { Effect, Source, TemplateNode, } from '#client' */\nimport {\n\tBOUNDARY_EFFECT,\n\tEFFECT_PRESERVED,\n\tEFFECT_RAN,\n\tEFFECT_TRANSPARENT\n} from '#client/constants';\nimport { component_context, set_component_context } from '../../context.js';\nimport { handle_error, invoke_error_boundary } from '../../error-handling.js';\nimport { block, branch, destroy_effect, pause_effect } from '../../reactivity/effects.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tget,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tnext,\n\tremove_nodes,\n\tset_hydrate_node\n} from '../hydration.js';\nimport { get_next_sibling } from '../operations.js';\nimport { queue_micro_task } from '../task.js';\nimport * as e from '../../errors.js';\nimport * as w from '../../warnings.js';\nimport { DEV } from 'esm-env';\nimport { Batch, effect_pending_updates } from '../../reactivity/batch.js';\nimport { internal_set, source } from '../../reactivity/sources.js';\nimport { tag } from '../../dev/tracing.js';\nimport { createSubscriber } from '../../../../reactivity/create-subscriber.js';\n\n/**\n * @typedef {{\n * \t onerror?: (error: unknown, reset: () => void) => void;\n * failed?: (anchor: Node, error: () => unknown, reset: () => () => void) => void;\n * pending?: (anchor: Node) => void;\n * }} BoundaryProps\n */\n\nvar flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED | BOUNDARY_EFFECT;\n\n/**\n * @param {TemplateNode} node\n * @param {BoundaryProps} props\n * @param {((anchor: Node) => void)} children\n * @returns {void}\n */\nexport function boundary(node, props, children) {\n\tnew Boundary(node, props, children);\n}\n\nexport class Boundary {\n\tpending = false;\n\n\t/** @type {Boundary | null} */\n\tparent;\n\n\t/** @type {TemplateNode} */\n\t#anchor;\n\n\t/** @type {TemplateNode} */\n\t#hydrate_open;\n\n\t/** @type {BoundaryProps} */\n\t#props;\n\n\t/** @type {((anchor: Node) => void)} */\n\t#children;\n\n\t/** @type {Effect} */\n\t#effect;\n\n\t/** @type {Effect | null} */\n\t#main_effect = null;\n\n\t/** @type {Effect | null} */\n\t#pending_effect = null;\n\n\t/** @type {Effect | null} */\n\t#failed_effect = null;\n\n\t/** @type {DocumentFragment | null} */\n\t#offscreen_fragment = null;\n\n\t#pending_count = 0;\n\t#is_creating_fallback = false;\n\n\t/**\n\t * A source containing the number of pending async deriveds/expressions.\n\t * Only created if `$effect.pending()` is used inside the boundary,\n\t * otherwise updating the source results in needless `Batch.ensure()`\n\t * calls followed by no-op flushes\n\t * @type {Source<number> | null}\n\t */\n\t#effect_pending = null;\n\n\t#effect_pending_update = () => {\n\t\tif (this.#effect_pending) {\n\t\t\tinternal_set(this.#effect_pending, this.#pending_count);\n\t\t}\n\t};\n\n\t#effect_pending_subscriber = createSubscriber(() => {\n\t\tthis.#effect_pending = source(this.#pending_count);\n\n\t\tif (DEV) {\n\t\t\ttag(this.#effect_pending, '$effect.pending()');\n\t\t}\n\n\t\treturn () => {\n\t\t\tthis.#effect_pending = null;\n\t\t};\n\t});\n\n\t/**\n\t * @param {TemplateNode} node\n\t * @param {BoundaryProps} props\n\t * @param {((anchor: Node) => void)} children\n\t */\n\tconstructor(node, props, children) {\n\t\tthis.#anchor = node;\n\t\tthis.#props = props;\n\t\tthis.#children = children;\n\n\t\tthis.#hydrate_open = hydrate_node;\n\n\t\tthis.parent = /** @type {Effect} */ (active_effect).b;\n\n\t\tthis.pending = !!this.#props.pending;\n\n\t\tthis.#effect = block(() => {\n\t\t\t/** @type {Effect} */ (active_effect).b = this;\n\n\t\t\tif (hydrating) {\n\t\t\t\thydrate_next();\n\t\t\t}\n\n\t\t\tconst pending = this.#props.pending;\n\n\t\t\tif (hydrating && pending) {\n\t\t\t\tthis.#pending_effect = branch(() => pending(this.#anchor));\n\n\t\t\t\t// future work: when we have some form of async SSR, we will\n\t\t\t\t// need to use hydration boundary comments to report whether\n\t\t\t\t// the pending or main block was rendered for a given\n\t\t\t\t// boundary, and hydrate accordingly\n\t\t\t\tBatch.enqueue(() => {\n\t\t\t\t\tthis.#main_effect = this.#run(() => {\n\t\t\t\t\t\tBatch.ensure();\n\t\t\t\t\t\treturn branch(() => this.#children(this.#anchor));\n\t\t\t\t\t});\n\n\t\t\t\t\tif (this.#pending_count > 0) {\n\t\t\t\t\t\tthis.#show_pending_snippet();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpause_effect(/** @type {Effect} */ (this.#pending_effect), () => {\n\t\t\t\t\t\t\tthis.#pending_effect = null;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tthis.pending = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tthis.#main_effect = branch(() => children(this.#anchor));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.error(error);\n\t\t\t\t}\n\n\t\t\t\tif (this.#pending_count > 0) {\n\t\t\t\t\tthis.#show_pending_snippet();\n\t\t\t\t} else {\n\t\t\t\t\tthis.pending = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}, flags);\n\n\t\tif (hydrating) {\n\t\t\tthis.#anchor = hydrate_node;\n\t\t}\n\t}\n\n\thas_pending_snippet() {\n\t\treturn !!this.#props.pending;\n\t}\n\n\t/**\n\t * @param {() => Effect | null} fn\n\t */\n\t#run(fn) {\n\t\tvar previous_effect = active_effect;\n\t\tvar previous_reaction = active_reaction;\n\t\tvar previous_ctx = component_context;\n\n\t\tset_active_effect(this.#effect);\n\t\tset_active_reaction(this.#effect);\n\t\tset_component_context(this.#effect.ctx);\n\n\t\ttry {\n\t\t\treturn fn();\n\t\t} catch (e) {\n\t\t\thandle_error(e);\n\t\t\treturn null;\n\t\t} finally {\n\t\t\tset_active_effect(previous_effect);\n\t\t\tset_active_reaction(previous_reaction);\n\t\t\tset_component_context(previous_ctx);\n\t\t}\n\t}\n\n\t#show_pending_snippet() {\n\t\tconst pending = /** @type {(anchor: Node) => void} */ (this.#props.pending);\n\n\t\tif (this.#main_effect !== null) {\n\t\t\tthis.#offscreen_fragment = document.createDocumentFragment();\n\t\t\tmove_effect(this.#main_effect, this.#offscreen_fragment);\n\t\t}\n\n\t\tif (this.#pending_effect === null) {\n\t\t\tthis.#pending_effect = branch(() => pending(this.#anchor));\n\t\t}\n\t}\n\n\t/** @param {1 | -1} d */\n\t#update_pending_count(d) {\n\t\tthis.#pending_count += d;\n\n\t\tif (this.#pending_count === 0) {\n\t\t\tthis.pending = false;\n\n\t\t\tif (this.#pending_effect) {\n\t\t\t\tpause_effect(this.#pending_effect, () => {\n\t\t\t\t\tthis.#pending_effect = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (this.#offscreen_fragment) {\n\t\t\t\tthis.#anchor.before(this.#offscreen_fragment);\n\t\t\t\tthis.#offscreen_fragment = null;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @param {1 | -1} d */\n\tupdate_pending_count(d) {\n\t\tif (this.has_pending_snippet()) {\n\t\t\tthis.#update_pending_count(d);\n\t\t} else if (this.parent) {\n\t\t\tthis.parent.#update_pending_count(d);\n\t\t}\n\n\t\teffect_pending_updates.add(this.#effect_pending_update);\n\t}\n\n\tget_effect_pending() {\n\t\tthis.#effect_pending_subscriber();\n\t\treturn get(/** @type {Source<number>} */ (this.#effect_pending));\n\t}\n\n\t/** @param {unknown} error */\n\terror(error) {\n\t\tvar onerror = this.#props.onerror;\n\t\tlet failed = this.#props.failed;\n\n\t\tif (this.#main_effect) {\n\t\t\tdestroy_effect(this.#main_effect);\n\t\t\tthis.#main_effect = null;\n\t\t}\n\n\t\tif (this.#pending_effect) {\n\t\t\tdestroy_effect(this.#pending_effect);\n\t\t\tthis.#pending_effect = null;\n\t\t}\n\n\t\tif (this.#failed_effect) {\n\t\t\tdestroy_effect(this.#failed_effect);\n\t\t\tthis.#failed_effect = null;\n\t\t}\n\n\t\tif (hydrating) {\n\t\t\tset_hydrate_node(this.#hydrate_open);\n\t\t\tnext();\n\t\t\tset_hydrate_node(remove_nodes());\n\t\t}\n\n\t\tvar did_reset = false;\n\t\tvar calling_on_error = false;\n\n\t\tconst reset = () => {\n\t\t\tif (did_reset) {\n\t\t\t\tw.svelte_boundary_reset_noop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdid_reset = true;\n\n\t\t\tif (calling_on_error) {\n\t\t\t\te.svelte_boundary_reset_onerror();\n\t\t\t}\n\n\t\t\tthis.#pending_count = 0;\n\n\t\t\tif (this.#failed_effect !== null) {\n\t\t\t\tpause_effect(this.#failed_effect, () => {\n\t\t\t\t\tthis.#failed_effect = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis.pending = true;\n\n\t\t\tthis.#main_effect = this.#run(() => {\n\t\t\t\tthis.#is_creating_fallback = false;\n\t\t\t\treturn branch(() => this.#children(this.#anchor));\n\t\t\t});\n\n\t\t\tif (this.#pending_count > 0) {\n\t\t\t\tthis.#show_pending_snippet();\n\t\t\t} else {\n\t\t\t\tthis.pending = false;\n\t\t\t}\n\t\t};\n\n\t\t// If we have nothing to capture the error, or if we hit an error while\n\t\t// rendering the fallback, re-throw for another boundary to handle\n\t\tif (this.#is_creating_fallback || (!onerror && !failed)) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tvar previous_reaction = active_reaction;\n\n\t\ttry {\n\t\t\tset_active_reaction(null);\n\t\t\tcalling_on_error = true;\n\t\t\tonerror?.(error, reset);\n\t\t\tcalling_on_error = false;\n\t\t} catch (error) {\n\t\t\tinvoke_error_boundary(error, this.#effect && this.#effect.parent);\n\t\t} finally {\n\t\t\tset_active_reaction(previous_reaction);\n\t\t}\n\n\t\tif (failed) {\n\t\t\tqueue_micro_task(() => {\n\t\t\t\tthis.#failed_effect = this.#run(() => {\n\t\t\t\t\tthis.#is_creating_fallback = true;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn branch(() => {\n\t\t\t\t\t\t\tfailed(\n\t\t\t\t\t\t\t\tthis.#anchor,\n\t\t\t\t\t\t\t\t() => error,\n\t\t\t\t\t\t\t\t() => reset\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tinvoke_error_boundary(error, /** @type {Effect} */ (this.#effect.parent));\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tthis.#is_creating_fallback = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\n/**\n *\n * @param {Effect} effect\n * @param {DocumentFragment} fragment\n */\nfunction move_effect(effect, fragment) {\n\tvar node = effect.nodes_start;\n\tvar end = effect.nodes_end;\n\n\twhile (node !== null) {\n\t\t/** @type {TemplateNode | null} */\n\t\tvar next = node === end ? null : /** @type {TemplateNode} */ (get_next_sibling(node));\n\n\t\tfragment.append(node);\n\t\tnode = next;\n\t}\n}\n\nexport function get_pending_boundary() {\n\tvar boundary = /** @type {Effect} */ (active_effect).b;\n\n\twhile (boundary !== null && !boundary.has_pending_snippet()) {\n\t\tboundary = boundary.parent;\n\t}\n\n\tif (boundary === null) {\n\t\te.await_outside_boundary();\n\t}\n\n\treturn boundary;\n}\n\nexport function pending() {\n\tif (active_effect === null) {\n\t\te.effect_pending_outside_reaction();\n\t}\n\n\tvar boundary = active_effect.b;\n\n\tif (boundary === null) {\n\t\treturn 0; // TODO eventually we will need this to be global\n\t}\n\n\treturn boundary.get_effect_pending();\n}\n","/** @import { Derived, Effect, Source } from '#client' */\n/** @import { Batch } from './batch.js'; */\nimport { DEV } from 'esm-env';\nimport {\n\tERROR_VALUE,\n\tCLEAN,\n\tDERIVED,\n\tDIRTY,\n\tEFFECT_PRESERVED,\n\tMAYBE_DIRTY,\n\tSTALE_REACTION,\n\tUNOWNED,\n\tASYNC\n} from '#client/constants';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tset_signal_status,\n\tskip_reaction,\n\tupdate_reaction,\n\tincrement_write_version,\n\tset_active_effect,\n\tpush_reaction_value,\n\tis_destroying_effect\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport * as e from '../errors.js';\nimport * as w from '../warnings.js';\nimport { async_effect, destroy_effect } from './effects.js';\nimport { inspect_effects, internal_set, set_inspect_effects, source } from './sources.js';\nimport { get_stack } from '../dev/tracing.js';\nimport { tracing_mode_flag } from '../../flags/index.js';\nimport { Boundary } from '../dom/blocks/boundary.js';\nimport { component_context } from '../context.js';\nimport { UNINITIALIZED } from '../../../constants.js';\nimport { batch_deriveds, current_batch } from './batch.js';\nimport { unset_context } from './async.js';\n\n/** @type {Effect | null} */\nexport let current_async_effect = null;\n\n/** @param {Effect | null} v */\nexport function set_from_async_derived(v) {\n\tcurrent_async_effect = v;\n}\n\nexport const recent_async_deriveds = new Set();\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived<V>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived(fn) {\n\tvar flags = DERIVED | DIRTY;\n\tvar parent_derived =\n\t\tactive_reaction !== null && (active_reaction.f & DERIVED) !== 0\n\t\t\t? /** @type {Derived} */ (active_reaction)\n\t\t\t: null;\n\n\tif (active_effect === null || (parent_derived !== null && (parent_derived.f & UNOWNED) !== 0)) {\n\t\tflags |= UNOWNED;\n\t} else {\n\t\t// Since deriveds are evaluated lazily, any effects created inside them are\n\t\t// created too late to ensure that the parent effect is added to the tree\n\t\tactive_effect.f |= EFFECT_PRESERVED;\n\t}\n\n\t/** @type {Derived<V>} */\n\tconst signal = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\teffects: null,\n\t\tequals,\n\t\tf: flags,\n\t\tfn,\n\t\treactions: null,\n\t\trv: 0,\n\t\tv: /** @type {V} */ (UNINITIALIZED),\n\t\twv: 0,\n\t\tparent: parent_derived ?? active_effect,\n\t\tac: null\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = get_stack('CreatedAt');\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {() => V | Promise<V>} fn\n * @param {string} [location] If provided, print a warning if the value is not read immediately after update\n * @returns {Promise<Source<V>>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function async_derived(fn, location) {\n\tlet parent = /** @type {Effect | null} */ (active_effect);\n\n\tif (parent === null) {\n\t\te.async_derived_orphan();\n\t}\n\n\tvar boundary = /** @type {Boundary} */ (parent.b);\n\n\tvar promise = /** @type {Promise<V>} */ (/** @type {unknown} */ (undefined));\n\tvar signal = source(/** @type {V} */ (UNINITIALIZED));\n\n\t/** @type {Promise<V> | null} */\n\tvar prev = null;\n\n\t// only suspend in async deriveds created on initialisation\n\tvar should_suspend = !active_reaction;\n\n\tasync_effect(() => {\n\t\tif (DEV) current_async_effect = active_effect;\n\n\t\ttry {\n\t\t\tvar p = fn();\n\t\t} catch (error) {\n\t\t\tp = Promise.reject(error);\n\t\t}\n\n\t\tif (DEV) current_async_effect = null;\n\n\t\tvar r = () => p;\n\t\tpromise = prev?.then(r, r) ?? Promise.resolve(p);\n\n\t\tprev = promise;\n\n\t\tvar batch = /** @type {Batch} */ (current_batch);\n\t\tvar pending = boundary.pending;\n\n\t\tif (should_suspend) {\n\t\t\tboundary.update_pending_count(1);\n\t\t\tif (!pending) batch.increment();\n\t\t}\n\n\t\t/**\n\t\t * @param {any} value\n\t\t * @param {unknown} error\n\t\t */\n\t\tconst handler = (value, error = undefined) => {\n\t\t\tprev = null;\n\n\t\t\tcurrent_async_effect = null;\n\n\t\t\tif (!pending) batch.activate();\n\n\t\t\tif (error) {\n\t\t\t\tif (error !== STALE_REACTION) {\n\t\t\t\t\tsignal.f |= ERROR_VALUE;\n\n\t\t\t\t\t// @ts-expect-error the error is the wrong type, but we don't care\n\t\t\t\t\tinternal_set(signal, error);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ((signal.f & ERROR_VALUE) !== 0) {\n\t\t\t\t\tsignal.f ^= ERROR_VALUE;\n\t\t\t\t}\n\n\t\t\t\tinternal_set(signal, value);\n\n\t\t\t\tif (DEV && location !== undefined) {\n\t\t\t\t\trecent_async_deriveds.add(signal);\n\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tif (recent_async_deriveds.has(signal)) {\n\t\t\t\t\t\t\tw.await_waterfall(/** @type {string} */ (signal.label), location);\n\t\t\t\t\t\t\trecent_async_deriveds.delete(signal);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (should_suspend) {\n\t\t\t\tboundary.update_pending_count(-1);\n\t\t\t\tif (!pending) batch.decrement();\n\t\t\t}\n\n\t\t\tunset_context();\n\t\t};\n\n\t\tpromise.then(handler, (e) => handler(null, e || 'unknown'));\n\n\t\tif (batch) {\n\t\t\treturn () => {\n\t\t\t\tqueueMicrotask(() => batch.neuter());\n\t\t\t};\n\t\t}\n\t});\n\n\tif (DEV) {\n\t\t// add a flag that lets this be printed as a derived\n\t\t// when using `$inspect.trace()`\n\t\tsignal.f |= ASYNC;\n\t}\n\n\treturn new Promise((fulfil) => {\n\t\t/** @param {Promise<V>} p */\n\t\tfunction next(p) {\n\t\t\tfunction go() {\n\t\t\t\tif (p === promise) {\n\t\t\t\t\tfulfil(signal);\n\t\t\t\t} else {\n\t\t\t\t\t// if the effect re-runs before the initial promise\n\t\t\t\t\t// resolves, delay resolution until we have a value\n\t\t\t\t\tnext(promise);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tp.then(go, go);\n\t\t}\n\n\t\tnext(promise);\n\t});\n}\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived<V>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function user_derived(fn) {\n\tconst d = derived(fn);\n\n\tpush_reaction_value(d);\n\n\treturn d;\n}\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived<V>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived_safe_equal(fn) {\n\tconst signal = derived(fn);\n\tsignal.equals = safe_equals;\n\treturn signal;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function destroy_derived_effects(derived) {\n\tvar effects = derived.effects;\n\n\tif (effects !== null) {\n\t\tderived.effects = null;\n\n\t\tfor (var i = 0; i < effects.length; i += 1) {\n\t\t\tdestroy_effect(/** @type {Effect} */ (effects[i]));\n\t\t}\n\t}\n}\n\n/**\n * The currently updating deriveds, used to detect infinite recursion\n * in dev mode and provide a nicer error than 'too much recursion'\n * @type {Derived[]}\n */\nlet stack = [];\n\n/**\n * @param {Derived} derived\n * @returns {Effect | null}\n */\nfunction get_derived_parent_effect(derived) {\n\tvar parent = derived.parent;\n\twhile (parent !== null) {\n\t\tif ((parent.f & DERIVED) === 0) {\n\t\t\treturn /** @type {Effect} */ (parent);\n\t\t}\n\t\tparent = parent.parent;\n\t}\n\treturn null;\n}\n\n/**\n * @template T\n * @param {Derived} derived\n * @returns {T}\n */\nexport function execute_derived(derived) {\n\tvar value;\n\tvar prev_active_effect = active_effect;\n\n\tset_active_effect(get_derived_parent_effect(derived));\n\n\tif (DEV) {\n\t\tlet prev_inspect_effects = inspect_effects;\n\t\tset_inspect_effects(new Set());\n\t\ttry {\n\t\t\tif (stack.includes(derived)) {\n\t\t\t\te.derived_references_self();\n\t\t\t}\n\n\t\t\tstack.push(derived);\n\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t\tset_inspect_effects(prev_inspect_effects);\n\t\t\tstack.pop();\n\t\t}\n\t} else {\n\t\ttry {\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t}\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function update_derived(derived) {\n\tvar value = execute_derived(derived);\n\n\tif (!derived.equals(value)) {\n\t\tderived.v = value;\n\t\tderived.wv = increment_write_version();\n\t}\n\n\t// don't mark derived clean if we're reading it inside a\n\t// cleanup function, or it will cache a stale value\n\tif (is_destroying_effect) {\n\t\treturn;\n\t}\n\n\tif (batch_deriveds !== null) {\n\t\tbatch_deriveds.set(derived, derived.v);\n\t} else {\n\t\tvar status =\n\t\t\t(skip_reaction || (derived.f & UNOWNED) !== 0) && derived.deps !== null ? MAYBE_DIRTY : CLEAN;\n\n\t\tset_signal_status(derived, status);\n\t}\n}\n","/** @import { Effect, Value } from '#client' */\n\nimport { DESTROYED } from '#client/constants';\nimport { DEV } from 'esm-env';\nimport { component_context, is_runes, set_component_context } from '../context.js';\nimport { get_pending_boundary } from '../dom/blocks/boundary.js';\nimport { invoke_error_boundary } from '../error-handling.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../runtime.js';\nimport { current_batch } from './batch.js';\nimport {\n\tasync_derived,\n\tcurrent_async_effect,\n\tderived,\n\tderived_safe_equal,\n\tset_from_async_derived\n} from './deriveds.js';\n\n/**\n *\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise<any>>} async\n * @param {(values: Value[]) => any} fn\n */\nexport function flatten(sync, async, fn) {\n\tconst d = is_runes() ? derived : derived_safe_equal;\n\n\tif (async.length === 0) {\n\t\tfn(sync.map(d));\n\t\treturn;\n\t}\n\n\tvar batch = current_batch;\n\tvar parent = /** @type {Effect} */ (active_effect);\n\n\tvar restore = capture();\n\tvar boundary = get_pending_boundary();\n\n\tPromise.all(async.map((expression) => async_derived(expression)))\n\t\t.then((result) => {\n\t\t\tbatch?.activate();\n\n\t\t\trestore();\n\n\t\t\ttry {\n\t\t\t\tfn([...sync.map(d), ...result]);\n\t\t\t} catch (error) {\n\t\t\t\t// ignore errors in blocks that have already been destroyed\n\t\t\t\tif ((parent.f & DESTROYED) === 0) {\n\t\t\t\t\tinvoke_error_boundary(error, parent);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbatch?.deactivate();\n\t\t\tunset_context();\n\t\t})\n\t\t.catch((error) => {\n\t\t\tboundary.error(error);\n\t\t});\n}\n\n/**\n * Captures the current effect context so that we can restore it after\n * some asynchronous work has happened (so that e.g. `await a + b`\n * causes `b` to be registered as a dependency).\n */\nfunction capture() {\n\tvar previous_effect = active_effect;\n\tvar previous_reaction = active_reaction;\n\tvar previous_component_context = component_context;\n\n\treturn function restore() {\n\t\tset_active_effect(previous_effect);\n\t\tset_active_reaction(previous_reaction);\n\t\tset_component_context(previous_component_context);\n\n\t\tif (DEV) {\n\t\t\tset_from_async_derived(null);\n\t\t}\n\t};\n}\n\n/**\n * Wraps an `await` expression in such a way that the effect context that was\n * active before the expression evaluated can be reapplied afterwards —\n * `await a + b` becomes `(await $.save(a))() + b`\n * @template T\n * @param {Promise<T>} promise\n * @returns {Promise<() => T>}\n */\nexport async function save(promise) {\n\tvar restore = capture();\n\tvar value = await promise;\n\n\treturn () => {\n\t\trestore();\n\t\treturn value;\n\t};\n}\n\n/**\n * Reset `current_async_effect` after the `promise` resolves, so\n * that we can emit `await_reactivity_loss` warnings\n * @template T\n * @param {Promise<T>} promise\n * @returns {Promise<() => T>}\n */\nexport async function track_reactivity_loss(promise) {\n\tvar previous_async_effect = current_async_effect;\n\tvar value = await promise;\n\n\treturn () => {\n\t\tset_from_async_derived(previous_async_effect);\n\t\treturn value;\n\t};\n}\n\n/**\n * Used in `for await` loops in DEV, so\n * that we can emit `await_reactivity_loss` warnings\n * after each `async_iterator` result resolves and\n * after the `async_iterator` return resolves (if it runs)\n * @template T\n * @template TReturn\n * @param {Iterable<T> | AsyncIterable<T>} iterable\n * @returns {AsyncGenerator<T, TReturn | undefined>}\n */\nexport async function* for_await_track_reactivity_loss(iterable) {\n\t// This is based on the algorithms described in ECMA-262:\n\t// ForIn/OfBodyEvaluation\n\t// https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset\n\t// AsyncIteratorClose\n\t// https://tc39.es/ecma262/multipage/abstract-operations.html#sec-asynciteratorclose\n\n\t/** @type {AsyncIterator<T, TReturn>} */\n\t// @ts-ignore\n\tconst iterator = iterable[Symbol.asyncIterator]?.() ?? iterable[Symbol.iterator]?.();\n\n\tif (iterator === undefined) {\n\t\tthrow new TypeError('value is not async iterable');\n\t}\n\n\t/** Whether the completion of the iterator was \"normal\", meaning it wasn't ended via `break` or a similar method */\n\tlet normal_completion = false;\n\ttry {\n\t\twhile (true) {\n\t\t\tconst { done, value } = (await track_reactivity_loss(iterator.next()))();\n\t\t\tif (done) {\n\t\t\t\tnormal_completion = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tyield value;\n\t\t}\n\t} finally {\n\t\t// If the iterator had a normal completion and `return` is defined on the iterator, call it and return the value\n\t\tif (normal_completion && iterator.return !== undefined) {\n\t\t\t// eslint-disable-next-line no-unsafe-finally\n\t\t\treturn /** @type {TReturn} */ ((await track_reactivity_loss(iterator.return()))().value);\n\t\t}\n\t}\n}\n\nexport function unset_context() {\n\tset_active_effect(null);\n\tset_active_reaction(null);\n\tset_component_context(null);\n\tif (DEV) set_from_async_derived(null);\n}\n","/** @import { Derived, Effect, Source } from '#client' */\nimport {\n\tBLOCK_EFFECT,\n\tBRANCH_EFFECT,\n\tCLEAN,\n\tDESTROYED,\n\tDIRTY,\n\tEFFECT,\n\tASYNC,\n\tINERT,\n\tRENDER_EFFECT,\n\tROOT_EFFECT,\n\tUSER_EFFECT,\n\tMAYBE_DIRTY\n} from '#client/constants';\nimport { async_mode_flag } from '../../flags/index.js';\nimport { deferred, define_property } from '../../shared/utils.js';\nimport { get_pending_boundary } from '../dom/blocks/boundary.js';\nimport {\n\tactive_effect,\n\tis_dirty,\n\tis_updating_effect,\n\tset_is_updating_effect,\n\tset_signal_status,\n\tupdate_effect\n} from '../runtime.js';\nimport * as e from '../errors.js';\nimport { flush_tasks } from '../dom/task.js';\nimport { DEV } from 'esm-env';\nimport { invoke_error_boundary } from '../error-handling.js';\nimport { old_values } from './sources.js';\nimport { unlink_effect } from './effects.js';\nimport { unset_context } from './async.js';\n\n/** @type {Set<Batch>} */\nconst batches = new Set();\n\n/** @type {Batch | null} */\nexport let current_batch = null;\n\n/**\n * This is needed to avoid overwriting inputs in non-async mode\n * TODO 6.0 remove this, as non-async mode will go away\n * @type {Batch | null}\n */\nexport let previous_batch = null;\n\n/**\n * When time travelling, we re-evaluate deriveds based on the temporary\n * values of their dependencies rather than their actual values, and cache\n * the results in this map rather than on the deriveds themselves\n * @type {Map<Derived, any> | null}\n */\nexport let batch_deriveds = null;\n\n/** @type {Set<() => void>} */\nexport let effect_pending_updates = new Set();\n\n/** @type {Array<() => void>} */\nlet tasks = [];\n\nfunction dequeue() {\n\tconst task = /** @type {() => void} */ (tasks.shift());\n\n\tif (tasks.length > 0) {\n\t\tqueueMicrotask(dequeue);\n\t}\n\n\ttask();\n}\n\n/** @type {Effect[]} */\nlet queued_root_effects = [];\n\n/** @type {Effect | null} */\nlet last_scheduled_effect = null;\n\nlet is_flushing = false;\n\nlet is_flushing_sync = false;\nexport class Batch {\n\t/**\n\t * The current values of any sources that are updated in this batch\n\t * They keys of this map are identical to `this.#previous`\n\t * @type {Map<Source, any>}\n\t */\n\tcurrent = new Map();\n\n\t/**\n\t * The values of any sources that are updated in this batch _before_ those updates took place.\n\t * They keys of this map are identical to `this.#current`\n\t * @type {Map<Source, any>}\n\t */\n\t#previous = new Map();\n\n\t/**\n\t * When the batch is committed (and the DOM is updated), we need to remove old branches\n\t * and append new ones by calling the functions added inside (if/each/key/etc) blocks\n\t * @type {Set<() => void>}\n\t */\n\t#callbacks = new Set();\n\n\t/**\n\t * The number of async effects that are currently in flight\n\t */\n\t#pending = 0;\n\n\t/**\n\t * A deferred that resolves when the batch is committed, used with `settled()`\n\t * TODO replace with Promise.withResolvers once supported widely enough\n\t * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}\n\t */\n\t#deferred = null;\n\n\t/**\n\t * True if an async effect inside this batch resolved and\n\t * its parent branch was already deleted\n\t */\n\t#neutered = false;\n\n\t/**\n\t * Async effects (created inside `async_derived`) encountered during processing.\n\t * These run after the rest of the batch has updated, since they should\n\t * always have the latest values\n\t * @type {Effect[]}\n\t */\n\t#async_effects = [];\n\n\t/**\n\t * The same as `#async_effects`, but for effects inside a newly-created\n\t * `<svelte:boundary>` — these do not prevent the batch from committing\n\t * @type {Effect[]}\n\t */\n\t#boundary_async_effects = [];\n\n\t/**\n\t * Template effects and `$effect.pre` effects, which run when\n\t * a batch is committed\n\t * @type {Effect[]}\n\t */\n\t#render_effects = [];\n\n\t/**\n\t * The same as `#render_effects`, but for `$effect` (which runs after)\n\t * @type {Effect[]}\n\t */\n\t#effects = [];\n\n\t/**\n\t * Block effects, which may need to re-run on subsequent flushes\n\t * in order to update internal sources (e.g. each block items)\n\t * @type {Effect[]}\n\t */\n\t#block_effects = [];\n\n\t/**\n\t * Deferred effects (which run after async work has completed) that are DIRTY\n\t * @type {Effect[]}\n\t */\n\t#dirty_effects = [];\n\n\t/**\n\t * Deferred effects that are MAYBE_DIRTY\n\t * @type {Effect[]}\n\t */\n\t#maybe_dirty_effects = [];\n\n\t/**\n\t * A set of branches that still exist, but will be destroyed when this batch\n\t * is committed — we skip over these during `process`\n\t * @type {Set<Effect>}\n\t */\n\tskipped_effects = new Set();\n\n\t/**\n\t *\n\t * @param {Effect[]} root_effects\n\t */\n\tprocess(root_effects) {\n\t\tqueued_root_effects = [];\n\n\t\tprevious_batch = null;\n\n\t\t/** @type {Map<Source, { v: unknown, wv: number }> | null} */\n\t\tvar current_values = null;\n\n\t\t// if there are multiple batches, we are 'time travelling' —\n\t\t// we need to undo the changes belonging to any batch\n\t\t// other than the current one\n\t\tif (batches.size > 1) {\n\t\t\tcurrent_values = new Map();\n\t\t\tbatch_deriveds = new Map();\n\n\t\t\tfor (const [source, current] of this.current) {\n\t\t\t\tcurrent_values.set(source, { v: source.v, wv: source.wv });\n\t\t\t\tsource.v = current;\n\t\t\t}\n\n\t\t\tfor (const batch of batches) {\n\t\t\t\tif (batch === this) continue;\n\n\t\t\t\tfor (const [source, previous] of batch.#previous) {\n\t\t\t\t\tif (!current_values.has(source)) {\n\t\t\t\t\t\tcurrent_values.set(source, { v: source.v, wv: source.wv });\n\t\t\t\t\t\tsource.v = previous;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const root of root_effects) {\n\t\t\tthis.#traverse_effect_tree(root);\n\t\t}\n\n\t\t// if we didn't start any new async work, and no async work\n\t\t// is outstanding from a previous flush, commit\n\t\tif (this.#async_effects.length === 0 && this.#pending === 0) {\n\t\t\tthis.#commit();\n\n\t\t\tvar render_effects = this.#render_effects;\n\t\t\tvar effects = this.#effects;\n\n\t\t\tthis.#render_effects = [];\n\t\t\tthis.#effects = [];\n\t\t\tthis.#block_effects = [];\n\n\t\t\t// If sources are written to, then work needs to happen in a separate batch, else prior sources would be mixed with\n\t\t\t// newly updated sources, which could lead to infinite loops when effects run over and over again.\n\t\t\tprevious_batch = current_batch;\n\t\t\tcurrent_batch = null;\n\n\t\t\tflush_queued_effects(render_effects);\n\t\t\tflush_queued_effects(effects);\n\n\t\t\t// Reinstate the current batch if there was no new one created, as `process()` runs in a loop in `flush_effects()`.\n\t\t\t// That method expects `current_batch` to be set, and could run the loop again if effects result in new effects\n\t\t\t// being scheduled but without writes happening in which case no new batch is created.\n\t\t\tif (current_batch === null) {\n\t\t\t\tcurrent_batch = this;\n\t\t\t} else {\n\t\t\t\tbatches.delete(this);\n\t\t\t}\n\n\t\t\tthis.#deferred?.resolve();\n\t\t} else {\n\t\t\tthis.#defer_effects(this.#render_effects);\n\t\t\tthis.#defer_effects(this.#effects);\n\t\t\tthis.#defer_effects(this.#block_effects);\n\t\t}\n\n\t\tif (current_values) {\n\t\t\tfor (const [source, { v, wv }] of current_values) {\n\t\t\t\t// reset the source to the current value (unless\n\t\t\t\t// it got a newer value as a result of effects running)\n\t\t\t\tif (source.wv <= wv) {\n\t\t\t\t\tsource.v = v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbatch_deriveds = null;\n\t\t}\n\n\t\tfor (const effect of this.#async_effects) {\n\t\t\tupdate_effect(effect);\n\t\t}\n\n\t\tfor (const effect of this.#boundary_async_effects) {\n\t\t\tupdate_effect(effect);\n\t\t}\n\n\t\tthis.#async_effects = [];\n\t\tthis.#boundary_async_effects = [];\n\t}\n\n\t/**\n\t * Traverse the effect tree, executing effects or stashing\n\t * them for later execution as appropriate\n\t * @param {Effect} root\n\t */\n\t#traverse_effect_tree(root) {\n\t\troot.f ^= CLEAN;\n\n\t\tvar effect = root.first;\n\n\t\twhile (effect !== null) {\n\t\t\tvar flags = effect.f;\n\t\t\tvar is_branch = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;\n\t\t\tvar is_skippable_branch = is_branch && (flags & CLEAN) !== 0;\n\n\t\t\tvar skip = is_skippable_branch || (flags & INERT) !== 0 || this.skipped_effects.has(effect);\n\n\t\t\tif (!skip && effect.fn !== null) {\n\t\t\t\tif (is_branch) {\n\t\t\t\t\teffect.f ^= CLEAN;\n\t\t\t\t} else if ((flags & EFFECT) !== 0) {\n\t\t\t\t\tthis.#effects.push(effect);\n\t\t\t\t} else if (async_mode_flag && (flags & RENDER_EFFECT) !== 0) {\n\t\t\t\t\tthis.#render_effects.push(effect);\n\t\t\t\t} else if ((flags & CLEAN) === 0) {\n\t\t\t\t\tif ((flags & ASYNC) !== 0) {\n\t\t\t\t\t\tvar effects = effect.b?.pending ? this.#boundary_async_effects : this.#async_effects;\n\t\t\t\t\t\teffects.push(effect);\n\t\t\t\t\t} else if (is_dirty(effect)) {\n\t\t\t\t\t\tif ((effect.f & BLOCK_EFFECT) !== 0) this.#block_effects.push(effect);\n\t\t\t\t\t\tupdate_effect(effect);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar child = effect.first;\n\n\t\t\t\tif (child !== null) {\n\t\t\t\t\teffect = child;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar parent = effect.parent;\n\t\t\teffect = effect.next;\n\n\t\t\twhile (effect === null && parent !== null) {\n\t\t\t\teffect = parent.next;\n\t\t\t\tparent = parent.parent;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param {Effect[]} effects\n\t */\n\t#defer_effects(effects) {\n\t\tfor (const e of effects) {\n\t\t\tconst target = (e.f & DIRTY) !== 0 ? this.#dirty_effects : this.#maybe_dirty_effects;\n\t\t\ttarget.push(e);\n\n\t\t\t// mark as clean so they get scheduled if they depend on pending async state\n\t\t\tset_signal_status(e, CLEAN);\n\t\t}\n\n\t\teffects.length = 0;\n\t}\n\n\t/**\n\t * Associate a change to a given source with the current\n\t * batch, noting its previous and current values\n\t * @param {Source} source\n\t * @param {any} value\n\t */\n\tcapture(source, value) {\n\t\tif (!this.#previous.has(source)) {\n\t\t\tthis.#previous.set(source, value);\n\t\t}\n\n\t\tthis.current.set(source, source.v);\n\t}\n\n\tactivate() {\n\t\tcurrent_batch = this;\n\t}\n\n\tdeactivate() {\n\t\tcurrent_batch = null;\n\t\tprevious_batch = null;\n\n\t\tfor (const update of effect_pending_updates) {\n\t\t\teffect_pending_updates.delete(update);\n\t\t\tupdate();\n\n\t\t\tif (current_batch !== null) {\n\t\t\t\t// only do one at a time\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tneuter() {\n\t\tthis.#neutered = true;\n\t}\n\n\tflush() {\n\t\tif (queued_root_effects.length > 0) {\n\t\t\tflush_effects();\n\t\t} else {\n\t\t\tthis.#commit();\n\t\t}\n\n\t\tif (current_batch !== this) {\n\t\t\t// this can happen if a `flushSync` occurred during `flush_effects()`,\n\t\t\t// which is permitted in legacy mode despite being a terrible idea\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.#pending === 0) {\n\t\t\tbatches.delete(this);\n\t\t}\n\n\t\tthis.deactivate();\n\t}\n\n\t/**\n\t * Append and remove branches to/from the DOM\n\t */\n\t#commit() {\n\t\tif (!this.#neutered) {\n\t\t\tfor (const fn of this.#callbacks) {\n\t\t\t\tfn();\n\t\t\t}\n\t\t}\n\n\t\tthis.#callbacks.clear();\n\t}\n\n\tincrement() {\n\t\tthis.#pending += 1;\n\t}\n\n\tdecrement() {\n\t\tthis.#pending -= 1;\n\n\t\tif (this.#pending === 0) {\n\t\t\tfor (const e of this.#dirty_effects) {\n\t\t\t\tset_signal_status(e, DIRTY);\n\t\t\t\tschedule_effect(e);\n\t\t\t}\n\n\t\t\tfor (const e of this.#maybe_dirty_effects) {\n\t\t\t\tset_signal_status(e, MAYBE_DIRTY);\n\t\t\t\tschedule_effect(e);\n\t\t\t}\n\n\t\t\tthis.#render_effects = [];\n\t\t\tthis.#effects = [];\n\n\t\t\tthis.flush();\n\t\t} else {\n\t\t\tthis.deactivate();\n\t\t}\n\t}\n\n\t/** @param {() => void} fn */\n\tadd_callback(fn) {\n\t\tthis.#callbacks.add(fn);\n\t}\n\n\tsettled() {\n\t\treturn (this.#deferred ??= deferred()).promise;\n\t}\n\n\tstatic ensure() {\n\t\tif (current_batch === null) {\n\t\t\tconst batch = (current_batch = new Batch());\n\t\t\tbatches.add(current_batch);\n\n\t\t\tif (!is_flushing_sync) {\n\t\t\t\tBatch.enqueue(() => {\n\t\t\t\t\tif (current_batch !== batch) {\n\t\t\t\t\t\t// a flushSync happened in the meantime\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tbatch.flush();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn current_batch;\n\t}\n\n\t/** @param {() => void} task */\n\tstatic enqueue(task) {\n\t\tif (tasks.length === 0) {\n\t\t\tqueueMicrotask(dequeue);\n\t\t}\n\n\t\ttasks.unshift(task);\n\t}\n}\n\n/**\n * Synchronously flush any pending updates.\n * Returns void if no callback is provided, otherwise returns the result of calling the callback.\n * @template [T=void]\n * @param {(() => T) | undefined} [fn]\n * @returns {T}\n */\nexport function flushSync(fn) {\n\tif (async_mode_flag && active_effect !== null) {\n\t\te.flush_sync_in_effect();\n\t}\n\n\tvar was_flushing_sync = is_flushing_sync;\n\tis_flushing_sync = true;\n\n\ttry {\n\t\tvar result;\n\n\t\tif (fn) {\n\t\t\tflush_effects();\n\t\t\tresult = fn();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tflush_tasks();\n\n\t\t\tif (queued_root_effects.length === 0) {\n\t\t\t\tcurrent_batch?.flush();\n\n\t\t\t\t// we need to check again, in case we just updated an `$effect.pending()`\n\t\t\t\tif (queued_root_effects.length === 0) {\n\t\t\t\t\t// this would be reset in `flush_effects()` but since we are early returning here,\n\t\t\t\t\t// we need to reset it here as well in case the first time there's 0 queued root effects\n\t\t\t\t\tlast_scheduled_effect = null;\n\n\t\t\t\t\treturn /** @type {T} */ (result);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tflush_effects();\n\t\t}\n\t} finally {\n\t\tis_flushing_sync = was_flushing_sync;\n\t}\n}\n\nfunction flush_effects() {\n\tvar was_updating_effect = is_updating_effect;\n\tis_flushing = true;\n\n\ttry {\n\t\tvar flush_count = 0;\n\t\tset_is_updating_effect(true);\n\n\t\twhile (queued_root_effects.length > 0) {\n\t\t\tvar batch = Batch.ensure();\n\n\t\t\tif (flush_count++ > 1000) {\n\t\t\t\tif (DEV) {\n\t\t\t\t\tvar updates = new Map();\n\n\t\t\t\t\tfor (const source of batch.current.keys()) {\n\t\t\t\t\t\tfor (const [stack, update] of source.updated ?? []) {\n\t\t\t\t\t\t\tvar entry = updates.get(stack);\n\n\t\t\t\t\t\t\tif (!entry) {\n\t\t\t\t\t\t\t\tentry = { error: update.error, count: 0 };\n\t\t\t\t\t\t\t\tupdates.set(stack, entry);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tentry.count += update.count;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (const update of updates.values()) {\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.error(update.error);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tinfinite_loop_guard();\n\t\t\t}\n\n\t\t\tbatch.process(queued_root_effects);\n\t\t\told_values.clear();\n\t\t}\n\t} finally {\n\t\tis_flushing = false;\n\t\tset_is_updating_effect(was_updating_effect);\n\n\t\tlast_scheduled_effect = null;\n\t}\n}\n\nfunction infinite_loop_guard() {\n\ttry {\n\t\te.effect_update_depth_exceeded();\n\t} catch (error) {\n\t\tif (DEV) {\n\t\t\t// stack contains no useful information, replace it\n\t\t\tdefine_property(error, 'stack', { value: '' });\n\t\t}\n\n\t\t// Best effort: invoke the boundary nearest the most recent\n\t\t// effect and hope that it's relevant to the infinite loop\n\t\tinvoke_error_boundary(error, last_scheduled_effect);\n\t}\n}\n\n/** @type {Effect[] | null} */\nexport let eager_block_effects = null;\n\n/**\n * @param {Array<Effect>} effects\n * @returns {void}\n */\nfunction flush_queued_effects(effects) {\n\tvar length = effects.length;\n\tif (length === 0) return;\n\n\tvar i = 0;\n\n\twhile (i < length) {\n\t\tvar effect = effects[i++];\n\n\t\tif ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) {\n\t\t\teager_block_effects = [];\n\n\t\t\tupdate_effect(effect);\n\n\t\t\t// Effects with no dependencies or teardown do not get added to the effect tree.\n\t\t\t// Deferred effects (e.g. `$effect(...)`) _are_ added to the tree because we\n\t\t\t// don't know if we need to keep them until they are executed. Doing the check\n\t\t\t// here (rather than in `update_effect`) allows us to skip the work for\n\t\t\t// immediate effects.\n\t\t\tif (effect.deps === null && effect.first === null && effect.nodes_start === null) {\n\t\t\t\t// if there's no teardown or abort controller we completely unlink\n\t\t\t\t// the effect from the graph\n\t\t\t\tif (effect.teardown === null && effect.ac === null) {\n\t\t\t\t\t// remove this effect from the graph\n\t\t\t\t\tunlink_effect(effect);\n\t\t\t\t} else {\n\t\t\t\t\t// keep the effect in the graph, but free up some memory\n\t\t\t\t\teffect.fn = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (eager_block_effects.length > 0) {\n\t\t\t\t// TODO this feels incorrect! it gets the tests passing\n\t\t\t\told_values.clear();\n\n\t\t\t\tfor (const e of eager_block_effects) {\n\t\t\t\t\tupdate_effect(e);\n\t\t\t\t}\n\n\t\t\t\teager_block_effects = [];\n\t\t\t}\n\t\t}\n\t}\n\n\teager_block_effects = null;\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function schedule_effect(signal) {\n\tvar effect = (last_scheduled_effect = signal);\n\n\twhile (effect.parent !== null) {\n\t\teffect = effect.parent;\n\t\tvar flags = effect.f;\n\n\t\t// if the effect is being scheduled because a parent (each/await/etc) block\n\t\t// updated an internal source, bail out or we'll cause a second flush\n\t\tif (is_flushing && effect === active_effect && (flags & BLOCK_EFFECT) !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {\n\t\t\tif ((flags & CLEAN) === 0) return;\n\t\t\teffect.f ^= CLEAN;\n\t\t}\n\t}\n\n\tqueued_root_effects.push(effect);\n}\n\nexport function suspend() {\n\tvar boundary = get_pending_boundary();\n\tvar batch = /** @type {Batch} */ (current_batch);\n\tvar pending = boundary.pending;\n\n\tboundary.update_pending_count(1);\n\tif (!pending) batch.increment();\n\n\treturn function unsuspend() {\n\t\tboundary.update_pending_count(-1);\n\n\t\tif (!pending) {\n\t\t\tbatch.activate();\n\t\t\tbatch.decrement();\n\t\t}\n\n\t\tunset_context();\n\t};\n}\n\n/**\n * Forcibly remove all current batches, to prevent cross-talk between tests\n */\nexport function clear() {\n\tbatches.clear();\n}\n","/** @import { Derived, Effect, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tuntracked_writes,\n\tget,\n\tset_untracked_writes,\n\tset_signal_status,\n\tuntrack,\n\tincrement_write_version,\n\tupdate_effect,\n\tcurrent_sources,\n\tis_dirty,\n\tuntracking,\n\tis_destroying_effect,\n\tpush_reaction_value\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport {\n\tCLEAN,\n\tDERIVED,\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tINSPECT_EFFECT,\n\tUNOWNED,\n\tMAYBE_DIRTY,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tASYNC\n} from '#client/constants';\nimport * as e from '../errors.js';\nimport { legacy_mode_flag, tracing_mode_flag } from '../../flags/index.js';\nimport { get_stack, tag_proxy } from '../dev/tracing.js';\nimport { component_context, is_runes } from '../context.js';\nimport { Batch, eager_block_effects, schedule_effect } from './batch.js';\nimport { proxy } from '../proxy.js';\nimport { execute_derived } from './deriveds.js';\n\n/** @type {Set<any>} */\nexport let inspect_effects = new Set();\n\n/** @type {Map<Source, any>} */\nexport const old_values = new Map();\n\n/**\n * @param {Set<any>} v\n */\nexport function set_inspect_effects(v) {\n\tinspect_effects = v;\n}\n\nlet inspect_effects_deferred = false;\n\nexport function set_inspect_effects_deferred() {\n\tinspect_effects_deferred = true;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {Error | null} [stack]\n * @returns {Source<V>}\n */\n// TODO rename this to `state` throughout the codebase\nexport function source(v, stack) {\n\t/** @type {Value} */\n\tvar signal = {\n\t\tf: 0, // TODO ideally we could skip this altogether, but it causes type errors\n\t\tv,\n\t\treactions: null,\n\t\tequals,\n\t\trv: 0,\n\t\twv: 0\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = stack ?? get_stack('CreatedAt');\n\t\tsignal.updated = null;\n\t\tsignal.set_during_effect = false;\n\t\tsignal.trace = null;\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {Error | null} [stack]\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function state(v, stack) {\n\tconst s = source(v, stack);\n\n\tpush_reaction_value(s);\n\n\treturn s;\n}\n\n/**\n * @template V\n * @param {V} initial_value\n * @param {boolean} [immutable]\n * @returns {Source<V>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function mutable_source(initial_value, immutable = false, trackable = true) {\n\tconst s = source(initial_value);\n\tif (!immutable) {\n\t\ts.equals = safe_equals;\n\t}\n\n\t// bind the signal to the component context, in case we need to\n\t// track updates to trigger beforeUpdate/afterUpdate callbacks\n\tif (legacy_mode_flag && trackable && component_context !== null && component_context.l !== null) {\n\t\t(component_context.l.s ??= []).push(s);\n\t}\n\n\treturn s;\n}\n\n/**\n * @template V\n * @param {Value<V>} source\n * @param {V} value\n */\nexport function mutate(source, value) {\n\tset(\n\t\tsource,\n\t\tuntrack(() => get(source))\n\t);\n\treturn value;\n}\n\n/**\n * @template V\n * @param {Source<V>} source\n * @param {V} value\n * @param {boolean} [should_proxy]\n * @returns {V}\n */\nexport function set(source, value, should_proxy = false) {\n\tif (\n\t\tactive_reaction !== null &&\n\t\t// since we are untracking the function inside `$inspect.with` we need to add this check\n\t\t// to ensure we error if state is set inside an inspect effect\n\t\t(!untracking || (active_reaction.f & INSPECT_EFFECT) !== 0) &&\n\t\tis_runes() &&\n\t\t(active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | INSPECT_EFFECT)) !== 0 &&\n\t\t!current_sources?.includes(source)\n\t) {\n\t\te.state_unsafe_mutation();\n\t}\n\n\tlet new_value = should_proxy ? proxy(value) : value;\n\n\tif (DEV) {\n\t\ttag_proxy(new_value, /** @type {string} */ (source.label));\n\t}\n\n\treturn internal_set(source, new_value);\n}\n\n/**\n * @template V\n * @param {Source<V>} source\n * @param {V} value\n * @returns {V}\n */\nexport function internal_set(source, value) {\n\tif (!source.equals(value)) {\n\t\tvar old_value = source.v;\n\n\t\tif (is_destroying_effect) {\n\t\t\told_values.set(source, value);\n\t\t} else {\n\t\t\told_values.set(source, old_value);\n\t\t}\n\n\t\tsource.v = value;\n\n\t\tvar batch = Batch.ensure();\n\t\tbatch.capture(source, old_value);\n\n\t\tif (DEV) {\n\t\t\tif (tracing_mode_flag || active_effect !== null) {\n\t\t\t\tconst error = get_stack('UpdatedAt');\n\n\t\t\t\tif (error !== null) {\n\t\t\t\t\tsource.updated ??= new Map();\n\t\t\t\t\tlet entry = source.updated.get(error.stack);\n\n\t\t\t\t\tif (!entry) {\n\t\t\t\t\t\tentry = { error, count: 0 };\n\t\t\t\t\t\tsource.updated.set(error.stack, entry);\n\t\t\t\t\t}\n\n\t\t\t\t\tentry.count++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (active_effect !== null) {\n\t\t\t\tsource.set_during_effect = true;\n\t\t\t}\n\t\t}\n\n\t\tif ((source.f & DERIVED) !== 0) {\n\t\t\t// if we are assigning to a dirty derived we set it to clean/maybe dirty but we also eagerly execute it to track the dependencies\n\t\t\tif ((source.f & DIRTY) !== 0) {\n\t\t\t\texecute_derived(/** @type {Derived} */ (source));\n\t\t\t}\n\t\t\tset_signal_status(source, (source.f & UNOWNED) === 0 ? CLEAN : MAYBE_DIRTY);\n\t\t}\n\n\t\tsource.wv = increment_write_version();\n\n\t\tmark_reactions(source, DIRTY);\n\n\t\t// It's possible that the current reaction might not have up-to-date dependencies\n\t\t// whilst it's actively running. So in the case of ensuring it registers the reaction\n\t\t// properly for itself, we need to ensure the current effect actually gets\n\t\t// scheduled. i.e: `$effect(() => x++)`\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tactive_effect !== null &&\n\t\t\t(active_effect.f & CLEAN) !== 0 &&\n\t\t\t(active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0\n\t\t) {\n\t\t\tif (untracked_writes === null) {\n\t\t\t\tset_untracked_writes([source]);\n\t\t\t} else {\n\t\t\t\tuntracked_writes.push(source);\n\t\t\t}\n\t\t}\n\n\t\tif (DEV && inspect_effects.size > 0 && !inspect_effects_deferred) {\n\t\t\tflush_inspect_effects();\n\t\t}\n\t}\n\n\treturn value;\n}\n\nexport function flush_inspect_effects() {\n\tinspect_effects_deferred = false;\n\n\tconst inspects = Array.from(inspect_effects);\n\n\tfor (const effect of inspects) {\n\t\t// Mark clean inspect-effects as maybe dirty and then check their dirtiness\n\t\t// instead of just updating the effects - this way we avoid overfiring.\n\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t}\n\n\t\tif (is_dirty(effect)) {\n\t\t\tupdate_effect(effect);\n\t\t}\n\t}\n\n\tinspect_effects.clear();\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source<T>} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update(source, d = 1) {\n\tvar value = get(source);\n\tvar result = d === 1 ? value++ : value--;\n\n\tset(source, value);\n\n\t// @ts-expect-error\n\treturn result;\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source<T>} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update_pre(source, d = 1) {\n\tvar value = get(source);\n\n\t// @ts-expect-error\n\treturn set(source, d === 1 ? ++value : --value);\n}\n\n/**\n * Silently (without using `get`) increment a source\n * @param {Source<number>} source\n */\nexport function increment(source) {\n\tset(source, source.v + 1);\n}\n\n/**\n * @param {Value} signal\n * @param {number} status should be DIRTY or MAYBE_DIRTY\n * @returns {void}\n */\nfunction mark_reactions(signal, status) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tvar runes = is_runes();\n\tvar length = reactions.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tvar reaction = reactions[i];\n\t\tvar flags = reaction.f;\n\n\t\t// In legacy mode, skip the current effect to prevent infinite loops\n\t\tif (!runes && reaction === active_effect) continue;\n\n\t\t// Inspect effects need to run immediately, so that the stack trace makes sense\n\t\tif (DEV && (flags & INSPECT_EFFECT) !== 0) {\n\t\t\tinspect_effects.add(reaction);\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar not_dirty = (flags & DIRTY) === 0;\n\n\t\t// don't set a DIRTY reaction to MAYBE_DIRTY\n\t\tif (not_dirty) {\n\t\t\tset_signal_status(reaction, status);\n\t\t}\n\n\t\tif ((flags & DERIVED) !== 0) {\n\t\t\tmark_reactions(/** @type {Derived} */ (reaction), MAYBE_DIRTY);\n\t\t} else if (not_dirty) {\n\t\t\tif ((flags & BLOCK_EFFECT) !== 0) {\n\t\t\t\tif (eager_block_effects !== null) {\n\t\t\t\t\teager_block_effects.push(/** @type {Effect} */ (reaction));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n","/** @import { Source } from '#client' */\nimport { DEV } from 'esm-env';\nimport {\n\tget,\n\tactive_effect,\n\tupdate_version,\n\tactive_reaction,\n\tset_update_version,\n\tset_active_reaction\n} from './runtime.js';\nimport {\n\tarray_prototype,\n\tget_descriptor,\n\tget_prototype_of,\n\tis_array,\n\tobject_prototype\n} from '../shared/utils.js';\nimport {\n\tstate as source,\n\tset,\n\tincrement,\n\tflush_inspect_effects,\n\tset_inspect_effects_deferred\n} from './reactivity/sources.js';\nimport { PROXY_PATH_SYMBOL, STATE_SYMBOL } from '#client/constants';\nimport { UNINITIALIZED } from '../../constants.js';\nimport * as e from './errors.js';\nimport { get_stack, tag } from './dev/tracing.js';\nimport { tracing_mode_flag } from '../flags/index.js';\n\n// TODO move all regexes into shared module?\nconst regex_is_valid_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;\n\n/**\n * @template T\n * @param {T} value\n * @returns {T}\n */\nexport function proxy(value) {\n\t// if non-proxyable, or is already a proxy, return `value`\n\tif (typeof value !== 'object' || value === null || STATE_SYMBOL in value) {\n\t\treturn value;\n\t}\n\n\tconst prototype = get_prototype_of(value);\n\n\tif (prototype !== object_prototype && prototype !== array_prototype) {\n\t\treturn value;\n\t}\n\n\t/** @type {Map<any, Source<any>>} */\n\tvar sources = new Map();\n\tvar is_proxied_array = is_array(value);\n\tvar version = source(0);\n\n\tvar stack = DEV && tracing_mode_flag ? get_stack('CreatedAt') : null;\n\tvar parent_version = update_version;\n\n\t/**\n\t * Executes the proxy in the context of the reaction it was originally created in, if any\n\t * @template T\n\t * @param {() => T} fn\n\t */\n\tvar with_parent = (fn) => {\n\t\tif (update_version === parent_version) {\n\t\t\treturn fn();\n\t\t}\n\n\t\t// child source is being created after the initial proxy —\n\t\t// prevent it from being associated with the current reaction\n\t\tvar reaction = active_reaction;\n\t\tvar version = update_version;\n\n\t\tset_active_reaction(null);\n\t\tset_update_version(parent_version);\n\n\t\tvar result = fn();\n\n\t\tset_active_reaction(reaction);\n\t\tset_update_version(version);\n\n\t\treturn result;\n\t};\n\n\tif (is_proxied_array) {\n\t\t// We need to create the length source eagerly to ensure that\n\t\t// mutations to the array are properly synced with our proxy\n\t\tsources.set('length', source(/** @type {any[]} */ (value).length, stack));\n\t\tif (DEV) {\n\t\t\tvalue = /** @type {any} */ (inspectable_array(/** @type {any[]} */ (value)));\n\t\t}\n\t}\n\n\t/** Used in dev for $inspect.trace() */\n\tvar path = '';\n\tlet updating = false;\n\t/** @param {string} new_path */\n\tfunction update_path(new_path) {\n\t\tif (updating) return;\n\t\tupdating = true;\n\t\tpath = new_path;\n\n\t\ttag(version, `${path} version`);\n\n\t\t// rename all child sources and child proxies\n\t\tfor (const [prop, source] of sources) {\n\t\t\ttag(source, get_label(path, prop));\n\t\t}\n\t\tupdating = false;\n\t}\n\n\treturn new Proxy(/** @type {any} */ (value), {\n\t\tdefineProperty(_, prop, descriptor) {\n\t\t\tif (\n\t\t\t\t!('value' in descriptor) ||\n\t\t\t\tdescriptor.configurable === false ||\n\t\t\t\tdescriptor.enumerable === false ||\n\t\t\t\tdescriptor.writable === false\n\t\t\t) {\n\t\t\t\t// we disallow non-basic descriptors, because unless they are applied to the\n\t\t\t\t// target object — which we avoid, so that state can be forked — we will run\n\t\t\t\t// afoul of the various invariants\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/getOwnPropertyDescriptor#invariants\n\t\t\t\te.state_descriptors_fixed();\n\t\t\t}\n\t\t\tvar s = sources.get(prop);\n\t\t\tif (s === undefined) {\n\t\t\t\ts = with_parent(() => {\n\t\t\t\t\tvar s = source(descriptor.value, stack);\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t\tif (DEV && typeof prop === 'string') {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t\treturn s;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tset(s, descriptor.value, true);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tdeleteProperty(target, prop) {\n\t\t\tvar s = sources.get(prop);\n\n\t\t\tif (s === undefined) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst s = with_parent(() => source(UNINITIALIZED, stack));\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t\tincrement(version);\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tset(s, UNINITIALIZED);\n\t\t\t\tincrement(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tget(target, prop, receiver) {\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tif (DEV && prop === PROXY_PATH_SYMBOL) {\n\t\t\t\treturn update_path;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar exists = prop in target;\n\n\t\t\t// create a source, but only if it's an own property and not a prototype property\n\t\t\tif (s === undefined && (!exists || get_descriptor(target, prop)?.writable)) {\n\t\t\t\ts = with_parent(() => {\n\t\t\t\t\tvar p = proxy(exists ? target[prop] : UNINITIALIZED);\n\t\t\t\t\tvar s = source(p, stack);\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn s;\n\t\t\t\t});\n\n\t\t\t\tsources.set(prop, s);\n\t\t\t}\n\n\t\t\tif (s !== undefined) {\n\t\t\t\tvar v = get(s);\n\t\t\t\treturn v === UNINITIALIZED ? undefined : v;\n\t\t\t}\n\n\t\t\treturn Reflect.get(target, prop, receiver);\n\t\t},\n\n\t\tgetOwnPropertyDescriptor(target, prop) {\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\tif (descriptor && 'value' in descriptor) {\n\t\t\t\tvar s = sources.get(prop);\n\t\t\t\tif (s) descriptor.value = get(s);\n\t\t\t} else if (descriptor === undefined) {\n\t\t\t\tvar source = sources.get(prop);\n\t\t\t\tvar value = source?.v;\n\n\t\t\t\tif (source !== undefined && value !== UNINITIALIZED) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\twritable: true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn descriptor;\n\t\t},\n\n\t\thas(target, prop) {\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = (s !== undefined && s.v !== UNINITIALIZED) || Reflect.has(target, prop);\n\n\t\t\tif (\n\t\t\t\ts !== undefined ||\n\t\t\t\t(active_effect !== null && (!has || get_descriptor(target, prop)?.writable))\n\t\t\t) {\n\t\t\t\tif (s === undefined) {\n\t\t\t\t\ts = with_parent(() => {\n\t\t\t\t\t\tvar p = has ? proxy(target[prop]) : UNINITIALIZED;\n\t\t\t\t\t\tvar s = source(p, stack);\n\n\t\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn s;\n\t\t\t\t\t});\n\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\n\t\t\t\tvar value = get(s);\n\t\t\t\tif (value === UNINITIALIZED) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn has;\n\t\t},\n\n\t\tset(target, prop, value, receiver) {\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = prop in target;\n\n\t\t\t// variable.length = value -> clear all signals with index >= value\n\t\t\tif (is_proxied_array && prop === 'length') {\n\t\t\t\tfor (var i = value; i < /** @type {Source<number>} */ (s).v; i += 1) {\n\t\t\t\t\tvar other_s = sources.get(i + '');\n\t\t\t\t\tif (other_s !== undefined) {\n\t\t\t\t\t\tset(other_s, UNINITIALIZED);\n\t\t\t\t\t} else if (i in target) {\n\t\t\t\t\t\t// If the item exists in the original, we need to create a uninitialized source,\n\t\t\t\t\t\t// else a later read of the property would result in a source being created with\n\t\t\t\t\t\t// the value of the original item at that index.\n\t\t\t\t\t\tother_s = with_parent(() => source(UNINITIALIZED, stack));\n\t\t\t\t\t\tsources.set(i + '', other_s);\n\n\t\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\t\ttag(other_s, get_label(path, i));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we haven't yet created a source for this property, we need to ensure\n\t\t\t// we do so otherwise if we read it later, then the write won't be tracked and\n\t\t\t// the heuristics of effects will be different vs if we had read the proxied\n\t\t\t// object property before writing to that property.\n\t\t\tif (s === undefined) {\n\t\t\t\tif (!has || get_descriptor(target, prop)?.writable) {\n\t\t\t\t\ts = with_parent(() => source(undefined, stack));\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t\tset(s, proxy(value));\n\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thas = s.v !== UNINITIALIZED;\n\n\t\t\t\tvar p = with_parent(() => proxy(value));\n\t\t\t\tset(s, p);\n\t\t\t}\n\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\t// Set the new value before updating any signals so that any listeners get the new value\n\t\t\tif (descriptor?.set) {\n\t\t\t\tdescriptor.set.call(receiver, value);\n\t\t\t}\n\n\t\t\tif (!has) {\n\t\t\t\t// If we have mutated an array directly, we might need to\n\t\t\t\t// signal that length has also changed. Do it before updating metadata\n\t\t\t\t// to ensure that iterating over the array as a result of a metadata update\n\t\t\t\t// will not cause the length to be out of sync.\n\t\t\t\tif (is_proxied_array && typeof prop === 'string') {\n\t\t\t\t\tvar ls = /** @type {Source<number>} */ (sources.get('length'));\n\t\t\t\t\tvar n = Number(prop);\n\n\t\t\t\t\tif (Number.isInteger(n) && n >= ls.v) {\n\t\t\t\t\t\tset(ls, n + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tincrement(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\townKeys(target) {\n\t\t\tget(version);\n\n\t\t\tvar own_keys = Reflect.ownKeys(target).filter((key) => {\n\t\t\t\tvar source = sources.get(key);\n\t\t\t\treturn source === undefined || source.v !== UNINITIALIZED;\n\t\t\t});\n\n\t\t\tfor (var [key, source] of sources) {\n\t\t\t\tif (source.v !== UNINITIALIZED && !(key in target)) {\n\t\t\t\t\town_keys.push(key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn own_keys;\n\t\t},\n\n\t\tsetPrototypeOf() {\n\t\t\te.state_prototype_fixed();\n\t\t}\n\t});\n}\n\n/**\n * @param {string} path\n * @param {string | symbol} prop\n */\nfunction get_label(path, prop) {\n\tif (typeof prop === 'symbol') return `${path}[Symbol(${prop.description ?? ''})]`;\n\tif (regex_is_valid_identifier.test(prop)) return `${path}.${prop}`;\n\treturn /^\\d+$/.test(prop) ? `${path}[${prop}]` : `${path}['${prop}']`;\n}\n\n/**\n * @param {any} value\n */\nexport function get_proxied_value(value) {\n\ttry {\n\t\tif (value !== null && typeof value === 'object' && STATE_SYMBOL in value) {\n\t\t\treturn value[STATE_SYMBOL];\n\t\t}\n\t} catch {\n\t\t// the above if check can throw an error if the value in question\n\t\t// is the contentWindow of an iframe on another domain, in which\n\t\t// case we want to just return the value (because it's definitely\n\t\t// not a proxied value) so we don't break any JavaScript interacting\n\t\t// with that iframe (such as various payment companies client side\n\t\t// JavaScript libraries interacting with their iframes on the same\n\t\t// domain)\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {any} a\n * @param {any} b\n */\nexport function is(a, b) {\n\treturn Object.is(get_proxied_value(a), get_proxied_value(b));\n}\n\nconst ARRAY_MUTATING_METHODS = new Set([\n\t'copyWithin',\n\t'fill',\n\t'pop',\n\t'push',\n\t'reverse',\n\t'shift',\n\t'sort',\n\t'splice',\n\t'unshift'\n]);\n\n/**\n * Wrap array mutating methods so $inspect is triggered only once and\n * to prevent logging an array in intermediate state (e.g. with an empty slot)\n * @param {any[]} array\n */\nfunction inspectable_array(array) {\n\treturn new Proxy(array, {\n\t\tget(target, prop, receiver) {\n\t\t\tvar value = Reflect.get(target, prop, receiver);\n\t\t\tif (!ARRAY_MUTATING_METHODS.has(/** @type {string} */ (prop))) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @this {any[]}\n\t\t\t * @param {any[]} args\n\t\t\t */\n\t\t\treturn function (...args) {\n\t\t\t\tset_inspect_effects_deferred();\n\t\t\t\tvar result = value.apply(this, args);\n\t\t\t\tflush_inspect_effects();\n\t\t\t\treturn result;\n\t\t\t};\n\t\t}\n\t});\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport { DEV } from 'esm-env';\nimport { init_array_prototype_warnings } from '../dev/equality.js';\nimport { get_descriptor, is_extensible } from '../../shared/utils.js';\nimport { active_effect } from '../runtime.js';\nimport { async_mode_flag } from '../../flags/index.js';\nimport { TEXT_NODE, EFFECT_RAN } from '#client/constants';\nimport { eager_block_effects } from '../reactivity/batch.js';\n\n// export these for reference in the compiled code, making global name deduplication unnecessary\n/** @type {Window} */\nexport var $window;\n\n/** @type {Document} */\nexport var $document;\n\n/** @type {boolean} */\nexport var is_firefox;\n\n/** @type {() => Node | null} */\nvar first_child_getter;\n/** @type {() => Node | null} */\nvar next_sibling_getter;\n\n/**\n * Initialize these lazily to avoid issues when using the runtime in a server context\n * where these globals are not available while avoiding a separate server entry point\n */\nexport function init_operations() {\n\tif ($window !== undefined) {\n\t\treturn;\n\t}\n\n\t$window = window;\n\t$document = document;\n\tis_firefox = /Firefox/.test(navigator.userAgent);\n\n\tvar element_prototype = Element.prototype;\n\tvar node_prototype = Node.prototype;\n\tvar text_prototype = Text.prototype;\n\n\t// @ts-ignore\n\tfirst_child_getter = get_descriptor(node_prototype, 'firstChild').get;\n\t// @ts-ignore\n\tnext_sibling_getter = get_descriptor(node_prototype, 'nextSibling').get;\n\n\tif (is_extensible(element_prototype)) {\n\t\t// the following assignments improve perf of lookups on DOM nodes\n\t\t// @ts-expect-error\n\t\telement_prototype.__click = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__className = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__attributes = null;\n\t\t// @ts-expect-error\n\t\telement_prototype.__style = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__e = undefined;\n\t}\n\n\tif (is_extensible(text_prototype)) {\n\t\t// @ts-expect-error\n\t\ttext_prototype.__t = undefined;\n\t}\n\n\tif (DEV) {\n\t\t// @ts-expect-error\n\t\telement_prototype.__svelte_meta = null;\n\n\t\tinit_array_prototype_warnings();\n\t}\n}\n\n/**\n * @param {string} value\n * @returns {Text}\n */\nexport function create_text(value = '') {\n\treturn document.createTextNode(value);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {Node | null}\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_first_child(node) {\n\treturn first_child_getter.call(node);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {Node | null}\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_next_sibling(node) {\n\treturn next_sibling_getter.call(node);\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @template {Node} N\n * @param {N} node\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function child(node, is_text) {\n\tif (!hydrating) {\n\t\treturn get_first_child(node);\n\t}\n\n\tvar child = /** @type {TemplateNode} */ (get_first_child(hydrate_node));\n\n\t// Child can be null if we have an element with a single child, like `<p>{text}</p>`, where `text` is empty\n\tif (child === null) {\n\t\tchild = hydrate_node.appendChild(create_text());\n\t} else if (is_text && child.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\t\tchild?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tset_hydrate_node(child);\n\treturn child;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {DocumentFragment | TemplateNode[]} fragment\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function first_child(fragment, is_text) {\n\tif (!hydrating) {\n\t\t// when not hydrating, `fragment` is a `DocumentFragment` (the result of calling `open_frag`)\n\t\tvar first = /** @type {DocumentFragment} */ (get_first_child(/** @type {Node} */ (fragment)));\n\n\t\t// TODO prevent user comments with the empty string when preserveComments is true\n\t\tif (first instanceof Comment && first.data === '') return get_next_sibling(first);\n\n\t\treturn first;\n\t}\n\n\t// if an {expression} is empty during SSR, there might be no\n\t// text node to hydrate — we must therefore create one\n\tif (is_text && hydrate_node?.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\n\t\thydrate_node?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\treturn hydrate_node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {TemplateNode} node\n * @param {number} count\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function sibling(node, count = 1, is_text = false) {\n\tlet next_sibling = hydrating ? hydrate_node : node;\n\tvar last_sibling;\n\n\twhile (count--) {\n\t\tlast_sibling = next_sibling;\n\t\tnext_sibling = /** @type {TemplateNode} */ (get_next_sibling(next_sibling));\n\t}\n\n\tif (!hydrating) {\n\t\treturn next_sibling;\n\t}\n\n\t// if a sibling {expression} is empty during SSR, there might be no\n\t// text node to hydrate — we must therefore create one\n\tif (is_text && next_sibling?.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\t\t// If the next sibling is `null` and we're handling text then it's because\n\t\t// the SSR content was empty for the text, so we need to generate a new text\n\t\t// node and insert it after the last sibling\n\t\tif (next_sibling === null) {\n\t\t\tlast_sibling?.after(text);\n\t\t} else {\n\t\t\tnext_sibling.before(text);\n\t\t}\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tset_hydrate_node(next_sibling);\n\treturn /** @type {TemplateNode} */ (next_sibling);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {void}\n */\nexport function clear_text_content(node) {\n\tnode.textContent = '';\n}\n\n/**\n * Returns `true` if we're updating the current block, for example `condition` in\n * an `{#if condition}` block just changed. In this case, the branch should be\n * appended (or removed) at the same time as other updates within the\n * current `<svelte:boundary>`\n */\nexport function should_defer_append() {\n\tif (!async_mode_flag) return false;\n\tif (eager_block_effects !== null) return false;\n\n\tvar flags = /** @type {Effect} */ (active_effect).f;\n\treturn (flags & EFFECT_RAN) !== 0;\n}\n\n/**\n *\n * @param {string} tag\n * @param {string} [namespace]\n * @param {string} [is]\n * @returns\n */\nexport function create_element(tag, namespace, is) {\n\tlet options = is ? { is } : undefined;\n\tif (namespace) {\n\t\treturn document.createElementNS(namespace, tag, options);\n\t}\n\treturn document.createElement(tag, options);\n}\n\nexport function create_fragment() {\n\treturn document.createDocumentFragment();\n}\n\n/**\n * @param {string} data\n * @returns\n */\nexport function create_comment(data = '') {\n\treturn document.createComment(data);\n}\n\n/**\n * @param {Element} element\n * @param {string} key\n * @param {string} value\n * @returns\n */\nexport function set_attribute(element, key, value = '') {\n\tif (key.startsWith('xlink:')) {\n\t\telement.setAttributeNS('http://www.w3.org/1999/xlink', key, value);\n\t\treturn;\n\t}\n\treturn element.setAttribute(key, value);\n}\n","import { teardown } from '../../../reactivity/effects.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../../runtime.js';\nimport { add_form_reset_listener } from '../misc.js';\n\n/**\n * Fires the handler once immediately (unless corresponding arg is set to `false`),\n * then listens to the given events until the render effect context is destroyed\n * @param {EventTarget} target\n * @param {Array<string>} events\n * @param {(event?: Event) => void} handler\n * @param {any} call_handler_immediately\n */\nexport function listen(target, events, handler, call_handler_immediately = true) {\n\tif (call_handler_immediately) {\n\t\thandler();\n\t}\n\n\tfor (var name of events) {\n\t\ttarget.addEventListener(name, handler);\n\t}\n\n\tteardown(() => {\n\t\tfor (var name of events) {\n\t\t\ttarget.removeEventListener(name, handler);\n\t\t}\n\t});\n}\n\n/**\n * @template T\n * @param {() => T} fn\n */\nexport function without_reactive_context(fn) {\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\ttry {\n\t\treturn fn();\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * Listen to the given event, and then instantiate a global form reset listener if not already done,\n * to notify all bindings when the form is reset\n * @param {HTMLElement} element\n * @param {string} event\n * @param {(is_reset?: true) => void} handler\n * @param {(is_reset?: true) => void} [on_reset]\n */\nexport function listen_to_event_and_reset_event(element, event, handler, on_reset = handler) {\n\telement.addEventListener(event, () => without_reactive_context(handler));\n\t// @ts-expect-error\n\tconst prev = element.__on_r;\n\tif (prev) {\n\t\t// special case for checkbox that can have multiple binds (group & checked)\n\t\t// @ts-expect-error\n\t\telement.__on_r = () => {\n\t\t\tprev();\n\t\t\ton_reset(true);\n\t\t};\n\t} else {\n\t\t// @ts-expect-error\n\t\telement.__on_r = () => on_reset(true);\n\t}\n\n\tadd_form_reset_listener();\n}\n","/** @import { ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */\nimport {\n\tis_dirty,\n\tactive_effect,\n\tactive_reaction,\n\tupdate_effect,\n\tget,\n\tis_destroying_effect,\n\tremove_reactions,\n\tset_active_reaction,\n\tset_is_destroying_effect,\n\tset_signal_status,\n\tuntrack,\n\tuntracking\n} from '../runtime.js';\nimport {\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tRENDER_EFFECT,\n\tEFFECT,\n\tDESTROYED,\n\tINERT,\n\tEFFECT_RAN,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tEFFECT_TRANSPARENT,\n\tDERIVED,\n\tUNOWNED,\n\tCLEAN,\n\tINSPECT_EFFECT,\n\tHEAD_EFFECT,\n\tMAYBE_DIRTY,\n\tEFFECT_PRESERVED,\n\tSTALE_REACTION,\n\tUSER_EFFECT,\n\tASYNC\n} from '#client/constants';\nimport * as e from '../errors.js';\nimport { DEV } from 'esm-env';\nimport { define_property } from '../../shared/utils.js';\nimport { get_next_sibling } from '../dom/operations.js';\nimport { component_context, dev_current_component_function, dev_stack } from '../context.js';\nimport { Batch, schedule_effect } from './batch.js';\nimport { flatten } from './async.js';\nimport { without_reactive_context } from '../dom/elements/bindings/shared.js';\n\n/**\n * @param {'$effect' | '$effect.pre' | '$inspect'} rune\n */\nexport function validate_effect(rune) {\n\tif (active_effect === null && active_reaction === null) {\n\t\te.effect_orphan(rune);\n\t}\n\n\tif (active_reaction !== null && (active_reaction.f & UNOWNED) !== 0 && active_effect === null) {\n\t\te.effect_in_unowned_derived();\n\t}\n\n\tif (is_destroying_effect) {\n\t\te.effect_in_teardown(rune);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {Effect} parent_effect\n */\nfunction push_effect(effect, parent_effect) {\n\tvar parent_last = parent_effect.last;\n\tif (parent_last === null) {\n\t\tparent_effect.last = parent_effect.first = effect;\n\t} else {\n\t\tparent_last.next = effect;\n\t\teffect.prev = parent_last;\n\t\tparent_effect.last = effect;\n\t}\n}\n\n/**\n * @param {number} type\n * @param {null | (() => void | (() => void))} fn\n * @param {boolean} sync\n * @param {boolean} push\n * @returns {Effect}\n */\nfunction create_effect(type, fn, sync, push = true) {\n\tvar parent = active_effect;\n\n\tif (DEV) {\n\t\t// Ensure the parent is never an inspect effect\n\t\twhile (parent !== null && (parent.f & INSPECT_EFFECT) !== 0) {\n\t\t\tparent = parent.parent;\n\t\t}\n\t}\n\n\tif (parent !== null && (parent.f & INERT) !== 0) {\n\t\ttype |= INERT;\n\t}\n\n\t/** @type {Effect} */\n\tvar effect = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\tnodes_start: null,\n\t\tnodes_end: null,\n\t\tf: type | DIRTY,\n\t\tfirst: null,\n\t\tfn,\n\t\tlast: null,\n\t\tnext: null,\n\t\tparent,\n\t\tb: parent && parent.b,\n\t\tprev: null,\n\t\tteardown: null,\n\t\ttransitions: null,\n\t\twv: 0,\n\t\tac: null\n\t};\n\n\tif (DEV) {\n\t\teffect.component_function = dev_current_component_function;\n\t}\n\n\tif (sync) {\n\t\ttry {\n\t\t\tupdate_effect(effect);\n\t\t\teffect.f |= EFFECT_RAN;\n\t\t} catch (e) {\n\t\t\tdestroy_effect(effect);\n\t\t\tthrow e;\n\t\t}\n\t} else if (fn !== null) {\n\t\tschedule_effect(effect);\n\t}\n\n\t// if an effect has no dependencies, no DOM and no teardown function,\n\t// don't bother adding it to the effect tree\n\tvar inert =\n\t\tsync &&\n\t\teffect.deps === null &&\n\t\teffect.first === null &&\n\t\teffect.nodes_start === null &&\n\t\teffect.teardown === null &&\n\t\t(effect.f & EFFECT_PRESERVED) === 0;\n\n\tif (!inert && push) {\n\t\tif (parent !== null) {\n\t\t\tpush_effect(effect, parent);\n\t\t}\n\n\t\t// if we're in a derived, add the effect there too\n\t\tif (\n\t\t\tactive_reaction !== null &&\n\t\t\t(active_reaction.f & DERIVED) !== 0 &&\n\t\t\t(type & ROOT_EFFECT) === 0\n\t\t) {\n\t\t\tvar derived = /** @type {Derived} */ (active_reaction);\n\t\t\t(derived.effects ??= []).push(effect);\n\t\t}\n\t}\n\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect.tracking()`\n * @returns {boolean}\n */\nexport function effect_tracking() {\n\treturn active_reaction !== null && !untracking;\n}\n\n/**\n * @param {() => void} fn\n */\nexport function teardown(fn) {\n\tconst effect = create_effect(RENDER_EFFECT, null, false);\n\tset_signal_status(effect, CLEAN);\n\teffect.teardown = fn;\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect(...)`\n * @param {() => void | (() => void)} fn\n */\nexport function user_effect(fn) {\n\tvalidate_effect('$effect');\n\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect'\n\t\t});\n\t}\n\n\t// Non-nested `$effect(...)` in a component should be deferred\n\t// until the component is mounted\n\tvar flags = /** @type {Effect} */ (active_effect).f;\n\tvar defer = !active_reaction && (flags & BRANCH_EFFECT) !== 0 && (flags & EFFECT_RAN) === 0;\n\n\tif (defer) {\n\t\t// Top-level `$effect(...)` in an unmounted component — defer until mount\n\t\tvar context = /** @type {ComponentContext} */ (component_context);\n\t\t(context.e ??= []).push(fn);\n\t} else {\n\t\t// Everything else — create immediately\n\t\treturn create_user_effect(fn);\n\t}\n}\n\n/**\n * @param {() => void | (() => void)} fn\n */\nexport function create_user_effect(fn) {\n\treturn create_effect(EFFECT | USER_EFFECT, fn, false);\n}\n\n/**\n * Internal representation of `$effect.pre(...)`\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function user_pre_effect(fn) {\n\tvalidate_effect('$effect.pre');\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect.pre'\n\t\t});\n\t}\n\treturn create_effect(RENDER_EFFECT | USER_EFFECT, fn, true);\n}\n\n/** @param {() => void | (() => void)} fn */\nexport function inspect_effect(fn) {\n\treturn create_effect(INSPECT_EFFECT, fn, true);\n}\n\n/**\n * Internal representation of `$effect.root(...)`\n * @param {() => void | (() => void)} fn\n * @returns {() => void}\n */\nexport function effect_root(fn) {\n\tBatch.ensure();\n\tconst effect = create_effect(ROOT_EFFECT, fn, true);\n\n\treturn () => {\n\t\tdestroy_effect(effect);\n\t};\n}\n\n/**\n * An effect root whose children can transition out\n * @param {() => void} fn\n * @returns {(options?: { outro?: boolean }) => Promise<void>}\n */\nexport function component_root(fn) {\n\tBatch.ensure();\n\tconst effect = create_effect(ROOT_EFFECT, fn, true);\n\n\treturn (options = {}) => {\n\t\treturn new Promise((fulfil) => {\n\t\t\tif (options.outro) {\n\t\t\t\tpause_effect(effect, () => {\n\t\t\t\t\tdestroy_effect(effect);\n\t\t\t\t\tfulfil(undefined);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tdestroy_effect(effect);\n\t\t\t\tfulfil(undefined);\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function effect(fn) {\n\treturn create_effect(EFFECT, fn, false);\n}\n\n/**\n * Internal representation of `$: ..`\n * @param {() => any} deps\n * @param {() => void | (() => void)} fn\n */\nexport function legacy_pre_effect(deps, fn) {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\t/** @type {{ effect: null | Effect, ran: boolean, deps: () => any }} */\n\tvar token = { effect: null, ran: false, deps };\n\n\tcontext.l.$.push(token);\n\n\ttoken.effect = render_effect(() => {\n\t\tdeps();\n\n\t\t// If this legacy pre effect has already run before the end of the reset, then\n\t\t// bail out to emulate the same behavior.\n\t\tif (token.ran) return;\n\n\t\ttoken.ran = true;\n\t\tuntrack(fn);\n\t});\n}\n\nexport function legacy_pre_effect_reset() {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\trender_effect(() => {\n\t\t// Run dirty `$:` statements\n\t\tfor (var token of context.l.$) {\n\t\t\ttoken.deps();\n\n\t\t\tvar effect = token.effect;\n\n\t\t\t// If the effect is CLEAN, then make it MAYBE_DIRTY. This ensures we traverse through\n\t\t\t// the effects dependencies and correctly ensure each dependency is up-to-date.\n\t\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t\t}\n\n\t\t\tif (is_dirty(effect)) {\n\t\t\t\tupdate_effect(effect);\n\t\t\t}\n\n\t\t\ttoken.ran = false;\n\t\t}\n\t});\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function async_effect(fn) {\n\treturn create_effect(ASYNC | EFFECT_PRESERVED, fn, true);\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function render_effect(fn, flags = 0) {\n\treturn create_effect(RENDER_EFFECT | flags, fn, true);\n}\n\n/**\n * @param {(...expressions: any) => void | (() => void)} fn\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise<any>>} async\n */\nexport function template_effect(fn, sync = [], async = []) {\n\tflatten(sync, async, (values) => {\n\t\tcreate_effect(RENDER_EFFECT, () => fn(...values.map(get)), true);\n\t});\n}\n\n/**\n * @param {(() => void)} fn\n * @param {number} flags\n */\nexport function block(fn, flags = 0) {\n\tvar effect = create_effect(BLOCK_EFFECT | flags, fn, true);\n\tif (DEV) {\n\t\teffect.dev_stack = dev_stack;\n\t}\n\treturn effect;\n}\n\n/**\n * @param {(() => void)} fn\n * @param {boolean} [push]\n */\nexport function branch(fn, push = true) {\n\treturn create_effect(BRANCH_EFFECT, fn, true, push);\n}\n\n/**\n * @param {Effect} effect\n */\nexport function execute_effect_teardown(effect) {\n\tvar teardown = effect.teardown;\n\tif (teardown !== null) {\n\t\tconst previously_destroying_effect = is_destroying_effect;\n\t\tconst previous_reaction = active_reaction;\n\t\tset_is_destroying_effect(true);\n\t\tset_active_reaction(null);\n\t\ttry {\n\t\t\tteardown.call(null);\n\t\t} finally {\n\t\t\tset_is_destroying_effect(previously_destroying_effect);\n\t\t\tset_active_reaction(previous_reaction);\n\t\t}\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @param {boolean} remove_dom\n * @returns {void}\n */\nexport function destroy_effect_children(signal, remove_dom = false) {\n\tvar effect = signal.first;\n\tsignal.first = signal.last = null;\n\n\twhile (effect !== null) {\n\t\tconst controller = effect.ac;\n\n\t\tif (controller !== null) {\n\t\t\twithout_reactive_context(() => {\n\t\t\t\tcontroller.abort(STALE_REACTION);\n\t\t\t});\n\t\t}\n\n\t\tvar next = effect.next;\n\n\t\tif ((effect.f & ROOT_EFFECT) !== 0) {\n\t\t\t// this is now an independent root\n\t\t\teffect.parent = null;\n\t\t} else {\n\t\t\tdestroy_effect(effect, remove_dom);\n\t\t}\n\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function destroy_block_effect_children(signal) {\n\tvar effect = signal.first;\n\n\twhile (effect !== null) {\n\t\tvar next = effect.next;\n\t\tif ((effect.f & BRANCH_EFFECT) === 0) {\n\t\t\tdestroy_effect(effect);\n\t\t}\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} [remove_dom]\n * @returns {void}\n */\nexport function destroy_effect(effect, remove_dom = true) {\n\tvar removed = false;\n\n\tif (\n\t\t(remove_dom || (effect.f & HEAD_EFFECT) !== 0) &&\n\t\teffect.nodes_start !== null &&\n\t\teffect.nodes_end !== null\n\t) {\n\t\tremove_effect_dom(effect.nodes_start, /** @type {TemplateNode} */ (effect.nodes_end));\n\t\tremoved = true;\n\t}\n\n\tdestroy_effect_children(effect, remove_dom && !removed);\n\tremove_reactions(effect, 0);\n\tset_signal_status(effect, DESTROYED);\n\n\tvar transitions = effect.transitions;\n\n\tif (transitions !== null) {\n\t\tfor (const transition of transitions) {\n\t\t\ttransition.stop();\n\t\t}\n\t}\n\n\texecute_effect_teardown(effect);\n\n\tvar parent = effect.parent;\n\n\t// If the parent doesn't have any children, then skip this work altogether\n\tif (parent !== null && parent.first !== null) {\n\t\tunlink_effect(effect);\n\t}\n\n\tif (DEV) {\n\t\teffect.component_function = null;\n\t}\n\n\t// `first` and `child` are nulled out in destroy_effect_children\n\t// we don't null out `parent` so that error propagation can work correctly\n\teffect.next =\n\t\teffect.prev =\n\t\teffect.teardown =\n\t\teffect.ctx =\n\t\teffect.deps =\n\t\teffect.fn =\n\t\teffect.nodes_start =\n\t\teffect.nodes_end =\n\t\teffect.ac =\n\t\t\tnull;\n}\n\n/**\n *\n * @param {TemplateNode | null} node\n * @param {TemplateNode} end\n */\nexport function remove_effect_dom(node, end) {\n\twhile (node !== null) {\n\t\t/** @type {TemplateNode | null} */\n\t\tvar next = node === end ? null : /** @type {TemplateNode} */ (get_next_sibling(node));\n\n\t\tnode.remove();\n\t\tnode = next;\n\t}\n}\n\n/**\n * Detach an effect from the effect tree, freeing up memory and\n * reducing the amount of work that happens on subsequent traversals\n * @param {Effect} effect\n */\nexport function unlink_effect(effect) {\n\tvar parent = effect.parent;\n\tvar prev = effect.prev;\n\tvar next = effect.next;\n\n\tif (prev !== null) prev.next = next;\n\tif (next !== null) next.prev = prev;\n\n\tif (parent !== null) {\n\t\tif (parent.first === effect) parent.first = next;\n\t\tif (parent.last === effect) parent.last = prev;\n\t}\n}\n\n/**\n * When a block effect is removed, we don't immediately destroy it or yank it\n * out of the DOM, because it might have transitions. Instead, we 'pause' it.\n * It stays around (in memory, and in the DOM) until outro transitions have\n * completed, and if the state change is reversed then we _resume_ it.\n * A paused effect does not update, and the DOM subtree becomes inert.\n * @param {Effect} effect\n * @param {() => void} [callback]\n */\nexport function pause_effect(effect, callback) {\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\n\tpause_children(effect, transitions, true);\n\n\trun_out_transitions(transitions, () => {\n\t\tdestroy_effect(effect);\n\t\tif (callback) callback();\n\t});\n}\n\n/**\n * @param {TransitionManager[]} transitions\n * @param {() => void} fn\n */\nexport function run_out_transitions(transitions, fn) {\n\tvar remaining = transitions.length;\n\tif (remaining > 0) {\n\t\tvar check = () => --remaining || fn();\n\t\tfor (var transition of transitions) {\n\t\t\ttransition.out(check);\n\t\t}\n\t} else {\n\t\tfn();\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {TransitionManager[]} transitions\n * @param {boolean} local\n */\nexport function pause_children(effect, transitions, local) {\n\tif ((effect.f & INERT) !== 0) return;\n\teffect.f ^= INERT;\n\n\tif (effect.transitions !== null) {\n\t\tfor (const transition of effect.transitions) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransitions.push(transition);\n\t\t\t}\n\t\t}\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;\n\t\t// TODO we don't need to call pause_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tpause_children(child, transitions, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n}\n\n/**\n * The opposite of `pause_effect`. We call this if (for example)\n * `x` becomes falsy then truthy: `{#if x}...{/if}`\n * @param {Effect} effect\n */\nexport function resume_effect(effect) {\n\tresume_children(effect, true);\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} local\n */\nfunction resume_children(effect, local) {\n\tif ((effect.f & INERT) === 0) return;\n\teffect.f ^= INERT;\n\n\t// If a dependency of this effect changed while it was paused,\n\t// schedule the effect to update. we don't use `is_dirty`\n\t// here because we don't want to eagerly recompute a derived like\n\t// `{#if foo}{foo.bar()}{/if}` if `foo` is now `undefined\n\tif ((effect.f & CLEAN) === 0) {\n\t\tset_signal_status(effect, DIRTY);\n\t\tschedule_effect(effect);\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;\n\t\t// TODO we don't need to call resume_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tresume_children(child, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n\n\tif (effect.transitions !== null) {\n\t\tfor (const transition of effect.transitions) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransition.in();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function aborted() {\n\tvar effect = /** @type {Effect} */ (active_effect);\n\treturn (effect.f & DESTROYED) !== 0;\n}\n","/** @import { Derived, Effect, Reaction, Signal, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport { get_descriptors, get_prototype_of, index_of } from '../shared/utils.js';\nimport {\n\tdestroy_block_effect_children,\n\tdestroy_effect_children,\n\texecute_effect_teardown\n} from './reactivity/effects.js';\nimport {\n\tDIRTY,\n\tMAYBE_DIRTY,\n\tCLEAN,\n\tDERIVED,\n\tUNOWNED,\n\tDESTROYED,\n\tBRANCH_EFFECT,\n\tSTATE_SYMBOL,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tDISCONNECTED,\n\tREACTION_IS_UPDATING,\n\tSTALE_REACTION,\n\tERROR_VALUE\n} from './constants.js';\nimport { old_values } from './reactivity/sources.js';\nimport {\n\tdestroy_derived_effects,\n\texecute_derived,\n\tcurrent_async_effect,\n\trecent_async_deriveds,\n\tupdate_derived\n} from './reactivity/deriveds.js';\nimport { async_mode_flag, tracing_mode_flag } from '../flags/index.js';\nimport { tracing_expressions, get_stack } from './dev/tracing.js';\nimport {\n\tcomponent_context,\n\tdev_current_component_function,\n\tdev_stack,\n\tis_runes,\n\tset_component_context,\n\tset_dev_current_component_function,\n\tset_dev_stack\n} from './context.js';\nimport * as w from './warnings.js';\nimport { Batch, batch_deriveds, flushSync, schedule_effect } from './reactivity/batch.js';\nimport { handle_error } from './error-handling.js';\nimport { UNINITIALIZED } from '../../constants.js';\nimport { captured_signals } from './legacy.js';\nimport { without_reactive_context } from './dom/elements/bindings/shared.js';\n\nexport let is_updating_effect = false;\n\n/** @param {boolean} value */\nexport function set_is_updating_effect(value) {\n\tis_updating_effect = value;\n}\n\nexport let is_destroying_effect = false;\n\n/** @param {boolean} value */\nexport function set_is_destroying_effect(value) {\n\tis_destroying_effect = value;\n}\n\n/** @type {null | Reaction} */\nexport let active_reaction = null;\n\nexport let untracking = false;\n\n/** @param {null | Reaction} reaction */\nexport function set_active_reaction(reaction) {\n\tactive_reaction = reaction;\n}\n\n/** @type {null | Effect} */\nexport let active_effect = null;\n\n/** @param {null | Effect} effect */\nexport function set_active_effect(effect) {\n\tactive_effect = effect;\n}\n\n/**\n * When sources are created within a reaction, reading and writing\n * them within that reaction should not cause a re-run\n * @type {null | Source[]}\n */\nexport let current_sources = null;\n\n/** @param {Value} value */\nexport function push_reaction_value(value) {\n\tif (active_reaction !== null && (!async_mode_flag || (active_reaction.f & DERIVED) !== 0)) {\n\t\tif (current_sources === null) {\n\t\t\tcurrent_sources = [value];\n\t\t} else {\n\t\t\tcurrent_sources.push(value);\n\t\t}\n\t}\n}\n\n/**\n * The dependencies of the reaction that is currently being executed. In many cases,\n * the dependencies are unchanged between runs, and so this will be `null` unless\n * and until a new dependency is accessed — we track this via `skipped_deps`\n * @type {null | Value[]}\n */\nlet new_deps = null;\n\nlet skipped_deps = 0;\n\n/**\n * Tracks writes that the effect it's executed in doesn't listen to yet,\n * so that the dependency can be added to the effect later on if it then reads it\n * @type {null | Source[]}\n */\nexport let untracked_writes = null;\n\n/** @param {null | Source[]} value */\nexport function set_untracked_writes(value) {\n\tuntracked_writes = value;\n}\n\n/**\n * @type {number} Used by sources and deriveds for handling updates.\n * Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing\n **/\nexport let write_version = 1;\n\n/** @type {number} Used to version each read of a source of derived to avoid duplicating depedencies inside a reaction */\nlet read_version = 0;\n\nexport let update_version = read_version;\n\n/** @param {number} value */\nexport function set_update_version(value) {\n\tupdate_version = value;\n}\n\n// If we are working with a get() chain that has no active container,\n// to prevent memory leaks, we skip adding the reaction.\nexport let skip_reaction = false;\n\nexport function increment_write_version() {\n\treturn ++write_version;\n}\n\n/**\n * Determines whether a derived or effect is dirty.\n * If it is MAYBE_DIRTY, will set the status to CLEAN\n * @param {Reaction} reaction\n * @returns {boolean}\n */\nexport function is_dirty(reaction) {\n\tvar flags = reaction.f;\n\n\tif ((flags & DIRTY) !== 0) {\n\t\treturn true;\n\t}\n\n\tif ((flags & MAYBE_DIRTY) !== 0) {\n\t\tvar dependencies = reaction.deps;\n\t\tvar is_unowned = (flags & UNOWNED) !== 0;\n\n\t\tif (dependencies !== null) {\n\t\t\tvar i;\n\t\t\tvar dependency;\n\t\t\tvar is_disconnected = (flags & DISCONNECTED) !== 0;\n\t\t\tvar is_unowned_connected = is_unowned && active_effect !== null && !skip_reaction;\n\t\t\tvar length = dependencies.length;\n\n\t\t\t// If we are working with a disconnected or an unowned signal that is now connected (due to an active effect)\n\t\t\t// then we need to re-connect the reaction to the dependency, unless the effect has already been destroyed\n\t\t\t// (which can happen if the derived is read by an async derived)\n\t\t\tif (\n\t\t\t\t(is_disconnected || is_unowned_connected) &&\n\t\t\t\t(active_effect === null || (active_effect.f & DESTROYED) === 0)\n\t\t\t) {\n\t\t\t\tvar derived = /** @type {Derived} */ (reaction);\n\t\t\t\tvar parent = derived.parent;\n\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tdependency = dependencies[i];\n\n\t\t\t\t\t// We always re-add all reactions (even duplicates) if the derived was\n\t\t\t\t\t// previously disconnected, however we don't if it was unowned as we\n\t\t\t\t\t// de-duplicate dependencies in that case\n\t\t\t\t\tif (is_disconnected || !dependency?.reactions?.includes(derived)) {\n\t\t\t\t\t\t(dependency.reactions ??= []).push(derived);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (is_disconnected) {\n\t\t\t\t\tderived.f ^= DISCONNECTED;\n\t\t\t\t}\n\t\t\t\t// If the unowned derived is now fully connected to the graph again (it's unowned and reconnected, has a parent\n\t\t\t\t// and the parent is not unowned), then we can mark it as connected again, removing the need for the unowned\n\t\t\t\t// flag\n\t\t\t\tif (is_unowned_connected && parent !== null && (parent.f & UNOWNED) === 0) {\n\t\t\t\t\tderived.f ^= UNOWNED;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\tdependency = dependencies[i];\n\n\t\t\t\tif (is_dirty(/** @type {Derived} */ (dependency))) {\n\t\t\t\t\tupdate_derived(/** @type {Derived} */ (dependency));\n\t\t\t\t}\n\n\t\t\t\tif (dependency.wv > reaction.wv) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Unowned signals should never be marked as clean unless they\n\t\t// are used within an active_effect without skip_reaction\n\t\tif (!is_unowned || (active_effect !== null && !skip_reaction)) {\n\t\t\tset_signal_status(reaction, CLEAN);\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * @param {Value} signal\n * @param {Effect} effect\n * @param {boolean} [root]\n */\nfunction schedule_possible_effect_self_invalidation(signal, effect, root = true) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tif (!async_mode_flag && current_sources?.includes(signal)) {\n\t\treturn;\n\t}\n\n\tfor (var i = 0; i < reactions.length; i++) {\n\t\tvar reaction = reactions[i];\n\n\t\tif ((reaction.f & DERIVED) !== 0) {\n\t\t\tschedule_possible_effect_self_invalidation(/** @type {Derived} */ (reaction), effect, false);\n\t\t} else if (effect === reaction) {\n\t\t\tif (root) {\n\t\t\t\tset_signal_status(reaction, DIRTY);\n\t\t\t} else if ((reaction.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(reaction, MAYBE_DIRTY);\n\t\t\t}\n\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n\n/** @param {Reaction} reaction */\nexport function update_reaction(reaction) {\n\tvar previous_deps = new_deps;\n\tvar previous_skipped_deps = skipped_deps;\n\tvar previous_untracked_writes = untracked_writes;\n\tvar previous_reaction = active_reaction;\n\tvar previous_skip_reaction = skip_reaction;\n\tvar previous_sources = current_sources;\n\tvar previous_component_context = component_context;\n\tvar previous_untracking = untracking;\n\tvar previous_update_version = update_version;\n\n\tvar flags = reaction.f;\n\n\tnew_deps = /** @type {null | Value[]} */ (null);\n\tskipped_deps = 0;\n\tuntracked_writes = null;\n\tskip_reaction =\n\t\t(flags & UNOWNED) !== 0 && (untracking || !is_updating_effect || active_reaction === null);\n\tactive_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;\n\n\tcurrent_sources = null;\n\tset_component_context(reaction.ctx);\n\tuntracking = false;\n\tupdate_version = ++read_version;\n\n\tif (reaction.ac !== null) {\n\t\twithout_reactive_context(() => {\n\t\t\t/** @type {AbortController} */ (reaction.ac).abort(STALE_REACTION);\n\t\t});\n\n\t\treaction.ac = null;\n\t}\n\n\ttry {\n\t\treaction.f |= REACTION_IS_UPDATING;\n\t\tvar fn = /** @type {Function} */ (reaction.fn);\n\t\tvar result = fn();\n\t\tvar deps = reaction.deps;\n\n\t\tif (new_deps !== null) {\n\t\t\tvar i;\n\n\t\t\tremove_reactions(reaction, skipped_deps);\n\n\t\t\tif (deps !== null && skipped_deps > 0) {\n\t\t\t\tdeps.length = skipped_deps + new_deps.length;\n\t\t\t\tfor (i = 0; i < new_deps.length; i++) {\n\t\t\t\t\tdeps[skipped_deps + i] = new_deps[i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treaction.deps = deps = new_deps;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!skip_reaction ||\n\t\t\t\t// Deriveds that already have reactions can cleanup, so we still add them as reactions\n\t\t\t\t((flags & DERIVED) !== 0 &&\n\t\t\t\t\t/** @type {import('#client').Derived} */ (reaction).reactions !== null)\n\t\t\t) {\n\t\t\t\tfor (i = skipped_deps; i < deps.length; i++) {\n\t\t\t\t\t(deps[i].reactions ??= []).push(reaction);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (deps !== null && skipped_deps < deps.length) {\n\t\t\tremove_reactions(reaction, skipped_deps);\n\t\t\tdeps.length = skipped_deps;\n\t\t}\n\n\t\t// If we're inside an effect and we have untracked writes, then we need to\n\t\t// ensure that if any of those untracked writes result in re-invalidation\n\t\t// of the current effect, then that happens accordingly\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tuntracked_writes !== null &&\n\t\t\t!untracking &&\n\t\t\tdeps !== null &&\n\t\t\t(reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0\n\t\t) {\n\t\t\tfor (i = 0; i < /** @type {Source[]} */ (untracked_writes).length; i++) {\n\t\t\t\tschedule_possible_effect_self_invalidation(\n\t\t\t\t\tuntracked_writes[i],\n\t\t\t\t\t/** @type {Effect} */ (reaction)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// If we are returning to an previous reaction then\n\t\t// we need to increment the read version to ensure that\n\t\t// any dependencies in this reaction aren't marked with\n\t\t// the same version\n\t\tif (previous_reaction !== null && previous_reaction !== reaction) {\n\t\t\tread_version++;\n\n\t\t\tif (untracked_writes !== null) {\n\t\t\t\tif (previous_untracked_writes === null) {\n\t\t\t\t\tprevious_untracked_writes = untracked_writes;\n\t\t\t\t} else {\n\t\t\t\t\tprevious_untracked_writes.push(.../** @type {Source[]} */ (untracked_writes));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ((reaction.f & ERROR_VALUE) !== 0) {\n\t\t\treaction.f ^= ERROR_VALUE;\n\t\t}\n\n\t\treturn result;\n\t} catch (error) {\n\t\treturn handle_error(error);\n\t} finally {\n\t\treaction.f ^= REACTION_IS_UPDATING;\n\t\tnew_deps = previous_deps;\n\t\tskipped_deps = previous_skipped_deps;\n\t\tuntracked_writes = previous_untracked_writes;\n\t\tactive_reaction = previous_reaction;\n\t\tskip_reaction = previous_skip_reaction;\n\t\tcurrent_sources = previous_sources;\n\t\tset_component_context(previous_component_context);\n\t\tuntracking = previous_untracking;\n\t\tupdate_version = previous_update_version;\n\t}\n}\n\n/**\n * @template V\n * @param {Reaction} signal\n * @param {Value<V>} dependency\n * @returns {void}\n */\nfunction remove_reaction(signal, dependency) {\n\tlet reactions = dependency.reactions;\n\tif (reactions !== null) {\n\t\tvar index = index_of.call(reactions, signal);\n\t\tif (index !== -1) {\n\t\t\tvar new_length = reactions.length - 1;\n\t\t\tif (new_length === 0) {\n\t\t\t\treactions = dependency.reactions = null;\n\t\t\t} else {\n\t\t\t\t// Swap with last element and then remove.\n\t\t\t\treactions[index] = reactions[new_length];\n\t\t\t\treactions.pop();\n\t\t\t}\n\t\t}\n\t}\n\n\t// If the derived has no reactions, then we can disconnect it from the graph,\n\t// allowing it to either reconnect in the future, or be GC'd by the VM.\n\tif (\n\t\treactions === null &&\n\t\t(dependency.f & DERIVED) !== 0 &&\n\t\t// Destroying a child effect while updating a parent effect can cause a dependency to appear\n\t\t// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`\n\t\t// allows us to skip the expensive work of disconnecting and immediately reconnecting it\n\t\t(new_deps === null || !new_deps.includes(dependency))\n\t) {\n\t\tset_signal_status(dependency, MAYBE_DIRTY);\n\t\t// If we are working with a derived that is owned by an effect, then mark it as being\n\t\t// disconnected.\n\t\tif ((dependency.f & (UNOWNED | DISCONNECTED)) === 0) {\n\t\t\tdependency.f ^= DISCONNECTED;\n\t\t}\n\t\t// Disconnect any reactions owned by this reaction\n\t\tdestroy_derived_effects(/** @type {Derived} **/ (dependency));\n\t\tremove_reactions(/** @type {Derived} **/ (dependency), 0);\n\t}\n}\n\n/**\n * @param {Reaction} signal\n * @param {number} start_index\n * @returns {void}\n */\nexport function remove_reactions(signal, start_index) {\n\tvar dependencies = signal.deps;\n\tif (dependencies === null) return;\n\n\tfor (var i = start_index; i < dependencies.length; i++) {\n\t\tremove_reaction(signal, dependencies[i]);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @returns {void}\n */\nexport function update_effect(effect) {\n\tvar flags = effect.f;\n\n\tif ((flags & DESTROYED) !== 0) {\n\t\treturn;\n\t}\n\n\tset_signal_status(effect, CLEAN);\n\n\tvar previous_effect = active_effect;\n\tvar was_updating_effect = is_updating_effect;\n\n\tactive_effect = effect;\n\tis_updating_effect = true;\n\n\tif (DEV) {\n\t\tvar previous_component_fn = dev_current_component_function;\n\t\tset_dev_current_component_function(effect.component_function);\n\t\tvar previous_stack = /** @type {any} */ (dev_stack);\n\t\t// only block effects have a dev stack, keep the current one otherwise\n\t\tset_dev_stack(effect.dev_stack ?? dev_stack);\n\t}\n\n\ttry {\n\t\tif ((flags & BLOCK_EFFECT) !== 0) {\n\t\t\tdestroy_block_effect_children(effect);\n\t\t} else {\n\t\t\tdestroy_effect_children(effect);\n\t\t}\n\n\t\texecute_effect_teardown(effect);\n\t\tvar teardown = update_reaction(effect);\n\t\teffect.teardown = typeof teardown === 'function' ? teardown : null;\n\t\teffect.wv = write_version;\n\n\t\t// In DEV, increment versions of any sources that were written to during the effect,\n\t\t// so that they are correctly marked as dirty when the effect re-runs\n\t\tif (DEV && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) {\n\t\t\tfor (var dep of effect.deps) {\n\t\t\t\tif (dep.set_during_effect) {\n\t\t\t\t\tdep.wv = increment_write_version();\n\t\t\t\t\tdep.set_during_effect = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tis_updating_effect = was_updating_effect;\n\t\tactive_effect = previous_effect;\n\n\t\tif (DEV) {\n\t\t\tset_dev_current_component_function(previous_component_fn);\n\t\t\tset_dev_stack(previous_stack);\n\t\t}\n\t}\n}\n\n/**\n * Returns a promise that resolves once any pending state changes have been applied.\n * @returns {Promise<void>}\n */\nexport async function tick() {\n\tif (async_mode_flag) {\n\t\treturn new Promise((f) => requestAnimationFrame(() => f()));\n\t}\n\n\tawait Promise.resolve();\n\n\t// By calling flushSync we guarantee that any pending state changes are applied after one tick.\n\t// TODO look into whether we can make flushing subsequent updates synchronously in the future.\n\tflushSync();\n}\n\n/**\n * Returns a promise that resolves once any state changes, and asynchronous work resulting from them,\n * have resolved and the DOM has been updated\n * @returns {Promise<void>}\n * @since 5.36\n */\nexport function settled() {\n\treturn Batch.ensure().settled();\n}\n\n/**\n * @template V\n * @param {Value<V>} signal\n * @returns {V}\n */\nexport function get(signal) {\n\tvar flags = signal.f;\n\tvar is_derived = (flags & DERIVED) !== 0;\n\n\tcaptured_signals?.add(signal);\n\n\t// Register the dependency on the current reaction signal.\n\tif (active_reaction !== null && !untracking) {\n\t\t// if we're in a derived that is being read inside an _async_ derived,\n\t\t// it's possible that the effect was already destroyed. In this case,\n\t\t// we don't add the dependency, because that would create a memory leak\n\t\tvar destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;\n\n\t\tif (!destroyed && !current_sources?.includes(signal)) {\n\t\t\tvar deps = active_reaction.deps;\n\n\t\t\tif ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {\n\t\t\t\t// we're in the effect init/update cycle\n\t\t\t\tif (signal.rv < read_version) {\n\t\t\t\t\tsignal.rv = read_version;\n\n\t\t\t\t\t// If the signal is accessing the same dependencies in the same\n\t\t\t\t\t// order as it did last time, increment `skipped_deps`\n\t\t\t\t\t// rather than updating `new_deps`, which creates GC cost\n\t\t\t\t\tif (new_deps === null && deps !== null && deps[skipped_deps] === signal) {\n\t\t\t\t\t\tskipped_deps++;\n\t\t\t\t\t} else if (new_deps === null) {\n\t\t\t\t\t\tnew_deps = [signal];\n\t\t\t\t\t} else if (!skip_reaction || !new_deps.includes(signal)) {\n\t\t\t\t\t\t// Normally we can push duplicated dependencies to `new_deps`, but if we're inside\n\t\t\t\t\t\t// an unowned derived because skip_reaction is true, then we need to ensure that\n\t\t\t\t\t\t// we don't have duplicates\n\t\t\t\t\t\tnew_deps.push(signal);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// we're adding a dependency outside the init/update cycle\n\t\t\t\t// (i.e. after an `await`)\n\t\t\t\t(active_reaction.deps ??= []).push(signal);\n\n\t\t\t\tvar reactions = signal.reactions;\n\n\t\t\t\tif (reactions === null) {\n\t\t\t\t\tsignal.reactions = [active_reaction];\n\t\t\t\t} else if (!reactions.includes(active_reaction)) {\n\t\t\t\t\treactions.push(active_reaction);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (\n\t\tis_derived &&\n\t\t/** @type {Derived} */ (signal).deps === null &&\n\t\t/** @type {Derived} */ (signal).effects === null\n\t) {\n\t\tvar derived = /** @type {Derived} */ (signal);\n\t\tvar parent = derived.parent;\n\n\t\tif (parent !== null && (parent.f & UNOWNED) === 0) {\n\t\t\t// If the derived is owned by another derived then mark it as unowned\n\t\t\t// as the derived value might have been referenced in a different context\n\t\t\t// since and thus its parent might not be its true owner anymore\n\t\t\tderived.f ^= UNOWNED;\n\t\t}\n\t}\n\n\tif (DEV) {\n\t\tif (current_async_effect) {\n\t\t\tvar tracking = (current_async_effect.f & REACTION_IS_UPDATING) !== 0;\n\t\t\tvar was_read = current_async_effect.deps?.includes(signal);\n\n\t\t\tif (!tracking && !untracking && !was_read) {\n\t\t\t\tw.await_reactivity_loss(/** @type {string} */ (signal.label));\n\n\t\t\t\tvar trace = get_stack('TracedAt');\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tif (trace) console.warn(trace);\n\t\t\t}\n\t\t}\n\n\t\trecent_async_deriveds.delete(signal);\n\n\t\tif (\n\t\t\ttracing_mode_flag &&\n\t\t\t!untracking &&\n\t\t\ttracing_expressions !== null &&\n\t\t\tactive_reaction !== null &&\n\t\t\ttracing_expressions.reaction === active_reaction\n\t\t) {\n\t\t\t// Used when mapping state between special blocks like `each`\n\t\t\tif (signal.trace) {\n\t\t\t\tsignal.trace();\n\t\t\t} else {\n\t\t\t\ttrace = get_stack('TracedAt');\n\n\t\t\t\tif (trace) {\n\t\t\t\t\tvar entry = tracing_expressions.entries.get(signal);\n\n\t\t\t\t\tif (entry === undefined) {\n\t\t\t\t\t\tentry = { traces: [] };\n\t\t\t\t\t\ttracing_expressions.entries.set(signal, entry);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar last = entry.traces[entry.traces.length - 1];\n\n\t\t\t\t\t// traces can be duplicated, e.g. by `snapshot` invoking both\n\t\t\t\t\t// both `getOwnPropertyDescriptor` and `get` traps at once\n\t\t\t\t\tif (trace.stack !== last?.stack) {\n\t\t\t\t\t\tentry.traces.push(trace);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (is_destroying_effect) {\n\t\tif (old_values.has(signal)) {\n\t\t\treturn old_values.get(signal);\n\t\t}\n\n\t\tif (is_derived) {\n\t\t\tderived = /** @type {Derived} */ (signal);\n\n\t\t\tvar value = derived.v;\n\n\t\t\t// if the derived is dirty and has reactions, or depends on the values that just changed, re-execute\n\t\t\t// (a derived can be maybe_dirty due to the effect destroy removing its last reaction)\n\t\t\tif (\n\t\t\t\t((derived.f & CLEAN) === 0 && derived.reactions !== null) ||\n\t\t\t\tdepends_on_old_values(derived)\n\t\t\t) {\n\t\t\t\tvalue = execute_derived(derived);\n\t\t\t}\n\n\t\t\told_values.set(derived, value);\n\n\t\t\treturn value;\n\t\t}\n\t} else if (is_derived) {\n\t\tderived = /** @type {Derived} */ (signal);\n\n\t\tif (batch_deriveds?.has(derived)) {\n\t\t\treturn batch_deriveds.get(derived);\n\t\t}\n\n\t\tif (is_dirty(derived)) {\n\t\t\tupdate_derived(derived);\n\t\t}\n\t}\n\n\tif ((signal.f & ERROR_VALUE) !== 0) {\n\t\tthrow signal.v;\n\t}\n\n\treturn signal.v;\n}\n\n/** @param {Derived} derived */\nfunction depends_on_old_values(derived) {\n\tif (derived.v === UNINITIALIZED) return true; // we don't know, so assume the worst\n\tif (derived.deps === null) return false;\n\n\tfor (const dep of derived.deps) {\n\t\tif (old_values.has(dep)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ((dep.f & DERIVED) !== 0 && depends_on_old_values(/** @type {Derived} */ (dep))) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Like `get`, but checks for `undefined`. Used for `var` declarations because they can be accessed before being declared\n * @template V\n * @param {Value<V> | undefined} signal\n * @returns {V | undefined}\n */\nexport function safe_get(signal) {\n\treturn signal && get(signal);\n}\n\n/**\n * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),\n * any state read inside `fn` will not be treated as a dependency.\n *\n * ```ts\n * $effect(() => {\n * // this will run when `data` changes, but not when `time` changes\n * save(data, {\n * timestamp: untrack(() => time)\n * });\n * });\n * ```\n * @template T\n * @param {() => T} fn\n * @returns {T}\n */\nexport function untrack(fn) {\n\tvar previous_untracking = untracking;\n\ttry {\n\t\tuntracking = true;\n\t\treturn fn();\n\t} finally {\n\t\tuntracking = previous_untracking;\n\t}\n}\n\nconst STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);\n\n/**\n * @param {Signal} signal\n * @param {number} status\n * @returns {void}\n */\nexport function set_signal_status(signal, status) {\n\tsignal.f = (signal.f & STATUS_MASK) | status;\n}\n\n/**\n * @param {Record<string, unknown>} obj\n * @param {string[]} keys\n * @returns {Record<string, unknown>}\n */\nexport function exclude_from_object(obj, keys) {\n\t/** @type {Record<string, unknown>} */\n\tvar result = {};\n\n\tfor (var key in obj) {\n\t\tif (!keys.includes(key)) {\n\t\t\tresult[key] = obj[key];\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Possibly traverse an object and read all its properties so that they're all reactive in case this is `$state`.\n * Does only check first level of an object for performance reasons (heuristic should be good for 99% of all cases).\n * @param {any} value\n * @returns {void}\n */\nexport function deep_read_state(value) {\n\tif (typeof value !== 'object' || !value || value instanceof EventTarget) {\n\t\treturn;\n\t}\n\n\tif (STATE_SYMBOL in value) {\n\t\tdeep_read(value);\n\t} else if (!Array.isArray(value)) {\n\t\tfor (let key in value) {\n\t\t\tconst prop = value[key];\n\t\t\tif (typeof prop === 'object' && prop && STATE_SYMBOL in prop) {\n\t\t\t\tdeep_read(prop);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Deeply traverse an object and read all its properties\n * so that they're all reactive in case this is `$state`\n * @param {any} value\n * @param {Set<any>} visited\n * @returns {void}\n */\nexport function deep_read(value, visited = new Set()) {\n\tif (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t// We don't want to traverse DOM elements\n\t\t!(value instanceof EventTarget) &&\n\t\t!visited.has(value)\n\t) {\n\t\tvisited.add(value);\n\t\t// When working with a possible SvelteDate, this\n\t\t// will ensure we capture changes to it.\n\t\tif (value instanceof Date) {\n\t\t\tvalue.getTime();\n\t\t}\n\t\tfor (let key in value) {\n\t\t\ttry {\n\t\t\t\tdeep_read(value[key], visited);\n\t\t\t} catch (e) {\n\t\t\t\t// continue\n\t\t\t}\n\t\t}\n\t\tconst proto = get_prototype_of(value);\n\t\tif (\n\t\t\tproto !== Object.prototype &&\n\t\t\tproto !== Array.prototype &&\n\t\t\tproto !== Map.prototype &&\n\t\t\tproto !== Set.prototype &&\n\t\t\tproto !== Date.prototype\n\t\t) {\n\t\t\tconst descriptors = get_descriptors(proto);\n\t\t\tfor (let key in descriptors) {\n\t\t\t\tconst get = descriptors[key].get;\n\t\t\t\tif (get) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tget.call(value);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t// continue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","const regex_return_characters = /\\r/g;\n\n/**\n * @param {string} str\n * @returns {string}\n */\nexport function hash(str) {\n\tstr = str.replace(regex_return_characters, '');\n\tlet hash = 5381;\n\tlet i = str.length;\n\n\twhile (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n\treturn (hash >>> 0).toString(36);\n}\n\nconst VOID_ELEMENT_NAMES = [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr'\n];\n\n/**\n * Returns `true` if `name` is of a void element\n * @param {string} name\n */\nexport function is_void(name) {\n\treturn VOID_ELEMENT_NAMES.includes(name) || name.toLowerCase() === '!doctype';\n}\n\nconst RESERVED_WORDS = [\n\t'arguments',\n\t'await',\n\t'break',\n\t'case',\n\t'catch',\n\t'class',\n\t'const',\n\t'continue',\n\t'debugger',\n\t'default',\n\t'delete',\n\t'do',\n\t'else',\n\t'enum',\n\t'eval',\n\t'export',\n\t'extends',\n\t'false',\n\t'finally',\n\t'for',\n\t'function',\n\t'if',\n\t'implements',\n\t'import',\n\t'in',\n\t'instanceof',\n\t'interface',\n\t'let',\n\t'new',\n\t'null',\n\t'package',\n\t'private',\n\t'protected',\n\t'public',\n\t'return',\n\t'static',\n\t'super',\n\t'switch',\n\t'this',\n\t'throw',\n\t'true',\n\t'try',\n\t'typeof',\n\t'var',\n\t'void',\n\t'while',\n\t'with',\n\t'yield'\n];\n\n/**\n * Returns `true` if `word` is a reserved JavaScript keyword\n * @param {string} word\n */\nexport function is_reserved(word) {\n\treturn RESERVED_WORDS.includes(word);\n}\n\n/**\n * @param {string} name\n */\nexport function is_capture_event(name) {\n\treturn name.endsWith('capture') && name !== 'gotpointercapture' && name !== 'lostpointercapture';\n}\n\n/** List of Element events that will be delegated */\nconst DELEGATED_EVENTS = [\n\t'beforeinput',\n\t'click',\n\t'change',\n\t'dblclick',\n\t'contextmenu',\n\t'focusin',\n\t'focusout',\n\t'input',\n\t'keydown',\n\t'keyup',\n\t'mousedown',\n\t'mousemove',\n\t'mouseout',\n\t'mouseover',\n\t'mouseup',\n\t'pointerdown',\n\t'pointermove',\n\t'pointerout',\n\t'pointerover',\n\t'pointerup',\n\t'touchend',\n\t'touchmove',\n\t'touchstart'\n];\n\n/**\n * Returns `true` if `event_name` is a delegated event\n * @param {string} event_name\n */\nexport function is_delegated(event_name) {\n\treturn DELEGATED_EVENTS.includes(event_name);\n}\n\n/**\n * Attributes that are boolean, i.e. they are present or not present.\n */\nconst DOM_BOOLEAN_ATTRIBUTES = [\n\t'allowfullscreen',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'disabled',\n\t'formnovalidate',\n\t'hidden',\n\t'indeterminate',\n\t'inert',\n\t'ismap',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'seamless',\n\t'selected',\n\t'webkitdirectory',\n\t'defer',\n\t'disablepictureinpicture',\n\t'disableremoteplayback'\n];\n\n/**\n * Returns `true` if `name` is a boolean attribute\n * @param {string} name\n */\nexport function is_boolean_attribute(name) {\n\treturn DOM_BOOLEAN_ATTRIBUTES.includes(name);\n}\n\n/**\n * @type {Record<string, string>}\n * List of attribute names that should be aliased to their property names\n * because they behave differently between setting them as an attribute and\n * setting them as a property.\n */\nconst ATTRIBUTE_ALIASES = {\n\t// no `class: 'className'` because we handle that separately\n\tformnovalidate: 'formNoValidate',\n\tismap: 'isMap',\n\tnomodule: 'noModule',\n\tplaysinline: 'playsInline',\n\treadonly: 'readOnly',\n\tdefaultvalue: 'defaultValue',\n\tdefaultchecked: 'defaultChecked',\n\tsrcobject: 'srcObject',\n\tnovalidate: 'noValidate',\n\tallowfullscreen: 'allowFullscreen',\n\tdisablepictureinpicture: 'disablePictureInPicture',\n\tdisableremoteplayback: 'disableRemotePlayback'\n};\n\n/**\n * @param {string} name\n */\nexport function normalize_attribute(name) {\n\tname = name.toLowerCase();\n\treturn ATTRIBUTE_ALIASES[name] ?? name;\n}\n\nconst DOM_PROPERTIES = [\n\t...DOM_BOOLEAN_ATTRIBUTES,\n\t'formNoValidate',\n\t'isMap',\n\t'noModule',\n\t'playsInline',\n\t'readOnly',\n\t'value',\n\t'volume',\n\t'defaultValue',\n\t'defaultChecked',\n\t'srcObject',\n\t'noValidate',\n\t'allowFullscreen',\n\t'disablePictureInPicture',\n\t'disableRemotePlayback'\n];\n\n/**\n * @param {string} name\n */\nexport function is_dom_property(name) {\n\treturn DOM_PROPERTIES.includes(name);\n}\n\nconst NON_STATIC_PROPERTIES = ['autofocus', 'muted', 'defaultValue', 'defaultChecked'];\n\n/**\n * Returns `true` if the given attribute cannot be set through the template\n * string, i.e. needs some kind of JavaScript handling to work.\n * @param {string} name\n */\nexport function cannot_be_set_statically(name) {\n\treturn NON_STATIC_PROPERTIES.includes(name);\n}\n\n/**\n * Subset of delegated events which should be passive by default.\n * These two are already passive via browser defaults on window, document and body.\n * But since\n * - we're delegating them\n * - they happen often\n * - they apply to mobile which is generally less performant\n * we're marking them as passive by default for other elements, too.\n */\nconst PASSIVE_EVENTS = ['touchstart', 'touchmove'];\n\n/**\n * Returns `true` if `name` is a passive event\n * @param {string} name\n */\nexport function is_passive_event(name) {\n\treturn PASSIVE_EVENTS.includes(name);\n}\n\nconst CONTENT_EDITABLE_BINDINGS = ['textContent', 'innerHTML', 'innerText'];\n\n/** @param {string} name */\nexport function is_content_editable_binding(name) {\n\treturn CONTENT_EDITABLE_BINDINGS.includes(name);\n}\n\nconst LOAD_ERROR_ELEMENTS = [\n\t'body',\n\t'embed',\n\t'iframe',\n\t'img',\n\t'link',\n\t'object',\n\t'script',\n\t'style',\n\t'track'\n];\n\n/**\n * Returns `true` if the element emits `load` and `error` events\n * @param {string} name\n */\nexport function is_load_error_element(name) {\n\treturn LOAD_ERROR_ELEMENTS.includes(name);\n}\n\nconst SVG_ELEMENTS = [\n\t'altGlyph',\n\t'altGlyphDef',\n\t'altGlyphItem',\n\t'animate',\n\t'animateColor',\n\t'animateMotion',\n\t'animateTransform',\n\t'circle',\n\t'clipPath',\n\t'color-profile',\n\t'cursor',\n\t'defs',\n\t'desc',\n\t'discard',\n\t'ellipse',\n\t'feBlend',\n\t'feColorMatrix',\n\t'feComponentTransfer',\n\t'feComposite',\n\t'feConvolveMatrix',\n\t'feDiffuseLighting',\n\t'feDisplacementMap',\n\t'feDistantLight',\n\t'feDropShadow',\n\t'feFlood',\n\t'feFuncA',\n\t'feFuncB',\n\t'feFuncG',\n\t'feFuncR',\n\t'feGaussianBlur',\n\t'feImage',\n\t'feMerge',\n\t'feMergeNode',\n\t'feMorphology',\n\t'feOffset',\n\t'fePointLight',\n\t'feSpecularLighting',\n\t'feSpotLight',\n\t'feTile',\n\t'feTurbulence',\n\t'filter',\n\t'font',\n\t'font-face',\n\t'font-face-format',\n\t'font-face-name',\n\t'font-face-src',\n\t'font-face-uri',\n\t'foreignObject',\n\t'g',\n\t'glyph',\n\t'glyphRef',\n\t'hatch',\n\t'hatchpath',\n\t'hkern',\n\t'image',\n\t'line',\n\t'linearGradient',\n\t'marker',\n\t'mask',\n\t'mesh',\n\t'meshgradient',\n\t'meshpatch',\n\t'meshrow',\n\t'metadata',\n\t'missing-glyph',\n\t'mpath',\n\t'path',\n\t'pattern',\n\t'polygon',\n\t'polyline',\n\t'radialGradient',\n\t'rect',\n\t'set',\n\t'solidcolor',\n\t'stop',\n\t'svg',\n\t'switch',\n\t'symbol',\n\t'text',\n\t'textPath',\n\t'tref',\n\t'tspan',\n\t'unknown',\n\t'use',\n\t'view',\n\t'vkern'\n];\n\n/** @param {string} name */\nexport function is_svg(name) {\n\treturn SVG_ELEMENTS.includes(name);\n}\n\nconst MATHML_ELEMENTS = [\n\t'annotation',\n\t'annotation-xml',\n\t'maction',\n\t'math',\n\t'merror',\n\t'mfrac',\n\t'mi',\n\t'mmultiscripts',\n\t'mn',\n\t'mo',\n\t'mover',\n\t'mpadded',\n\t'mphantom',\n\t'mprescripts',\n\t'mroot',\n\t'mrow',\n\t'ms',\n\t'mspace',\n\t'msqrt',\n\t'mstyle',\n\t'msub',\n\t'msubsup',\n\t'msup',\n\t'mtable',\n\t'mtd',\n\t'mtext',\n\t'mtr',\n\t'munder',\n\t'munderover',\n\t'semantics'\n];\n\n/** @param {string} name */\nexport function is_mathml(name) {\n\treturn MATHML_ELEMENTS.includes(name);\n}\n\nconst STATE_CREATION_RUNES = /** @type {const} */ ([\n\t'$state',\n\t'$state.raw',\n\t'$derived',\n\t'$derived.by'\n]);\n\nconst RUNES = /** @type {const} */ ([\n\t...STATE_CREATION_RUNES,\n\t'$state.snapshot',\n\t'$props',\n\t'$props.id',\n\t'$bindable',\n\t'$effect',\n\t'$effect.pre',\n\t'$effect.tracking',\n\t'$effect.root',\n\t'$effect.pending',\n\t'$inspect',\n\t'$inspect().with',\n\t'$inspect.trace',\n\t'$host'\n]);\n\n/** @typedef {typeof RUNES[number]} RuneName */\n\n/**\n * @param {string} name\n * @returns {name is RuneName}\n */\nexport function is_rune(name) {\n\treturn RUNES.includes(/** @type {RuneName} */ (name));\n}\n\n/** @typedef {typeof STATE_CREATION_RUNES[number]} StateCreationRuneName */\n\n/**\n * @param {string} name\n * @returns {name is StateCreationRuneName}\n */\nexport function is_state_creation_rune(name) {\n\treturn STATE_CREATION_RUNES.includes(/** @type {StateCreationRuneName} */ (name));\n}\n\n/** List of elements that require raw contents and should not have SSR comments put in them */\nconst RAW_TEXT_ELEMENTS = /** @type {const} */ (['textarea', 'script', 'style', 'title']);\n\n/** @param {string} name */\nexport function is_raw_text_element(name) {\n\treturn RAW_TEXT_ELEMENTS.includes(/** @type {typeof RAW_TEXT_ELEMENTS[number]} */ (name));\n}\n\n/**\n * Prevent devtools trying to make `location` a clickable link by inserting a zero-width space\n * @template {string | undefined} T\n * @param {T} location\n * @returns {T};\n */\nexport function sanitize_location(location) {\n\treturn /** @type {T} */ (location?.replace(/\\//g, '/\\u200b'));\n}\n","import { teardown } from '../../reactivity/effects.js';\nimport { define_property, is_array } from '../../../shared/utils.js';\nimport { hydrating } from '../hydration.js';\nimport { queue_micro_task } from '../task.js';\nimport { FILENAME } from '../../../../constants.js';\nimport * as w from '../../warnings.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { without_reactive_context } from './bindings/shared.js';\n\n/** @type {Set<string>} */\nexport const all_registered_events = new Set();\n\n/** @type {Set<(events: Array<string>) => void>} */\nexport const root_event_handles = new Set();\n\n/**\n * SSR adds onload and onerror attributes to catch those events before the hydration.\n * This function detects those cases, removes the attributes and replays the events.\n * @param {HTMLElement} dom\n */\nexport function replay_events(dom) {\n\tif (!hydrating) return;\n\n\tdom.removeAttribute('onload');\n\tdom.removeAttribute('onerror');\n\t// @ts-expect-error\n\tconst event = dom.__e;\n\tif (event !== undefined) {\n\t\t// @ts-expect-error\n\t\tdom.__e = undefined;\n\t\tqueueMicrotask(() => {\n\t\t\tif (dom.isConnected) {\n\t\t\t\tdom.dispatchEvent(event);\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * @param {string} event_name\n * @param {EventTarget} dom\n * @param {EventListener} [handler]\n * @param {AddEventListenerOptions} [options]\n */\nexport function create_event(event_name, dom, handler, options = {}) {\n\t/**\n\t * @this {EventTarget}\n\t */\n\tfunction target_handler(/** @type {Event} */ event) {\n\t\tif (!options.capture) {\n\t\t\t// Only call in the bubble phase, else delegated events would be called before the capturing events\n\t\t\thandle_event_propagation.call(dom, event);\n\t\t}\n\t\tif (!event.cancelBubble) {\n\t\t\treturn without_reactive_context(() => {\n\t\t\t\treturn handler?.call(this, event);\n\t\t\t});\n\t\t}\n\t}\n\n\t// Chrome has a bug where pointer events don't work when attached to a DOM element that has been cloned\n\t// with cloneNode() and the DOM element is disconnected from the document. To ensure the event works, we\n\t// defer the attachment till after it's been appended to the document. TODO: remove this once Chrome fixes\n\t// this bug. The same applies to wheel events and touch events.\n\tif (\n\t\tevent_name.startsWith('pointer') ||\n\t\tevent_name.startsWith('touch') ||\n\t\tevent_name === 'wheel'\n\t) {\n\t\tqueue_micro_task(() => {\n\t\t\tdom.addEventListener(event_name, target_handler, options);\n\t\t});\n\t} else {\n\t\tdom.addEventListener(event_name, target_handler, options);\n\t}\n\n\treturn target_handler;\n}\n\n/**\n * Attaches an event handler to an element and returns a function that removes the handler. Using this\n * rather than `addEventListener` will preserve the correct order relative to handlers added declaratively\n * (with attributes like `onclick`), which use event delegation for performance reasons\n *\n * @param {EventTarget} element\n * @param {string} type\n * @param {EventListener} handler\n * @param {AddEventListenerOptions} [options]\n */\nexport function on(element, type, handler, options = {}) {\n\tvar target_handler = create_event(type, element, handler, options);\n\n\treturn () => {\n\t\telement.removeEventListener(type, target_handler, options);\n\t};\n}\n\n/**\n * @param {string} event_name\n * @param {Element} dom\n * @param {EventListener} [handler]\n * @param {boolean} [capture]\n * @param {boolean} [passive]\n * @returns {void}\n */\nexport function event(event_name, dom, handler, capture, passive) {\n\tvar options = { capture, passive };\n\tvar target_handler = create_event(event_name, dom, handler, options);\n\n\tif (\n\t\tdom === document.body ||\n\t\t// @ts-ignore\n\t\tdom === window ||\n\t\t// @ts-ignore\n\t\tdom === document ||\n\t\t// Firefox has quirky behavior, it can happen that we still get \"canplay\" events when the element is already removed\n\t\tdom instanceof HTMLMediaElement\n\t) {\n\t\tteardown(() => {\n\t\t\tdom.removeEventListener(event_name, target_handler, options);\n\t\t});\n\t}\n}\n\n/**\n * @param {Array<string>} events\n * @returns {void}\n */\nexport function delegate(events) {\n\tfor (var i = 0; i < events.length; i++) {\n\t\tall_registered_events.add(events[i]);\n\t}\n\n\tfor (var fn of root_event_handles) {\n\t\tfn(events);\n\t}\n}\n\n// used to store the reference to the currently propagated event\n// to prevent garbage collection between microtasks in Firefox\n// If the event object is GCed too early, the expando __root property\n// set on the event object is lost, causing the event delegation\n// to process the event twice\nlet last_propagated_event = null;\n\n/**\n * @this {EventTarget}\n * @param {Event} event\n * @returns {void}\n */\nexport function handle_event_propagation(event) {\n\tvar handler_element = this;\n\tvar owner_document = /** @type {Node} */ (handler_element).ownerDocument;\n\tvar event_name = event.type;\n\tvar path = event.composedPath?.() || [];\n\tvar current_target = /** @type {null | Element} */ (path[0] || event.target);\n\n\tlast_propagated_event = event;\n\n\t// composedPath contains list of nodes the event has propagated through.\n\t// We check __root to skip all nodes below it in case this is a\n\t// parent of the __root node, which indicates that there's nested\n\t// mounted apps. In this case we don't want to trigger events multiple times.\n\tvar path_idx = 0;\n\n\t// the `last_propagated_event === event` check is redundant, but\n\t// without it the variable will be DCE'd and things will\n\t// fail mysteriously in Firefox\n\t// @ts-expect-error is added below\n\tvar handled_at = last_propagated_event === event && event.__root;\n\n\tif (handled_at) {\n\t\tvar at_idx = path.indexOf(handled_at);\n\t\tif (\n\t\t\tat_idx !== -1 &&\n\t\t\t(handler_element === document || handler_element === /** @type {any} */ (window))\n\t\t) {\n\t\t\t// This is the fallback document listener or a window listener, but the event was already handled\n\t\t\t// -> ignore, but set handle_at to document/window so that we're resetting the event\n\t\t\t// chain in case someone manually dispatches the same event object again.\n\t\t\t// @ts-expect-error\n\t\t\tevent.__root = handler_element;\n\t\t\treturn;\n\t\t}\n\n\t\t// We're deliberately not skipping if the index is higher, because\n\t\t// someone could create an event programmatically and emit it multiple times,\n\t\t// in which case we want to handle the whole propagation chain properly each time.\n\t\t// (this will only be a false negative if the event is dispatched multiple times and\n\t\t// the fallback document listener isn't reached in between, but that's super rare)\n\t\tvar handler_idx = path.indexOf(handler_element);\n\t\tif (handler_idx === -1) {\n\t\t\t// handle_idx can theoretically be -1 (happened in some JSDOM testing scenarios with an event listener on the window object)\n\t\t\t// so guard against that, too, and assume that everything was handled at this point.\n\t\t\treturn;\n\t\t}\n\n\t\tif (at_idx <= handler_idx) {\n\t\t\tpath_idx = at_idx;\n\t\t}\n\t}\n\n\tcurrent_target = /** @type {Element} */ (path[path_idx] || event.target);\n\t// there can only be one delegated event per element, and we either already handled the current target,\n\t// or this is the very first target in the chain which has a non-delegated listener, in which case it's safe\n\t// to handle a possible delegated event on it later (through the root delegation listener for example).\n\tif (current_target === handler_element) return;\n\n\t// Proxy currentTarget to correct target\n\tdefine_property(event, 'currentTarget', {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn current_target || owner_document;\n\t\t}\n\t});\n\n\t// This started because of Chromium issue https://chromestatus.com/feature/5128696823545856,\n\t// where removal or moving of of the DOM can cause sync `blur` events to fire, which can cause logic\n\t// to run inside the current `active_reaction`, which isn't what we want at all. However, on reflection,\n\t// it's probably best that all event handled by Svelte have this behaviour, as we don't really want\n\t// an event handler to run in the context of another reaction or effect.\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\n\ttry {\n\t\t/**\n\t\t * @type {unknown}\n\t\t */\n\t\tvar throw_error;\n\t\t/**\n\t\t * @type {unknown[]}\n\t\t */\n\t\tvar other_errors = [];\n\n\t\twhile (current_target !== null) {\n\t\t\t/** @type {null | Element} */\n\t\t\tvar parent_element =\n\t\t\t\tcurrent_target.assignedSlot ||\n\t\t\t\tcurrent_target.parentNode ||\n\t\t\t\t/** @type {any} */ (current_target).host ||\n\t\t\t\tnull;\n\n\t\t\ttry {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tvar delegated = current_target['__' + event_name];\n\n\t\t\t\tif (\n\t\t\t\t\tdelegated != null &&\n\t\t\t\t\t(!(/** @type {any} */ (current_target).disabled) ||\n\t\t\t\t\t\t// DOM could've been updated already by the time this is reached, so we check this as well\n\t\t\t\t\t\t// -> the target could not have been disabled because it emits the event in the first place\n\t\t\t\t\t\tevent.target === current_target)\n\t\t\t\t) {\n\t\t\t\t\tif (is_array(delegated)) {\n\t\t\t\t\t\tvar [fn, ...data] = delegated;\n\t\t\t\t\t\tfn.apply(current_target, [event, ...data]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdelegated.call(current_target, event);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (throw_error) {\n\t\t\t\t\tother_errors.push(error);\n\t\t\t\t} else {\n\t\t\t\t\tthrow_error = error;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (event.cancelBubble || parent_element === handler_element || parent_element === null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcurrent_target = parent_element;\n\t\t}\n\n\t\tif (throw_error) {\n\t\t\tfor (let error of other_errors) {\n\t\t\t\t// Throw the rest of the errors, one-by-one on a microtask\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow throw_error;\n\t\t}\n\t} finally {\n\t\t// @ts-expect-error is used above\n\t\tevent.__root = handler_element;\n\t\t// @ts-ignore remove proxy on currentTarget\n\t\tdelete event.currentTarget;\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * In dev, warn if an event handler is not a function, as it means the\n * user probably called the handler or forgot to add a `() =>`\n * @param {() => (event: Event, ...args: any) => void} thunk\n * @param {EventTarget} element\n * @param {[Event, ...any]} args\n * @param {any} component\n * @param {[number, number]} [loc]\n * @param {boolean} [remove_parens]\n */\nexport function apply(\n\tthunk,\n\telement,\n\targs,\n\tcomponent,\n\tloc,\n\thas_side_effects = false,\n\tremove_parens = false\n) {\n\tlet handler;\n\tlet error;\n\n\ttry {\n\t\thandler = thunk();\n\t} catch (e) {\n\t\terror = e;\n\t}\n\n\tif (typeof handler !== 'function' && (has_side_effects || handler != null || error)) {\n\t\tconst filename = component?.[FILENAME];\n\t\tconst location = loc ? ` at ${filename}:${loc[0]}:${loc[1]}` : ` in ${filename}`;\n\t\tconst phase = args[0]?.eventPhase < Event.BUBBLING_PHASE ? 'capture' : '';\n\t\tconst event_name = args[0]?.type + phase;\n\t\tconst description = `\\`${event_name}\\` handler${location}`;\n\t\tconst suggestion = remove_parens ? 'remove the trailing `()`' : 'add a leading `() =>`';\n\n\t\tw.event_handler_invalid(description, suggestion);\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\t}\n\thandler?.apply(element, args);\n}\n","/** @param {string} html */\nexport function create_fragment_from_html(html) {\n\tvar elem = document.createElement('template');\n\telem.innerHTML = html.replaceAll('<!>', '<!---->'); // XHTML compliance\n\treturn elem.content;\n}\n","/** @import { Effect, TemplateNode } from '#client' */\n/** @import { TemplateStructure } from './types' */\nimport { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport {\n\tcreate_text,\n\tget_first_child,\n\tis_firefox,\n\tcreate_element,\n\tcreate_fragment,\n\tcreate_comment,\n\tset_attribute\n} from './operations.js';\nimport { create_fragment_from_html } from './reconciler.js';\nimport { active_effect } from '../runtime.js';\nimport {\n\tNAMESPACE_MATHML,\n\tNAMESPACE_SVG,\n\tTEMPLATE_FRAGMENT,\n\tTEMPLATE_USE_IMPORT_NODE,\n\tTEMPLATE_USE_MATHML,\n\tTEMPLATE_USE_SVG\n} from '../../../constants.js';\nimport { COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, TEXT_NODE } from '#client/constants';\n\n/**\n * @param {TemplateNode} start\n * @param {TemplateNode | null} end\n */\nexport function assign_nodes(start, end) {\n\tvar effect = /** @type {Effect} */ (active_effect);\n\tif (effect.nodes_start === null) {\n\t\teffect.nodes_start = start;\n\t\teffect.nodes_end = end;\n\t}\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_html(content, flags) {\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;\n\n\t/** @type {Node} */\n\tvar node;\n\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('<!>');\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (node === undefined) {\n\t\t\tnode = create_fragment_from_html(has_start ? content : '<!>' + content);\n\t\t\tif (!is_fragment) node = /** @type {Node} */ (get_first_child(node));\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (\n\t\t\tuse_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)\n\t\t);\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @param {'svg' | 'math'} ns\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nfunction from_namespace(content, flags, ns = 'svg') {\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('<!>');\n\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar wrapped = `<${ns}>${has_start ? content : '<!>' + content}</${ns}>`;\n\n\t/** @type {Element | DocumentFragment} */\n\tvar node;\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (!node) {\n\t\t\tvar fragment = /** @type {DocumentFragment} */ (create_fragment_from_html(wrapped));\n\t\t\tvar root = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (is_fragment) {\n\t\t\t\tnode = document.createDocumentFragment();\n\t\t\t\twhile (get_first_child(root)) {\n\t\t\t\t\tnode.appendChild(/** @type {Node} */ (get_first_child(root)));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode = /** @type {Element} */ (get_first_child(root));\n\t\t\t}\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (node.cloneNode(true));\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_svg(content, flags) {\n\treturn from_namespace(content, flags, 'svg');\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_mathml(content, flags) {\n\treturn from_namespace(content, flags, 'math');\n}\n\n/**\n * @param {TemplateStructure[]} structure\n * @param {typeof NAMESPACE_SVG | typeof NAMESPACE_MATHML | undefined} [ns]\n */\nfunction fragment_from_tree(structure, ns) {\n\tvar fragment = create_fragment();\n\n\tfor (var item of structure) {\n\t\tif (typeof item === 'string') {\n\t\t\tfragment.append(create_text(item));\n\t\t\tcontinue;\n\t\t}\n\n\t\t// if `preserveComments === true`, comments are represented as `['// <data>']`\n\t\tif (item === undefined || item[0][0] === '/') {\n\t\t\tfragment.append(create_comment(item ? item[0].slice(3) : ''));\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst [name, attributes, ...children] = item;\n\n\t\tconst namespace = name === 'svg' ? NAMESPACE_SVG : name === 'math' ? NAMESPACE_MATHML : ns;\n\n\t\tvar element = create_element(name, namespace, attributes?.is);\n\n\t\tfor (var key in attributes) {\n\t\t\tset_attribute(element, key, attributes[key]);\n\t\t}\n\n\t\tif (children.length > 0) {\n\t\t\tvar target =\n\t\t\t\telement.tagName === 'TEMPLATE'\n\t\t\t\t\t? /** @type {HTMLTemplateElement} */ (element).content\n\t\t\t\t\t: element;\n\n\t\t\ttarget.append(\n\t\t\t\tfragment_from_tree(children, element.tagName === 'foreignObject' ? undefined : namespace)\n\t\t\t);\n\t\t}\n\n\t\tfragment.append(element);\n\t}\n\n\treturn fragment;\n}\n\n/**\n * @param {TemplateStructure[]} structure\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_tree(structure, flags) {\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;\n\n\t/** @type {Node} */\n\tvar node;\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (node === undefined) {\n\t\t\tconst ns =\n\t\t\t\t(flags & TEMPLATE_USE_SVG) !== 0\n\t\t\t\t\t? NAMESPACE_SVG\n\t\t\t\t\t: (flags & TEMPLATE_USE_MATHML) !== 0\n\t\t\t\t\t\t? NAMESPACE_MATHML\n\t\t\t\t\t\t: undefined;\n\n\t\t\tnode = fragment_from_tree(structure, ns);\n\t\t\tif (!is_fragment) node = /** @type {Node} */ (get_first_child(node));\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (\n\t\t\tuse_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)\n\t\t);\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {() => Element | DocumentFragment} fn\n */\nexport function with_script(fn) {\n\treturn () => run_scripts(fn());\n}\n\n/**\n * Creating a document fragment from HTML that contains script tags will not execute\n * the scripts. We need to replace the script tags with new ones so that they are executed.\n * @param {Element | DocumentFragment} node\n * @returns {Node | Node[]}\n */\nfunction run_scripts(node) {\n\t// scripts were SSR'd, in which case they will run\n\tif (hydrating) return node;\n\n\tconst is_fragment = node.nodeType === DOCUMENT_FRAGMENT_NODE;\n\tconst scripts =\n\t\t/** @type {HTMLElement} */ (node).tagName === 'SCRIPT'\n\t\t\t? [/** @type {HTMLScriptElement} */ (node)]\n\t\t\t: node.querySelectorAll('script');\n\tconst effect = /** @type {Effect} */ (active_effect);\n\n\tfor (const script of scripts) {\n\t\tconst clone = document.createElement('script');\n\t\tfor (var attribute of script.attributes) {\n\t\t\tclone.setAttribute(attribute.name, attribute.value);\n\t\t}\n\n\t\tclone.textContent = script.textContent;\n\n\t\t// The script has changed - if it's at the edges, the effect now points at dead nodes\n\t\tif (is_fragment ? node.firstChild === script : node === script) {\n\t\t\teffect.nodes_start = clone;\n\t\t}\n\t\tif (is_fragment ? node.lastChild === script : node === script) {\n\t\t\teffect.nodes_end = clone;\n\t\t}\n\n\t\tscript.replaceWith(clone);\n\t}\n\treturn node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {any} value\n */\nexport function text(value = '') {\n\tif (!hydrating) {\n\t\tvar t = create_text(value + '');\n\t\tassign_nodes(t, t);\n\t\treturn t;\n\t}\n\n\tvar node = hydrate_node;\n\n\tif (node.nodeType !== TEXT_NODE) {\n\t\t// if an {expression} is empty during SSR, we need to insert an empty text node\n\t\tnode.before((node = create_text()));\n\t\tset_hydrate_node(node);\n\t}\n\n\tassign_nodes(node, node);\n\treturn node;\n}\n\nexport function comment() {\n\t// we're not delegating to `template` here for performance reasons\n\tif (hydrating) {\n\t\tassign_nodes(hydrate_node, null);\n\t\treturn hydrate_node;\n\t}\n\n\tvar frag = document.createDocumentFragment();\n\tvar start = document.createComment('');\n\tvar anchor = create_text();\n\tfrag.append(start, anchor);\n\n\tassign_nodes(start, anchor);\n\n\treturn frag;\n}\n\n/**\n * Assign the created (or in hydration mode, traversed) dom elements to the current block\n * and insert the elements into the dom (in client mode).\n * @param {Text | Comment | Element} anchor\n * @param {DocumentFragment | Element} dom\n */\nexport function append(anchor, dom) {\n\tif (hydrating) {\n\t\t/** @type {Effect} */ (active_effect).nodes_end = hydrate_node;\n\t\thydrate_next();\n\t\treturn;\n\t}\n\n\tif (anchor === null) {\n\t\t// edge case — void `<svelte:element>` with content\n\t\treturn;\n\t}\n\n\tanchor.before(/** @type {Node} */ (dom));\n}\n\n/**\n * Create (or hydrate) an unique UID for the component instance.\n */\nexport function props_id() {\n\tif (\n\t\thydrating &&\n\t\thydrate_node &&\n\t\thydrate_node.nodeType === COMMENT_NODE &&\n\t\thydrate_node.textContent?.startsWith(`#`)\n\t) {\n\t\tconst id = hydrate_node.textContent.substring(1);\n\t\thydrate_next();\n\t\treturn id;\n\t}\n\n\t// @ts-expect-error This way we ensure the id is unique even across Svelte runtimes\n\t(window.__svelte ??= {}).uid ??= 1;\n\n\t// @ts-expect-error\n\treturn `c${window.__svelte.uid++}`;\n}\n","/** @import { ComponentContext, Effect, TemplateNode } from '#client' */\n/** @import { Component, ComponentType, SvelteComponent, MountOptions } from '../../index.js' */\nimport { DEV } from 'esm-env';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tinit_operations\n} from './dom/operations.js';\nimport { HYDRATION_END, HYDRATION_ERROR, HYDRATION_START } from '../../constants.js';\nimport { active_effect } from './runtime.js';\nimport { push, pop, component_context } from './context.js';\nimport { component_root, branch } from './reactivity/effects.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tset_hydrate_node,\n\tset_hydrating\n} from './dom/hydration.js';\nimport { array_from } from '../shared/utils.js';\nimport {\n\tall_registered_events,\n\thandle_event_propagation,\n\troot_event_handles\n} from './dom/elements/events.js';\nimport { reset_head_anchor } from './dom/blocks/svelte-head.js';\nimport * as w from './warnings.js';\nimport * as e from './errors.js';\nimport { assign_nodes } from './dom/template.js';\nimport { is_passive_event } from '../../utils.js';\nimport { COMMENT_NODE } from './constants.js';\n\n/**\n * This is normally true — block effects should run their intro transitions —\n * but is false during hydration (unless `options.intro` is `true`) and\n * when creating the children of a `<svelte:element>` that just changed tag\n */\nexport let should_intro = true;\n\n/** @param {boolean} value */\nexport function set_should_intro(value) {\n\tshould_intro = value;\n}\n\n/**\n * @param {Element} text\n * @param {string} value\n * @returns {void}\n */\nexport function set_text(text, value) {\n\t// For objects, we apply string coercion (which might make things like $state array references in the template reactive) before diffing\n\tvar str = value == null ? '' : typeof value === 'object' ? value + '' : value;\n\t// @ts-expect-error\n\tif (str !== (text.__t ??= text.nodeValue)) {\n\t\t// @ts-expect-error\n\t\ttext.__t = str;\n\t\ttext.nodeValue = str + '';\n\t}\n}\n\n/**\n * Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.\n * Transitions will play during the initial render unless the `intro` option is set to `false`.\n *\n * @template {Record<string, any>} Props\n * @template {Record<string, any>} Exports\n * @param {ComponentType<SvelteComponent<Props>> | Component<Props, Exports, any>} component\n * @param {MountOptions<Props>} options\n * @returns {Exports}\n */\nexport function mount(component, options) {\n\treturn _mount(component, options);\n}\n\n/**\n * Hydrates a component on the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component\n *\n * @template {Record<string, any>} Props\n * @template {Record<string, any>} Exports\n * @param {ComponentType<SvelteComponent<Props>> | Component<Props, Exports, any>} component\n * @param {{} extends Props ? {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops?: Props;\n * \t\tevents?: Record<string, (e: any) => any>;\n * \tcontext?: Map<any, any>;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n * \t} : {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops: Props;\n * \t\tevents?: Record<string, (e: any) => any>;\n * \tcontext?: Map<any, any>;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n * \t}} options\n * @returns {Exports}\n */\nexport function hydrate(component, options) {\n\tinit_operations();\n\toptions.intro = options.intro ?? false;\n\tconst target = options.target;\n\tconst was_hydrating = hydrating;\n\tconst previous_hydrate_node = hydrate_node;\n\n\ttry {\n\t\tvar anchor = /** @type {TemplateNode} */ (get_first_child(target));\n\t\twhile (\n\t\t\tanchor &&\n\t\t\t(anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */ (anchor).data !== HYDRATION_START)\n\t\t) {\n\t\t\tanchor = /** @type {TemplateNode} */ (get_next_sibling(anchor));\n\t\t}\n\n\t\tif (!anchor) {\n\t\t\tthrow HYDRATION_ERROR;\n\t\t}\n\n\t\tset_hydrating(true);\n\t\tset_hydrate_node(/** @type {Comment} */ (anchor));\n\t\thydrate_next();\n\n\t\tconst instance = _mount(component, { ...options, anchor });\n\n\t\tif (\n\t\t\thydrate_node === null ||\n\t\t\thydrate_node.nodeType !== COMMENT_NODE ||\n\t\t\t/** @type {Comment} */ (hydrate_node).data !== HYDRATION_END\n\t\t) {\n\t\t\tw.hydration_mismatch();\n\t\t\tthrow HYDRATION_ERROR;\n\t\t}\n\n\t\tset_hydrating(false);\n\n\t\treturn /** @type {Exports} */ (instance);\n\t} catch (error) {\n\t\t// re-throw Svelte errors - they are certainly not related to hydration\n\t\tif (\n\t\t\terror instanceof Error &&\n\t\t\terror.message.split('\\n').some((line) => line.startsWith('https://svelte.dev/e/'))\n\t\t) {\n\t\t\tthrow error;\n\t\t}\n\t\tif (error !== HYDRATION_ERROR) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('Failed to hydrate: ', error);\n\t\t}\n\n\t\tif (options.recover === false) {\n\t\t\te.hydration_failed();\n\t\t}\n\n\t\t// If an error occured above, the operations might not yet have been initialised.\n\t\tinit_operations();\n\t\tclear_text_content(target);\n\n\t\tset_hydrating(false);\n\t\treturn mount(component, options);\n\t} finally {\n\t\tset_hydrating(was_hydrating);\n\t\tset_hydrate_node(previous_hydrate_node);\n\t\treset_head_anchor();\n\t}\n}\n\n/** @type {Map<string, number>} */\nconst document_listeners = new Map();\n\n/**\n * @template {Record<string, any>} Exports\n * @param {ComponentType<SvelteComponent<any>> | Component<any>} Component\n * @param {MountOptions} options\n * @returns {Exports}\n */\nfunction _mount(Component, { target, anchor, props = {}, events, context, intro = true }) {\n\tinit_operations();\n\n\t/** @type {Set<string>} */\n\tvar registered_events = new Set();\n\n\t/** @param {Array<string>} events */\n\tvar event_handle = (events) => {\n\t\tfor (var i = 0; i < events.length; i++) {\n\t\t\tvar event_name = events[i];\n\n\t\t\tif (registered_events.has(event_name)) continue;\n\t\t\tregistered_events.add(event_name);\n\n\t\t\tvar passive = is_passive_event(event_name);\n\n\t\t\t// Add the event listener to both the container and the document.\n\t\t\t// The container listener ensures we catch events from within in case\n\t\t\t// the outer content stops propagation of the event.\n\t\t\ttarget.addEventListener(event_name, handle_event_propagation, { passive });\n\n\t\t\tvar n = document_listeners.get(event_name);\n\n\t\t\tif (n === undefined) {\n\t\t\t\t// The document listener ensures we catch events that originate from elements that were\n\t\t\t\t// manually moved outside of the container (e.g. via manual portals).\n\t\t\t\tdocument.addEventListener(event_name, handle_event_propagation, { passive });\n\t\t\t\tdocument_listeners.set(event_name, 1);\n\t\t\t} else {\n\t\t\t\tdocument_listeners.set(event_name, n + 1);\n\t\t\t}\n\t\t}\n\t};\n\n\tevent_handle(array_from(all_registered_events));\n\troot_event_handles.add(event_handle);\n\n\t/** @type {Exports} */\n\t// @ts-expect-error will be defined because the render effect runs synchronously\n\tvar component = undefined;\n\n\tvar unmount = component_root(() => {\n\t\tvar anchor_node = anchor ?? target.appendChild(create_text());\n\n\t\tbranch(() => {\n\t\t\tif (context) {\n\t\t\t\tpush({});\n\t\t\t\tvar ctx = /** @type {ComponentContext} */ (component_context);\n\t\t\t\tctx.c = context;\n\t\t\t}\n\n\t\t\tif (events) {\n\t\t\t\t// We can't spread the object or else we'd lose the state proxy stuff, if it is one\n\t\t\t\t/** @type {any} */ (props).$$events = events;\n\t\t\t}\n\n\t\t\tif (hydrating) {\n\t\t\t\tassign_nodes(/** @type {TemplateNode} */ (anchor_node), null);\n\t\t\t}\n\n\t\t\tshould_intro = intro;\n\t\t\t// @ts-expect-error the public typings are not what the actual function looks like\n\t\t\tcomponent = Component(anchor_node, props) || {};\n\t\t\tshould_intro = true;\n\n\t\t\tif (hydrating) {\n\t\t\t\t/** @type {Effect} */ (active_effect).nodes_end = hydrate_node;\n\t\t\t}\n\n\t\t\tif (context) {\n\t\t\t\tpop();\n\t\t\t}\n\t\t});\n\n\t\treturn () => {\n\t\t\tfor (var event_name of registered_events) {\n\t\t\t\ttarget.removeEventListener(event_name, handle_event_propagation);\n\n\t\t\t\tvar n = /** @type {number} */ (document_listeners.get(event_name));\n\n\t\t\t\tif (--n === 0) {\n\t\t\t\t\tdocument.removeEventListener(event_name, handle_event_propagation);\n\t\t\t\t\tdocument_listeners.delete(event_name);\n\t\t\t\t} else {\n\t\t\t\t\tdocument_listeners.set(event_name, n);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\troot_event_handles.delete(event_handle);\n\n\t\t\tif (anchor_node !== anchor) {\n\t\t\t\tanchor_node.parentNode?.removeChild(anchor_node);\n\t\t\t}\n\t\t};\n\t});\n\n\tmounted_components.set(component, unmount);\n\treturn component;\n}\n\n/**\n * References of the components that were mounted or hydrated.\n * Uses a `WeakMap` to avoid memory leaks.\n */\nlet mounted_components = new WeakMap();\n\n/**\n * Unmounts a component that was previously mounted using `mount` or `hydrate`.\n *\n * Since 5.13.0, if `options.outro` is `true`, [transitions](https://svelte.dev/docs/svelte/transition) will play before the component is removed from the DOM.\n *\n * Returns a `Promise` that resolves after transitions have completed if `options.outro` is true, or immediately otherwise (prior to 5.13.0, returns `void`).\n *\n * ```js\n * import { mount, unmount } from 'svelte';\n * import App from './App.svelte';\n *\n * const app = mount(App, { target: document.body });\n *\n * // later...\n * unmount(app, { outro: true });\n * ```\n * @param {Record<string, any>} component\n * @param {{ outro?: boolean }} [options]\n * @returns {Promise<void>}\n */\nexport function unmount(component, options) {\n\tconst fn = mounted_components.get(component);\n\n\tif (fn) {\n\t\tmounted_components.delete(component);\n\t\treturn fn(options);\n\t}\n\n\tif (DEV) {\n\t\tw.lifecycle_double_unmount();\n\t}\n\n\treturn Promise.resolve();\n}\n","/** @import { Effect, TemplateNode } from '#client' */\n/** @import { Batch } from '../../reactivity/batch.js'; */\nimport { EFFECT_TRANSPARENT } from '#client/constants';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tread_hydration_instruction,\n\tremove_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport { block, branch, pause_effect, resume_effect } from '../../reactivity/effects.js';\nimport { HYDRATION_START_ELSE, UNINITIALIZED } from '../../../../constants.js';\nimport { create_text, should_defer_append } from '../operations.js';\nimport { current_batch } from '../../reactivity/batch.js';\n\n// TODO reinstate https://github.com/sveltejs/svelte/pull/15250\n\n/**\n * @param {TemplateNode} node\n * @param {(branch: (fn: (anchor: Node) => void, flag?: boolean) => void) => void} fn\n * @param {boolean} [elseif] True if this is an `{:else if ...}` block rather than an `{#if ...}`, as that affects which transitions are considered 'local'\n * @returns {void}\n */\nexport function if_block(node, fn, elseif = false) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar anchor = node;\n\n\t/** @type {Effect | null} */\n\tvar consequent_effect = null;\n\n\t/** @type {Effect | null} */\n\tvar alternate_effect = null;\n\n\t/** @type {typeof UNINITIALIZED | boolean | null} */\n\tvar condition = UNINITIALIZED;\n\n\tvar flags = elseif ? EFFECT_TRANSPARENT : 0;\n\n\tvar has_branch = false;\n\n\tconst set_branch = (/** @type {(anchor: Node) => void} */ fn, flag = true) => {\n\t\thas_branch = true;\n\t\tupdate_branch(flag, fn);\n\t};\n\n\t/** @type {DocumentFragment | null} */\n\tvar offscreen_fragment = null;\n\n\tfunction commit() {\n\t\tif (offscreen_fragment !== null) {\n\t\t\t// remove the anchor\n\t\t\t/** @type {Text} */ (offscreen_fragment.lastChild).remove();\n\n\t\t\tanchor.before(offscreen_fragment);\n\t\t\toffscreen_fragment = null;\n\t\t}\n\n\t\tvar active = condition ? consequent_effect : alternate_effect;\n\t\tvar inactive = condition ? alternate_effect : consequent_effect;\n\n\t\tif (active) {\n\t\t\tresume_effect(active);\n\t\t}\n\n\t\tif (inactive) {\n\t\t\tpause_effect(inactive, () => {\n\t\t\t\tif (condition) {\n\t\t\t\t\talternate_effect = null;\n\t\t\t\t} else {\n\t\t\t\t\tconsequent_effect = null;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tconst update_branch = (\n\t\t/** @type {boolean | null} */ new_condition,\n\t\t/** @type {null | ((anchor: Node) => void)} */ fn\n\t) => {\n\t\tif (condition === (condition = new_condition)) return;\n\n\t\t/** Whether or not there was a hydration mismatch. Needs to be a `let` or else it isn't treeshaken out */\n\t\tlet mismatch = false;\n\n\t\tif (hydrating) {\n\t\t\tconst is_else = read_hydration_instruction(anchor) === HYDRATION_START_ELSE;\n\n\t\t\tif (!!condition === is_else) {\n\t\t\t\t// Hydration mismatch: remove everything inside the anchor and start fresh.\n\t\t\t\t// This could happen with `{#if browser}...{/if}`, for example\n\t\t\t\tanchor = remove_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tset_hydrating(false);\n\t\t\t\tmismatch = true;\n\t\t\t}\n\t\t}\n\n\t\tvar defer = should_defer_append();\n\t\tvar target = anchor;\n\n\t\tif (defer) {\n\t\t\toffscreen_fragment = document.createDocumentFragment();\n\t\t\toffscreen_fragment.append((target = create_text()));\n\t\t}\n\n\t\tif (condition) {\n\t\t\tconsequent_effect ??= fn && branch(() => fn(target));\n\t\t} else {\n\t\t\talternate_effect ??= fn && branch(() => fn(target));\n\t\t}\n\n\t\tif (defer) {\n\t\t\tvar batch = /** @type {Batch} */ (current_batch);\n\n\t\t\tvar active = condition ? consequent_effect : alternate_effect;\n\t\t\tvar inactive = condition ? alternate_effect : consequent_effect;\n\n\t\t\tif (active) batch.skipped_effects.delete(active);\n\t\t\tif (inactive) batch.skipped_effects.add(inactive);\n\n\t\t\tbatch.add_callback(commit);\n\t\t} else {\n\t\t\tcommit();\n\t\t}\n\n\t\tif (mismatch) {\n\t\t\t// continue in hydration mode\n\t\t\tset_hydrating(true);\n\t\t}\n\t};\n\n\tblock(() => {\n\t\thas_branch = false;\n\t\tfn(set_branch);\n\t\tif (!has_branch) {\n\t\t\tupdate_branch(null, null);\n\t\t}\n\t}, flags);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n","/** @import { EachItem, EachState, Effect, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */\n/** @import { Batch } from '../../reactivity/batch.js'; */\nimport {\n\tEACH_INDEX_REACTIVE,\n\tEACH_IS_ANIMATED,\n\tEACH_IS_CONTROLLED,\n\tEACH_ITEM_IMMUTABLE,\n\tEACH_ITEM_REACTIVE,\n\tHYDRATION_END,\n\tHYDRATION_START_ELSE\n} from '../../../../constants.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tread_hydration_instruction,\n\tremove_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tshould_defer_append\n} from '../operations.js';\nimport {\n\tblock,\n\tbranch,\n\tdestroy_effect,\n\trun_out_transitions,\n\tpause_children,\n\tpause_effect,\n\tresume_effect\n} from '../../reactivity/effects.js';\nimport { source, mutable_source, internal_set } from '../../reactivity/sources.js';\nimport { array_from, is_array } from '../../../shared/utils.js';\nimport { COMMENT_NODE, INERT } from '#client/constants';\nimport { queue_micro_task } from '../task.js';\nimport { active_effect, get } from '../../runtime.js';\nimport { DEV } from 'esm-env';\nimport { derived_safe_equal } from '../../reactivity/deriveds.js';\nimport { current_batch } from '../../reactivity/batch.js';\n\n/**\n * The row of a keyed each block that is currently updating. We track this\n * so that `animate:` directives have something to attach themselves to\n * @type {EachItem | null}\n */\nexport let current_each_item = null;\n\n/** @param {EachItem | null} item */\nexport function set_current_each_item(item) {\n\tcurrent_each_item = item;\n}\n\n/**\n * @param {any} _\n * @param {number} i\n */\nexport function index(_, i) {\n\treturn i;\n}\n\n/**\n * Pause multiple effects simultaneously, and coordinate their\n * subsequent destruction. Used in each blocks\n * @param {EachState} state\n * @param {EachItem[]} items\n * @param {null | Node} controlled_anchor\n */\nfunction pause_effects(state, items, controlled_anchor) {\n\tvar items_map = state.items;\n\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\tvar length = items.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tpause_children(items[i].e, transitions, true);\n\t}\n\n\tvar is_controlled = length > 0 && transitions.length === 0 && controlled_anchor !== null;\n\t// If we have a controlled anchor, it means that the each block is inside a single\n\t// DOM element, so we can apply a fast-path for clearing the contents of the element.\n\tif (is_controlled) {\n\t\tvar parent_node = /** @type {Element} */ (\n\t\t\t/** @type {Element} */ (controlled_anchor).parentNode\n\t\t);\n\t\tclear_text_content(parent_node);\n\t\tparent_node.append(/** @type {Element} */ (controlled_anchor));\n\t\titems_map.clear();\n\t\tlink(state, items[0].prev, items[length - 1].next);\n\t}\n\n\trun_out_transitions(transitions, () => {\n\t\tfor (var i = 0; i < length; i++) {\n\t\t\tvar item = items[i];\n\t\t\tif (!is_controlled) {\n\t\t\t\titems_map.delete(item.k);\n\t\t\t\tlink(state, item.prev, item.next);\n\t\t\t}\n\t\t\tdestroy_effect(item.e, !is_controlled);\n\t\t}\n\t});\n}\n\n/**\n * @template V\n * @param {Element | Comment} node The next sibling node, or the parent node if this is a 'controlled' block\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @param {(value: V, index: number) => any} get_key\n * @param {(anchor: Node, item: MaybeSource<V>, index: MaybeSource<number>) => void} render_fn\n * @param {null | ((anchor: Node) => void)} fallback_fn\n * @returns {void}\n */\nexport function each(node, flags, get_collection, get_key, render_fn, fallback_fn = null) {\n\tvar anchor = node;\n\n\t/** @type {EachState} */\n\tvar state = { flags, items: new Map(), first: null };\n\n\tvar is_controlled = (flags & EACH_IS_CONTROLLED) !== 0;\n\n\tif (is_controlled) {\n\t\tvar parent_node = /** @type {Element} */ (node);\n\n\t\tanchor = hydrating\n\t\t\t? set_hydrate_node(/** @type {Comment | Text} */ (get_first_child(parent_node)))\n\t\t\t: parent_node.appendChild(create_text());\n\t}\n\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\t/** @type {Effect | null} */\n\tvar fallback = null;\n\n\tvar was_empty = false;\n\n\t/** @type {Map<any, EachItem>} */\n\tvar offscreen_items = new Map();\n\n\t// TODO: ideally we could use derived for runes mode but because of the ability\n\t// to use a store which can be mutated, we can't do that here as mutating a store\n\t// will still result in the collection array being the same from the store\n\tvar each_array = derived_safe_equal(() => {\n\t\tvar collection = get_collection();\n\n\t\treturn is_array(collection) ? collection : collection == null ? [] : array_from(collection);\n\t});\n\n\t/** @type {V[]} */\n\tvar array;\n\n\t/** @type {Effect} */\n\tvar each_effect;\n\n\tfunction commit() {\n\t\treconcile(\n\t\t\teach_effect,\n\t\t\tarray,\n\t\t\tstate,\n\t\t\toffscreen_items,\n\t\t\tanchor,\n\t\t\trender_fn,\n\t\t\tflags,\n\t\t\tget_key,\n\t\t\tget_collection\n\t\t);\n\n\t\tif (fallback_fn !== null) {\n\t\t\tif (array.length === 0) {\n\t\t\t\tif (fallback) {\n\t\t\t\t\tresume_effect(fallback);\n\t\t\t\t} else {\n\t\t\t\t\tfallback = branch(() => fallback_fn(anchor));\n\t\t\t\t}\n\t\t\t} else if (fallback !== null) {\n\t\t\t\tpause_effect(fallback, () => {\n\t\t\t\t\tfallback = null;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tblock(() => {\n\t\t// store a reference to the effect so that we can update the start/end nodes in reconciliation\n\t\teach_effect ??= /** @type {Effect} */ (active_effect);\n\n\t\tarray = /** @type {V[]} */ (get(each_array));\n\t\tvar length = array.length;\n\n\t\tif (was_empty && length === 0) {\n\t\t\t// ignore updates if the array is empty,\n\t\t\t// and it already was empty on previous run\n\t\t\treturn;\n\t\t}\n\t\twas_empty = length === 0;\n\n\t\t/** `true` if there was a hydration mismatch. Needs to be a `let` or else it isn't treeshaken out */\n\t\tlet mismatch = false;\n\n\t\tif (hydrating) {\n\t\t\tvar is_else = read_hydration_instruction(anchor) === HYDRATION_START_ELSE;\n\n\t\t\tif (is_else !== (length === 0)) {\n\t\t\t\t// hydration mismatch — remove the server-rendered DOM and start over\n\t\t\t\tanchor = remove_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tset_hydrating(false);\n\t\t\t\tmismatch = true;\n\t\t\t}\n\t\t}\n\n\t\t// this is separate to the previous block because `hydrating` might change\n\t\tif (hydrating) {\n\t\t\t/** @type {EachItem | null} */\n\t\t\tvar prev = null;\n\n\t\t\t/** @type {EachItem} */\n\t\t\tvar item;\n\n\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\tif (\n\t\t\t\t\thydrate_node.nodeType === COMMENT_NODE &&\n\t\t\t\t\t/** @type {Comment} */ (hydrate_node).data === HYDRATION_END\n\t\t\t\t) {\n\t\t\t\t\t// The server rendered fewer items than expected,\n\t\t\t\t\t// so break out and continue appending non-hydrated items\n\t\t\t\t\tanchor = /** @type {Comment} */ (hydrate_node);\n\t\t\t\t\tmismatch = true;\n\t\t\t\t\tset_hydrating(false);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tvar value = array[i];\n\t\t\t\tvar key = get_key(value, i);\n\t\t\t\titem = create_item(\n\t\t\t\t\thydrate_node,\n\t\t\t\t\tstate,\n\t\t\t\t\tprev,\n\t\t\t\t\tnull,\n\t\t\t\t\tvalue,\n\t\t\t\t\tkey,\n\t\t\t\t\ti,\n\t\t\t\t\trender_fn,\n\t\t\t\t\tflags,\n\t\t\t\t\tget_collection\n\t\t\t\t);\n\t\t\t\tstate.items.set(key, item);\n\n\t\t\t\tprev = item;\n\t\t\t}\n\n\t\t\t// remove excess nodes\n\t\t\tif (length > 0) {\n\t\t\t\tset_hydrate_node(remove_nodes());\n\t\t\t}\n\t\t}\n\n\t\tif (hydrating) {\n\t\t\tif (length === 0 && fallback_fn) {\n\t\t\t\tfallback = branch(() => fallback_fn(anchor));\n\t\t\t}\n\t\t} else {\n\t\t\tif (should_defer_append()) {\n\t\t\t\tvar keys = new Set();\n\t\t\t\tvar batch = /** @type {Batch} */ (current_batch);\n\n\t\t\t\tfor (i = 0; i < length; i += 1) {\n\t\t\t\t\tvalue = array[i];\n\t\t\t\t\tkey = get_key(value, i);\n\n\t\t\t\t\tvar existing = state.items.get(key) ?? offscreen_items.get(key);\n\n\t\t\t\t\tif (existing) {\n\t\t\t\t\t\t// update before reconciliation, to trigger any async updates\n\t\t\t\t\t\tif ((flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0) {\n\t\t\t\t\t\t\tupdate_item(existing, value, i, flags);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\titem = create_item(\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\trender_fn,\n\t\t\t\t\t\t\tflags,\n\t\t\t\t\t\t\tget_collection,\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\toffscreen_items.set(key, item);\n\t\t\t\t\t}\n\n\t\t\t\t\tkeys.add(key);\n\t\t\t\t}\n\n\t\t\t\tfor (const [key, item] of state.items) {\n\t\t\t\t\tif (!keys.has(key)) {\n\t\t\t\t\t\tbatch.skipped_effects.add(item.e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbatch.add_callback(commit);\n\t\t\t} else {\n\t\t\t\tcommit();\n\t\t\t}\n\t\t}\n\n\t\tif (mismatch) {\n\t\t\t// continue in hydration mode\n\t\t\tset_hydrating(true);\n\t\t}\n\n\t\t// When we mount the each block for the first time, the collection won't be\n\t\t// connected to this effect as the effect hasn't finished running yet and its deps\n\t\t// won't be assigned. However, it's possible that when reconciling the each block\n\t\t// that a mutation occurred and it's made the collection MAYBE_DIRTY, so reading the\n\t\t// collection again can provide consistency to the reactive graph again as the deriveds\n\t\t// will now be `CLEAN`.\n\t\tget(each_array);\n\t});\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n\n/**\n * Add, remove, or reorder items output by an each block as its input changes\n * @template V\n * @param {Effect} each_effect\n * @param {Array<V>} array\n * @param {EachState} state\n * @param {Map<any, EachItem>} offscreen_items\n * @param {Element | Comment | Text} anchor\n * @param {(anchor: Node, item: MaybeSource<V>, index: number | Source<number>, collection: () => V[]) => void} render_fn\n * @param {number} flags\n * @param {(value: V, index: number) => any} get_key\n * @param {() => V[]} get_collection\n * @returns {void}\n */\nfunction reconcile(\n\teach_effect,\n\tarray,\n\tstate,\n\toffscreen_items,\n\tanchor,\n\trender_fn,\n\tflags,\n\tget_key,\n\tget_collection\n) {\n\tvar is_animated = (flags & EACH_IS_ANIMATED) !== 0;\n\tvar should_update = (flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0;\n\n\tvar length = array.length;\n\tvar items = state.items;\n\tvar first = state.first;\n\tvar current = first;\n\n\t/** @type {undefined | Set<EachItem>} */\n\tvar seen;\n\n\t/** @type {EachItem | null} */\n\tvar prev = null;\n\n\t/** @type {undefined | Set<EachItem>} */\n\tvar to_animate;\n\n\t/** @type {EachItem[]} */\n\tvar matched = [];\n\n\t/** @type {EachItem[]} */\n\tvar stashed = [];\n\n\t/** @type {V} */\n\tvar value;\n\n\t/** @type {any} */\n\tvar key;\n\n\t/** @type {EachItem | undefined} */\n\tvar item;\n\n\t/** @type {number} */\n\tvar i;\n\n\tif (is_animated) {\n\t\tfor (i = 0; i < length; i += 1) {\n\t\t\tvalue = array[i];\n\t\t\tkey = get_key(value, i);\n\t\t\titem = items.get(key);\n\n\t\t\tif (item !== undefined) {\n\t\t\t\titem.a?.measure();\n\t\t\t\t(to_animate ??= new Set()).add(item);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (i = 0; i < length; i += 1) {\n\t\tvalue = array[i];\n\t\tkey = get_key(value, i);\n\n\t\titem = items.get(key);\n\n\t\tif (item === undefined) {\n\t\t\tvar pending = offscreen_items.get(key);\n\n\t\t\tif (pending !== undefined) {\n\t\t\t\toffscreen_items.delete(key);\n\t\t\t\titems.set(key, pending);\n\n\t\t\t\tvar next = prev ? prev.next : current;\n\n\t\t\t\tlink(state, prev, pending);\n\t\t\t\tlink(state, pending, next);\n\n\t\t\t\tmove(pending, next, anchor);\n\t\t\t\tprev = pending;\n\t\t\t} else {\n\t\t\t\tvar child_anchor = current ? /** @type {TemplateNode} */ (current.e.nodes_start) : anchor;\n\n\t\t\t\tprev = create_item(\n\t\t\t\t\tchild_anchor,\n\t\t\t\t\tstate,\n\t\t\t\t\tprev,\n\t\t\t\t\tprev === null ? state.first : prev.next,\n\t\t\t\t\tvalue,\n\t\t\t\t\tkey,\n\t\t\t\t\ti,\n\t\t\t\t\trender_fn,\n\t\t\t\t\tflags,\n\t\t\t\t\tget_collection\n\t\t\t\t);\n\t\t\t}\n\n\t\t\titems.set(key, prev);\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\tcurrent = prev.next;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (should_update) {\n\t\t\tupdate_item(item, value, i, flags);\n\t\t}\n\n\t\tif ((item.e.f & INERT) !== 0) {\n\t\t\tresume_effect(item.e);\n\t\t\tif (is_animated) {\n\t\t\t\titem.a?.unfix();\n\t\t\t\t(to_animate ??= new Set()).delete(item);\n\t\t\t}\n\t\t}\n\n\t\tif (item !== current) {\n\t\t\tif (seen !== undefined && seen.has(item)) {\n\t\t\t\tif (matched.length < stashed.length) {\n\t\t\t\t\t// more efficient to move later items to the front\n\t\t\t\t\tvar start = stashed[0];\n\t\t\t\t\tvar j;\n\n\t\t\t\t\tprev = start.prev;\n\n\t\t\t\t\tvar a = matched[0];\n\t\t\t\t\tvar b = matched[matched.length - 1];\n\n\t\t\t\t\tfor (j = 0; j < matched.length; j += 1) {\n\t\t\t\t\t\tmove(matched[j], start, anchor);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (j = 0; j < stashed.length; j += 1) {\n\t\t\t\t\t\tseen.delete(stashed[j]);\n\t\t\t\t\t}\n\n\t\t\t\t\tlink(state, a.prev, b.next);\n\t\t\t\t\tlink(state, prev, a);\n\t\t\t\t\tlink(state, b, start);\n\n\t\t\t\t\tcurrent = start;\n\t\t\t\t\tprev = b;\n\t\t\t\t\ti -= 1;\n\n\t\t\t\t\tmatched = [];\n\t\t\t\t\tstashed = [];\n\t\t\t\t} else {\n\t\t\t\t\t// more efficient to move earlier items to the back\n\t\t\t\t\tseen.delete(item);\n\t\t\t\t\tmove(item, current, anchor);\n\n\t\t\t\t\tlink(state, item.prev, item.next);\n\t\t\t\t\tlink(state, item, prev === null ? state.first : prev.next);\n\t\t\t\t\tlink(state, prev, item);\n\n\t\t\t\t\tprev = item;\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\twhile (current !== null && current.k !== key) {\n\t\t\t\t// If the each block isn't inert and an item has an effect that is already inert,\n\t\t\t\t// skip over adding it to our seen Set as the item is already being handled\n\t\t\t\tif ((current.e.f & INERT) === 0) {\n\t\t\t\t\t(seen ??= new Set()).add(current);\n\t\t\t\t}\n\t\t\t\tstashed.push(current);\n\t\t\t\tcurrent = current.next;\n\t\t\t}\n\n\t\t\tif (current === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\titem = current;\n\t\t}\n\n\t\tmatched.push(item);\n\t\tprev = item;\n\t\tcurrent = item.next;\n\t}\n\n\tif (current !== null || seen !== undefined) {\n\t\tvar to_destroy = seen === undefined ? [] : array_from(seen);\n\n\t\twhile (current !== null) {\n\t\t\t// If the each block isn't inert, then inert effects are currently outroing and will be removed once the transition is finished\n\t\t\tif ((current.e.f & INERT) === 0) {\n\t\t\t\tto_destroy.push(current);\n\t\t\t}\n\t\t\tcurrent = current.next;\n\t\t}\n\n\t\tvar destroy_length = to_destroy.length;\n\n\t\tif (destroy_length > 0) {\n\t\t\tvar controlled_anchor = (flags & EACH_IS_CONTROLLED) !== 0 && length === 0 ? anchor : null;\n\n\t\t\tif (is_animated) {\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].a?.measure();\n\t\t\t\t}\n\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].a?.fix();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpause_effects(state, to_destroy, controlled_anchor);\n\t\t}\n\t}\n\n\tif (is_animated) {\n\t\tqueue_micro_task(() => {\n\t\t\tif (to_animate === undefined) return;\n\t\t\tfor (item of to_animate) {\n\t\t\t\titem.a?.apply();\n\t\t\t}\n\t\t});\n\t}\n\n\teach_effect.first = state.first && state.first.e;\n\teach_effect.last = prev && prev.e;\n\n\tfor (var unused of offscreen_items.values()) {\n\t\tdestroy_effect(unused.e);\n\t}\n\n\toffscreen_items.clear();\n}\n\n/**\n * @param {EachItem} item\n * @param {any} value\n * @param {number} index\n * @param {number} type\n * @returns {void}\n */\nfunction update_item(item, value, index, type) {\n\tif ((type & EACH_ITEM_REACTIVE) !== 0) {\n\t\tinternal_set(item.v, value);\n\t}\n\n\tif ((type & EACH_INDEX_REACTIVE) !== 0) {\n\t\tinternal_set(/** @type {Value<number>} */ (item.i), index);\n\t} else {\n\t\titem.i = index;\n\t}\n}\n\n/**\n * @template V\n * @param {Node | null} anchor\n * @param {EachState} state\n * @param {EachItem | null} prev\n * @param {EachItem | null} next\n * @param {V} value\n * @param {unknown} key\n * @param {number} index\n * @param {(anchor: Node, item: V | Source<V>, index: number | Value<number>, collection: () => V[]) => void} render_fn\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @param {boolean} [deferred]\n * @returns {EachItem}\n */\nfunction create_item(\n\tanchor,\n\tstate,\n\tprev,\n\tnext,\n\tvalue,\n\tkey,\n\tindex,\n\trender_fn,\n\tflags,\n\tget_collection,\n\tdeferred\n) {\n\tvar previous_each_item = current_each_item;\n\tvar reactive = (flags & EACH_ITEM_REACTIVE) !== 0;\n\tvar mutable = (flags & EACH_ITEM_IMMUTABLE) === 0;\n\n\tvar v = reactive ? (mutable ? mutable_source(value, false, false) : source(value)) : value;\n\tvar i = (flags & EACH_INDEX_REACTIVE) === 0 ? index : source(index);\n\n\tif (DEV && reactive) {\n\t\t// For tracing purposes, we need to link the source signal we create with the\n\t\t// collection + index so that tracing works as intended\n\t\t/** @type {Value} */ (v).trace = () => {\n\t\t\tvar collection_index = typeof i === 'number' ? index : i.v;\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-expressions\n\t\t\tget_collection()[collection_index];\n\t\t};\n\t}\n\n\t/** @type {EachItem} */\n\tvar item = {\n\t\ti,\n\t\tv,\n\t\tk: key,\n\t\ta: null,\n\t\t// @ts-expect-error\n\t\te: null,\n\t\tprev,\n\t\tnext\n\t};\n\n\tcurrent_each_item = item;\n\n\ttry {\n\t\tif (anchor === null) {\n\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\tfragment.append((anchor = create_text()));\n\t\t}\n\n\t\titem.e = branch(() => render_fn(/** @type {Node} */ (anchor), v, i, get_collection), hydrating);\n\n\t\titem.e.prev = prev && prev.e;\n\t\titem.e.next = next && next.e;\n\n\t\tif (prev === null) {\n\t\t\tif (!deferred) {\n\t\t\t\tstate.first = item;\n\t\t\t}\n\t\t} else {\n\t\t\tprev.next = item;\n\t\t\tprev.e.next = item.e;\n\t\t}\n\n\t\tif (next !== null) {\n\t\t\tnext.prev = item;\n\t\t\tnext.e.prev = item.e;\n\t\t}\n\n\t\treturn item;\n\t} finally {\n\t\tcurrent_each_item = previous_each_item;\n\t}\n}\n\n/**\n * @param {EachItem} item\n * @param {EachItem | null} next\n * @param {Text | Element | Comment} anchor\n */\nfunction move(item, next, anchor) {\n\tvar end = item.next ? /** @type {TemplateNode} */ (item.next.e.nodes_start) : anchor;\n\n\tvar dest = next ? /** @type {TemplateNode} */ (next.e.nodes_start) : anchor;\n\tvar node = /** @type {TemplateNode} */ (item.e.nodes_start);\n\n\twhile (node !== null && node !== end) {\n\t\tvar next_node = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tdest.before(node);\n\t\tnode = next_node;\n\t}\n}\n\n/**\n * @param {EachState} state\n * @param {EachItem | null} prev\n * @param {EachItem | null} next\n */\nfunction link(state, prev, next) {\n\tif (prev === null) {\n\t\tstate.first = next;\n\t} else {\n\t\tprev.next = next;\n\t\tprev.e.next = next && next.e;\n\t}\n\n\tif (next !== null) {\n\t\tnext.prev = prev;\n\t\tnext.e.prev = prev && prev.e;\n\t}\n}\n","/** @import { Snippet } from 'svelte' */\n/** @import { Effect, TemplateNode } from '#client' */\n/** @import { Getters } from '#shared' */\nimport { EFFECT_TRANSPARENT, ELEMENT_NODE } from '#client/constants';\nimport { branch, block, destroy_effect, teardown } from '../../reactivity/effects.js';\nimport {\n\tdev_current_component_function,\n\tset_dev_current_component_function\n} from '../../context.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\nimport { create_fragment_from_html } from '../reconciler.js';\nimport { assign_nodes } from '../template.js';\nimport * as w from '../../warnings.js';\nimport * as e from '../../errors.js';\nimport { DEV } from 'esm-env';\nimport { get_first_child, get_next_sibling } from '../operations.js';\nimport { noop } from '../../../shared/utils.js';\nimport { prevent_snippet_stringification } from '../../../shared/validate.js';\n\n/**\n * @template {(node: TemplateNode, ...args: any[]) => void} SnippetFn\n * @param {TemplateNode} node\n * @param {() => SnippetFn | null | undefined} get_snippet\n * @param {(() => any)[]} args\n * @returns {void}\n */\nexport function snippet(node, get_snippet, ...args) {\n\tvar anchor = node;\n\n\t/** @type {SnippetFn | null | undefined} */\n\t// @ts-ignore\n\tvar snippet = noop;\n\n\t/** @type {Effect | null} */\n\tvar snippet_effect;\n\n\tblock(() => {\n\t\tif (snippet === (snippet = get_snippet())) return;\n\n\t\tif (snippet_effect) {\n\t\t\tdestroy_effect(snippet_effect);\n\t\t\tsnippet_effect = null;\n\t\t}\n\n\t\tif (DEV && snippet == null) {\n\t\t\te.invalid_snippet();\n\t\t}\n\n\t\tsnippet_effect = branch(() => /** @type {SnippetFn} */ (snippet)(anchor, ...args));\n\t}, EFFECT_TRANSPARENT);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n\n/**\n * In development, wrap the snippet function so that it passes validation, and so that the\n * correct component context is set for ownership checks\n * @param {any} component\n * @param {(node: TemplateNode, ...args: any[]) => void} fn\n */\nexport function wrap_snippet(component, fn) {\n\tconst snippet = (/** @type {TemplateNode} */ node, /** @type {any[]} */ ...args) => {\n\t\tvar previous_component_function = dev_current_component_function;\n\t\tset_dev_current_component_function(component);\n\n\t\ttry {\n\t\t\treturn fn(node, ...args);\n\t\t} finally {\n\t\t\tset_dev_current_component_function(previous_component_function);\n\t\t}\n\t};\n\n\tprevent_snippet_stringification(snippet);\n\n\treturn snippet;\n}\n\n/**\n * Create a snippet programmatically\n * @template {unknown[]} Params\n * @param {(...params: Getters<Params>) => {\n * render: () => string\n * setup?: (element: Element) => void | (() => void)\n * }} fn\n * @returns {Snippet<Params>}\n */\nexport function createRawSnippet(fn) {\n\t// @ts-expect-error the types are a lie\n\treturn (/** @type {TemplateNode} */ anchor, /** @type {Getters<Params>} */ ...params) => {\n\t\tvar snippet = fn(...params);\n\n\t\t/** @type {Element} */\n\t\tvar element;\n\n\t\tif (hydrating) {\n\t\t\telement = /** @type {Element} */ (hydrate_node);\n\t\t\thydrate_next();\n\t\t} else {\n\t\t\tvar html = snippet.render().trim();\n\t\t\tvar fragment = create_fragment_from_html(html);\n\t\t\telement = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (DEV && (get_next_sibling(element) !== null || element.nodeType !== ELEMENT_NODE)) {\n\t\t\t\tw.invalid_raw_snippet_render();\n\t\t\t}\n\n\t\t\tanchor.before(element);\n\t\t}\n\n\t\tconst result = snippet.setup?.(element);\n\t\tassign_nodes(element, element);\n\n\t\tif (typeof result === 'function') {\n\t\t\tteardown(result);\n\t\t}\n\t};\n}\n","/** @import { TemplateNode, Dom, Effect } from '#client' */\n/** @import { Batch } from '../../reactivity/batch.js'; */\nimport { EFFECT_TRANSPARENT } from '#client/constants';\nimport { block, branch, pause_effect } from '../../reactivity/effects.js';\nimport { current_batch } from '../../reactivity/batch.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\nimport { create_text, should_defer_append } from '../operations.js';\n\n/**\n * @template P\n * @template {(props: P) => void} C\n * @param {TemplateNode} node\n * @param {() => C} get_component\n * @param {(anchor: TemplateNode, component: C) => Dom | void} render_fn\n * @returns {void}\n */\nexport function component(node, get_component, render_fn) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar anchor = node;\n\n\t/** @type {C} */\n\tvar component;\n\n\t/** @type {Effect | null} */\n\tvar effect;\n\n\t/** @type {DocumentFragment | null} */\n\tvar offscreen_fragment = null;\n\n\t/** @type {Effect | null} */\n\tvar pending_effect = null;\n\n\tfunction commit() {\n\t\tif (effect) {\n\t\t\tpause_effect(effect);\n\t\t\teffect = null;\n\t\t}\n\n\t\tif (offscreen_fragment) {\n\t\t\t// remove the anchor\n\t\t\t/** @type {Text} */ (offscreen_fragment.lastChild).remove();\n\n\t\t\tanchor.before(offscreen_fragment);\n\t\t\toffscreen_fragment = null;\n\t\t}\n\n\t\teffect = pending_effect;\n\t\tpending_effect = null;\n\t}\n\n\tblock(() => {\n\t\tif (component === (component = get_component())) return;\n\n\t\tvar defer = should_defer_append();\n\n\t\tif (component) {\n\t\t\tvar target = anchor;\n\n\t\t\tif (defer) {\n\t\t\t\toffscreen_fragment = document.createDocumentFragment();\n\t\t\t\toffscreen_fragment.append((target = create_text()));\n\t\t\t\tif (effect) {\n\t\t\t\t\t/** @type {Batch} */ (current_batch).skipped_effects.add(effect);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpending_effect = branch(() => render_fn(target, component));\n\t\t}\n\n\t\tif (defer) {\n\t\t\t/** @type {Batch} */ (current_batch).add_callback(commit);\n\t\t} else {\n\t\t\tcommit();\n\t\t}\n\t}, EFFECT_TRANSPARENT);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n","/** @import { ActionPayload } from '#client' */\nimport { effect, render_effect } from '../../reactivity/effects.js';\nimport { safe_not_equal } from '../../reactivity/equality.js';\nimport { deep_read_state, untrack } from '../../runtime.js';\n\n/**\n * @template P\n * @param {Element} dom\n * @param {(dom: Element, value?: P) => ActionPayload<P>} action\n * @param {() => P} [get_value]\n * @returns {void}\n */\nexport function action(dom, action, get_value) {\n\teffect(() => {\n\t\tvar payload = untrack(() => action(dom, get_value?.()) || {});\n\n\t\tif (get_value && payload?.update) {\n\t\t\tvar inited = false;\n\t\t\t/** @type {P} */\n\t\t\tvar prev = /** @type {any} */ ({}); // initialize with something so it's never equal on first run\n\n\t\t\trender_effect(() => {\n\t\t\t\tvar value = get_value();\n\n\t\t\t\t// Action's update method is coarse-grained, i.e. when anything in the passed value changes, update.\n\t\t\t\t// This works in legacy mode because of mutable_source being updated as a whole, but when using $state\n\t\t\t\t// together with actions and mutation, it wouldn't notice the change without a deep read.\n\t\t\t\tdeep_read_state(value);\n\n\t\t\t\tif (inited && safe_not_equal(prev, value)) {\n\t\t\t\t\tprev = value;\n\t\t\t\t\t/** @type {Function} */ (payload.update)(value);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tinited = true;\n\t\t}\n\n\t\tif (payload?.destroy) {\n\t\t\treturn () => /** @type {Function} */ (payload.destroy)();\n\t\t}\n\t});\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import { escape_html } from '../../escaping.js';\nimport { clsx as _clsx } from 'clsx';\n\n/**\n * `<div translate={false}>` should be rendered as `<div translate=\"no\">` and _not_\n * `<div translate=\"false\">`, which is equivalent to `<div translate=\"yes\">`. There\n * may be other odd cases that need to be added to this list in future\n * @type {Record<string, Map<any, string>>}\n */\nconst replacements = {\n\ttranslate: new Map([\n\t\t[true, 'yes'],\n\t\t[false, 'no']\n\t])\n};\n\n/**\n * @template V\n * @param {string} name\n * @param {V} value\n * @param {boolean} [is_boolean]\n * @returns {string}\n */\nexport function attr(name, value, is_boolean = false) {\n\tif (value == null || (!value && is_boolean)) return '';\n\tconst normalized = (name in replacements && replacements[name].get(value)) || value;\n\tconst assignment = is_boolean ? '' : `=\"${escape_html(normalized, true)}\"`;\n\treturn ` ${name}${assignment}`;\n}\n\n/**\n * Small wrapper around clsx to preserve Svelte's (weird) handling of falsy values.\n * TODO Svelte 6 revisit this, and likely turn all falsy values into the empty string (what clsx also does)\n * @param {any} value\n */\nexport function clsx(value) {\n\tif (typeof value === 'object') {\n\t\treturn _clsx(value);\n\t} else {\n\t\treturn value ?? '';\n\t}\n}\n\nconst whitespace = [...' \\t\\n\\r\\f\\u00a0\\u000b\\ufeff'];\n\n/**\n * @param {any} value\n * @param {string | null} [hash]\n * @param {Record<string, boolean>} [directives]\n * @returns {string | null}\n */\nexport function to_class(value, hash, directives) {\n\tvar classname = value == null ? '' : '' + value;\n\n\tif (hash) {\n\t\tclassname = classname ? classname + ' ' + hash : hash;\n\t}\n\n\tif (directives) {\n\t\tfor (var key in directives) {\n\t\t\tif (directives[key]) {\n\t\t\t\tclassname = classname ? classname + ' ' + key : key;\n\t\t\t} else if (classname.length) {\n\t\t\t\tvar len = key.length;\n\t\t\t\tvar a = 0;\n\n\t\t\t\twhile ((a = classname.indexOf(key, a)) >= 0) {\n\t\t\t\t\tvar b = a + len;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(a === 0 || whitespace.includes(classname[a - 1])) &&\n\t\t\t\t\t\t(b === classname.length || whitespace.includes(classname[b]))\n\t\t\t\t\t) {\n\t\t\t\t\t\tclassname = (a === 0 ? '' : classname.substring(0, a)) + classname.substring(b + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ta = b;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn classname === '' ? null : classname;\n}\n\n/**\n *\n * @param {Record<string,any>} styles\n * @param {boolean} important\n */\nfunction append_styles(styles, important = false) {\n\tvar separator = important ? ' !important;' : ';';\n\tvar css = '';\n\n\tfor (var key in styles) {\n\t\tvar value = styles[key];\n\t\tif (value != null && value !== '') {\n\t\t\tcss += ' ' + key + ': ' + value + separator;\n\t\t}\n\t}\n\n\treturn css;\n}\n\n/**\n * @param {string} name\n * @returns {string}\n */\nfunction to_css_name(name) {\n\tif (name[0] !== '-' || name[1] !== '-') {\n\t\treturn name.toLowerCase();\n\t}\n\treturn name;\n}\n\n/**\n * @param {any} value\n * @param {Record<string, any> | [Record<string, any>, Record<string, any>]} [styles]\n * @returns {string | null}\n */\nexport function to_style(value, styles) {\n\tif (styles) {\n\t\tvar new_style = '';\n\n\t\t/** @type {Record<string,any> | undefined} */\n\t\tvar normal_styles;\n\n\t\t/** @type {Record<string,any> | undefined} */\n\t\tvar important_styles;\n\n\t\tif (Array.isArray(styles)) {\n\t\t\tnormal_styles = styles[0];\n\t\t\timportant_styles = styles[1];\n\t\t} else {\n\t\t\tnormal_styles = styles;\n\t\t}\n\n\t\tif (value) {\n\t\t\tvalue = String(value)\n\t\t\t\t.replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g, '')\n\t\t\t\t.trim();\n\n\t\t\t/** @type {boolean | '\"' | \"'\"} */\n\t\t\tvar in_str = false;\n\t\t\tvar in_apo = 0;\n\t\t\tvar in_comment = false;\n\n\t\t\tvar reserved_names = [];\n\n\t\t\tif (normal_styles) {\n\t\t\t\treserved_names.push(...Object.keys(normal_styles).map(to_css_name));\n\t\t\t}\n\t\t\tif (important_styles) {\n\t\t\t\treserved_names.push(...Object.keys(important_styles).map(to_css_name));\n\t\t\t}\n\n\t\t\tvar start_index = 0;\n\t\t\tvar name_index = -1;\n\n\t\t\tconst len = value.length;\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\tvar c = value[i];\n\n\t\t\t\tif (in_comment) {\n\t\t\t\t\tif (c === '/' && value[i - 1] === '*') {\n\t\t\t\t\t\tin_comment = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (in_str) {\n\t\t\t\t\tif (in_str === c) {\n\t\t\t\t\t\tin_str = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (c === '/' && value[i + 1] === '*') {\n\t\t\t\t\tin_comment = true;\n\t\t\t\t} else if (c === '\"' || c === \"'\") {\n\t\t\t\t\tin_str = c;\n\t\t\t\t} else if (c === '(') {\n\t\t\t\t\tin_apo++;\n\t\t\t\t} else if (c === ')') {\n\t\t\t\t\tin_apo--;\n\t\t\t\t}\n\n\t\t\t\tif (!in_comment && in_str === false && in_apo === 0) {\n\t\t\t\t\tif (c === ':' && name_index === -1) {\n\t\t\t\t\t\tname_index = i;\n\t\t\t\t\t} else if (c === ';' || i === len - 1) {\n\t\t\t\t\t\tif (name_index !== -1) {\n\t\t\t\t\t\t\tvar name = to_css_name(value.substring(start_index, name_index).trim());\n\n\t\t\t\t\t\t\tif (!reserved_names.includes(name)) {\n\t\t\t\t\t\t\t\tif (c !== ';') {\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar property = value.substring(start_index, i).trim();\n\t\t\t\t\t\t\t\tnew_style += ' ' + property + ';';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart_index = i + 1;\n\t\t\t\t\t\tname_index = -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (normal_styles) {\n\t\t\tnew_style += append_styles(normal_styles);\n\t\t}\n\n\t\tif (important_styles) {\n\t\t\tnew_style += append_styles(important_styles, true);\n\t\t}\n\n\t\tnew_style = new_style.trim();\n\t\treturn new_style === '' ? null : new_style;\n\t}\n\n\treturn value == null ? null : String(value);\n}\n","import { to_class } from '../../../shared/attributes.js';\nimport { hydrating } from '../hydration.js';\n\n/**\n * @param {Element} dom\n * @param {boolean | number} is_html\n * @param {string | null} value\n * @param {string} [hash]\n * @param {Record<string, any>} [prev_classes]\n * @param {Record<string, any>} [next_classes]\n * @returns {Record<string, boolean> | undefined}\n */\nexport function set_class(dom, is_html, value, hash, prev_classes, next_classes) {\n\t// @ts-expect-error need to add __className to patched prototype\n\tvar prev = dom.__className;\n\n\tif (\n\t\thydrating ||\n\t\tprev !== value ||\n\t\tprev === undefined // for edge case of `class={undefined}`\n\t) {\n\t\tvar next_class_name = to_class(value, hash, next_classes);\n\n\t\tif (!hydrating || next_class_name !== dom.getAttribute('class')) {\n\t\t\t// Removing the attribute when the value is only an empty string causes\n\t\t\t// performance issues vs simply making the className an empty string. So\n\t\t\t// we should only remove the class if the value is nullish\n\t\t\t// and there no hash/directives :\n\t\t\tif (next_class_name == null) {\n\t\t\t\tdom.removeAttribute('class');\n\t\t\t} else if (is_html) {\n\t\t\t\tdom.className = next_class_name;\n\t\t\t} else {\n\t\t\t\tdom.setAttribute('class', next_class_name);\n\t\t\t}\n\t\t}\n\n\t\t// @ts-expect-error need to add __className to patched prototype\n\t\tdom.__className = value;\n\t} else if (next_classes && prev_classes !== next_classes) {\n\t\tfor (var key in next_classes) {\n\t\t\tvar is_present = !!next_classes[key];\n\n\t\t\tif (prev_classes == null || is_present !== !!prev_classes[key]) {\n\t\t\t\tdom.classList.toggle(key, is_present);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn next_classes;\n}\n","import { to_style } from '../../../shared/attributes.js';\nimport { hydrating } from '../hydration.js';\n\n/**\n * @param {Element & ElementCSSInlineStyle} dom\n * @param {Record<string, any>} prev\n * @param {Record<string, any>} next\n * @param {string} [priority]\n */\nfunction update_styles(dom, prev = {}, next, priority) {\n\tfor (var key in next) {\n\t\tvar value = next[key];\n\n\t\tif (prev[key] !== value) {\n\t\t\tif (next[key] == null) {\n\t\t\t\tdom.style.removeProperty(key);\n\t\t\t} else {\n\t\t\t\tdom.style.setProperty(key, value, priority);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} dom\n * @param {string | null} value\n * @param {Record<string, any> | [Record<string, any>, Record<string, any>]} [prev_styles]\n * @param {Record<string, any> | [Record<string, any>, Record<string, any>]} [next_styles]\n */\nexport function set_style(dom, value, prev_styles, next_styles) {\n\t// @ts-expect-error\n\tvar prev = dom.__style;\n\n\tif (hydrating || prev !== value) {\n\t\tvar next_style_attr = to_style(value, next_styles);\n\n\t\tif (!hydrating || next_style_attr !== dom.getAttribute('style')) {\n\t\t\tif (next_style_attr == null) {\n\t\t\t\tdom.removeAttribute('style');\n\t\t\t} else {\n\t\t\t\tdom.style.cssText = next_style_attr;\n\t\t\t}\n\t\t}\n\n\t\t// @ts-expect-error\n\t\tdom.__style = value;\n\t} else if (next_styles) {\n\t\tif (Array.isArray(next_styles)) {\n\t\t\tupdate_styles(dom, prev_styles?.[0], next_styles[0]);\n\t\t\tupdate_styles(dom, prev_styles?.[1], next_styles[1], 'important');\n\t\t} else {\n\t\t\tupdate_styles(dom, prev_styles, next_styles);\n\t\t}\n\t}\n\n\treturn next_styles;\n}\n","/** @import { Effect } from '#client' */\nimport { DEV } from 'esm-env';\nimport { hydrating, set_hydrating } from '../hydration.js';\nimport { get_descriptors, get_prototype_of } from '../../../shared/utils.js';\nimport { create_event, delegate } from './events.js';\nimport { add_form_reset_listener, autofocus } from './misc.js';\nimport * as w from '../../warnings.js';\nimport { LOADING_ATTR_SYMBOL } from '#client/constants';\nimport { queue_idle_task } from '../task.js';\nimport { is_capture_event, is_delegated, normalize_attribute } from '../../../../utils.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tget,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { attach } from './attachments.js';\nimport { clsx } from '../../../shared/attributes.js';\nimport { set_class } from './class.js';\nimport { set_style } from './style.js';\nimport { ATTACHMENT_KEY, NAMESPACE_HTML, UNINITIALIZED } from '../../../../constants.js';\nimport { block, branch, destroy_effect, effect } from '../../reactivity/effects.js';\nimport { init_select, select_option } from './bindings/select.js';\nimport { flatten } from '../../reactivity/async.js';\n\nexport const CLASS = Symbol('class');\nexport const STYLE = Symbol('style');\n\nconst IS_CUSTOM_ELEMENT = Symbol('is custom element');\nconst IS_HTML = Symbol('is html');\n\n/**\n * The value/checked attribute in the template actually corresponds to the defaultValue property, so we need\n * to remove it upon hydration to avoid a bug when someone resets the form value.\n * @param {HTMLInputElement} input\n * @returns {void}\n */\nexport function remove_input_defaults(input) {\n\tif (!hydrating) return;\n\n\tvar already_removed = false;\n\n\t// We try and remove the default attributes later, rather than sync during hydration.\n\t// Doing it sync during hydration has a negative impact on performance, but deferring the\n\t// work in an idle task alleviates this greatly. If a form reset event comes in before\n\t// the idle callback, then we ensure the input defaults are cleared just before.\n\tvar remove_defaults = () => {\n\t\tif (already_removed) return;\n\t\talready_removed = true;\n\n\t\t// Remove the attributes but preserve the values\n\t\tif (input.hasAttribute('value')) {\n\t\t\tvar value = input.value;\n\t\t\tset_attribute(input, 'value', null);\n\t\t\tinput.value = value;\n\t\t}\n\n\t\tif (input.hasAttribute('checked')) {\n\t\t\tvar checked = input.checked;\n\t\t\tset_attribute(input, 'checked', null);\n\t\t\tinput.checked = checked;\n\t\t}\n\t};\n\n\t// @ts-expect-error\n\tinput.__on_r = remove_defaults;\n\tqueue_idle_task(remove_defaults);\n\tadd_form_reset_listener();\n}\n\n/**\n * @param {Element} element\n * @param {any} value\n */\nexport function set_value(element, value) {\n\tvar attributes = get_attributes(element);\n\n\tif (\n\t\tattributes.value ===\n\t\t\t(attributes.value =\n\t\t\t\t// treat null and undefined the same for the initial value\n\t\t\t\tvalue ?? undefined) ||\n\t\t// @ts-expect-error\n\t\t// `progress` elements always need their value set when it's `0`\n\t\t(element.value === value && (value !== 0 || element.nodeName !== 'PROGRESS'))\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.value = value ?? '';\n}\n\n/**\n * @param {Element} element\n * @param {boolean} checked\n */\nexport function set_checked(element, checked) {\n\tvar attributes = get_attributes(element);\n\n\tif (\n\t\tattributes.checked ===\n\t\t(attributes.checked =\n\t\t\t// treat null and undefined the same for the initial value\n\t\t\tchecked ?? undefined)\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.checked = checked;\n}\n\n/**\n * Sets the `selected` attribute on an `option` element.\n * Not set through the property because that doesn't reflect to the DOM,\n * which means it wouldn't be taken into account when a form is reset.\n * @param {HTMLOptionElement} element\n * @param {boolean} selected\n */\nexport function set_selected(element, selected) {\n\tif (selected) {\n\t\t// The selected option could've changed via user selection, and\n\t\t// setting the value without this check would set it back.\n\t\tif (!element.hasAttribute('selected')) {\n\t\t\telement.setAttribute('selected', '');\n\t\t}\n\t} else {\n\t\telement.removeAttribute('selected');\n\t}\n}\n\n/**\n * Applies the default checked property without influencing the current checked property.\n * @param {HTMLInputElement} element\n * @param {boolean} checked\n */\nexport function set_default_checked(element, checked) {\n\tconst existing_value = element.checked;\n\telement.defaultChecked = checked;\n\telement.checked = existing_value;\n}\n\n/**\n * Applies the default value property without influencing the current value property.\n * @param {HTMLInputElement | HTMLTextAreaElement} element\n * @param {string} value\n */\nexport function set_default_value(element, value) {\n\tconst existing_value = element.value;\n\telement.defaultValue = value;\n\telement.value = existing_value;\n}\n\n/**\n * @param {Element} element\n * @param {string} attribute\n * @param {string | null} value\n * @param {boolean} [skip_warning]\n */\nexport function set_attribute(element, attribute, value, skip_warning) {\n\tvar attributes = get_attributes(element);\n\n\tif (hydrating) {\n\t\tattributes[attribute] = element.getAttribute(attribute);\n\n\t\tif (\n\t\t\tattribute === 'src' ||\n\t\t\tattribute === 'srcset' ||\n\t\t\t(attribute === 'href' && element.nodeName === 'LINK')\n\t\t) {\n\t\t\tif (!skip_warning) {\n\t\t\t\tcheck_src_in_dev_hydration(element, attribute, value ?? '');\n\t\t\t}\n\n\t\t\t// If we reset these attributes, they would result in another network request, which we want to avoid.\n\t\t\t// We assume they are the same between client and server as checking if they are equal is expensive\n\t\t\t// (we can't just compare the strings as they can be different between client and server but result in the\n\t\t\t// same url, so we would need to create hidden anchor elements to compare them)\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (attributes[attribute] === (attributes[attribute] = value)) return;\n\n\tif (attribute === 'loading') {\n\t\t// @ts-expect-error\n\t\telement[LOADING_ATTR_SYMBOL] = value;\n\t}\n\n\tif (value == null) {\n\t\telement.removeAttribute(attribute);\n\t} else if (typeof value !== 'string' && get_setters(element).includes(attribute)) {\n\t\t// @ts-ignore\n\t\telement[attribute] = value;\n\t} else {\n\t\telement.setAttribute(attribute, value);\n\t}\n}\n\n/**\n * @param {Element} dom\n * @param {string} attribute\n * @param {string} value\n */\nexport function set_xlink_attribute(dom, attribute, value) {\n\tdom.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @param {string} prop\n * @param {any} value\n */\nexport function set_custom_element_data(node, prop, value) {\n\t// We need to ensure that setting custom element props, which can\n\t// invoke lifecycle methods on other custom elements, does not also\n\t// associate those lifecycle methods with the current active reaction\n\t// or effect\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet was_hydrating = hydrating;\n\tif (hydrating) {\n\t\tset_hydrating(false);\n\t}\n\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\n\ttry {\n\t\tif (\n\t\t\t// `style` should use `set_attribute` rather than the setter\n\t\t\tprop !== 'style' &&\n\t\t\t// Don't compute setters for custom elements while they aren't registered yet,\n\t\t\t// because during their upgrade/instantiation they might add more setters.\n\t\t\t// Instead, fall back to a simple \"an object, then set as property\" heuristic.\n\t\t\t(setters_cache.has(node.nodeName) ||\n\t\t\t// customElements may not be available in browser extension contexts\n\t\t\t!customElements ||\n\t\t\tcustomElements.get(node.tagName.toLowerCase())\n\t\t\t\t? get_setters(node).includes(prop)\n\t\t\t\t: value && typeof value === 'object')\n\t\t) {\n\t\t\t// @ts-expect-error\n\t\t\tnode[prop] = value;\n\t\t} else {\n\t\t\t// We did getters etc checks already, stringify before passing to set_attribute\n\t\t\t// to ensure it doesn't invoke the same logic again, and potentially populating\n\t\t\t// the setters cache too early.\n\t\t\tset_attribute(node, prop, value == null ? value : String(value));\n\t\t}\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t\tif (was_hydrating) {\n\t\t\tset_hydrating(true);\n\t\t}\n\t}\n}\n\n/**\n * Spreads attributes onto a DOM element, taking into account the currently set attributes\n * @param {Element & ElementCSSInlineStyle} element\n * @param {Record<string | symbol, any> | undefined} prev\n * @param {Record<string | symbol, any>} next New attributes - this function mutates this object\n * @param {string} [css_hash]\n * @param {boolean} [skip_warning]\n * @returns {Record<string, any>}\n */\nexport function set_attributes(element, prev, next, css_hash, skip_warning = false) {\n\tvar attributes = get_attributes(element);\n\n\tvar is_custom_element = attributes[IS_CUSTOM_ELEMENT];\n\tvar preserve_attribute_case = !attributes[IS_HTML];\n\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet is_hydrating_custom_element = hydrating && is_custom_element;\n\tif (is_hydrating_custom_element) {\n\t\tset_hydrating(false);\n\t}\n\n\tvar current = prev || {};\n\tvar is_option_element = element.tagName === 'OPTION';\n\n\tfor (var key in prev) {\n\t\tif (!(key in next)) {\n\t\t\tnext[key] = null;\n\t\t}\n\t}\n\n\tif (next.class) {\n\t\tnext.class = clsx(next.class);\n\t} else if (css_hash || next[CLASS]) {\n\t\tnext.class = null; /* force call to set_class() */\n\t}\n\n\tif (next[STYLE]) {\n\t\tnext.style ??= null; /* force call to set_style() */\n\t}\n\n\tvar setters = get_setters(element);\n\n\t// since key is captured we use const\n\tfor (const key in next) {\n\t\t// let instead of var because referenced in a closure\n\t\tlet value = next[key];\n\n\t\t// Up here because we want to do this for the initial value, too, even if it's undefined,\n\t\t// and this wouldn't be reached in case of undefined because of the equality check below\n\t\tif (is_option_element && key === 'value' && value == null) {\n\t\t\t// The <option> element is a special case because removing the value attribute means\n\t\t\t// the value is set to the text content of the option element, and setting the value\n\t\t\t// to null or undefined means the value is set to the string \"null\" or \"undefined\".\n\t\t\t// To align with how we handle this case in non-spread-scenarios, this logic is needed.\n\t\t\t// There's a super-edge-case bug here that is left in in favor of smaller code size:\n\t\t\t// Because of the \"set missing props to null\" logic above, we can't differentiate\n\t\t\t// between a missing value and an explicitly set value of null or undefined. That means\n\t\t\t// that once set, the value attribute of an <option> element can't be removed. This is\n\t\t\t// a very rare edge case, and removing the attribute altogether isn't possible either\n\t\t\t// for the <option value={undefined}> case, so we're not losing any functionality here.\n\t\t\t// @ts-ignore\n\t\t\telement.value = element.__value = '';\n\t\t\tcurrent[key] = value;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (key === 'class') {\n\t\t\tvar is_html = element.namespaceURI === 'http://www.w3.org/1999/xhtml';\n\t\t\tset_class(element, is_html, value, css_hash, prev?.[CLASS], next[CLASS]);\n\t\t\tcurrent[key] = value;\n\t\t\tcurrent[CLASS] = next[CLASS];\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (key === 'style') {\n\t\t\tset_style(element, value, prev?.[STYLE], next[STYLE]);\n\t\t\tcurrent[key] = value;\n\t\t\tcurrent[STYLE] = next[STYLE];\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar prev_value = current[key];\n\n\t\t// Skip if value is unchanged, unless it's `undefined` and the element still has the attribute\n\t\tif (value === prev_value && !(value === undefined && element.hasAttribute(key))) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tcurrent[key] = value;\n\n\t\tvar prefix = key[0] + key[1]; // this is faster than key.slice(0, 2)\n\t\tif (prefix === '$$') continue;\n\n\t\tif (prefix === 'on') {\n\t\t\t/** @type {{ capture?: true }} */\n\t\t\tconst opts = {};\n\t\t\tconst event_handle_key = '$$' + key;\n\t\t\tlet event_name = key.slice(2);\n\t\t\tvar delegated = is_delegated(event_name);\n\n\t\t\tif (is_capture_event(event_name)) {\n\t\t\t\tevent_name = event_name.slice(0, -7);\n\t\t\t\topts.capture = true;\n\t\t\t}\n\n\t\t\tif (!delegated && prev_value) {\n\t\t\t\t// Listening to same event but different handler -> our handle function below takes care of this\n\t\t\t\t// If we were to remove and add listeners in this case, it could happen that the event is \"swallowed\"\n\t\t\t\t// (the browser seems to not know yet that a new one exists now) and doesn't reach the handler\n\t\t\t\t// https://github.com/sveltejs/svelte/issues/11903\n\t\t\t\tif (value != null) continue;\n\n\t\t\t\telement.removeEventListener(event_name, current[event_handle_key], opts);\n\t\t\t\tcurrent[event_handle_key] = null;\n\t\t\t}\n\n\t\t\tif (value != null) {\n\t\t\t\tif (!delegated) {\n\t\t\t\t\t/**\n\t\t\t\t\t * @this {any}\n\t\t\t\t\t * @param {Event} evt\n\t\t\t\t\t */\n\t\t\t\t\tfunction handle(evt) {\n\t\t\t\t\t\tcurrent[key].call(this, evt);\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent[event_handle_key] = create_event(event_name, element, handle, opts);\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\telement[`__${event_name}`] = value;\n\t\t\t\t\tdelegate([event_name]);\n\t\t\t\t}\n\t\t\t} else if (delegated) {\n\t\t\t\t// @ts-ignore\n\t\t\t\telement[`__${event_name}`] = undefined;\n\t\t\t}\n\t\t} else if (key === 'style') {\n\t\t\t// avoid using the setter\n\t\t\tset_attribute(element, key, value);\n\t\t} else if (key === 'autofocus') {\n\t\t\tautofocus(/** @type {HTMLElement} */ (element), Boolean(value));\n\t\t} else if (!is_custom_element && (key === '__value' || (key === 'value' && value != null))) {\n\t\t\t// @ts-ignore We're not running this for custom elements because __value is actually\n\t\t\t// how Lit stores the current value on the element, and messing with that would break things.\n\t\t\telement.value = element.__value = value;\n\t\t} else if (key === 'selected' && is_option_element) {\n\t\t\tset_selected(/** @type {HTMLOptionElement} */ (element), value);\n\t\t} else {\n\t\t\tvar name = key;\n\t\t\tif (!preserve_attribute_case) {\n\t\t\t\tname = normalize_attribute(name);\n\t\t\t}\n\n\t\t\tvar is_default = name === 'defaultValue' || name === 'defaultChecked';\n\n\t\t\tif (value == null && !is_custom_element && !is_default) {\n\t\t\t\tattributes[key] = null;\n\n\t\t\t\tif (name === 'value' || name === 'checked') {\n\t\t\t\t\t// removing value/checked also removes defaultValue/defaultChecked — preserve\n\t\t\t\t\tlet input = /** @type {HTMLInputElement} */ (element);\n\t\t\t\t\tconst use_default = prev === undefined;\n\t\t\t\t\tif (name === 'value') {\n\t\t\t\t\t\tlet previous = input.defaultValue;\n\t\t\t\t\t\tinput.removeAttribute(name);\n\t\t\t\t\t\tinput.defaultValue = previous;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tinput.value = input.__value = use_default ? previous : null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet previous = input.defaultChecked;\n\t\t\t\t\t\tinput.removeAttribute(name);\n\t\t\t\t\t\tinput.defaultChecked = previous;\n\t\t\t\t\t\tinput.checked = use_default ? previous : false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\telement.removeAttribute(key);\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tis_default ||\n\t\t\t\t(setters.includes(name) && (is_custom_element || typeof value !== 'string'))\n\t\t\t) {\n\t\t\t\t// @ts-ignore\n\t\t\t\telement[name] = value;\n\t\t\t\t// remove it from attributes's cache\n\t\t\t\tif (name in attributes) attributes[name] = UNINITIALIZED;\n\t\t\t} else if (typeof value !== 'function') {\n\t\t\t\tset_attribute(element, name, value, skip_warning);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (is_hydrating_custom_element) {\n\t\tset_hydrating(true);\n\t}\n\n\treturn current;\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} element\n * @param {(...expressions: any) => Record<string | symbol, any>} fn\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise<any>>} async\n * @param {string} [css_hash]\n * @param {boolean} [skip_warning]\n */\nexport function attribute_effect(\n\telement,\n\tfn,\n\tsync = [],\n\tasync = [],\n\tcss_hash,\n\tskip_warning = false\n) {\n\tflatten(sync, async, (values) => {\n\t\t/** @type {Record<string | symbol, any> | undefined} */\n\t\tvar prev = undefined;\n\n\t\t/** @type {Record<symbol, Effect>} */\n\t\tvar effects = {};\n\n\t\tvar is_select = element.nodeName === 'SELECT';\n\t\tvar inited = false;\n\n\t\tblock(() => {\n\t\t\tvar next = fn(...values.map(get));\n\t\t\t/** @type {Record<string | symbol, any>} */\n\t\t\tvar current = set_attributes(element, prev, next, css_hash, skip_warning);\n\n\t\t\tif (inited && is_select && 'value' in next) {\n\t\t\t\tselect_option(/** @type {HTMLSelectElement} */ (element), next.value);\n\t\t\t}\n\n\t\t\tfor (let symbol of Object.getOwnPropertySymbols(effects)) {\n\t\t\t\tif (!next[symbol]) destroy_effect(effects[symbol]);\n\t\t\t}\n\n\t\t\tfor (let symbol of Object.getOwnPropertySymbols(next)) {\n\t\t\t\tvar n = next[symbol];\n\n\t\t\t\tif (symbol.description === ATTACHMENT_KEY && (!prev || n !== prev[symbol])) {\n\t\t\t\t\tif (effects[symbol]) destroy_effect(effects[symbol]);\n\t\t\t\t\teffects[symbol] = branch(() => attach(element, () => n));\n\t\t\t\t}\n\n\t\t\t\tcurrent[symbol] = n;\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t});\n\n\t\tif (is_select) {\n\t\t\tvar select = /** @type {HTMLSelectElement} */ (element);\n\n\t\t\teffect(() => {\n\t\t\t\tselect_option(select, /** @type {Record<string | symbol, any>} */ (prev).value, true);\n\t\t\t\tinit_select(select);\n\t\t\t});\n\t\t}\n\n\t\tinited = true;\n\t});\n}\n\n/**\n *\n * @param {Element} element\n */\nfunction get_attributes(element) {\n\treturn /** @type {Record<string | symbol, unknown>} **/ (\n\t\t// @ts-expect-error\n\t\telement.__attributes ??= {\n\t\t\t[IS_CUSTOM_ELEMENT]: element.nodeName.includes('-'),\n\t\t\t[IS_HTML]: element.namespaceURI === NAMESPACE_HTML\n\t\t}\n\t);\n}\n\n/** @type {Map<string, string[]>} */\nvar setters_cache = new Map();\n\n/** @param {Element} element */\nfunction get_setters(element) {\n\tvar setters = setters_cache.get(element.nodeName);\n\tif (setters) return setters;\n\tsetters_cache.set(element.nodeName, (setters = []));\n\n\tvar descriptors;\n\tvar proto = element; // In the case of custom elements there might be setters on the instance\n\tvar element_proto = Element.prototype;\n\n\t// Stop at Element, from there on there's only unnecessary setters we're not interested in\n\t// Do not use contructor.name here as that's unreliable in some browser environments\n\twhile (element_proto !== proto) {\n\t\tdescriptors = get_descriptors(proto);\n\n\t\tfor (var key in descriptors) {\n\t\t\tif (descriptors[key].set) {\n\t\t\t\tsetters.push(key);\n\t\t\t}\n\t\t}\n\n\t\tproto = get_prototype_of(proto);\n\t}\n\n\treturn setters;\n}\n\n/**\n * @param {any} element\n * @param {string} attribute\n * @param {string} value\n */\nfunction check_src_in_dev_hydration(element, attribute, value) {\n\tif (!DEV) return;\n\tif (attribute === 'srcset' && srcset_url_equal(element, value)) return;\n\tif (src_url_equal(element.getAttribute(attribute) ?? '', value)) return;\n\n\tw.hydration_attribute_changed(\n\t\tattribute,\n\t\telement.outerHTML.replace(element.innerHTML, element.innerHTML && '...'),\n\t\tString(value)\n\t);\n}\n\n/**\n * @param {string} element_src\n * @param {string} url\n * @returns {boolean}\n */\nfunction src_url_equal(element_src, url) {\n\tif (element_src === url) return true;\n\treturn new URL(element_src, document.baseURI).href === new URL(url, document.baseURI).href;\n}\n\n/** @param {string} srcset */\nfunction split_srcset(srcset) {\n\treturn srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean));\n}\n\n/**\n * @param {HTMLSourceElement | HTMLImageElement} element\n * @param {string} srcset\n * @returns {boolean}\n */\nfunction srcset_url_equal(element, srcset) {\n\tvar element_urls = split_srcset(element.srcset);\n\tvar urls = split_srcset(srcset);\n\n\treturn (\n\t\turls.length === element_urls.length &&\n\t\turls.every(\n\t\t\t([url, width], i) =>\n\t\t\t\twidth === element_urls[i][1] &&\n\t\t\t\t// We need to test both ways because Vite will create an a full URL with\n\t\t\t\t// `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the\n\t\t\t\t// relative URLs inside srcset are not automatically resolved to absolute URLs by\n\t\t\t\t// browsers (in contrast to img.src). This means both SSR and DOM code could\n\t\t\t\t// contain relative or absolute URLs.\n\t\t\t\t(src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0]))\n\t\t)\n\t);\n}\n","import { teardown } from '../../../reactivity/effects.js';\nimport { get_descriptor } from '../../../../shared/utils.js';\n\n/**\n * Makes an `export`ed (non-prop) variable available on the `$$props` object\n * so that consumers can do `bind:x` on the component.\n * @template V\n * @param {Record<string, unknown>} props\n * @param {string} prop\n * @param {V} value\n * @returns {void}\n */\nexport function bind_prop(props, prop, value) {\n\tvar desc = get_descriptor(props, prop);\n\n\tif (desc && desc.set) {\n\t\tprops[prop] = value;\n\t\tteardown(() => {\n\t\t\tprops[prop] = null;\n\t\t});\n\t}\n}\n","import { STATE_SYMBOL } from '#client/constants';\nimport { effect, render_effect } from '../../../reactivity/effects.js';\nimport { untrack } from '../../../runtime.js';\nimport { queue_micro_task } from '../../task.js';\n\n/**\n * @param {any} bound_value\n * @param {Element} element_or_component\n * @returns {boolean}\n */\nfunction is_bound_this(bound_value, element_or_component) {\n\treturn (\n\t\tbound_value === element_or_component || bound_value?.[STATE_SYMBOL] === element_or_component\n\t);\n}\n\n/**\n * @param {any} element_or_component\n * @param {(value: unknown, ...parts: unknown[]) => void} update\n * @param {(...parts: unknown[]) => unknown} get_value\n * @param {() => unknown[]} [get_parts] Set if the this binding is used inside an each block,\n * \t\t\t\t\t\t\t\t\t\treturns all the parts of the each block context that are used in the expression\n * @returns {void}\n */\nexport function bind_this(element_or_component = {}, update, get_value, get_parts) {\n\teffect(() => {\n\t\t/** @type {unknown[]} */\n\t\tvar old_parts;\n\n\t\t/** @type {unknown[]} */\n\t\tvar parts;\n\n\t\trender_effect(() => {\n\t\t\told_parts = parts;\n\t\t\t// We only track changes to the parts, not the value itself to avoid unnecessary reruns.\n\t\t\tparts = get_parts?.() || [];\n\n\t\t\tuntrack(() => {\n\t\t\t\tif (element_or_component !== get_value(...parts)) {\n\t\t\t\t\tupdate(element_or_component, ...parts);\n\t\t\t\t\t// If this is an effect rerun (cause: each block context changes), then nullfiy the binding at\n\t\t\t\t\t// the previous position if it isn't already taken over by a different effect.\n\t\t\t\t\tif (old_parts && is_bound_this(get_value(...old_parts), element_or_component)) {\n\t\t\t\t\t\tupdate(null, ...old_parts);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\treturn () => {\n\t\t\t// We cannot use effects in the teardown phase, we we use a microtask instead.\n\t\t\tqueue_micro_task(() => {\n\t\t\t\tif (parts && is_bound_this(get_value(...parts), element_or_component)) {\n\t\t\t\t\tupdate(null, ...parts);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t});\n\n\treturn element_or_component;\n}\n","/** @import { ComponentContextLegacy } from '#client' */\nimport { run, run_all } from '../../../shared/utils.js';\nimport { component_context } from '../../context.js';\nimport { derived } from '../../reactivity/deriveds.js';\nimport { user_pre_effect, user_effect } from '../../reactivity/effects.js';\nimport { deep_read_state, get, untrack } from '../../runtime.js';\n\n/**\n * Legacy-mode only: Call `onMount` callbacks and set up `beforeUpdate`/`afterUpdate` effects\n * @param {boolean} [immutable]\n */\nexport function init(immutable = false) {\n\tconst context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\tconst callbacks = context.l.u;\n\tif (!callbacks) return;\n\n\tlet props = () => deep_read_state(context.s);\n\n\tif (immutable) {\n\t\tlet version = 0;\n\t\tlet prev = /** @type {Record<string, any>} */ ({});\n\n\t\t// In legacy immutable mode, before/afterUpdate only fire if the object identity of a prop changes\n\t\tconst d = derived(() => {\n\t\t\tlet changed = false;\n\t\t\tconst props = context.s;\n\t\t\tfor (const key in props) {\n\t\t\t\tif (props[key] !== prev[key]) {\n\t\t\t\t\tprev[key] = props[key];\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (changed) version++;\n\t\t\treturn version;\n\t\t});\n\n\t\tprops = () => get(d);\n\t}\n\n\t// beforeUpdate\n\tif (callbacks.b.length) {\n\t\tuser_pre_effect(() => {\n\t\t\tobserve_all(context, props);\n\t\t\trun_all(callbacks.b);\n\t\t});\n\t}\n\n\t// onMount (must run before afterUpdate)\n\tuser_effect(() => {\n\t\tconst fns = untrack(() => callbacks.m.map(run));\n\t\treturn () => {\n\t\t\tfor (const fn of fns) {\n\t\t\t\tif (typeof fn === 'function') {\n\t\t\t\t\tfn();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t});\n\n\t// afterUpdate\n\tif (callbacks.a.length) {\n\t\tuser_effect(() => {\n\t\t\tobserve_all(context, props);\n\t\t\trun_all(callbacks.a);\n\t\t});\n\t}\n}\n\n/**\n * Invoke the getter of all signals associated with a component\n * so they can be registered to the effect this function is called in.\n * @param {ComponentContextLegacy} context\n * @param {(() => void)} props\n */\nfunction observe_all(context, props) {\n\tif (context.l.s) {\n\t\tfor (const signal of context.l.s) get(signal);\n\t}\n\n\tprops();\n}\n","/** @import { Readable } from './public' */\nimport { untrack } from '../index-client.js';\nimport { noop } from '../internal/shared/utils.js';\n\n/**\n * @template T\n * @param {Readable<T> | null | undefined} store\n * @param {(value: T) => void} run\n * @param {(value: T) => void} [invalidate]\n * @returns {() => void}\n */\nexport function subscribe_to_store(store, run, invalidate) {\n\tif (store == null) {\n\t\t// @ts-expect-error\n\t\trun(undefined);\n\n\t\t// @ts-expect-error\n\t\tif (invalidate) invalidate(undefined);\n\n\t\treturn noop;\n\t}\n\n\t// Svelte store takes a private second argument\n\t// StartStopNotifier could mutate state, and we want to silence the corresponding validation error\n\tconst unsub = untrack(() =>\n\t\tstore.subscribe(\n\t\t\trun,\n\t\t\t// @ts-expect-error\n\t\t\tinvalidate\n\t\t)\n\t);\n\n\t// Also support RxJS\n\t// @ts-expect-error TODO fix this in the types?\n\treturn unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\n","/** @import { Readable, StartStopNotifier, Subscriber, Unsubscriber, Updater, Writable } from '../public.js' */\n/** @import { Stores, StoresValues, SubscribeInvalidateTuple } from '../private.js' */\nimport { noop, run_all } from '../../internal/shared/utils.js';\nimport { safe_not_equal } from '../../internal/client/reactivity/equality.js';\nimport { subscribe_to_store } from '../utils.js';\n\n/**\n * @type {Array<SubscribeInvalidateTuple<any> | any>}\n */\nconst subscriber_queue = [];\n\n/**\n * Creates a `Readable` store that allows reading by subscription.\n *\n * @template T\n * @param {T} [value] initial value\n * @param {StartStopNotifier<T>} [start]\n * @returns {Readable<T>}\n */\nexport function readable(value, start) {\n\treturn {\n\t\tsubscribe: writable(value, start).subscribe\n\t};\n}\n\n/**\n * Create a `Writable` store that allows both updating and reading by subscription.\n *\n * @template T\n * @param {T} [value] initial value\n * @param {StartStopNotifier<T>} [start]\n * @returns {Writable<T>}\n */\nexport function writable(value, start = noop) {\n\t/** @type {Unsubscriber | null} */\n\tlet stop = null;\n\n\t/** @type {Set<SubscribeInvalidateTuple<T>>} */\n\tconst subscribers = new Set();\n\n\t/**\n\t * @param {T} new_value\n\t * @returns {void}\n\t */\n\tfunction set(new_value) {\n\t\tif (safe_not_equal(value, new_value)) {\n\t\t\tvalue = new_value;\n\t\t\tif (stop) {\n\t\t\t\t// store is ready\n\t\t\t\tconst run_queue = !subscriber_queue.length;\n\t\t\t\tfor (const subscriber of subscribers) {\n\t\t\t\t\tsubscriber[1]();\n\t\t\t\t\tsubscriber_queue.push(subscriber, value);\n\t\t\t\t}\n\t\t\t\tif (run_queue) {\n\t\t\t\t\tfor (let i = 0; i < subscriber_queue.length; i += 2) {\n\t\t\t\t\t\tsubscriber_queue[i][0](subscriber_queue[i + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tsubscriber_queue.length = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param {Updater<T>} fn\n\t * @returns {void}\n\t */\n\tfunction update(fn) {\n\t\tset(fn(/** @type {T} */ (value)));\n\t}\n\n\t/**\n\t * @param {Subscriber<T>} run\n\t * @param {() => void} [invalidate]\n\t * @returns {Unsubscriber}\n\t */\n\tfunction subscribe(run, invalidate = noop) {\n\t\t/** @type {SubscribeInvalidateTuple<T>} */\n\t\tconst subscriber = [run, invalidate];\n\t\tsubscribers.add(subscriber);\n\t\tif (subscribers.size === 1) {\n\t\t\tstop = start(set, update) || noop;\n\t\t}\n\t\trun(/** @type {T} */ (value));\n\t\treturn () => {\n\t\t\tsubscribers.delete(subscriber);\n\t\t\tif (subscribers.size === 0 && stop) {\n\t\t\t\tstop();\n\t\t\t\tstop = null;\n\t\t\t}\n\t\t};\n\t}\n\treturn { set, update, subscribe };\n}\n\n/**\n * Derived value store by synchronizing one or more readable stores and\n * applying an aggregation function over its input values.\n *\n * @template {Stores} S\n * @template T\n * @overload\n * @param {S} stores\n * @param {(values: StoresValues<S>, set: (value: T) => void, update: (fn: Updater<T>) => void) => Unsubscriber | void} fn\n * @param {T} [initial_value]\n * @returns {Readable<T>}\n */\n/**\n * Derived value store by synchronizing one or more readable stores and\n * applying an aggregation function over its input values.\n *\n * @template {Stores} S\n * @template T\n * @overload\n * @param {S} stores\n * @param {(values: StoresValues<S>) => T} fn\n * @param {T} [initial_value]\n * @returns {Readable<T>}\n */\n/**\n * @template {Stores} S\n * @template T\n * @param {S} stores\n * @param {Function} fn\n * @param {T} [initial_value]\n * @returns {Readable<T>}\n */\nexport function derived(stores, fn, initial_value) {\n\tconst single = !Array.isArray(stores);\n\t/** @type {Array<Readable<any>>} */\n\tconst stores_array = single ? [stores] : stores;\n\tif (!stores_array.every(Boolean)) {\n\t\tthrow new Error('derived() expects stores as input, got a falsy value');\n\t}\n\tconst auto = fn.length < 2;\n\treturn readable(initial_value, (set, update) => {\n\t\tlet started = false;\n\t\t/** @type {T[]} */\n\t\tconst values = [];\n\t\tlet pending = 0;\n\t\tlet cleanup = noop;\n\t\tconst sync = () => {\n\t\t\tif (pending) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcleanup();\n\t\t\tconst result = fn(single ? values[0] : values, set, update);\n\t\t\tif (auto) {\n\t\t\t\tset(result);\n\t\t\t} else {\n\t\t\t\tcleanup = typeof result === 'function' ? result : noop;\n\t\t\t}\n\t\t};\n\t\tconst unsubscribers = stores_array.map((store, i) =>\n\t\t\tsubscribe_to_store(\n\t\t\t\tstore,\n\t\t\t\t(value) => {\n\t\t\t\t\tvalues[i] = value;\n\t\t\t\t\tpending &= ~(1 << i);\n\t\t\t\t\tif (started) {\n\t\t\t\t\t\tsync();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tpending |= 1 << i;\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t\tstarted = true;\n\t\tsync();\n\t\treturn function stop() {\n\t\t\trun_all(unsubscribers);\n\t\t\tcleanup();\n\t\t\t// We need to set this to false because callbacks can still happen despite having unsubscribed:\n\t\t\t// Callbacks might already be placed in the queue which doesn't know it should no longer\n\t\t\t// invoke this derived store.\n\t\t\tstarted = false;\n\t\t};\n\t});\n}\n\n/**\n * Takes a store and returns a new one derived from the old one that is readable.\n *\n * @template T\n * @param {Readable<T>} store - store to make readonly\n * @returns {Readable<T>}\n */\nexport function readonly(store) {\n\treturn {\n\t\t// @ts-expect-error TODO i suspect the bind is unnecessary\n\t\tsubscribe: store.subscribe.bind(store)\n\t};\n}\n\n/**\n * Get the current value from a store by subscribing and immediately unsubscribing.\n *\n * @template T\n * @param {Readable<T>} store\n * @returns {T}\n */\nexport function get(store) {\n\tlet value;\n\tsubscribe_to_store(store, (_) => (value = _))();\n\t// @ts-expect-error\n\treturn value;\n}\n","/** @import { StoreReferencesContainer } from '#client' */\n/** @import { Store } from '#shared' */\nimport { subscribe_to_store } from '../../../store/utils.js';\nimport { get as get_store } from '../../../store/shared/index.js';\nimport { define_property, noop } from '../../shared/utils.js';\nimport { get } from '../runtime.js';\nimport { teardown } from './effects.js';\nimport { mutable_source, set } from './sources.js';\nimport { DEV } from 'esm-env';\n\n/**\n * Whether or not the prop currently being read is a store binding, as in\n * `<Child bind:x={$y} />`. If it is, we treat the prop as mutable even in\n * runes mode, and skip `binding_property_non_reactive` validation\n */\nlet is_store_binding = false;\n\nlet IS_UNMOUNTED = Symbol();\n\n/**\n * Gets the current value of a store. If the store isn't subscribed to yet, it will create a proxy\n * signal that will be updated when the store is. The store references container is needed to\n * track reassignments to stores and to track the correct component context.\n * @template V\n * @param {Store<V> | null | undefined} store\n * @param {string} store_name\n * @param {StoreReferencesContainer} stores\n * @returns {V}\n */\nexport function store_get(store, store_name, stores) {\n\tconst entry = (stores[store_name] ??= {\n\t\tstore: null,\n\t\tsource: mutable_source(undefined),\n\t\tunsubscribe: noop\n\t});\n\n\tif (DEV) {\n\t\tentry.source.label = store_name;\n\t}\n\n\t// if the component that setup this is already unmounted we don't want to register a subscription\n\tif (entry.store !== store && !(IS_UNMOUNTED in stores)) {\n\t\tentry.unsubscribe();\n\t\tentry.store = store ?? null;\n\n\t\tif (store == null) {\n\t\t\tentry.source.v = undefined; // see synchronous callback comment below\n\t\t\tentry.unsubscribe = noop;\n\t\t} else {\n\t\t\tvar is_synchronous_callback = true;\n\n\t\t\tentry.unsubscribe = subscribe_to_store(store, (v) => {\n\t\t\t\tif (is_synchronous_callback) {\n\t\t\t\t\t// If the first updates to the store value (possibly multiple of them) are synchronously\n\t\t\t\t\t// inside a derived, we will hit the `state_unsafe_mutation` error if we `set` the value\n\t\t\t\t\tentry.source.v = v;\n\t\t\t\t} else {\n\t\t\t\t\tset(entry.source, v);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tis_synchronous_callback = false;\n\t\t}\n\t}\n\n\t// if the component that setup this stores is already unmounted the source will be out of sync\n\t// so we just use the `get` for the stores, less performant but it avoids to create a memory leak\n\t// and it will keep the value consistent\n\tif (store && IS_UNMOUNTED in stores) {\n\t\treturn get_store(store);\n\t}\n\n\treturn get(entry.source);\n}\n\n/**\n * Unsubscribe from a store if it's not the same as the one in the store references container.\n * We need this in addition to `store_get` because someone could unsubscribe from a store but\n * then never subscribe to the new one (if any), causing the subscription to stay open wrongfully.\n * @param {Store<any> | null | undefined} store\n * @param {string} store_name\n * @param {StoreReferencesContainer} stores\n */\nexport function store_unsub(store, store_name, stores) {\n\t/** @type {StoreReferencesContainer[''] | undefined} */\n\tlet entry = stores[store_name];\n\n\tif (entry && entry.store !== store) {\n\t\t// Don't reset store yet, so that store_get above can resubscribe to new store if necessary\n\t\tentry.unsubscribe();\n\t\tentry.unsubscribe = noop;\n\t}\n\n\treturn store;\n}\n\n/**\n * Sets the new value of a store and returns that value.\n * @template V\n * @param {Store<V>} store\n * @param {V} value\n * @returns {V}\n */\nexport function store_set(store, value) {\n\tstore.set(value);\n\treturn value;\n}\n\n/**\n * @param {StoreReferencesContainer} stores\n * @param {string} store_name\n */\nexport function invalidate_store(stores, store_name) {\n\tvar entry = stores[store_name];\n\tif (entry.store !== null) {\n\t\tstore_set(entry.store, entry.source.v);\n\t}\n}\n\n/**\n * Unsubscribes from all auto-subscribed stores on destroy\n * @returns {[StoreReferencesContainer, ()=>void]}\n */\nexport function setup_stores() {\n\t/** @type {StoreReferencesContainer} */\n\tconst stores = {};\n\n\tfunction cleanup() {\n\t\tteardown(() => {\n\t\t\tfor (var store_name in stores) {\n\t\t\t\tconst ref = stores[store_name];\n\t\t\t\tref.unsubscribe();\n\t\t\t}\n\t\t\tdefine_property(stores, IS_UNMOUNTED, {\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: true\n\t\t\t});\n\t\t});\n\t}\n\n\treturn [stores, cleanup];\n}\n\n/**\n * Updates a store with a new value.\n * @param {Store<V>} store the store to update\n * @param {any} expression the expression that mutates the store\n * @param {V} new_value the new store value\n * @template V\n */\nexport function store_mutate(store, expression, new_value) {\n\tstore.set(new_value);\n\treturn expression;\n}\n\n/**\n * @param {Store<number>} store\n * @param {number} store_value\n * @param {1 | -1} [d]\n * @returns {number}\n */\nexport function update_store(store, store_value, d = 1) {\n\tstore.set(store_value + d);\n\treturn store_value;\n}\n\n/**\n * @param {Store<number>} store\n * @param {number} store_value\n * @param {1 | -1} [d]\n * @returns {number}\n */\nexport function update_pre_store(store, store_value, d = 1) {\n\tconst value = store_value + d;\n\tstore.set(value);\n\treturn value;\n}\n\n/**\n * Called inside prop getters to communicate that the prop is a store binding\n */\nexport function mark_store_binding() {\n\tis_store_binding = true;\n}\n\n/**\n * Returns a tuple that indicates whether `fn()` reads a prop that is a store binding.\n * Used to prevent `binding_property_non_reactive` validation false positives and\n * ensure that these props are treated as mutable even in runes mode\n * @template T\n * @param {() => T} fn\n * @returns {[T, boolean]}\n */\nexport function capture_store_binding(fn) {\n\tvar previous_is_store_binding = is_store_binding;\n\n\ttry {\n\t\tis_store_binding = false;\n\t\treturn [fn(), is_store_binding];\n\t} finally {\n\t\tis_store_binding = previous_is_store_binding;\n\t}\n}\n","/** @import { Effect, Source } from './types.js' */\nimport { DEV } from 'esm-env';\nimport {\n\tPROPS_IS_BINDABLE,\n\tPROPS_IS_IMMUTABLE,\n\tPROPS_IS_LAZY_INITIAL,\n\tPROPS_IS_RUNES,\n\tPROPS_IS_UPDATED\n} from '../../../constants.js';\nimport { get_descriptor, is_function } from '../../shared/utils.js';\nimport { set, source, update } from './sources.js';\nimport { derived, derived_safe_equal } from './deriveds.js';\nimport {\n\tactive_effect,\n\tget,\n\tis_destroying_effect,\n\tset_active_effect,\n\tuntrack\n} from '../runtime.js';\nimport * as e from '../errors.js';\nimport { DESTROYED, LEGACY_PROPS, STATE_SYMBOL } from '#client/constants';\nimport { proxy } from '../proxy.js';\nimport { capture_store_binding } from './store.js';\nimport { legacy_mode_flag } from '../../flags/index.js';\n\n/**\n * @param {((value?: number) => number)} fn\n * @param {1 | -1} [d]\n * @returns {number}\n */\nexport function update_prop(fn, d = 1) {\n\tconst value = fn();\n\tfn(value + d);\n\treturn value;\n}\n\n/**\n * @param {((value?: number) => number)} fn\n * @param {1 | -1} [d]\n * @returns {number}\n */\nexport function update_pre_prop(fn, d = 1) {\n\tconst value = fn() + d;\n\tfn(value);\n\treturn value;\n}\n\n/**\n * The proxy handler for rest props (i.e. `const { x, ...rest } = $props()`).\n * Is passed the full `$$props` object and excludes the named props.\n * @type {ProxyHandler<{ props: Record<string | symbol, unknown>, exclude: Array<string | symbol>, name?: string }>}}\n */\nconst rest_props_handler = {\n\tget(target, key) {\n\t\tif (target.exclude.includes(key)) return;\n\t\treturn target.props[key];\n\t},\n\tset(target, key) {\n\t\tif (DEV) {\n\t\t\t// TODO should this happen in prod too?\n\t\t\te.props_rest_readonly(`${target.name}.${String(key)}`);\n\t\t}\n\n\t\treturn false;\n\t},\n\tgetOwnPropertyDescriptor(target, key) {\n\t\tif (target.exclude.includes(key)) return;\n\t\tif (key in target.props) {\n\t\t\treturn {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: target.props[key]\n\t\t\t};\n\t\t}\n\t},\n\thas(target, key) {\n\t\tif (target.exclude.includes(key)) return false;\n\t\treturn key in target.props;\n\t},\n\townKeys(target) {\n\t\treturn Reflect.ownKeys(target.props).filter((key) => !target.exclude.includes(key));\n\t}\n};\n\n/**\n * @param {Record<string, unknown>} props\n * @param {string[]} exclude\n * @param {string} [name]\n * @returns {Record<string, unknown>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function rest_props(props, exclude, name) {\n\treturn new Proxy(\n\t\tDEV ? { props, exclude, name, other: {}, to_proxy: [] } : { props, exclude },\n\t\trest_props_handler\n\t);\n}\n\n/**\n * The proxy handler for legacy $$restProps and $$props\n * @type {ProxyHandler<{ props: Record<string | symbol, unknown>, exclude: Array<string | symbol>, special: Record<string | symbol, (v?: unknown) => unknown>, version: Source<number>, parent_effect: Effect }>}}\n */\nconst legacy_rest_props_handler = {\n\tget(target, key) {\n\t\tif (target.exclude.includes(key)) return;\n\t\tget(target.version);\n\t\treturn key in target.special ? target.special[key]() : target.props[key];\n\t},\n\tset(target, key, value) {\n\t\tif (!(key in target.special)) {\n\t\t\tvar previous_effect = active_effect;\n\n\t\t\ttry {\n\t\t\t\tset_active_effect(target.parent_effect);\n\n\t\t\t\t// Handle props that can temporarily get out of sync with the parent\n\t\t\t\t/** @type {Record<string, (v?: unknown) => unknown>} */\n\t\t\t\ttarget.special[key] = prop(\n\t\t\t\t\t{\n\t\t\t\t\t\tget [key]() {\n\t\t\t\t\t\t\treturn target.props[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t/** @type {string} */ (key),\n\t\t\t\t\tPROPS_IS_UPDATED\n\t\t\t\t);\n\t\t\t} finally {\n\t\t\t\tset_active_effect(previous_effect);\n\t\t\t}\n\t\t}\n\n\t\ttarget.special[key](value);\n\t\tupdate(target.version); // $$props is coarse-grained: when $$props.x is updated, usages of $$props.y etc are also rerun\n\t\treturn true;\n\t},\n\tgetOwnPropertyDescriptor(target, key) {\n\t\tif (target.exclude.includes(key)) return;\n\t\tif (key in target.props) {\n\t\t\treturn {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: target.props[key]\n\t\t\t};\n\t\t}\n\t},\n\tdeleteProperty(target, key) {\n\t\t// Svelte 4 allowed for deletions on $$restProps\n\t\tif (target.exclude.includes(key)) return true;\n\t\ttarget.exclude.push(key);\n\t\tupdate(target.version);\n\t\treturn true;\n\t},\n\thas(target, key) {\n\t\tif (target.exclude.includes(key)) return false;\n\t\treturn key in target.props;\n\t},\n\townKeys(target) {\n\t\treturn Reflect.ownKeys(target.props).filter((key) => !target.exclude.includes(key));\n\t}\n};\n\n/**\n * @param {Record<string, unknown>} props\n * @param {string[]} exclude\n * @returns {Record<string, unknown>}\n */\nexport function legacy_rest_props(props, exclude) {\n\treturn new Proxy(\n\t\t{\n\t\t\tprops,\n\t\t\texclude,\n\t\t\tspecial: {},\n\t\t\tversion: source(0),\n\t\t\t// TODO this is only necessary because we need to track component\n\t\t\t// destruction inside `prop`, because of `bind:this`, but it\n\t\t\t// seems likely that we can simplify `bind:this` instead\n\t\t\tparent_effect: /** @type {Effect} */ (active_effect)\n\t\t},\n\t\tlegacy_rest_props_handler\n\t);\n}\n\n/**\n * The proxy handler for spread props. Handles the incoming array of props\n * that looks like `() => { dynamic: props }, { static: prop }, ..` and wraps\n * them so that the whole thing is passed to the component as the `$$props` argument.\n * @type {ProxyHandler<{ props: Array<Record<string | symbol, unknown> | (() => Record<string | symbol, unknown>)> }>}}\n */\nconst spread_props_handler = {\n\tget(target, key) {\n\t\tlet i = target.props.length;\n\t\twhile (i--) {\n\t\t\tlet p = target.props[i];\n\t\t\tif (is_function(p)) p = p();\n\t\t\tif (typeof p === 'object' && p !== null && key in p) return p[key];\n\t\t}\n\t},\n\tset(target, key, value) {\n\t\tlet i = target.props.length;\n\t\twhile (i--) {\n\t\t\tlet p = target.props[i];\n\t\t\tif (is_function(p)) p = p();\n\t\t\tconst desc = get_descriptor(p, key);\n\t\t\tif (desc && desc.set) {\n\t\t\t\tdesc.set(value);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t},\n\tgetOwnPropertyDescriptor(target, key) {\n\t\tlet i = target.props.length;\n\t\twhile (i--) {\n\t\t\tlet p = target.props[i];\n\t\t\tif (is_function(p)) p = p();\n\t\t\tif (typeof p === 'object' && p !== null && key in p) {\n\t\t\t\tconst descriptor = get_descriptor(p, key);\n\t\t\t\tif (descriptor && !descriptor.configurable) {\n\t\t\t\t\t// Prevent a \"Non-configurability Report Error\": The target is an array, it does\n\t\t\t\t\t// not actually contain this property. If it is now described as non-configurable,\n\t\t\t\t\t// the proxy throws a validation error. Setting it to true avoids that.\n\t\t\t\t\tdescriptor.configurable = true;\n\t\t\t\t}\n\t\t\t\treturn descriptor;\n\t\t\t}\n\t\t}\n\t},\n\thas(target, key) {\n\t\t// To prevent a false positive `is_entry_props` in the `prop` function\n\t\tif (key === STATE_SYMBOL || key === LEGACY_PROPS) return false;\n\n\t\tfor (let p of target.props) {\n\t\t\tif (is_function(p)) p = p();\n\t\t\tif (p != null && key in p) return true;\n\t\t}\n\n\t\treturn false;\n\t},\n\townKeys(target) {\n\t\t/** @type {Array<string | symbol>} */\n\t\tconst keys = [];\n\n\t\tfor (let p of target.props) {\n\t\t\tif (is_function(p)) p = p();\n\t\t\tif (!p) continue;\n\n\t\t\tfor (const key in p) {\n\t\t\t\tif (!keys.includes(key)) keys.push(key);\n\t\t\t}\n\n\t\t\tfor (const key of Object.getOwnPropertySymbols(p)) {\n\t\t\t\tif (!keys.includes(key)) keys.push(key);\n\t\t\t}\n\t\t}\n\n\t\treturn keys;\n\t}\n};\n\n/**\n * @param {Array<Record<string, unknown> | (() => Record<string, unknown>)>} props\n * @returns {any}\n */\nexport function spread_props(...props) {\n\treturn new Proxy({ props }, spread_props_handler);\n}\n\n/**\n * This function is responsible for synchronizing a possibly bound prop with the inner component state.\n * It is used whenever the compiler sees that the component writes to the prop, or when it has a default prop_value.\n * @template V\n * @param {Record<string, unknown>} props\n * @param {string} key\n * @param {number} flags\n * @param {V | (() => V)} [fallback]\n * @returns {(() => V | ((arg: V) => V) | ((arg: V, mutation: boolean) => V))}\n */\nexport function prop(props, key, flags, fallback) {\n\tvar runes = !legacy_mode_flag || (flags & PROPS_IS_RUNES) !== 0;\n\tvar bindable = (flags & PROPS_IS_BINDABLE) !== 0;\n\tvar lazy = (flags & PROPS_IS_LAZY_INITIAL) !== 0;\n\n\tvar fallback_value = /** @type {V} */ (fallback);\n\tvar fallback_dirty = true;\n\n\tvar get_fallback = () => {\n\t\tif (fallback_dirty) {\n\t\t\tfallback_dirty = false;\n\n\t\t\tfallback_value = lazy\n\t\t\t\t? untrack(/** @type {() => V} */ (fallback))\n\t\t\t\t: /** @type {V} */ (fallback);\n\t\t}\n\n\t\treturn fallback_value;\n\t};\n\n\t/** @type {((v: V) => void) | undefined} */\n\tvar setter;\n\n\tif (bindable) {\n\t\t// Can be the case when someone does `mount(Component, props)` with `let props = $state({...})`\n\t\t// or `createClassComponent(Component, props)`\n\t\tvar is_entry_props = STATE_SYMBOL in props || LEGACY_PROPS in props;\n\n\t\tsetter =\n\t\t\tget_descriptor(props, key)?.set ??\n\t\t\t(is_entry_props && key in props ? (v) => (props[key] = v) : undefined);\n\t}\n\n\tvar initial_value;\n\tvar is_store_sub = false;\n\n\tif (bindable) {\n\t\t[initial_value, is_store_sub] = capture_store_binding(() => /** @type {V} */ (props[key]));\n\t} else {\n\t\tinitial_value = /** @type {V} */ (props[key]);\n\t}\n\n\tif (initial_value === undefined && fallback !== undefined) {\n\t\tinitial_value = get_fallback();\n\n\t\tif (setter) {\n\t\t\tif (runes) e.props_invalid_value(key);\n\t\t\tsetter(initial_value);\n\t\t}\n\t}\n\n\t/** @type {() => V} */\n\tvar getter;\n\n\tif (runes) {\n\t\tgetter = () => {\n\t\t\tvar value = /** @type {V} */ (props[key]);\n\t\t\tif (value === undefined) return get_fallback();\n\t\t\tfallback_dirty = true;\n\t\t\treturn value;\n\t\t};\n\t} else {\n\t\tgetter = () => {\n\t\t\tvar value = /** @type {V} */ (props[key]);\n\n\t\t\tif (value !== undefined) {\n\t\t\t\t// in legacy mode, we don't revert to the fallback value\n\t\t\t\t// if the prop goes from defined to undefined. The easiest\n\t\t\t\t// way to model this is to make the fallback undefined\n\t\t\t\t// as soon as the prop has a value\n\t\t\t\tfallback_value = /** @type {V} */ (undefined);\n\t\t\t}\n\n\t\t\treturn value === undefined ? fallback_value : value;\n\t\t};\n\t}\n\n\t// prop is never written to — we only need a getter\n\tif (runes && (flags & PROPS_IS_UPDATED) === 0) {\n\t\treturn getter;\n\t}\n\n\t// prop is written to, but the parent component had `bind:foo` which\n\t// means we can just call `$$props.foo = value` directly\n\tif (setter) {\n\t\tvar legacy_parent = props.$$legacy;\n\t\treturn /** @type {() => V} */ (\n\t\t\tfunction (/** @type {V} */ value, /** @type {boolean} */ mutation) {\n\t\t\t\tif (arguments.length > 0) {\n\t\t\t\t\t// We don't want to notify if the value was mutated and the parent is in runes mode.\n\t\t\t\t\t// In that case the state proxy (if it exists) should take care of the notification.\n\t\t\t\t\t// If the parent is not in runes mode, we need to notify on mutation, too, that the prop\n\t\t\t\t\t// has changed because the parent will not be able to detect the change otherwise.\n\t\t\t\t\tif (!runes || !mutation || legacy_parent || is_store_sub) {\n\t\t\t\t\t\t/** @type {Function} */ (setter)(mutation ? getter() : value);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\n\t\t\t\treturn getter();\n\t\t\t}\n\t\t);\n\t}\n\n\t// Either prop is written to, but there's no binding, which means we\n\t// create a derived that we can write to locally.\n\t// Or we are in legacy mode where we always create a derived to replicate that\n\t// Svelte 4 did not trigger updates when a primitive value was updated to the same value.\n\tvar overridden = false;\n\n\tvar d = ((flags & PROPS_IS_IMMUTABLE) !== 0 ? derived : derived_safe_equal)(() => {\n\t\toverridden = false;\n\t\treturn getter();\n\t});\n\n\tif (DEV) {\n\t\td.label = key;\n\t}\n\n\t// Capture the initial value if it's bindable\n\tif (bindable) get(d);\n\n\tvar parent_effect = /** @type {Effect} */ (active_effect);\n\n\treturn /** @type {() => V} */ (\n\t\tfunction (/** @type {any} */ value, /** @type {boolean} */ mutation) {\n\t\t\tif (arguments.length > 0) {\n\t\t\t\tconst new_value = mutation ? get(d) : runes && bindable ? proxy(value) : value;\n\n\t\t\t\tset(d, new_value);\n\t\t\t\toverridden = true;\n\n\t\t\t\tif (fallback_value !== undefined) {\n\t\t\t\t\tfallback_value = new_value;\n\t\t\t\t}\n\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\t// special case — avoid recalculating the derived if we're in a\n\t\t\t// teardown function and the prop was overridden locally, or the\n\t\t\t// component was already destroyed (this latter part is necessary\n\t\t\t// because `bind:this` can read props after the component has\n\t\t\t// been destroyed. TODO simplify `bind:this`\n\t\t\tif ((is_destroying_effect && overridden) || (parent_effect.f & DESTROYED) !== 0) {\n\t\t\t\treturn d.v;\n\t\t\t}\n\n\t\t\treturn get(d);\n\t\t}\n\t);\n}\n","/** @import { ComponentContext, ComponentContextLegacy } from '#client' */\n/** @import { EventDispatcher } from './index.js' */\n/** @import { NotFunction } from './internal/types.js' */\nimport { active_reaction, untrack } from './internal/client/runtime.js';\nimport { is_array } from './internal/shared/utils.js';\nimport { user_effect } from './internal/client/index.js';\nimport * as e from './internal/client/errors.js';\nimport { legacy_mode_flag } from './internal/flags/index.js';\nimport { component_context } from './internal/client/context.js';\nimport { DEV } from 'esm-env';\n\nif (DEV) {\n\t/**\n\t * @param {string} rune\n\t */\n\tfunction throw_rune_error(rune) {\n\t\tif (!(rune in globalThis)) {\n\t\t\t// TODO if people start adjusting the \"this can contain runes\" config through v-p-s more, adjust this message\n\t\t\t/** @type {any} */\n\t\t\tlet value; // let's hope noone modifies this global, but belts and braces\n\t\t\tObject.defineProperty(globalThis, rune, {\n\t\t\t\tconfigurable: true,\n\t\t\t\t// eslint-disable-next-line getter-return\n\t\t\t\tget: () => {\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t}\n\n\t\t\t\t\te.rune_outside_svelte(rune);\n\t\t\t\t},\n\t\t\t\tset: (v) => {\n\t\t\t\t\tvalue = v;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tthrow_rune_error('$state');\n\tthrow_rune_error('$effect');\n\tthrow_rune_error('$derived');\n\tthrow_rune_error('$inspect');\n\tthrow_rune_error('$props');\n\tthrow_rune_error('$bindable');\n}\n\n/**\n * Returns an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that aborts when the current [derived](https://svelte.dev/docs/svelte/$derived) or [effect](https://svelte.dev/docs/svelte/$effect) re-runs or is destroyed.\n *\n * Must be called while a derived or effect is running.\n *\n * ```svelte\n * <script>\n * \timport { getAbortSignal } from 'svelte';\n *\n * \tlet { id } = $props();\n *\n * \tasync function getData(id) {\n * \t\tconst response = await fetch(`/items/${id}`, {\n * \t\t\tsignal: getAbortSignal()\n * \t\t});\n *\n * \t\treturn await response.json();\n * \t}\n *\n * \tconst data = $derived(await getData(id));\n * </script>\n * ```\n */\nexport function getAbortSignal() {\n\tif (active_reaction === null) {\n\t\te.get_abort_signal_outside_reaction();\n\t}\n\n\treturn (active_reaction.ac ??= new AbortController()).signal;\n}\n\n/**\n * `onMount`, like [`$effect`](https://svelte.dev/docs/svelte/$effect), schedules a function to run as soon as the component has been mounted to the DOM.\n * Unlike `$effect`, the provided function only runs once.\n *\n * It must be called during the component's initialisation (but doesn't need to live _inside_ the component;\n * it can be called from an external module). If a function is returned _synchronously_ from `onMount`,\n * it will be called when the component is unmounted.\n *\n * `onMount` functions do not run during [server-side rendering](https://svelte.dev/docs/svelte/svelte-server#render).\n *\n * @template T\n * @param {() => NotFunction<T> | Promise<NotFunction<T>> | (() => any)} fn\n * @returns {void}\n */\nexport function onMount(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('onMount');\n\t}\n\n\tif (legacy_mode_flag && component_context.l !== null) {\n\t\tinit_update_callbacks(component_context).m.push(fn);\n\t} else {\n\t\tuser_effect(() => {\n\t\t\tconst cleanup = untrack(fn);\n\t\t\tif (typeof cleanup === 'function') return /** @type {() => void} */ (cleanup);\n\t\t});\n\t}\n}\n\n/**\n * Schedules a callback to run immediately before the component is unmounted.\n *\n * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the\n * only one that runs inside a server-side component.\n *\n * @param {() => any} fn\n * @returns {void}\n */\nexport function onDestroy(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('onDestroy');\n\t}\n\n\tonMount(() => () => untrack(fn));\n}\n\n/**\n * @template [T=any]\n * @param {string} type\n * @param {T} [detail]\n * @param {any}params_0\n * @returns {CustomEvent<T>}\n */\nfunction create_custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n\treturn new CustomEvent(type, { detail, bubbles, cancelable });\n}\n\n/**\n * Creates an event dispatcher that can be used to dispatch [component events](https://svelte.dev/docs/svelte/legacy-on#Component-events).\n * Event dispatchers are functions that can take two arguments: `name` and `detail`.\n *\n * Component events created with `createEventDispatcher` create a\n * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).\n * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).\n * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)\n * property and can contain any type of data.\n *\n * The event dispatcher can be typed to narrow the allowed event names and the type of the `detail` argument:\n * ```ts\n * const dispatch = createEventDispatcher<{\n * loaded: null; // does not take a detail argument\n * change: string; // takes a detail argument of type string, which is required\n * optional: number | null; // takes an optional detail argument of type number\n * }>();\n * ```\n *\n * @deprecated Use callback props and/or the `$host()` rune instead — see [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Event-changes-Component-events)\n * @template {Record<string, any>} [EventMap = any]\n * @returns {EventDispatcher<EventMap>}\n */\nexport function createEventDispatcher() {\n\tconst active_component_context = component_context;\n\tif (active_component_context === null) {\n\t\te.lifecycle_outside_component('createEventDispatcher');\n\t}\n\n\t/**\n\t * @param [detail]\n\t * @param [options]\n\t */\n\treturn (type, detail, options) => {\n\t\tconst events = /** @type {Record<string, Function | Function[]>} */ (\n\t\t\tactive_component_context.s.$$events\n\t\t)?.[/** @type {string} */ (type)];\n\n\t\tif (events) {\n\t\t\tconst callbacks = is_array(events) ? events.slice() : [events];\n\t\t\t// TODO are there situations where events could be dispatched\n\t\t\t// in a server (non-DOM) environment?\n\t\t\tconst event = create_custom_event(/** @type {string} */ (type), detail, options);\n\t\t\tfor (const fn of callbacks) {\n\t\t\t\tfn.call(active_component_context.x, event);\n\t\t\t}\n\t\t\treturn !event.defaultPrevented;\n\t\t}\n\n\t\treturn true;\n\t};\n}\n\n// TODO mark beforeUpdate and afterUpdate as deprecated in Svelte 6\n\n/**\n * Schedules a callback to run immediately before the component is updated after any state change.\n *\n * The first time the callback runs will be before the initial `onMount`.\n *\n * In runes mode use `$effect.pre` instead.\n *\n * @deprecated Use [`$effect.pre`](https://svelte.dev/docs/svelte/$effect#$effect.pre) instead\n * @param {() => void} fn\n * @returns {void}\n */\nexport function beforeUpdate(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('beforeUpdate');\n\t}\n\n\tif (component_context.l === null) {\n\t\te.lifecycle_legacy_only('beforeUpdate');\n\t}\n\n\tinit_update_callbacks(component_context).b.push(fn);\n}\n\n/**\n * Schedules a callback to run immediately after the component has been updated.\n *\n * The first time the callback runs will be after the initial `onMount`.\n *\n * In runes mode use `$effect` instead.\n *\n * @deprecated Use [`$effect`](https://svelte.dev/docs/svelte/$effect) instead\n * @param {() => void} fn\n * @returns {void}\n */\nexport function afterUpdate(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('afterUpdate');\n\t}\n\n\tif (component_context.l === null) {\n\t\te.lifecycle_legacy_only('afterUpdate');\n\t}\n\n\tinit_update_callbacks(component_context).a.push(fn);\n}\n\n/**\n * Legacy-mode: Init callbacks object for onMount/beforeUpdate/afterUpdate\n * @param {ComponentContext} context\n */\nfunction init_update_callbacks(context) {\n\tvar l = /** @type {ComponentContextLegacy} */ (context).l;\n\treturn (l.u ??= { a: [], b: [], m: [] });\n}\n\nexport { flushSync } from './internal/client/reactivity/batch.js';\nexport { getContext, getAllContexts, hasContext, setContext } from './internal/client/context.js';\nexport { hydrate, mount, unmount } from './internal/client/render.js';\nexport { tick, untrack, settled } from './internal/client/runtime.js';\nexport { createRawSnippet } from './internal/client/dom/blocks/snippet.js';\n","// generated during release, do not modify\n\n/**\n * The current version, as set in package.json.\n * @type {string}\n */\nexport const VERSION = '5.38.2';\nexport const PUBLIC_VERSION = '5';\n","import { PUBLIC_VERSION } from '../version.js';\n\nif (typeof window !== 'undefined') {\n\t// @ts-expect-error\n\t((window.__svelte ??= {}).v ??= new Set()).add(PUBLIC_VERSION);\n}\n","\nexport function keyEnter(fn) {\n return function (e) {\n return e.key === 'Enter' || e.key === ' ' && !e.preventDefault() // prevent page scroll down\n ? fn.call(this, e)\n : undefined;\n };\n}\n","\nexport function setContent(node, content) {\n let actions = {\n update(content) {\n if (typeof content == 'string') {\n node.innerText = content;\n } else if (content?.domNodes) {\n node.replaceChildren(...content.domNodes);\n } else if (content?.html) {\n node.innerHTML = content.html;\n }\n }\n };\n actions.update(content);\n\n return actions;\n}\n\n/** Dispatch event occurred outside of node */\nexport function outsideEvent(node, type) {\n\n const handlePointerDown = jsEvent => {\n if (node && !node.contains(jsEvent.target)) {\n node.dispatchEvent(\n new CustomEvent(type + 'outside', {detail: {jsEvent}})\n );\n }\n };\n\n document.addEventListener(type, handlePointerDown, true);\n\n return {\n destroy() {\n document.removeEventListener(type, handlePointerDown, true);\n }\n };\n}\n\nexport function observeResize(node, callback) {\n let resizeObserver = new ResizeObserver(entries => {\n for (let entry of entries) {\n callback(entry);\n }\n });\n resizeObserver.observe(node);\n\n return {\n destroy() {\n resizeObserver.unobserve(node);\n }\n };\n}\n","export const DAY_IN_SECONDS = 86400;\n\nexport function createDate(input = undefined) {\n if (input !== undefined) {\n return input instanceof Date ? _fromLocalDate(input) : _fromISOString(input);\n }\n\n return _fromLocalDate(new Date());\n}\n\nexport function createDuration(input) {\n if (typeof input === 'number') {\n input = {seconds: input};\n } else if (typeof input === 'string') {\n // Expected format hh[:mm[:ss]]\n let seconds = 0, exp = 2;\n for (let part of input.split(':', 3)) {\n seconds += parseInt(part, 10) * Math.pow(60, exp--);\n }\n input = {seconds};\n } else if (input instanceof Date) {\n input = {hours: input.getUTCHours(), minutes: input.getUTCMinutes(), seconds: input.getUTCSeconds()};\n }\n\n let weeks = input.weeks || input.week || 0;\n\n return {\n years: input.years || input.year || 0,\n months: input.months || input.month || 0,\n days: weeks * 7 + (input.days || input.day || 0),\n seconds: (input.hours || input.hour || 0) * 60 * 60 +\n (input.minutes || input.minute || 0) * 60 +\n (input.seconds || input.second || 0),\n inWeeks: !!weeks\n };\n}\n\nexport function cloneDate(date) {\n return new Date(date.getTime());\n}\n\nexport function addDuration(date, duration, x = 1) {\n date.setUTCFullYear(date.getUTCFullYear() + x * duration.years);\n let month = date.getUTCMonth() + x * duration.months;\n date.setUTCMonth(month);\n month %= 12;\n if (month < 0) {\n month += 12;\n }\n while (date.getUTCMonth() !== month) {\n subtractDay(date);\n }\n date.setUTCDate(date.getUTCDate() + x * duration.days);\n date.setUTCSeconds(date.getUTCSeconds() + x * duration.seconds);\n\n return date;\n}\n\nexport function subtractDuration(date, duration, x = 1) {\n return addDuration(date, duration, -x);\n}\n\nexport function addDay(date, x = 1) {\n date.setUTCDate(date.getUTCDate() + x);\n\n return date;\n}\n\nexport function subtractDay(date, x = 1) {\n return addDay(date, -x);\n}\n\nexport function setMidnight(date) {\n date.setUTCHours(0, 0, 0, 0);\n\n return date;\n}\n\nexport function toLocalDate(date) {\n return new Date(\n date.getUTCFullYear(),\n date.getUTCMonth(),\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds()\n );\n}\n\nexport function toISOString(date, len = 19) {\n return date.toISOString().substring(0, len);\n}\n\nexport function datesEqual(date1, ...dates2) {\n return dates2.every(date2 => date1.getTime() === date2.getTime());\n}\n\nexport function nextClosestDay(date, day) {\n let diff = day - date.getUTCDay();\n date.setUTCDate(date.getUTCDate() + (diff >= 0 ? diff : diff + 7));\n return date;\n}\n\nexport function prevClosestDay(date, day) {\n let diff = day - date.getUTCDay();\n date.setUTCDate(date.getUTCDate() + (diff <= 0 ? diff : diff - 7));\n return date;\n}\n\n/**\n * Check whether given date is string which contains no time part\n */\nexport function noTimePart(date) {\n return typeof date === 'string' && date.length <= 10;\n}\n\n/**\n * Copy time from one date to another\n */\nexport function copyTime(toDate, fromDate) {\n toDate.setUTCHours(fromDate.getUTCHours(), fromDate.getUTCMinutes(), fromDate.getUTCSeconds(), 0);\n\n return toDate;\n}\n\n/**\n * Get duration value in seconds\n */\nexport function toSeconds(duration) {\n return duration.seconds;\n}\n\n/**\n * Move the date forward (when pressing the next button)\n */\nexport function nextDate(date, duration) {\n addDuration(date, duration);\n return date;\n}\n\n/**\n * Move the date backward (when pressing the prev button)\n */\nexport function prevDate(date, duration, hiddenDays) {\n subtractDuration(date, duration);\n if (hiddenDays.length && hiddenDays.length < 7) {\n while (hiddenDays.includes(date.getUTCDay())) {\n subtractDay(date);\n }\n }\n return date;\n}\n\n/**\n * For a given date, get its week number\n * - ISO @see https://stackoverflow.com/questions/6117814/get-week-of-year-in-javascript-like-in-php\n * - Western @see https://en.wikipedia.org/wiki/Week#Other_week_numbering_systems\n */\nexport function getWeekNumber(date, firstDay) {\n // Copy date so don't modify original\n date = cloneDate(date);\n if (firstDay == 0) { // Western\n // Set to nearest Saturday: current date + 6 - current day number\n date.setUTCDate(date.getUTCDate() + 6 - date.getUTCDay());\n } else { // ISO\n // Set to nearest Thursday: current date + 4 - current day number\n // Make Sunday's day number 7\n date.setUTCDate(date.getUTCDate() + 4 - (date.getUTCDay() || 7));\n }\n // Get first day of year\n let yearStart = new Date(Date.UTC(date.getUTCFullYear(),0,1));\n // Calculate full weeks to `date`\n return Math.ceil((((date - yearStart) / 1000 / DAY_IN_SECONDS) + 1) / 7);\n}\n\n/**\n * Private functions\n */\n\nfunction _fromLocalDate(date) {\n return new Date(Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds()\n ));\n}\n\nfunction _fromISOString(str) {\n const parts = str.match(/\\d+/g);\n return new Date(Date.UTC(\n Number(parts[0]),\n Number(parts[1]) - 1,\n Number(parts[2]),\n Number(parts[3] || 0),\n Number(parts[4] || 0),\n Number(parts[5] || 0)\n ));\n}\n","export function assign(...args) {\n return Object.assign(...args);\n}\n\nexport function keys(object) {\n return Object.keys(object);\n}\n\nexport function entries(object) {\n return Object.entries(object);\n}\n\nexport function floor(value) {\n return Math.floor(value);\n}\n\nexport function ceil(value) {\n return Math.ceil(value);\n}\n\nexport function min(...args) {\n return Math.min(...args);\n}\n\nexport function max(...args) {\n return Math.max(...args);\n}\n\nexport function symbol() {\n return Symbol('ec');\n}\n\nexport function isArray(value) {\n return Array.isArray(value);\n}\n\nexport function isFunction(value) {\n return typeof value === 'function';\n}\n\nexport function run(fn) {\n return fn();\n}\n\nexport function runAll(fns) {\n fns.forEach(run);\n}\n\nexport function noop() {}\n\nexport const identity = (x) => x;\n\nexport function stopPropagation(fn) {\n return function (event) {\n event.stopPropagation();\n if (fn) {\n fn.call(this, event);\n }\n };\n}\n","import {runAll} from './utils.js';\n\nexport function debounce(fn, handle, queueStore) {\n queueStore.update(queue => queue.set(handle, fn));\n}\n\nexport function flushDebounce(queue) {\n runAll(queue);\n queue.clear();\n}\n\nexport function task(fn, handle, tasks) {\n handle ??= fn;\n if (!tasks.has(handle)) {\n tasks.set(handle, setTimeout(() => {\n tasks.delete(handle);\n fn();\n }));\n }\n}\n","import {symbol} from './utils.js';\n\nlet payloadProp = symbol();\nexport function setPayload(obj, payload) {\n obj[payloadProp] = payload;\n}\n\nexport function hasPayload(obj) {\n return !!obj?.[payloadProp];\n}\n\nexport function getPayload(obj) {\n return obj[payloadProp];\n}\n","import {hasPayload} from './payload.js';\n\nexport function createElement(tag, className, content, attrs = []) {\n let el = document.createElement(tag);\n el.className = className;\n if (typeof content == 'string') {\n el.innerText = content;\n } else if (content.domNodes) {\n el.replaceChildren(...content.domNodes);\n } else if (content.html) {\n el.innerHTML = content.html;\n }\n for (let attr of attrs) {\n el.setAttribute(...attr);\n }\n return el;\n}\n\nexport function hasYScroll(el) {\n return el.scrollHeight > el.clientHeight;\n}\n\nexport function rect(el) {\n return el.getBoundingClientRect();\n}\n\nexport function ancestor(el, up) {\n while (up--) {\n el = el.parentElement;\n }\n return el;\n}\n\nexport function height(el) {\n return rect(el).height;\n}\n\nexport function getElementWithPayload(x, y, root = document, processed = []) {\n processed.push(root);\n for (let el of root.elementsFromPoint(x, y)) {\n if (hasPayload(el)) {\n return el;\n }\n /** @see https://github.com/vkurko/calendar/issues/142 */\n if (el.shadowRoot && !processed.includes(el.shadowRoot)) {\n let shadowEl = getElementWithPayload(x, y, el.shadowRoot, processed);\n if (shadowEl) {\n return shadowEl;\n }\n }\n }\n return null;\n}\n\nexport function listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\n","import {assign} from './utils.js';\nimport {toLocalDate} from './date.js';\n\nexport function createView(view, _viewTitle, _currentRange, _activeRange) {\n return {\n type: view,\n title: _viewTitle,\n currentStart: _currentRange.start,\n currentEnd: _currentRange.end,\n activeStart: _activeRange.start,\n activeEnd: _activeRange.end,\n calendar: undefined\n };\n}\n\nexport function toViewWithLocalDates(view) {\n view = assign({}, view);\n view.currentStart = toLocalDate(view.currentStart);\n view.currentEnd = toLocalDate(view.currentEnd);\n view.activeStart = toLocalDate(view.activeStart);\n view.activeEnd = toLocalDate(view.activeEnd);\n\n return view;\n}\n\nexport function listView(view) {\n return view.startsWith('list');\n}\n\nexport function timelineView(view) {\n return view.includes('Timeline');\n}\n","import {addDay, addDuration, datesEqual, createDate, cloneDate, setMidnight, toLocalDate, toISOString, noTimePart, copyTime} from './date.js';\nimport {createElement} from './dom.js';\nimport {assign, isArray, isFunction} from './utils.js';\nimport {toViewWithLocalDates} from './view.js';\n\nlet eventId = 1;\nexport function createEvents(input) {\n return input.map(event => {\n let result = {\n id: 'id' in event ? String(event.id) : `{generated-${eventId++}}`,\n resourceIds: toArrayProp(event, 'resourceId').map(String),\n allDay: event.allDay ?? (noTimePart(event.start) && noTimePart(event.end)),\n start: createDate(event.start),\n end: createDate(event.end),\n title: event.title ?? '',\n editable: event.editable,\n startEditable: event.startEditable,\n durationEditable: event.durationEditable,\n display: event.display ?? 'auto',\n extendedProps: event.extendedProps ?? {},\n backgroundColor: event.backgroundColor ?? event.color,\n textColor: event.textColor,\n classNames: toArrayProp(event, 'className'),\n styles: toArrayProp(event, 'style')\n };\n\n if (result.allDay) {\n // Make sure all-day events start and end at midnight\n setMidnight(result.start);\n let end = cloneDate(result.end);\n setMidnight(result.end);\n if (\n !datesEqual(result.end, end) ||\n datesEqual(result.end, result.start) /** @see https://github.com/vkurko/calendar/issues/50 */\n ) {\n addDay(result.end);\n }\n }\n\n return result;\n });\n}\n\nfunction toArrayProp(input, propName) {\n let result = input[propName + 's'] ?? input[propName] ?? [];\n return isArray(result) ? result : [result];\n}\n\nexport function createEventSources(input) {\n return input.map(source => ({\n events: source.events,\n url: (source.url && source.url.trimEnd('&')) || '',\n method: (source.method && source.method.toUpperCase()) || 'GET',\n extraParams: source.extraParams || {}\n }));\n}\n\nexport function createEventChunk(event, start, end) {\n let chunk = {\n start: event.start > start ? event.start : start,\n end: event.end < end ? event.end : end,\n event\n };\n chunk.zeroDuration = datesEqual(chunk.start, chunk.end);\n\n return chunk;\n}\n\nexport function sortEventChunks(chunks) {\n // Sort by start date (all-day events always on top)\n chunks.sort((a, b) => a.start - b.start || b.event.allDay - a.event.allDay);\n}\n\nexport function createEventContent(chunk, displayEventEnd, eventContent, theme, _intlEventTime, _view) {\n let timeText = _intlEventTime.formatRange(\n chunk.start,\n displayEventEnd && chunk.event.display !== 'pointer' && !chunk.zeroDuration\n ? copyTime(cloneDate(chunk.start), chunk.end) // make Intl.formatRange output only the time part\n : chunk.start\n );\n let content;\n\n if (eventContent) {\n content = isFunction(eventContent)\n ? eventContent({\n event: toEventWithLocalDates(chunk.event),\n timeText,\n view: toViewWithLocalDates(_view)\n })\n : eventContent;\n }\n\n if (content === undefined) {\n let domNodes;\n switch (chunk.event.display) {\n case 'background':\n domNodes = [];\n break;\n case 'pointer':\n domNodes = [createTimeElement(timeText, chunk, theme)];\n break;\n default:\n domNodes = [\n ...chunk.event.allDay ? [] : [createTimeElement(timeText, chunk, theme)],\n createElement('h4', theme.eventTitle, chunk.event.title)\n ];\n }\n content = {domNodes};\n }\n\n return [timeText, content];\n}\n\nfunction createTimeElement(timeText, chunk, theme) {\n return createElement(\n 'time',\n theme.eventTime,\n timeText,\n [['datetime', toISOString(chunk.start)]]\n );\n}\n\nexport function createEventClasses(eventClassNames, event, _view) {\n let result = event.classNames;\n if (eventClassNames) {\n if (isFunction(eventClassNames)) {\n eventClassNames = eventClassNames({\n event: toEventWithLocalDates(event),\n view: toViewWithLocalDates(_view)\n });\n }\n result = [\n ...isArray(eventClassNames) ? eventClassNames : [eventClassNames],\n ...result\n ];\n }\n return result;\n}\n\nexport function toEventWithLocalDates(event) {\n return _cloneEvent(event, toLocalDate);\n}\n\nexport function cloneEvent(event) {\n return _cloneEvent(event, cloneDate);\n}\n\nfunction _cloneEvent(event, dateFn) {\n event = assign({}, event);\n event.start = dateFn(event.start);\n event.end = dateFn(event.end);\n\n return event;\n}\n\n/**\n * Prepare event chunks for month view and all-day slot in week view\n */\nexport function prepareEventChunks(chunks, hiddenDays) {\n let longChunks = {};\n\n if (chunks.length) {\n sortEventChunks(chunks);\n\n let prevChunk;\n for (let chunk of chunks) {\n let dates = [];\n let date = setMidnight(cloneDate(chunk.start));\n while (chunk.end > date) {\n if (!hiddenDays.includes(date.getUTCDay())) {\n dates.push(cloneDate(date));\n if (dates.length > 1) {\n let key = date.getTime();\n if (longChunks[key]) {\n longChunks[key].chunks.push(chunk);\n } else {\n longChunks[key] = {\n sorted: false,\n chunks: [chunk]\n };\n }\n }\n }\n addDay(date);\n }\n if (dates.length) {\n chunk.date = dates[0];\n chunk.days = dates.length;\n chunk.dates = dates;\n // Adjust the start and end dates of the chunk if hidden days affected them\n if (chunk.start < dates[0]) {\n chunk.start = dates[0];\n }\n let maxEnd = addDay(cloneDate(dates.at(-1)));\n if (chunk.end > maxEnd) {\n chunk.end = maxEnd;\n }\n } else {\n chunk.date = setMidnight(cloneDate(chunk.start));\n chunk.days = 1;\n chunk.dates = [chunk.date];\n }\n\n if (prevChunk && datesEqual(prevChunk.date, chunk.date)) {\n chunk.prev = prevChunk;\n }\n prevChunk = chunk;\n }\n }\n\n return longChunks;\n}\n\nexport function repositionEvent(chunk, longChunks, height) {\n chunk.top = 0;\n if (chunk.prev) {\n chunk.top = chunk.prev.bottom + 1;\n }\n chunk.bottom = chunk.top + height;\n let margin = 1;\n let key = chunk.date.getTime();\n if (longChunks[key]) {\n if (!longChunks[key].sorted) {\n longChunks[key].chunks.sort((a, b) => a.top - b.top);\n longChunks[key].sorted = true;\n }\n for (let longChunk of longChunks[key].chunks) {\n if (chunk.top < longChunk.bottom && chunk.bottom > longChunk.top) {\n let offset = longChunk.bottom - chunk.top + 1;\n margin += offset;\n chunk.top += offset;\n chunk.bottom += offset;\n }\n }\n }\n\n return margin;\n}\n\nexport function runReposition(refs, data) {\n refs.length = data.length;\n let result = [];\n for (let ref of refs) {\n result.push(ref?.reposition?.());\n }\n return result;\n}\n\n/**\n * Check whether the event intersects with the given date range and resources\n * @param event\n * @param start\n * @param end\n * @param resources\n * @return boolean\n */\nexport function eventIntersects(event, start, end, resources) {\n if (event.start < end && event.end > start) {\n if (resources) {\n if (!isArray(resources)) {\n resources = [resources];\n }\n return resources.some(resource => event.resourceIds.includes(resource.id));\n }\n return true;\n }\n return false;\n}\n\nexport function helperEvent(display) {\n return previewEvent(display) || ghostEvent(display) || pointerEvent(display);\n}\n\nexport function bgEvent(display) {\n return display === 'background';\n}\n\nexport function previewEvent(display) {\n return display === 'preview';\n}\n\nexport function ghostEvent(display) {\n return display === 'ghost';\n}\n\nexport function pointerEvent(display) {\n return display === 'pointer';\n}\n","\nexport function btnTextDay(text) {\n return btnText(text, 'day');\n}\n\nexport function btnTextWeek(text) {\n return btnText(text, 'week');\n}\n\nexport function btnTextMonth(text) {\n return btnText(text, 'month');\n}\n\nexport function btnTextYear(text) {\n return btnText(text, 'year');\n}\n\nfunction btnText(text, period) {\n return {\n ...text,\n next: 'Next ' + period,\n prev: 'Previous ' + period\n };\n}\n\nexport function themeView(view) {\n return theme => ({...theme, view});\n}\n","import {createDate, setMidnight} from './date.js';\n\nexport function createDateRange(input) {\n let start, end;\n if (input) {\n ({start, end} = input);\n if (start) {\n start = setMidnight(createDate(start));\n }\n if (end) {\n end = setMidnight(createDate(end));\n }\n }\n return {start, end};\n}\n\nexport function outsideRange(date, range) {\n return range.start && date < range.start || range.end && date > range.end;\n}\n\nexport function limitToRange(date, range) {\n if (range.start && date < range.start) {\n date = range.start;\n }\n if (range.end && date > range.end) {\n date = range.end;\n }\n return date;\n}\n","import {setPayload} from './payload.js';\n\nexport function createResources(input) {\n let result = [];\n _createResources(input, 0, result);\n return result;\n}\n\nfunction _createResources(input, level, flat) {\n let result = [];\n for (let item of input) {\n let resource = createResource(item);\n result.push(resource);\n flat.push(resource);\n let payload = {\n level,\n children: [],\n expanded: true,\n hidden: false\n };\n setPayload(resource, payload);\n if (item.children) {\n payload.children = _createResources(item.children, level + 1, flat);\n }\n }\n return result;\n}\n\nexport function createResource(input) {\n return {\n id: String(input.id),\n title: input.title || '',\n eventBackgroundColor: input.eventBackgroundColor,\n eventTextColor: input.eventTextColor,\n extendedProps: input.extendedProps ?? {}\n };\n}\n\nexport function resourceBackgroundColor(event, resources) {\n return findResource(event, resources)?.eventBackgroundColor;\n}\n\nexport function resourceTextColor(event, resources) {\n return findResource(event, resources)?.eventTextColor;\n}\n\nfunction findResource(event, resources) {\n return resources.find(resource => event.resourceIds.includes(resource.id));\n}\n","import {derived} from 'svelte/store';\nimport {isFunction} from './utils.js';\nimport {toLocalDate} from './date.js';\nimport {createResources} from './resources.js';\nimport {getPayload} from './payload.js';\n\nexport function intl(locale, format) {\n return derived([locale, format], ([$locale, $format]) => {\n let intl = isFunction($format)\n ? {format: $format}\n : new Intl.DateTimeFormat($locale, $format);\n return {\n format: date => intl.format(toLocalDate(date))\n };\n });\n}\n\nexport function intlRange(locale, format) {\n return derived([locale, format], ([$locale, $format]) => {\n let formatRange;\n if (isFunction($format)) {\n formatRange = $format;\n } else {\n let intl = new Intl.DateTimeFormat($locale, $format);\n formatRange = (start, end) => {\n if (start <= end) {\n return intl.formatRange(start, end);\n } else {\n // In iOS 16 and older, intl.formatRange() throws an exception if the start date is later than the end date.\n // Therefore, we first swap the parameters, and then swap the resulting parts.\n /** @see https://github.com/vkurko/calendar/issues/227 */\n let parts = intl.formatRangeToParts(end, start);\n let result = '';\n let sources = ['startRange', 'endRange'];\n let processed = [false, false];\n for (let part of parts) {\n let i = sources.indexOf(part.source);\n if (i >= 0) {\n if (!processed[i]) {\n result += _getParts(sources[1 - i], parts);\n processed[i] = true;\n }\n } else {\n result += part.value;\n }\n }\n return result;\n }\n };\n }\n return {\n formatRange: (start, end) => formatRange(toLocalDate(start), toLocalDate(end))\n };\n });\n}\n\nfunction _getParts(source, parts) {\n let result = '';\n for (let part of parts) {\n if (part.source == source) {\n result += part.value;\n }\n }\n return result;\n}\n\nexport function viewResources(state) {\n return derived(\n [state.resources, state.filterResourcesWithEvents, state._filteredEvents, state._activeRange],\n ([$resources, $filterResourcesWithEvents, $_filteredEvents, $_activeRange]) => {\n let result = $resources.filter(resource => !getPayload(resource).hidden);\n\n if ($filterResourcesWithEvents) {\n result = $resources.filter(resource => {\n for (let event of $_filteredEvents) {\n if (\n event.display !== 'background' &&\n event.resourceIds.includes(resource.id) &&\n event.start < $_activeRange.end &&\n event.end > $_activeRange.start\n ) {\n return true;\n }\n }\n return false;\n });\n }\n\n if (!result.length) {\n result = createResources([{}]);\n }\n\n return result;\n }\n );\n}\n","import {addDuration, cloneDate, createDuration, DAY_IN_SECONDS, toISOString, toSeconds} from './date.js';\nimport {max as maxFn, min as minFn, isFunction} from './utils.js';\nimport {bgEvent} from './events.js';\n\nexport function createTimes(date, $slotDuration, $slotLabelInterval, $_slotTimeLimits, $_intlSlotLabel) {\n date = cloneDate(date);\n let times = [];\n let end = cloneDate(date);\n addDuration(date, $_slotTimeLimits.min);\n addDuration(end, $_slotTimeLimits.max);\n // Labels\n if ($slotLabelInterval === undefined) {\n $slotLabelInterval = $slotDuration.seconds < 3600\n ? createDuration($slotDuration.seconds * 2)\n : $slotDuration;\n }\n let label = cloneDate(date);\n // Build times\n while (date < end) {\n times.push([\n toISOString(date),\n $_intlSlotLabel.format(date),\n date >= label\n ]);\n while ($slotLabelInterval.seconds && date >= label) {\n addDuration(label, $slotLabelInterval);\n }\n addDuration(date, $slotDuration);\n }\n\n return times;\n}\n\nexport function createSlotTimeLimits($slotMinTime, $slotMaxTime, $flexibleSlotTimeLimits, $_viewDates, $_filteredEvents) {\n let min = createDuration($slotMinTime);\n let max = createDuration($slotMaxTime);\n\n if ($flexibleSlotTimeLimits) {\n // If slotMaxTime goes past midnight, then extend it back by a maximum of 24 hours\n let minMin = createDuration(minFn(toSeconds(min), maxFn(0, toSeconds(max) - DAY_IN_SECONDS)));\n let maxMax = createDuration(maxFn(toSeconds(max), toSeconds(minMin) + DAY_IN_SECONDS));\n let filter = isFunction($flexibleSlotTimeLimits?.eventFilter)\n ? $flexibleSlotTimeLimits.eventFilter\n : event => !bgEvent(event.display);\n loop: for (let date of $_viewDates) {\n let start = addDuration(cloneDate(date), min);\n let end = addDuration(cloneDate(date), max);\n let minStart = addDuration(cloneDate(date), minMin);\n let maxEnd = addDuration(cloneDate(date), maxMax);\n for (let event of $_filteredEvents) {\n if (!event.allDay && filter(event) && event.start < maxEnd && event.end > minStart) {\n if (event.start < start) {\n let seconds = maxFn((event.start - date) / 1000, toSeconds(minMin));\n if (seconds < toSeconds(min)) {\n min.seconds = seconds;\n }\n }\n if (event.end > end) {\n let seconds = minFn((event.end - date) / 1000, toSeconds(maxMax));\n if (seconds > toSeconds(max)) {\n max.seconds = seconds;\n }\n }\n if (toSeconds(min) === toSeconds(minMin) && toSeconds(max) === toSeconds(maxMax)) {\n break loop;\n }\n }\n }\n }\n }\n\n return {min, max};\n}\n","import {\n createDate, createDuration, createEvents, createEventSources, createResources, createDateRange, keys, setMidnight\n} from '#lib';\n\nexport function createOptions(plugins) {\n let options = {\n allDayContent: undefined,\n allDaySlot: true,\n buttonText: {\n today: 'today',\n },\n customButtons: {},\n date: new Date(),\n datesSet: undefined,\n dayHeaderFormat: {\n weekday: 'short',\n month: 'numeric',\n day: 'numeric'\n },\n dayHeaderAriaLabelFormat: {\n dateStyle: 'full'\n },\n displayEventEnd: true,\n duration: {weeks: 1},\n events: [],\n eventAllUpdated: undefined,\n eventBackgroundColor: undefined,\n eventClassNames: undefined,\n eventClick: undefined,\n eventColor: undefined,\n eventContent: undefined,\n eventDidMount: undefined,\n eventFilter: undefined, // ec option\n eventMouseEnter: undefined,\n eventMouseLeave: undefined,\n eventSources: [],\n eventTextColor: undefined,\n eventTimeFormat: {\n hour: 'numeric',\n minute: '2-digit'\n },\n filterEventsWithResources: false,\n filterResourcesWithEvents: false,\n firstDay: 0,\n flexibleSlotTimeLimits: false, // ec option\n headerToolbar: {\n start: 'title',\n center: '',\n end: 'today prev,next'\n },\n height: undefined,\n hiddenDays: [],\n highlightedDates: [], // ec option\n lazyFetching: true,\n loading: undefined,\n locale: undefined,\n nowIndicator: false,\n resourceLabelContent: undefined,\n resourceLabelDidMount: undefined,\n resources: [],\n selectable: false,\n scrollTime: '06:00:00',\n slotDuration: '00:30:00',\n slotEventOverlap: true,\n slotHeight: 24, // ec option\n slotLabelInterval: undefined,\n slotLabelFormat: {\n hour: 'numeric',\n minute: '2-digit'\n },\n slotMaxTime: '24:00:00',\n slotMinTime: '00:00:00',\n slotWidth: 72,\n theme: {\n allDay: 'ec-all-day',\n active: 'ec-active',\n bgEvent: 'ec-bg-event',\n bgEvents: 'ec-bg-events',\n body: 'ec-body',\n button: 'ec-button',\n buttonGroup: 'ec-button-group',\n calendar: 'ec',\n content: 'ec-content',\n day: 'ec-day',\n dayHead: 'ec-day-head',\n days: 'ec-days',\n disabled: 'ec-disabled',\n event: 'ec-event',\n eventBody: 'ec-event-body',\n eventTime: 'ec-event-time',\n eventTitle: 'ec-event-title',\n events: 'ec-events',\n extra: 'ec-extra',\n handle: 'ec-handle',\n header: 'ec-header',\n hiddenScroll: 'ec-hidden-scroll',\n highlight: 'ec-highlight',\n icon: 'ec-icon',\n line: 'ec-line',\n lines: 'ec-lines',\n minor: 'ec-minor',\n nowIndicator: 'ec-now-indicator',\n otherMonth: 'ec-other-month',\n resource: 'ec-resource',\n sidebar: 'ec-sidebar',\n sidebarTitle: 'ec-sidebar-title',\n today: 'ec-today',\n time: 'ec-time',\n title: 'ec-title',\n toolbar: 'ec-toolbar',\n view: '',\n weekdays: ['ec-sun', 'ec-mon', 'ec-tue', 'ec-wed', 'ec-thu', 'ec-fri', 'ec-sat'],\n withScroll: 'ec-with-scroll'\n },\n titleFormat: {\n year: 'numeric',\n month: 'short',\n day: 'numeric'\n },\n validRange: undefined,\n view: undefined,\n viewDidMount: undefined,\n views: {}\n };\n\n for (let plugin of plugins) {\n plugin.createOptions?.(options);\n }\n\n return options;\n}\n\nexport function createParsers(plugins) {\n let parsers = {\n date: date => setMidnight(createDate(date)),\n duration: createDuration,\n events: createEvents,\n eventSources: createEventSources,\n hiddenDays: days => [...new Set(days)],\n highlightedDates: dates => dates.map(date => setMidnight(createDate(date))),\n resources: createResources,\n scrollTime: createDuration,\n slotDuration: createDuration,\n slotLabelInterval: input => input !== undefined ? createDuration(input) : undefined,\n slotMaxTime: createDuration,\n slotMinTime: createDuration,\n validRange: createDateRange\n };\n\n for (let plugin of plugins) {\n plugin.createParsers?.(parsers);\n }\n\n return parsers;\n}\n\nexport function diff(options, prevOptions) {\n let diff = [];\n for (let key of keys(options)) {\n if (options[key] !== prevOptions[key]) {\n diff.push([key, options[key]]);\n }\n }\n return diff;\n}\n","import {derived, get, readable, writable} from 'svelte/store';\nimport {\n addDay, addDuration, assign, cloneDate, createDate, createEvents, createView, DAY_IN_SECONDS, debounce,\n isFunction, nextClosestDay, prevClosestDay, setMidnight, subtractDay, toISOString, toLocalDate\n} from '#lib';\n\nexport function dayGrid(state) {\n return derived(state.view, $view => $view?.startsWith('dayGrid'));\n}\n\nexport function activeRange(state) {\n return derived(\n [state._currentRange, state.firstDay, state.slotMaxTime, state._dayGrid],\n ([$_currentRange, $firstDay, $slotMaxTime, $_dayGrid]) => {\n let start = cloneDate($_currentRange.start);\n let end = cloneDate($_currentRange.end);\n\n if ($_dayGrid) {\n // First day of week\n prevClosestDay(start, $firstDay);\n nextClosestDay(end, $firstDay);\n } else if ($slotMaxTime.days || $slotMaxTime.seconds > DAY_IN_SECONDS) {\n addDuration(subtractDay(end), $slotMaxTime);\n let start2 = subtractDay(cloneDate(end));\n if (start2 < start) {\n start = start2;\n }\n }\n\n return {start, end};\n }\n );\n}\n\nexport function currentRange(state) {\n return derived(\n [state.date, state.duration, state.firstDay],\n ([$date, $duration, $firstDay]) => {\n let start = cloneDate($date), end;\n if ($duration.months) {\n start.setUTCDate(1);\n } else if ($duration.inWeeks) {\n // First day of week\n prevClosestDay(start, $firstDay);\n }\n end = addDuration(cloneDate(start), $duration);\n\n return {start, end};\n }\n );\n}\n\nexport function viewDates(state) {\n return derived([state._activeRange, state.hiddenDays], ([$_activeRange, $hiddenDays]) => {\n let dates = [];\n let date = setMidnight(cloneDate($_activeRange.start));\n let end = setMidnight(cloneDate($_activeRange.end));\n while (date < end) {\n if (!$hiddenDays.includes(date.getUTCDay())) {\n dates.push(cloneDate(date));\n }\n addDay(date);\n }\n if (!dates.length && $hiddenDays.length && $hiddenDays.length < 7) {\n // Try to move the date\n state.date.update(date => {\n while ($hiddenDays.includes(date.getUTCDay())) {\n addDay(date);\n }\n return date;\n });\n dates = get(state._viewDates);\n }\n\n return dates;\n });\n}\n\nexport function viewTitle(state) {\n return derived(\n [state.date, state._activeRange, state._intlTitle, state._dayGrid],\n ([$date, $_activeRange, $_intlTitle, $_dayGrid]) => {\n return $_dayGrid\n ? $_intlTitle.formatRange($date, $date)\n : $_intlTitle.formatRange($_activeRange.start, subtractDay(cloneDate($_activeRange.end)));\n }\n );\n}\n\nexport function view(state) {\n return derived([state.view, state._viewTitle, state._currentRange, state._activeRange], args => createView(...args));\n}\n\nexport function events(state) {\n let _events = writable([]);\n let abortController;\n let fetching = 0;\n let debounceHandle = {};\n derived(\n [state.events, state.eventSources, state._activeRange, state._fetchedRange, state.lazyFetching, state.loading],\n (values, set) => debounce(() => {\n let [$events, $eventSources, $_activeRange, $_fetchedRange, $lazyFetching, $loading] = values;\n if (!$eventSources.length) {\n set($events);\n return;\n }\n // Do not fetch if new range is within the previous one\n if (!$_fetchedRange.start || $_fetchedRange.start > $_activeRange.start || $_fetchedRange.end < $_activeRange.end || !$lazyFetching) {\n if (abortController) {\n // Abort previous request\n abortController.abort();\n }\n // Create new abort controller\n abortController = new AbortController();\n // Call loading hook\n if (isFunction($loading) && !fetching) {\n $loading(true);\n }\n let stopLoading = () => {\n if (--fetching === 0 && isFunction($loading)) {\n $loading(false);\n }\n };\n let events = [];\n // Prepare handlers\n let failure = e => stopLoading();\n let success = data => {\n events = events.concat(createEvents(data));\n set(events);\n stopLoading();\n };\n // Prepare other stuff\n let startStr = toISOString($_activeRange.start)\n let endStr = toISOString($_activeRange.end);\n // Loop over event sources\n for (let source of $eventSources) {\n if (isFunction(source.events)) {\n // Events as a function\n let result = source.events({\n start: toLocalDate($_activeRange.start),\n end: toLocalDate($_activeRange.end),\n startStr,\n endStr\n }, success, failure);\n if (result !== undefined) {\n Promise.resolve(result).then(success, failure);\n }\n } else {\n // Events as a JSON feed\n // Prepare params\n let params = isFunction(source.extraParams) ? source.extraParams() : assign({}, source.extraParams);\n params.start = startStr;\n params.end = endStr;\n params = new URLSearchParams(params);\n // Prepare fetch\n let url = source.url, headers = {}, body;\n if (['GET', 'HEAD'].includes(source.method)) {\n url += (url.includes('?') ? '&' : '?') + params;\n } else {\n headers['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';\n body = String(params); // Safari 10.1 doesn't convert to string automatically\n }\n // Do the fetch\n fetch(url, {method: source.method, headers, body, signal: abortController.signal, credentials: 'same-origin'})\n .then(response => response.json())\n .then(success)\n .catch(failure);\n }\n ++fetching;\n }\n // Save current range for future requests\n $_fetchedRange.start = $_activeRange.start;\n $_fetchedRange.end = $_activeRange.end;\n }\n }, debounceHandle, state._queue),\n []\n ).subscribe(_events.set);\n\n return _events;\n}\n\nexport function filteredEvents(state){\n let view;\n state._view.subscribe($_view => view = $_view);\n let debounceHandle = {};\n return derived(\n [state._events, state.eventFilter],\n (values, set) => debounce(() => {\n let [$_events, $eventFilter] = values;\n set(\n isFunction($eventFilter)\n ? $_events.filter((event, index, events) => $eventFilter({\n event,\n index,\n events,\n view\n }))\n : $_events\n );\n }, debounceHandle, state._queue),\n []\n );\n}\n\nexport function now() {\n return readable(createDate(), set => {\n let interval = setInterval(() => {\n set(createDate());\n }, 1000);\n\n return () => clearInterval(interval);\n });\n}\n\nexport function today(state) {\n return derived(state._now, $_now => setMidnight(cloneDate($_now)));\n}\n","import {get, writable} from 'svelte/store';\nimport {tick} from 'svelte';\nimport {createOptions, createParsers} from './options.js';\nimport {activeRange, currentRange, dayGrid, events, now, today, view as view2, viewDates, viewTitle, filteredEvents} from './stores.js';\nimport {identity, intl, intlRange, isFunction, keys, toViewWithLocalDates} from '#lib';\n\nexport default class {\n constructor(plugins, input) {\n plugins = plugins || [];\n\n // Create options\n let options = createOptions(plugins);\n let parsers = createParsers(plugins);\n\n // Parse options\n options = parseOpts(options, parsers);\n input = parseOpts(input, parsers);\n\n // Create stores for options\n for (let [option, value] of Object.entries(options)) {\n this[option] = writable(value);\n }\n\n // Private stores\n this._queue = writable(new Map()); // debounce queue (beforeUpdate)\n this._tasks = new Map(); // timeout IDs for tasks\n this._auxiliary = writable([]); // auxiliary components\n this._dayGrid = dayGrid(this);\n this._currentRange = currentRange(this);\n this._activeRange = activeRange(this);\n this._fetchedRange = writable({start: undefined, end: undefined});\n this._events = events(this);\n this._now = now();\n this._today = today(this);\n this._intlEventTime = intlRange(this.locale, this.eventTimeFormat);\n this._intlSlotLabel = intl(this.locale, this.slotLabelFormat);\n this._intlDayHeader = intl(this.locale, this.dayHeaderFormat);\n this._intlDayHeaderAL = intl(this.locale, this.dayHeaderAriaLabelFormat);\n this._intlTitle = intlRange(this.locale, this.titleFormat);\n this._bodyEl = writable(undefined);\n this._scrollable = writable(false);\n this._recheckScrollable = writable(false);\n this._viewTitle = viewTitle(this);\n this._viewDates = viewDates(this);\n this._view = view2(this);\n this._viewComponent = writable(undefined);\n this._filteredEvents = filteredEvents(this);\n // Interaction\n this._interaction = writable({});\n this._iEvents = writable([null, null]); // interaction events: [drag/resize, pointer]\n this._iClasses = writable(identity); // interaction event css classes\n this._iClass = writable(undefined); // interaction css class for entire calendar\n\n // Set & Get\n this._set = (key, value) => {\n if (validKey(key, this)) {\n if (parsers[key]) {\n value = parsers[key](value);\n }\n this[key].set(value);\n }\n };\n this._get = key => validKey(key, this) ? get(this[key]) : undefined;\n\n // Let plugins create their private stores\n for (let plugin of plugins) {\n plugin.createStores?.(this);\n }\n\n if (input.view) {\n // Set initial view based on input\n this.view.set(input.view);\n }\n\n // Set options for each view\n let views = new Set([...keys(options.views), ...keys(input.views ?? {})]);\n for (let view of views) {\n let defOpts = mergeOpts(options, options.views[view] ?? {});\n let opts = mergeOpts(defOpts, input, input.views?.[view] ?? {});\n let component = opts.component;\n // Make sure we deal with valid opts from now on\n filterOpts(opts, this);\n // Process options\n for (let key of keys(opts)) {\n let {set, _set = set, ...rest} = this[key];\n\n this[key] = {\n // Set value in all views\n set: ['buttonText', 'theme'].includes(key)\n ? value => {\n if (isFunction(value)) {\n let result = value(defOpts[key]);\n opts[key] = result;\n set(set === _set ? result : value);\n } else {\n opts[key] = value;\n set(value);\n }\n }\n : value => {\n opts[key] = value;\n set(value);\n },\n _set,\n ...rest\n };\n }\n // When view changes...\n this.view.subscribe(newView => {\n if (newView === view) {\n // switch view component\n this._viewComponent.set(component);\n if (isFunction(opts.viewDidMount)) {\n tick().then(() => opts.viewDidMount({\n view: toViewWithLocalDates(get(this._view))\n }));\n }\n // update store values\n for (let key of keys(opts)) {\n this[key]._set(opts[key]);\n }\n }\n });\n }\n }\n}\n\nfunction parseOpts(opts, parsers) {\n let result = {...opts};\n for (let key of keys(parsers)) {\n if (key in result) {\n result[key] = parsers[key](result[key]);\n }\n }\n if (opts.views) {\n result.views = {};\n for (let view of keys(opts.views)) {\n result.views[view] = parseOpts(opts.views[view], parsers);\n }\n }\n return result;\n}\n\nfunction mergeOpts(...args) {\n let result = {};\n for (let opts of args) {\n let override = {};\n for (let key of ['buttonText', 'theme']) {\n if (isFunction(opts[key])) {\n override[key] = opts[key](result[key]);\n }\n }\n result = {\n ...result,\n ...opts,\n ...override\n };\n }\n return result;\n}\n\nfunction filterOpts(opts, state) {\n keys(opts)\n .filter(key => !validKey(key, state) || key === 'view')\n .forEach(key => delete opts[key]);\n}\n\nfunction validKey(key, state) {\n return state.hasOwnProperty(key) && key[0] !== '_';\n}\n","import { enable_legacy_mode_flag } from './index.js';\n\nenable_legacy_mode_flag();\n","<script>\n import {getContext, tick} from 'svelte';\n import {createDate, cloneDate, setContent, setMidnight, nextDate, prevDate, outsideRange} from '#lib';\n\n export let buttons;\n\n let {\n _currentRange, _viewTitle, _viewDates, buttonText, customButtons, date, duration, hiddenDays, theme, validRange,\n view\n } = getContext('state');\n\n let today = setMidnight(createDate());\n let prevDisabled, nextDisabled, todayDisabled;\n\n let running = false;\n function isRunning() {\n return running;\n }\n $: if (!isRunning()) {\n running = true;\n prevDisabled = false;\n nextDisabled = false;\n if ($validRange.start) {\n let currentDate = cloneDate($date);\n $date = prevDate($date, $duration, $hiddenDays);\n prevDisabled = test();\n $date = currentDate;\n }\n if ($validRange.end) {\n let currentDate = cloneDate($date);\n $date = nextDate($date, $duration);\n nextDisabled = test();\n $date = currentDate;\n }\n todayDisabled = today >= $_currentRange.start && today < $_currentRange.end;\n if (!todayDisabled && ($validRange.start || $validRange.end)) {\n let currentDate = cloneDate($date);\n $date = cloneDate(today);\n todayDisabled = test();\n $date = currentDate;\n }\n tick().then(() => running = false);\n }\n\n function test() {\n return $_viewDates.every(date => outsideRange(date, $validRange));\n }\n\n function prev() {\n $date = prevDate($date, $duration, $hiddenDays);\n }\n\n function next() {\n $date = nextDate($date, $duration);\n }\n</script>\n\n{#each buttons as button}\n {#if button == 'title'}\n <!-- svelte-ignore a11y-missing-content -->\n <h2 class=\"{$theme.title}\" use:setContent={$_viewTitle}></h2>\n {:else if button == 'prev'}\n <button\n class=\"{$theme.button} ec-{button}\"\n aria-label={$buttonText.prev}\n title={$buttonText.prev}\n on:click={prev}\n disabled={prevDisabled}\n ><i class=\"{$theme.icon} ec-{button}\"></i></button>\n {:else if button == 'next'}\n <button\n class=\"{$theme.button} ec-{button}\"\n aria-label={$buttonText.next}\n title={$buttonText.next}\n on:click={next}\n disabled={nextDisabled}\n ><i class=\"{$theme.icon} ec-{button}\"></i></button>\n {:else if button == 'today'}\n <button\n class=\"{$theme.button} ec-{button}\"\n on:click={() => $date = cloneDate(today)}\n disabled={todayDisabled}\n >{$buttonText[button]}</button>\n {:else if $customButtons[button]}\n <!-- svelte-ignore a11y_consider_explicit_label -->\n <button\n class=\"{$theme.button} ec-{button}{$customButtons[button].active ? ' ' + $theme.active : ''}\"\n on:click={$customButtons[button].click}\n use:setContent={$customButtons[button].text}\n ></button>\n {:else if button != ''}\n <button\n class=\"{$theme.button}{$view === button ? ' ' + $theme.active : ''} ec-{button}\"\n on:click={() => $view = button}\n >{$buttonText[button]}</button>\n {/if}\n{/each}\n","<script>\n import {getContext} from 'svelte';\n import {keys} from '#lib';\n import Buttons from './Buttons.svelte';\n\n let {headerToolbar, theme} = getContext('state');\n\n let sections = $derived.by(() => {\n let sections = {};\n for (let key of ['start', 'center', 'end']) {\n sections[key] = $headerToolbar[key]?.split(' ').map(group => group.split(',')) ?? [];\n }\n return sections;\n });\n</script>\n\n<nav class=\"{$theme.toolbar}\">\n {#each keys(sections) as key}\n <div class=\"ec-{key}\">\n {#each sections[key] as buttons}\n {#if buttons.length > 1}\n <div class=\"{$theme.buttonGroup}\">\n <Buttons {buttons}/>\n </div>\n {:else}\n <Buttons {buttons}/>\n {/if}\n {/each}\n </div>\n {/each}\n</nav>\n","<script>\n import {getContext, untrack} from 'svelte';\n import {\n toISOString, toLocalDate, toViewWithLocalDates, isFunction, task, flushDebounce, hasYScroll\n } from '#lib';\n\n let {\n datesSet, eventAllUpdated, _auxiliary, _activeRange, _filteredEvents, _scrollable, _bodyEl, _tasks, _recheckScrollable,\n _queue, _view\n } = getContext('state');\n\n // datesSet callback\n $effect(() => {\n $_activeRange;\n untrack(() => {\n if (isFunction($datesSet)) {\n $datesSet({\n start: toLocalDate($_activeRange.start),\n end: toLocalDate($_activeRange.end),\n startStr: toISOString($_activeRange.start),\n endStr: toISOString($_activeRange.end),\n view: toViewWithLocalDates($_view)\n });\n }\n });\n });\n\n // eventAllUpdated callback\n $effect(() => {\n $_filteredEvents;\n untrack(() => {\n if (isFunction($eventAllUpdated)) {\n task(() => $eventAllUpdated({view: toViewWithLocalDates($_view)}), 'eau', _tasks);\n }\n });\n });\n\n $effect(() => {\n $_queue;\n untrack(() => {\n flushDebounce($_queue);\n });\n });\n\n $effect(() => {\n $_recheckScrollable;\n untrack(() => {\n if ($_bodyEl) {\n $_scrollable = hasYScroll($_bodyEl);\n }\n $_recheckScrollable = false;\n });\n });\n</script>\n\n{#each $_auxiliary as Component}\n <Component/>\n{/each}\n","<script>\n import './styles/index.scss';\n import {setContext, untrack} from 'svelte';\n import {get} from 'svelte/store';\n import {diff} from './storage/options.js';\n import State from './storage/state.js';\n import Toolbar from './Toolbar.svelte';\n import Auxiliary from './Auxiliary.svelte';\n import {\n assign, createEvents, getElementWithPayload, getPayload, listView, nextDate,\n prevDate, toEventWithLocalDates, toLocalDate, toViewWithLocalDates\n } from '#lib';\n\n let {plugins = [], options = {}} = $props();\n\n let state = new State(plugins, options);\n setContext('state', state);\n\n let {\n _viewComponent, _interaction, _iClass, _events, _scrollable,\n date, duration, hiddenDays, height, theme, view\n } = state;\n\n // Reactively update options that did change\n let prevOptions = {...options};\n $effect(() => {\n for (let [name, value] of diff(options, prevOptions)) {\n untrack(() => {\n setOption(name, value);\n });\n }\n assign(prevOptions, options);\n });\n\n export function setOption(name, value) {\n state._set(name, value);\n return this;\n }\n\n export function getOption(name) {\n let value = state._get(name);\n return value instanceof Date ? toLocalDate(value) : value;\n }\n\n export function refetchEvents() {\n state._fetchedRange.set({start: undefined, end: undefined});\n return this;\n }\n\n export function getEvents() {\n return $_events.map(toEventWithLocalDates);\n }\n\n export function getEventById(id) {\n for (let event of $_events) {\n if (event.id == id) {\n return toEventWithLocalDates(event);\n }\n }\n return null;\n }\n\n export function addEvent(event) {\n event = createEvents([event])[0];\n $_events.push(event);\n $_events = $_events;\n return toEventWithLocalDates(event);\n }\n\n export function updateEvent(event) {\n let id = String(event.id);\n let idx = $_events.findIndex(event => event.id === id);\n if (idx >= 0) {\n event = createEvents([event])[0];\n $_events[idx] = event;\n return toEventWithLocalDates(event);\n }\n return null;\n }\n\n export function removeEventById(id) {\n id = String(id);\n let idx = $_events.findIndex(event => event.id === id);\n if (idx >= 0) {\n $_events.splice(idx, 1);\n $_events = $_events;\n }\n return this;\n }\n\n export function getView() {\n return toViewWithLocalDates(get(state._view));\n }\n\n export function unselect() {\n $_interaction.action?.unselect();\n return this;\n }\n\n export function dateFromPoint(x, y) {\n let dayEl = getElementWithPayload(x, y);\n if (dayEl) {\n let info = getPayload(dayEl)(x, y);\n info.date = toLocalDate(info.date);\n\n return info;\n }\n return null;\n }\n\n export function next() {\n $date = nextDate($date, $duration);\n return this;\n }\n\n export function prev() {\n $date = prevDate($date, $duration, $hiddenDays);\n return this;\n }\n\n let View = $derived($_viewComponent);\n</script>\n\n<div\n class=\"{$theme.calendar} {$theme.view}{$_scrollable ? ' ' + $theme.withScroll : ''}{$_iClass ? ' ' + $theme[$_iClass] : ''}\"\n style:height={$height}\n role=\"{listView($view) ? 'list' : 'table'}\"\n>\n <Toolbar/>\n <View/>\n</div>\n<Auxiliary/>\n","import {derived} from 'svelte/store';\nimport {cloneDate, addDay, subtractDay} from '#lib';\n\nexport function days(state) {\n return derived([state.date, state.firstDay, state.hiddenDays], ([$date, $firstDay, $hiddenDays]) => {\n let days = [];\n let day = cloneDate($date);\n let max = 7;\n // First day of week\n while (day.getUTCDay() !== $firstDay && max) {\n subtractDay(day);\n --max;\n }\n for (let i = 0; i < 7; ++i) {\n if (!$hiddenDays.includes(day.getUTCDay())) {\n days.push(cloneDate(day));\n }\n addDay(day);\n }\n\n return days;\n });\n}\n","<script>\n import {getContext} from 'svelte';\n import {setContent} from '#lib';\n\n let {theme, _intlDayHeader, _intlDayHeaderAL, _days} = getContext('state');\n</script>\n\n<div class=\"{$theme.header}\">\n <div class=\"{$theme.days}\" role=\"row\">\n {#each $_days as day}\n <div class=\"{$theme.day} {$theme.weekdays?.[day.getUTCDay()]}\" role=\"columnheader\">\n <span\n aria-label=\"{$_intlDayHeaderAL.format(day)}\"\n use:setContent={$_intlDayHeader.format(day)}\n ></span>\n </div>\n {/each}\n </div>\n <div class=\"{$theme.hiddenScroll}\"></div>\n</div>\n","/** @import { Source } from '#client' */\nimport { DEV } from 'esm-env';\nimport { source, set, state, increment } from '../internal/client/reactivity/sources.js';\nimport { label, tag } from '../internal/client/dev/tracing.js';\nimport { get, update_version } from '../internal/client/runtime.js';\n\nvar read_methods = ['forEach', 'isDisjointFrom', 'isSubsetOf', 'isSupersetOf'];\nvar set_like_methods = ['difference', 'intersection', 'symmetricDifference', 'union'];\n\nvar inited = false;\n\n/**\n * A reactive version of the built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) object.\n * Reading contents of the set (by iterating, or by reading `set.size` or calling `set.has(...)` as in the [example](https://svelte.dev/playground/53438b51194b4882bcc18cddf9f96f15) below) in an [effect](https://svelte.dev/docs/svelte/$effect) or [derived](https://svelte.dev/docs/svelte/$derived)\n * will cause it to be re-evaluated as necessary when the set is updated.\n *\n * Note that values in a reactive set are _not_ made [deeply reactive](https://svelte.dev/docs/svelte/$state#Deep-state).\n *\n * ```svelte\n * <script>\n * \timport { SvelteSet } from 'svelte/reactivity';\n * \tlet monkeys = new SvelteSet();\n *\n * \tfunction toggle(monkey) {\n * \t\tif (monkeys.has(monkey)) {\n * \t\t\tmonkeys.delete(monkey);\n * \t\t} else {\n * \t\t\tmonkeys.add(monkey);\n * \t\t}\n * \t}\n * </script>\n *\n * {#each ['🙈', '🙉', '🙊'] as monkey}\n * \t<button onclick={() => toggle(monkey)}>{monkey}</button>\n * {/each}\n *\n * <button onclick={() => monkeys.clear()}>clear</button>\n *\n * {#if monkeys.has('🙈')}<p>see no evil</p>{/if}\n * {#if monkeys.has('🙉')}<p>hear no evil</p>{/if}\n * {#if monkeys.has('🙊')}<p>speak no evil</p>{/if}\n * ```\n *\n * @template T\n * @extends {Set<T>}\n */\nexport class SvelteSet extends Set {\n\t/** @type {Map<T, Source<boolean>>} */\n\t#sources = new Map();\n\t#version = state(0);\n\t#size = state(0);\n\t#update_version = update_version || -1;\n\n\t/**\n\t * @param {Iterable<T> | null | undefined} [value]\n\t */\n\tconstructor(value) {\n\t\tsuper();\n\n\t\tif (DEV) {\n\t\t\t// If the value is invalid then the native exception will fire here\n\t\t\tvalue = new Set(value);\n\n\t\t\ttag(this.#version, 'SvelteSet version');\n\t\t\ttag(this.#size, 'SvelteSet.size');\n\t\t}\n\n\t\tif (value) {\n\t\t\tfor (var element of value) {\n\t\t\t\tsuper.add(element);\n\t\t\t}\n\t\t\tthis.#size.v = super.size;\n\t\t}\n\n\t\tif (!inited) this.#init();\n\t}\n\n\t/**\n\t * If the source is being created inside the same reaction as the SvelteSet instance,\n\t * we use `state` so that it will not be a dependency of the reaction. Otherwise we\n\t * use `source` so it will be.\n\t *\n\t * @template T\n\t * @param {T} value\n\t * @returns {Source<T>}\n\t */\n\t#source(value) {\n\t\treturn update_version === this.#update_version ? state(value) : source(value);\n\t}\n\n\t// We init as part of the first instance so that we can treeshake this class\n\t#init() {\n\t\tinited = true;\n\n\t\tvar proto = SvelteSet.prototype;\n\t\tvar set_proto = Set.prototype;\n\n\t\tfor (const method of read_methods) {\n\t\t\t// @ts-ignore\n\t\t\tproto[method] = function (...v) {\n\t\t\t\tget(this.#version);\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn set_proto[method].apply(this, v);\n\t\t\t};\n\t\t}\n\n\t\tfor (const method of set_like_methods) {\n\t\t\t// @ts-ignore\n\t\t\tproto[method] = function (...v) {\n\t\t\t\tget(this.#version);\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar set = /** @type {Set<T>} */ (set_proto[method].apply(this, v));\n\t\t\t\treturn new SvelteSet(set);\n\t\t\t};\n\t\t}\n\t}\n\n\t/** @param {T} value */\n\thas(value) {\n\t\tvar has = super.has(value);\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(value);\n\n\t\tif (s === undefined) {\n\t\t\tif (!has) {\n\t\t\t\t// If the value doesn't exist, track the version in case it's added later\n\t\t\t\t// but don't create sources willy-nilly to track all possible values\n\t\t\t\tget(this.#version);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\ts = this.#source(true);\n\n\t\t\tif (DEV) {\n\t\t\t\ttag(s, `SvelteSet has(${label(value)})`);\n\t\t\t}\n\n\t\t\tsources.set(value, s);\n\t\t}\n\n\t\tget(s);\n\t\treturn has;\n\t}\n\n\t/** @param {T} value */\n\tadd(value) {\n\t\tif (!super.has(value)) {\n\t\t\tsuper.add(value);\n\t\t\tset(this.#size, super.size);\n\t\t\tincrement(this.#version);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/** @param {T} value */\n\tdelete(value) {\n\t\tvar deleted = super.delete(value);\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(value);\n\n\t\tif (s !== undefined) {\n\t\t\tsources.delete(value);\n\t\t\tset(s, false);\n\t\t}\n\n\t\tif (deleted) {\n\t\t\tset(this.#size, super.size);\n\t\t\tincrement(this.#version);\n\t\t}\n\n\t\treturn deleted;\n\t}\n\n\tclear() {\n\t\tif (super.size === 0) {\n\t\t\treturn;\n\t\t}\n\t\t// Clear first, so we get nice console.log outputs with $inspect\n\t\tsuper.clear();\n\t\tvar sources = this.#sources;\n\n\t\tfor (var s of sources.values()) {\n\t\t\tset(s, false);\n\t\t}\n\n\t\tsources.clear();\n\t\tset(this.#size, 0);\n\t\tincrement(this.#version);\n\t}\n\n\tkeys() {\n\t\treturn this.values();\n\t}\n\n\tvalues() {\n\t\tget(this.#version);\n\t\treturn super.values();\n\t}\n\n\tentries() {\n\t\tget(this.#version);\n\t\treturn super.entries();\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.keys();\n\t}\n\n\tget size() {\n\t\treturn get(this.#size);\n\t}\n}\n","<script>\n import {getContext, onMount} from 'svelte';\n import {\n bgEvent, createEventClasses, createEventContent, entries, helperEvent, identity, isFunction, keyEnter,\n resourceBackgroundColor, resourceTextColor, setContent, toEventWithLocalDates, toViewWithLocalDates\n } from '#lib';\n\n let {\n el = $bindable(),\n chunk,\n classes = identity,\n styles = identity,\n onpointerdown,\n body\n } = $props();\n\n let {\n displayEventEnd, eventBackgroundColor, eventColor, eventContent, eventClick, eventDidMount, eventClassNames,\n eventMouseEnter, eventMouseLeave, eventTextColor, resources, theme, _view, _intlEventTime\n } = getContext('state');\n\n let event = $derived(chunk.event);\n let display = $derived(chunk.event.display);\n\n // Style\n let bgColor = $derived(event.backgroundColor ?? resourceBackgroundColor(event, $resources) ?? $eventBackgroundColor ?? $eventColor);\n let txtColor = $derived(event.textColor ?? resourceTextColor(event, $resources) ?? $eventTextColor);\n let style = $derived(entries(styles(\n {'background-color': bgColor, 'color': txtColor}\n )).map(entry => `${entry[0]}:${entry[1]}`).concat(event.styles).join(';'));\n\n // Class\n let classNames = $derived(classes([\n bgEvent(display) ? $theme.bgEvent : $theme.event,\n ...createEventClasses($eventClassNames, event, $_view)\n ]).join(' '));\n\n // Content\n let [timeText, content] = $derived(createEventContent(\n chunk, $displayEventEnd, $eventContent, $theme, $_intlEventTime, $_view\n ));\n\n onMount(() => {\n if (isFunction($eventDidMount)) {\n $eventDidMount({\n event: toEventWithLocalDates(event),\n timeText,\n el,\n view: toViewWithLocalDates($_view)\n });\n }\n });\n\n function createHandler(fn, display) {\n return !helperEvent(display) && isFunction(fn)\n ? jsEvent => fn({event: toEventWithLocalDates(event), el, jsEvent, view: toViewWithLocalDates($_view)})\n : undefined;\n }\n\n // Handlers\n let onclick = $derived(!bgEvent(display) && createHandler($eventClick, display) || undefined);\n let onkeydown = $derived(onclick && keyEnter(onclick));\n let onmouseenter = $derived(createHandler($eventMouseEnter, display));\n let onmouseleave = $derived(createHandler($eventMouseLeave, display));\n</script>\n\n<!-- svelte-ignore a11y_no_noninteractive_tabindex -->\n<article\n bind:this={el}\n class={classNames}\n {style}\n role={onclick ? 'button' : undefined}\n tabindex={onclick ? 0 : undefined}\n {onclick}\n {onkeydown}\n {onmouseenter}\n {onmouseleave}\n {onpointerdown}\n>\n {#snippet defaultBody()}\n <div class={$theme.eventBody} use:setContent={content}></div>\n {/snippet}\n {#if body}\n {@render body(defaultBody, bgColor, txtColor)}\n {:else}\n {@render defaultBody()}\n {/if}\n</article>\n","<script>\n import {getContext} from 'svelte';\n import BaseEvent from './BaseEvent.svelte';\n import {bgEvent, helperEvent} from \"#lib\";\n\n let {\n el = $bindable(),\n chunk,\n styles,\n axis,\n forceDate,\n forceMargin\n } = $props();\n\n let {_interaction, _iClasses} = getContext('state');\n\n let event = $derived(chunk.event);\n let display = $derived(chunk.event.display);\n\n // Class\n let classes = $derived(classNames => $_iClasses(classNames, event));\n\n function createDragHandler(event) {\n return $_interaction.action?.draggable(event)\n ? jsEvent => $_interaction.action.drag(\n event, jsEvent, forceDate?.(), forceMargin?.()\n )\n : $_interaction.action?.noAction;\n }\n let onpointerdown = $derived(!bgEvent(display) && !helperEvent(display) ? createDragHandler(event) : undefined);\n\n let Resizer = $derived($_interaction.resizer);\n</script>\n\n<BaseEvent bind:el {chunk} {classes} {styles} {onpointerdown}>\n {#snippet body(defaultBody)}\n {#if Resizer}\n <Resizer {chunk} {axis} {forceDate} {forceMargin}>\n {@render defaultBody()}\n </Resizer>\n {:else}\n {@render defaultBody()}\n {/if}\n {/snippet}\n</BaseEvent>\n","<script>\n import {getContext} from 'svelte';\n import {ancestor, bgEvent, height, max, rect, repositionEvent} from '#lib';\n import {InteractableEvent} from '#components';\n\n let {chunk, longChunks = {}, inPopup = false, dates = []} = $props();\n\n let {dayMaxEvents, _hiddenEvents, _popupDate} = getContext('state');\n\n let el = $state();\n let margin = $state(1);\n let hidden = $state(false);\n\n let event = $derived(chunk.event);\n let display = $derived(chunk.event.display);\n\n // Style\n let styles = $derived(style => {\n if (bgEvent(display)) {\n style['width'] = `calc(${chunk.days * 100}% + ${(chunk.days - 1)}px)`;\n } else {\n let marginTop = margin;\n if (event._margin) {\n // Force margin for helper events\n let [_margin, _dates] = event._margin;\n if (chunk.date >= _dates[0] && chunk.date <= _dates.at(-1)) {\n marginTop = _margin;\n }\n }\n style['width'] = `calc(${chunk.days * 100}% + ${(chunk.days - 1) * 7}px)`;\n style['margin-top'] = `${marginTop}px`;\n }\n if (hidden) {\n style['visibility'] = 'hidden';\n }\n return style;\n });\n\n export function reposition() {\n margin = repositionEvent(chunk, longChunks, height(el));\n if ($dayMaxEvents === true) {\n hide();\n } else {\n hidden = false;\n }\n }\n\n function hide() {\n let dayEl = ancestor(el, 2);\n let h = height(dayEl) - height(dayEl.firstElementChild) - footHeight(dayEl);\n hidden = chunk.bottom > h;\n let update = false;\n // Hide or show the event throughout all days\n for (let date of chunk.dates) {\n let hiddenEvents = $_hiddenEvents[date.getTime()];\n if (hiddenEvents) {\n let size = hiddenEvents.size;\n if (hidden) {\n hiddenEvents.add(chunk.event);\n } else {\n hiddenEvents.delete(chunk.event);\n }\n if (size !== hiddenEvents.size) {\n update = true;\n }\n }\n }\n if (update) {\n $_hiddenEvents = $_hiddenEvents;\n }\n }\n\n function footHeight(dayEl) {\n let h = 0;\n for (let i = 0; i < chunk.days; ++i) {\n h = max(h, height(dayEl.lastElementChild));\n dayEl = dayEl.nextElementSibling;\n if (!dayEl) {\n break;\n }\n }\n return h;\n }\n</script>\n\n<InteractableEvent\n bind:el\n {chunk}\n {styles}\n axis=\"x\"\n forceDate={() => inPopup ? $_popupDate : undefined}\n forceMargin={() => [rect(el).top - rect(ancestor(el, 1)).top, dates]}\n/>\n","<script>\n import {getContext, tick, untrack} from 'svelte';\n import {ancestor, rect, setContent, outsideEvent, keyEnter, toISOString, stopPropagation} from '#lib';\n import Event from './Event.svelte';\n\n let {buttonText, theme, _interaction, _intlDayPopover, _popupDate, _popupChunks} = getContext('state');\n\n let el = $state();\n let style = $state('');\n\n function position() {\n let dayEl = ancestor(el, 1);\n let bodyEl = ancestor(dayEl, 3);\n let popupRect = rect(el);\n let dayRect = rect(dayEl);\n let bodyRect = rect(bodyEl);\n style = '';\n\n let left;\n if (popupRect.width >= bodyRect.width) {\n left = bodyRect.left - dayRect.left;\n let right = dayRect.right - bodyRect.right;\n style += `right:${right}px;`;\n } else {\n left = (dayRect.width - popupRect.width) / 2;\n if (dayRect.left + left < bodyRect.left) {\n left = bodyRect.left - dayRect.left;\n } else if (dayRect.left + left + popupRect.width > bodyRect.right) {\n left = bodyRect.right - dayRect.left - popupRect.width;\n }\n }\n style += `left:${left}px;`;\n\n let top;\n if (popupRect.height >= bodyRect.height) {\n top = bodyRect.top - dayRect.top;\n let bottom = dayRect.bottom - bodyRect.bottom;\n style += `bottom:${bottom}px;`;\n } else {\n top = (dayRect.height - popupRect.height) / 2;\n if (dayRect.top + top < bodyRect.top) {\n top = bodyRect.top - dayRect.top;\n } else if (dayRect.top + top + popupRect.height > bodyRect.bottom) {\n top = bodyRect.bottom - dayRect.top - popupRect.height;\n }\n }\n style += `top:${top}px;`;\n }\n\n $effect(() => {\n // Fire reposition only on popup chunks change\n $_popupChunks;\n // Let chunks to update/mount then position the popup\n tick().then(reposition);\n });\n function reposition() {\n if ($_popupChunks.length) {\n position();\n } else {\n close();\n }\n }\n\n function close() {\n $_popupDate = null;\n $_popupChunks = [];\n }\n\n function handlePointerDownOutside() {\n close();\n $_interaction.action?.noClick();\n }\n</script>\n\n<div\n bind:this={el}\n class=\"{$theme.popup}\"\n {style}\n use:outsideEvent={'pointerdown'}\n onpointerdown={stopPropagation()}\n onpointerdownoutside={handlePointerDownOutside}\n>\n <div class=\"{$theme.dayHead}\">\n <time datetime=\"{toISOString($_popupDate, 10)}\" use:setContent={$_intlDayPopover.format($_popupDate)}></time>\n <!-- svelte-ignore a11y_missing_attribute -->\n <a\n role=\"button\"\n tabindex=\"0\"\n aria-label={$buttonText.close}\n onclick={stopPropagation(close)}\n onkeydown={keyEnter(close)}\n >&times;</a>\n </div>\n <div class=\"{$theme.events}\">\n {#each $_popupChunks as chunk (chunk.event)}\n <Event {chunk} inPopup />\n {/each}\n </div>\n</div>\n","<script>\n import {getContext, onMount, tick, untrack} from 'svelte';\n import {SvelteSet} from 'svelte/reactivity';\n import {\n addDay, assign, cloneDate, createEventChunk, datesEqual, getWeekNumber, isFunction, keyEnter, outsideRange,\n runReposition, setContent, setPayload, toISOString, toLocalDate, stopPropagation\n } from '#lib';\n import Event from './Event.svelte';\n import Popup from './Popup.svelte';\n\n let {date, chunks, bgChunks, longChunks, iChunks = [], dates} = $props();\n\n let {\n date: currentDate, dayMaxEvents, highlightedDates, firstDay, moreLinkContent, theme, validRange, weekNumbers,\n weekNumberContent, _hiddenEvents, _intlDayCell, _popupDate, _popupChunks, _today, _interaction\n } = getContext('state');\n\n let el = $state();\n let hiddenEvents = new SvelteSet(); // hidden events of this day\n $effect.pre(() => {\n $_hiddenEvents[date.getTime()] = untrack(() => hiddenEvents);\n });\n let refs = [];\n let isToday = $derived(datesEqual(date, $_today));\n let otherMonth = $derived(date.getUTCMonth() !== $currentDate.getUTCMonth());\n let highlight = $derived($highlightedDates.some(d => datesEqual(d, date)));\n let disabled = $derived(outsideRange(date, $validRange));\n\n let dayBgChunks = $derived(!disabled ? bgChunks.filter(bgChunk => datesEqual(bgChunk.date, date)) : []);\n let dayChunks = $derived.by(() => {\n let dayChunks = [];\n if (!disabled) {\n for (let chunk of chunks) {\n if (datesEqual(chunk.date, date)) {\n dayChunks.push(chunk);\n // if ($dayMaxEvents !== false && dayChunks.length > $dayMaxEvents) {\n // \tchunk.hidden = true;\n // }\n }\n }\n }\n return dayChunks;\n });\n $effect.pre(() => {\n dayChunks;\n hiddenEvents.clear();\n });\n\n let moreLink = $derived.by(() => {\n let moreLink = '';\n if (!disabled && hiddenEvents.size) {\n let text = '+' + hiddenEvents.size + ' more';\n if ($moreLinkContent) {\n moreLink = isFunction($moreLinkContent)\n ? $moreLinkContent({num: hiddenEvents.size, text})\n : $moreLinkContent;\n } else {\n moreLink = text;\n }\n }\n return moreLink;\n });\n\n // dateFromPoint\n onMount(() => {\n setPayload(el, () => ({allDay: true, date, resource: undefined, dayEl: el, disabled}));\n });\n\n // Popup\n function showMore() {\n $_popupDate = date;\n }\n let showPopup = $derived($_popupDate && datesEqual(date, $_popupDate));\n // Use `pre` to tick before popup positioning tick\n $effect.pre(() => {\n dayChunks;\n longChunks;\n if (showPopup) {\n // Let chunks to reposition then set popup chunks\n tick().then(setPopupChunks);\n }\n });\n function setPopupChunks() {\n let nextDay = addDay(cloneDate(date));\n let chunks = dayChunks.concat(longChunks[date.getTime()]?.chunks || []);\n $_popupChunks = chunks\n .map(chunk => assign({}, chunk, createEventChunk(chunk.event, date, nextDay), {days: 1, dates: [date]}))\n .sort((a, b) => a.top - b.top);\n }\n\n // Week numbers\n let showWeekNumber = $derived($weekNumbers && date.getUTCDay() == ($firstDay ? 1 : 0));\n let weekNumber = $derived.by(() => {\n let weekNumber;\n if (showWeekNumber) {\n let week = getWeekNumber(date, $firstDay);\n if ($weekNumberContent) {\n weekNumber = isFunction($weekNumberContent)\n ? $weekNumberContent({date: toLocalDate(date), week})\n : $weekNumberContent;\n } else {\n weekNumber = 'W' + String(week).padStart(2, '0');\n }\n }\n return weekNumber;\n });\n\n export function reposition() {\n if (!disabled) {\n runReposition(refs, dayChunks);\n }\n }\n</script>\n\n<div\n bind:this={el}\n class=\"{$theme.day} {$theme.weekdays?.[date.getUTCDay()]}{isToday ? ' ' + $theme.today : ''}{otherMonth ? ' ' + $theme.otherMonth : ''}{highlight ? ' ' + $theme.highlight : ''}{disabled ? ' ' + $theme.disabled : ''}\"\n role=\"cell\"\n onpointerdown={$_interaction.action?.select}\n>\n <div class=\"{$theme.dayHead}\">\n <time\n datetime=\"{toISOString(date, 10)}\"\n use:setContent={$_intlDayCell.format(date)}\n ></time>\n {#if showWeekNumber}\n <span\n class=\"{$theme.weekNumber}\"\n use:setContent={weekNumber}\n ></span>\n {/if}\n </div>\n <div class=\"{$theme.bgEvents}\">\n {#if !disabled}\n {#each dayBgChunks as chunk (chunk.event)}\n <Event {chunk}/>\n {/each}\n {/if}\n </div>\n {#if !disabled}\n <!-- Pointer -->\n {#if iChunks[2] && datesEqual(iChunks[2].date, date)}\n <div class=\"{$theme.events}\">\n <Event chunk={iChunks[2]}/>\n </div>\n {/if}\n <!-- Drag & Resize -->\n {#if iChunks[0] && datesEqual(iChunks[0].date, date)}\n <div class=\"{$theme.events} {$theme.preview}\">\n <Event chunk={iChunks[0]}/>\n </div>\n {/if}\n {/if}\n <div class=\"{$theme.events}\">\n {#if !disabled}\n {#each dayChunks as chunk, i (chunk.event)}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Event {chunk} {longChunks} {dates} bind:this={refs[i]}/>\n {/each}\n {/if}\n </div>\n {#if showPopup}\n <Popup/>\n {/if}\n <div class=\"{$theme.dayFoot}\">\n {#if !disabled && hiddenEvents.size}\n <!-- svelte-ignore a11y_missing_attribute -->\n <!-- svelte-ignore a11y_missing_content -->\n <!-- svelte-ignore a11y_consider_explicit_label -->\n <a\n role=\"button\"\n tabindex=\"0\"\n aria-haspopup=\"true\"\n onclick={stopPropagation(showMore)}\n onkeydown={keyEnter(showMore)}\n onpointerdown={stopPropagation()}\n use:setContent={moreLink}\n ></a>\n {/if}\n </div>\n</div>\n","<script>\n import {getContext} from 'svelte';\n import {\n addDay, bgEvent, cloneDate, createEventChunk, eventIntersects, limitToRange, prepareEventChunks,\n runReposition\n } from '#lib';\n import Day from './Day.svelte';\n\n let {dates} = $props();\n\n let {_filteredEvents, _iEvents,\n resources, filterEventsWithResources, hiddenDays, theme, validRange } = getContext('state');\n\n let refs = [];\n\n let start = $derived(limitToRange(dates[0], $validRange));\n let end = $derived(addDay(cloneDate(limitToRange(dates.at(-1), $validRange))));\n\n let [chunks, bgChunks, longChunks] = $derived.by(() => {\n let chunks = [];\n let bgChunks = [];\n for (let event of $_filteredEvents) {\n if (eventIntersects(event, start, end, $filterEventsWithResources ? $resources : undefined)) {\n let chunk = createEventChunk(event, start, end);\n if (bgEvent(event.display)) {\n if (event.allDay) {\n bgChunks.push(chunk);\n }\n } else {\n chunks.push(chunk);\n }\n }\n }\n prepareEventChunks(bgChunks, $hiddenDays);\n let longChunks = prepareEventChunks(chunks, $hiddenDays);\n return [chunks, bgChunks, longChunks];\n });\n\n let iChunks = $derived($_iEvents.map(event => {\n let chunk;\n if (event && eventIntersects(event, start, end)) {\n chunk = createEventChunk(event, start, end);\n prepareEventChunks([chunk], $hiddenDays);\n } else {\n chunk = null;\n }\n return chunk;\n }));\n\n export function reposition() {\n runReposition(refs, dates);\n }\n</script>\n\n<div class=\"{$theme.days}\" role=\"row\">\n {#each dates as date, i}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Day {date} {chunks} {bgChunks} {longChunks} {iChunks} {dates} bind:this={refs[i]} />\n {/each}\n</div>\n","<script>\n import {getContext, untrack} from 'svelte';\n import {runReposition, observeResize} from '#lib';\n import Week from './Week.svelte';\n\n let {\n _bodyEl, _viewDates, _filteredEvents, _hiddenEvents, _recheckScrollable, dayMaxEvents, hiddenDays, theme\n } = getContext('state');\n\n let refs = [];\n\n let days = $derived(7 - $hiddenDays.length);\n let weeks = $derived.by(() => {\n let weeks = [];\n for (let i = 0; i < $_viewDates.length / days; ++i) {\n let dates = [];\n for (let j = 0; j < days; ++j) {\n dates.push($_viewDates[i * days + j]);\n }\n weeks.push(dates);\n }\n return weeks;\n });\n $effect.pre(() => {\n weeks;\n $dayMaxEvents;\n $_hiddenEvents = {};\n });\n\n function reposition() {\n runReposition(refs, weeks);\n }\n $effect(() => {\n $_filteredEvents;\n $_hiddenEvents;\n $dayMaxEvents;\n untrack(reposition);\n });\n</script>\n\n<div\n bind:this={$_bodyEl}\n class=\"{$theme.body}{$dayMaxEvents === true ? ' ' + $theme.uniform : ''}\"\n use:observeResize={() => $_recheckScrollable = true}\n>\n <div class=\"{$theme.content}\">\n {#each weeks as dates, i}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Week {dates} bind:this={refs[i]}/>\n {/each}\n </div>\n</div>\n\n<svelte:window on:resize={reposition}/>\n","<script>\n import Header from './Header.svelte';\n import Body from './Body.svelte';\n</script>\n\n<Header/>\n<Body/>\n","import {writable} from 'svelte/store';\nimport {btnTextMonth, intl, themeView} from '#lib';\nimport {days} from './stores.js';\nimport View from './View.svelte';\n\nexport default {\n createOptions(options) {\n options.dayMaxEvents = false;\n options.dayCellFormat = {day: 'numeric'};\n options.dayPopoverFormat = {month: 'long', day: 'numeric', year: 'numeric'};\n options.moreLinkContent = undefined;\n options.weekNumbers = false;\n options.weekNumberContent = undefined;\n // Common options\n options.buttonText.dayGridMonth = 'month';\n options.buttonText.close = 'Close';\n options.theme.uniform = 'ec-uniform';\n options.theme.dayFoot = 'ec-day-foot';\n options.theme.popup = 'ec-popup';\n options.theme.weekNumber = 'ec-week-number';\n options.view = 'dayGridMonth';\n options.views.dayGridMonth = {\n buttonText: btnTextMonth,\n component: View,\n dayHeaderFormat: {weekday: 'short'},\n dayHeaderAriaLabelFormat: {weekday: 'long'},\n displayEventEnd: false,\n duration: {months: 1},\n theme: themeView('ec-day-grid ec-month-view'),\n titleFormat: {year: 'numeric', month: 'long'}\n };\n },\n\n createStores(state) {\n state._days = days(state);\n state._intlDayCell = intl(state.locale, state.dayCellFormat);\n state._intlDayPopover = intl(state.locale, state.dayPopoverFormat);\n state._hiddenEvents = writable({});\n state._popupDate = writable(null);\n state._popupChunks = writable([]);\n }\n}\n","import {bgEvent, helperEvent} from '#lib';\n\nexport function eventDraggable(event, $eventStartEditable, $editable) {\n return (event.startEditable ?? $eventStartEditable ?? event.editable ?? $editable);\n}\n\nexport function eventResizable(event, $eventDurationEditable, $editable) {\n return (event.durationEditable ?? $eventDurationEditable ?? event.editable ?? $editable);\n}\n","import {min, max} from '#lib';\n\nlet busy = false;\nexport function animate(fn) {\n if (!busy) {\n busy = true;\n window.requestAnimationFrame(() => {\n fn();\n busy = false;\n });\n }\n}\n\nexport function limit(value, minLimit, maxLimit) {\n return max(minLimit, min(maxLimit, value));\n}\n\nexport function draggable(event) {\n\n}\n","<script>\n import {getContext} from 'svelte';\n import {\n addDay, addDuration, ancestor, assign, cloneDate, cloneEvent, copyTime, createDuration, getElementWithPayload,\n getPayload, isFunction, listen, listView, max, min, noop, rect, runAll, subtractDay, subtractDuration,\n timelineView, toEventWithLocalDates, toISOString, toLocalDate, toViewWithLocalDates\n } from '#lib';\n import {animate, limit, eventDraggable} from './lib';\n\n let {_iEvents, _iClass, _events, _view, _dayGrid, _bodyEl, datesAboveResources, dateClick, dragConstraint,\n dragScroll, editable, eventStartEditable, eventDragMinDistance, eventDragStart, eventDragStop, eventDrop,\n eventLongPressDelay, eventResizeStart, eventResizeStop, eventResize, longPressDelay, resizeConstraint,\n selectable, select: selectFn, selectBackgroundColor, selectConstraint, selectLongPressDelay, selectMinDistance,\n slotDuration, slotHeight, slotWidth, unselect: unselectFn, unselectAuto, unselectCancel, validRange,\n view} = getContext('state');\n\n const ACTION_DRAG = 1;\n const ACTION_RESIZE_END = 2;\n const ACTION_RESIZE_START = 3;\n const ACTION_SELECT = 4;\n const ACTION_CLICK = 5;\n const ACTION_NO_ACTION = 6;\n let action;\n let interacting;\n let event;\n let display;\n let date, newDate;\n let resource, newResource;\n let fromX, fromY;\n let toX, toY;\n let bodyEl, bodyRect, clipEl, clipRect;\n let delta;\n let allDay;\n let iClass;\n let minResize; // minimum end time when resizing\n let selectStep; // minimum selection step\n let selected; // whether selection has been made\n let noDateClick; // do not perform date click\n let timer; // timer for long press delays\n let viewport;\n let margin;\n let extraDuration; // extra duration for zero duration events\n\n export function draggable(event) {\n return eventDraggable(event, $eventStartEditable, $editable);\n }\n\n export function drag(eventToDrag, jsEvent, forceDate, forceMargin) {\n if (!action) {\n action = validJsEvent(jsEvent) ? ACTION_DRAG : ACTION_NO_ACTION;\n\n if (complexAction()) {\n event = eventToDrag;\n\n common(jsEvent);\n\n if (forceDate) {\n // Force date in popup\n date = forceDate;\n }\n\n if (forceMargin) {\n margin = forceMargin;\n }\n\n iClass = 'dragging';\n\n move(jsEvent);\n }\n }\n }\n\n export function resize(eventToResize, jsEvent, start, axis, forceDate, forceMargin, zeroDuration) {\n if (!action) {\n action = validJsEvent(jsEvent) ? (\n start ? ACTION_RESIZE_START : ACTION_RESIZE_END\n ) : ACTION_NO_ACTION;\n\n if (complexAction()) {\n event = eventToResize;\n\n common(jsEvent);\n\n if (forceDate) {\n // Force date in popup\n date = forceDate;\n }\n\n if (forceMargin) {\n margin = forceMargin;\n }\n\n iClass = axis === 'x' ? 'resizingX' : 'resizingY';\n\n // Calculate the limits for resize\n if (resizingStart()) {\n minResize = cloneDate(event.end);\n if (allDay) {\n copyTime(minResize, event.start);\n if (minResize >= event.end) {\n subtractDay(minResize);\n }\n } else {\n subtractDuration(minResize, $slotDuration);\n if (minResize < event.start) {\n minResize = event.start;\n }\n // Overwrite the date due to possible discrepancy between calculated date\n // and resizer coordinates in browser\n date = event.start;\n }\n } else {\n minResize = cloneDate(event.start);\n if (allDay) {\n copyTime(minResize, event.end);\n if (minResize <= event.start && !zeroDuration) {\n addDay(minResize);\n }\n } else {\n addDuration(minResize, $slotDuration);\n if (minResize > event.end) {\n minResize = event.end;\n }\n // Overwrite the date due to possible discrepancy between calculated date\n // and resizer coordinates in browser\n date = event.end;\n if (!zeroDuration) {\n date = subtractDuration(cloneDate(date), $slotDuration);\n }\n }\n\n // Handle zero duration events\n if (zeroDuration && !allDay) {\n extraDuration = $slotDuration;\n }\n }\n\n move(jsEvent);\n }\n }\n }\n\n export function select(jsEvent) {\n if (!action) {\n action = validJsEvent(jsEvent) ? (\n $selectable && !listView($view) ? ACTION_SELECT : ACTION_CLICK\n ) : ACTION_NO_ACTION;\n\n if (complexAction()) {\n common(jsEvent);\n\n iClass = 'selecting';\n\n selectStep = allDay ? createDuration({day: 1}) : $slotDuration;\n\n // Create dummy source event\n event = {\n allDay,\n start: date,\n end: addDuration(cloneDate(date), selectStep),\n resourceIds: resource ? [resource.id] : []\n };\n\n move(jsEvent);\n }\n }\n }\n\n export function noAction() {\n if (!action) {\n action = ACTION_NO_ACTION;\n }\n }\n\n\tfunction common(jsEvent) {\n window.getSelection().removeAllRanges();\n\n fromX = toX = jsEvent.clientX;\n fromY = toY = jsEvent.clientY;\n\n let dayEl = getElementWithPayload(toX, toY);\n ({allDay, date, resource} = getPayload(dayEl)(toX, toY));\n\n if (timelineView($view)) {\n bodyEl = clipEl = $_bodyEl;\n } else {\n bodyEl = ancestor(dayEl, resource ? 4 : 3);\n clipEl = ancestor(dayEl, resource && (dragging() || $datesAboveResources) ? 2 : 1);\n }\n calcViewport();\n\n if (jsEvent.pointerType !== 'mouse') {\n // For touch devices init long press delay\n timer = setTimeout(() => {\n if (action) {\n interacting = true;\n move(jsEvent);\n }\n }, (selecting() ? $selectLongPressDelay : $eventLongPressDelay) ?? $longPressDelay);\n }\n }\n\n function move(jsEvent) {\n if (\n interacting ||\n jsEvent && jsEvent.pointerType === 'mouse' && distance() >= (selecting() ? $selectMinDistance : $eventDragMinDistance)\n ) {\n interacting = true;\n unselect(jsEvent);\n $_iClass = iClass;\n\n if (!$_iEvents[0]) {\n if (selecting()) {\n createIEventSelect();\n } else {\n createIEvent(jsEvent, resizing() ? $eventResizeStart : $eventDragStart);\n }\n }\n\n let payload = findPayload(findDayEl());\n if (payload) {\n let newAllDay;\n ({allDay: newAllDay, date: newDate, resource: newResource} = payload);\n\n if (newAllDay === allDay) {\n let candidate = copyIEventData({}, $_iEvents[0]);\n let constraintFn = $resizeConstraint;\n delta = createDuration((newDate - date) / 1000);\n if (resizingStart()) {\n // Resizing start\n candidate.start = addDuration(cloneDate(event.start), delta);\n if (candidate.start > minResize) {\n candidate.start = minResize;\n delta = createDuration((minResize - event.start) / 1000);\n }\n } else {\n candidate.end = addDuration(cloneDate(event.end), delta);\n if (extraDuration) {\n addDuration(candidate.end, extraDuration);\n }\n if (resizing()) {\n // Resizing end\n if (candidate.end < minResize) {\n candidate.end = minResize;\n delta = createDuration((minResize - event.end) / 1000);\n }\n } else if (selecting()) {\n // Selecting\n if (candidate.end < event.end) {\n candidate.start = subtractDuration(candidate.end, selectStep);\n candidate.end = event.end;\n } else {\n candidate.start = event.start;\n }\n constraintFn = $selectConstraint;\n } else {\n // Dragging\n candidate.start = addDuration(cloneDate(event.start), delta);\n if (resource) {\n candidate.resourceIds = event.resourceIds.filter(id => id !== resource.id);\n candidate.resourceIds.push(newResource.id);\n }\n constraintFn = $dragConstraint;\n }\n }\n // Check constraint\n do {\n if (constraintFn !== undefined) {\n candidate = copyIEventData(cloneEvent(event), candidate);\n let result = constraintFn(\n selecting()\n ? createSelectCallbackInfo(candidate, jsEvent)\n : createCallbackInfo(candidate, event, jsEvent)\n );\n if (result === false) {\n // Revert preview event\n $_iEvents[0] = copyIEventData($_iEvents[0], event);\n break;\n }\n }\n // Update preview event\n $_iEvents[0] = copyIEventData($_iEvents[0], candidate);\n } while (0);\n }\n }\n }\n\n if ($dragScroll) {\n let thresholdY = $slotHeight * 2;\n let thresholdX = $slotWidth;\n animate(() => {\n if (bodyEl) {\n if (toY < thresholdY) {\n window.scrollBy(0, max(-10, (toY - thresholdY) / 3));\n }\n if (toY < bodyRect.top + thresholdY) {\n bodyEl.scrollTop += max(-10, (toY - bodyRect.top - thresholdY) / 3);\n }\n if (toY > window.innerHeight - thresholdY) {\n window.scrollBy(0, min(10, (toY - window.innerHeight + thresholdY) / 3));\n }\n if (toY > bodyRect.bottom - thresholdY) {\n bodyEl.scrollTop += min(10, (toY - bodyRect.bottom + thresholdY) / 3);\n }\n\n if (timelineView($view)) {\n if (toX < bodyRect.left + thresholdX) {\n bodyEl.scrollLeft += max(-10, (toX - bodyRect.left - thresholdX) / 3);\n }\n if (toX > bodyRect.right - thresholdX) {\n bodyEl.scrollLeft += min(10, (toX - bodyRect.right + thresholdX) / 3);\n }\n }\n }\n });\n }\n }\n\n export function handleScroll() {\n if (complexAction()) {\n calcViewport();\n move();\n }\n }\n\n function handlePointerMove(jsEvent) {\n if (complexAction() && jsEvent.isPrimary) {\n toX = jsEvent.clientX;\n toY = jsEvent.clientY;\n move(jsEvent);\n }\n }\n\n function handlePointerUp(jsEvent) {\n if (selected && $unselectAuto && !($unselectCancel && jsEvent.target.closest($unselectCancel))) {\n unselect(jsEvent);\n }\n if (action && jsEvent.isPrimary) {\n if (interacting) {\n if (selecting()) {\n selected = true;\n if (isFunction($selectFn)) {\n let info = createSelectCallbackInfo($_iEvents[0], jsEvent);\n $selectFn(info);\n }\n } else {\n event.display = display;\n\n let callback = resizing() ? $eventResizeStop : $eventDragStop;\n if (isFunction(callback)) {\n callback({event: toEventWithLocalDates(event), jsEvent, view: toViewWithLocalDates($_view)});\n }\n\n let oldEvent = cloneEvent(event);\n updateEvent(event, $_iEvents[0]);\n\n destroyIEvent();\n\n callback = resizing() ? $eventResize : $eventDrop;\n if (isFunction(callback)) {\n let eventRef = event;\n let info = createCallbackInfo(event, oldEvent, jsEvent);\n callback(assign(info, {\n revert() {\n updateEvent(eventRef, oldEvent);\n }\n }));\n }\n }\n } else {\n if (clicking() || selecting()) {\n // Perform date click\n if (isFunction($dateClick) && !noDateClick) {\n toX = jsEvent.clientX;\n toY = jsEvent.clientY;\n let dayEl = getElementWithPayload(toX, toY);\n if (dayEl) {\n let {allDay, date, resource} = getPayload(dayEl)(toX, toY);\n $dateClick({\n allDay,\n date: toLocalDate(date),\n dateStr: toISOString(date),\n dayEl,\n jsEvent,\n view: toViewWithLocalDates($_view),\n resource\n });\n }\n }\n }\n }\n\n interacting = false;\n action = fromX = fromY = toX = toY = event = display = date = newDate = resource = newResource = delta =\n extraDuration = allDay = $_iClass = minResize = selectStep = margin = undefined;\n bodyEl = clipEl = bodyRect = clipRect = undefined;\n\n if (timer) {\n clearTimeout(timer);\n timer = undefined;\n }\n }\n\n noDateClick = false;\n }\n\n function findDayEl() {\n // Limit coordinates to viewport\n return getElementWithPayload(\n limit(toX, viewport[0], viewport[1]),\n limit(toY, viewport[2], viewport[3])\n );\n }\n\n function findPayload(dayEl) {\n if (dayEl) {\n let payload = getPayload(dayEl)(toX, toY);\n if (payload.disabled) {\n if (!$validRange.end || payload.date < $validRange.end) {\n return findPayload(dayEl.nextElementSibling);\n }\n if (!$validRange.start || payload.date > $validRange.start) {\n return findPayload(dayEl.previousElementSibling);\n }\n } else {\n return payload;\n }\n }\n return null;\n }\n\n function calcViewport() {\n bodyRect = rect(bodyEl);\n clipRect = rect(clipEl);\n viewport = [\n max(0, clipRect.left + (timelineView($view) ? 1 : ($_dayGrid ? 0 : 8))), // left\n min(document.documentElement.clientWidth, clipRect.left + clipEl.clientWidth) - 2, // right\n max(0, bodyRect.top), // top\n min(document.documentElement.clientHeight, bodyRect.top + bodyEl.clientHeight) - 2 // bottom\n ];\n }\n\n function createIEvent(jsEvent, callback) {\n if (isFunction(callback)) {\n callback({event: toEventWithLocalDates(event), jsEvent, view: toViewWithLocalDates($_view)});\n }\n display = event.display;\n event.display = 'preview';\n $_iEvents[0] = cloneEvent(event);\n if (margin !== undefined) {\n $_iEvents[0]._margin = margin;\n }\n if (extraDuration) {\n addDuration($_iEvents[0].end, extraDuration);\n }\n event.display = 'ghost';\n $_events = $_events;\n }\n\n function createIEventSelect() {\n $_iEvents[0] = {\n id: '{select}',\n allDay: event.allDay,\n start: event.start,\n title: '',\n display: 'preview',\n extendedProps: {},\n backgroundColor: $selectBackgroundColor,\n resourceIds: event.resourceIds,\n classNames: [],\n styles: []\n };\n }\n\n function destroyIEvent() {\n $_iEvents[0] = null;\n }\n\n function copyIEventData(target, source) {\n target.start = source.start;\n target.end = source.end;\n target.resourceIds = source.resourceIds;\n return target;\n }\n\n function updateEvent(target, source) {\n copyIEventData(target, source);\n $_events = $_events;\n }\n\n function createSelectCallbackInfo(event, jsEvent) {\n let {start, end} = toEventWithLocalDates(event);\n return {\n start,\n end,\n startStr: toISOString(event.start),\n endStr: toISOString(event.end),\n allDay,\n view: toViewWithLocalDates($_view),\n resource,\n jsEvent\n };\n }\n\n function createCallbackInfo(event, oldEvent, jsEvent) {\n let info;\n if (resizing()) {\n info = resizingStart()\n ? {startDelta: delta, endDelta: createDuration(0)}\n : {startDelta: createDuration(0), endDelta: delta};\n } else {\n info = {\n delta,\n oldResource: resource !== newResource ? resource : undefined,\n newResource: resource !== newResource ? newResource : undefined\n };\n }\n assign(info, {\n event: toEventWithLocalDates(event),\n oldEvent: toEventWithLocalDates(oldEvent),\n view: toViewWithLocalDates($_view),\n jsEvent\n });\n\n return info;\n }\n\n function distance() {\n return Math.sqrt(Math.pow(toX - fromX, 2) + Math.pow(toY - fromY, 2));\n }\n\n function dragging() {\n return action === ACTION_DRAG;\n }\n\n function resizing() {\n return action === ACTION_RESIZE_END || resizingStart();\n }\n\n function resizingStart() {\n return action === ACTION_RESIZE_START;\n }\n\n function clicking() {\n return action === ACTION_CLICK;\n }\n\n function selecting() {\n return action === ACTION_SELECT;\n }\n\n function complexAction() {\n return action && action < ACTION_CLICK;\n }\n\n function validJsEvent(jsEvent) {\n return jsEvent.isPrimary && (jsEvent.pointerType !== 'mouse' || jsEvent.buttons & 1);\n }\n\n export function unselect(jsEvent) {\n if (selected) {\n selected = false;\n destroyIEvent();\n if (isFunction($unselectFn)) {\n $unselectFn({\n jsEvent,\n view: toViewWithLocalDates($_view)\n });\n }\n }\n }\n\n export function noClick() {\n noDateClick = true;\n }\n\n // Clear selection on view params change\n _view.subscribe(unselect);\n\n function handleTouchStart(jsEvent) {\n if (complexAction()) {\n let target = jsEvent.target;\n let stops = [];\n let stop = () => runAll(stops);\n stops.push(listen(window, 'touchmove', noop, {passive: false}))\n stops.push(listen(target, 'touchmove', createPreventDefaultHandler(() => interacting)));\n stops.push(listen(target, 'touchend', stop));\n stops.push(listen(target, 'touchcancel', stop));\n }\n }\n\n function createPreventDefaultHandler(condition) {\n return jsEvent => {\n if (condition()) {\n jsEvent.preventDefault();\n }\n };\n }\n</script>\n\n<svelte:window\n onpointermove={handlePointerMove}\n onpointerup={handlePointerUp}\n onpointercancel={handlePointerUp}\n onscroll={handleScroll}\n onselectstart={createPreventDefaultHandler(complexAction)}\n oncontextmenu={createPreventDefaultHandler(() => timer)}\n ontouchstart={handleTouchStart}\n/>\n","<script>\n import {getContext} from 'svelte';\n import {addDuration, cloneDate, getElementWithPayload, getPayload} from '#lib';\n\n let {_iEvents, slotDuration} = getContext('state');\n\n let x = 0, y = 0;\n\n $effect(() => {\n if ($_iEvents[0]) {\n removePointerEvent();\n }\n });\n\n function move() {\n let dayEl = getElementWithPayload(x, y);\n\n if (dayEl) {\n let {allDay, date, resource, disabled} = getPayload(dayEl)(x, y);\n if (!disabled) {\n let idx = allDay ? 2 : 1;\n\n if (!$_iEvents[idx]) {\n createPointerEvent(idx);\n }\n $_iEvents[idx].start = date;\n $_iEvents[idx].end = addDuration(cloneDate(date), $slotDuration);\n $_iEvents[idx].resourceIds = resource ? [resource.id] : [];\n\n return;\n }\n }\n\n removePointerEvent();\n }\n\n export function handleScroll() {\n move();\n }\n\n function handlePointerMove(jsEvent) {\n if (validEvent(jsEvent)) {\n x = jsEvent.clientX;\n y = jsEvent.clientY;\n move();\n }\n }\n\n function createPointerEvent(idx) {\n $_iEvents[idx] = {\n id: '{pointer}',\n title: '',\n display: 'pointer',\n extendedProps: {},\n backgroundColor: 'transparent',\n classNames: [],\n styles: []\n };\n }\n\n function removePointerEvent() {\n if ($_iEvents[1]) {\n $_iEvents[1] = null;\n }\n if ($_iEvents[2]) {\n $_iEvents[2] = null;\n }\n }\n\n function validEvent(jsEvent) {\n return jsEvent.isPrimary && jsEvent.pointerType === 'mouse';\n }\n</script>\n\n<svelte:window\n onpointermove={handlePointerMove}\n onscroll={handleScroll}\n/>\n","<script>\n import {getContext} from 'svelte';\n import {bgEvent, helperEvent} from '#lib';\n import {eventResizable} from './lib';\n\n let {chunk, axis, forceDate = undefined, forceMargin = undefined, children} = $props();\n\n let {theme, eventDurationEditable, eventResizableFromStart, editable, _interaction} = getContext('state');\n\n let event = $derived(chunk.event);\n let display = $derived(chunk.event.display);\n\n let resizable = $derived(\n !bgEvent(display) && !helperEvent(display) && eventResizable(event, $eventDurationEditable, $editable)\n );\n\n function createResizeHandler(start) {\n return jsEvent => $_interaction.action.resize(\n event,\n jsEvent,\n start,\n axis,\n forceDate?.(),\n forceMargin?.(),\n chunk.zeroDuration\n );\n }\n</script>\n\n{#if resizable && $eventResizableFromStart}\n <div class=\"{$theme.resizer} {$theme.start}\" onpointerdown={createResizeHandler(true)}></div>\n{/if}\n{@render children()}\n{#if resizable}\n <div class=\"{$theme.resizer}\" onpointerdown={createResizeHandler(false)}></div>\n{/if}\n","<script>\n import {getContext} from 'svelte';\n import {bgEvent, helperEvent, listen} from '#lib';\n import {eventDraggable} from './lib';\n import Action from './Action.svelte';\n import Pointer from './Pointer.svelte';\n import Resizer from './Resizer.svelte';\n\n let {theme, editable, eventStartEditable, pointer, _bodyEl,\n _interaction, _iClasses} = getContext('state');\n\n $_interaction.resizer = Resizer;\n\n $effect(() => {\n $theme;\n $eventStartEditable;\n $editable;\n $_iClasses = (classNames, event) => {\n let {display} = event;\n return [\n ...classNames,\n helperEvent(display)\n ? [$theme[display]]\n : (\n !bgEvent(display) && eventDraggable(event, $eventStartEditable, $editable)\n ? [$theme.draggable]\n : []\n )\n ];\n };\n });\n\n $effect(() => {\n if ($_bodyEl) {\n return listen($_bodyEl, 'scroll', bodyScrollHandler);\n }\n });\n\n function bodyScrollHandler() {\n for (let component of Object.values($_interaction)) {\n component?.handleScroll?.();\n }\n }\n</script>\n\n<Action bind:this={$_interaction.action}/>\n{#if $pointer}\n <Pointer bind:this={$_interaction.pointer}/>\n{/if}\n","import Auxiliary from './Auxiliary.svelte';\n\nexport default {\n createOptions(options) {\n options.dateClick = undefined;\n options.dragConstraint = undefined;\n options.dragScroll = true;\n options.editable = false;\n options.eventDragMinDistance = 5;\n options.eventDragStart = undefined;\n options.eventDragStop = undefined;\n options.eventDrop = undefined;\n options.eventDurationEditable = true;\n options.eventLongPressDelay = undefined;\n options.eventResizableFromStart = false;\n options.eventResizeStart = undefined;\n options.eventResizeStop = undefined;\n options.eventResize = undefined;\n options.eventStartEditable = true;\n options.longPressDelay = 1000;\n options.pointer = false;\n options.resizeConstraint = undefined;\n options.select = undefined;\n options.selectBackgroundColor = undefined; // ec option\n options.selectConstraint = undefined;\n options.selectLongPressDelay = undefined;\n options.selectMinDistance = 5;\n options.unselect = undefined;\n options.unselectAuto = true;\n options.unselectCancel = '';\n options.theme.draggable = 'ec-draggable';\n options.theme.ghost = 'ec-ghost';\n options.theme.preview = 'ec-preview';\n options.theme.pointer = 'ec-pointer';\n options.theme.resizer = 'ec-resizer';\n options.theme.start = 'ec-start';\n options.theme.dragging = 'ec-dragging';\n options.theme.resizingY = 'ec-resizing-y';\n options.theme.resizingX = 'ec-resizing-x';\n options.theme.selecting = 'ec-selecting';\n },\n\n createStores(state) {\n state._auxiliary.update($_auxiliary => [...$_auxiliary, Auxiliary]);\n }\n}\n","<script>\n import {getContext} from 'svelte';\n import {BaseEvent} from '#components';\n\n let {chunk} = $props();\n\n let {theme, _interaction} = getContext('state');\n\n // Style\n let styles = $derived(style => {\n delete style['background-color'];\n delete style['color'];\n return style;\n });\n</script>\n\n<BaseEvent {chunk} {styles} onpointerdown={$_interaction.action?.noAction}>\n {#snippet body(defaultBody, bgColor, txtColor)}\n <div class=\"{$theme.eventTag}\" style:background-color={bgColor}></div>\n {@render defaultBody()}\n {/snippet}\n</BaseEvent>\n","<script>\n import {getContext} from 'svelte';\n import {\n addDay, bgEvent, cloneDate, createEventChunk, datesEqual, eventIntersects, outsideRange, setContent, setPayload,\n sortEventChunks, toISOString\n } from '#lib';\n import Event from './Event.svelte';\n\n let {date} = $props();\n\n let {_filteredEvents, _interaction, _intlListDay, _intlListDaySide, _today,\n resources, filterEventsWithResources, highlightedDates, theme, validRange} = getContext('state');\n\n let el = $state();\n let isToday = $derived(datesEqual(date, $_today));\n let highlight = $derived($highlightedDates.some(d => datesEqual(d, date)));\n let disabled = $derived(outsideRange(date, $validRange));\n let datetime = $derived(toISOString(date, 10));\n\n let chunks = $derived.by(() => {\n let chunks = [];\n if (!disabled) {\n let start = date;\n let end = addDay(cloneDate(date));\n for (let event of $_filteredEvents) {\n if (!bgEvent(event.display) && eventIntersects(event, start, end, $filterEventsWithResources ? $resources : undefined)) {\n let chunk = createEventChunk(event, start, end);\n chunks.push(chunk);\n }\n }\n sortEventChunks(chunks);\n }\n return chunks;\n });\n\n // dateFromPoint\n $effect(() => {\n if (el) {\n setPayload(el, () => ({allDay: true, date, resource: undefined, dayEl: el, disabled}));\n }\n });\n</script>\n\n{#if chunks.length}\n <div\n bind:this={el}\n class=\"{$theme.day} {$theme.weekdays?.[date.getUTCDay()]}{isToday ? ' ' + $theme.today : ''}{highlight ? ' ' + $theme.highlight : ''}\"\n role=\"listitem\"\n onpointerdown={$_interaction.action?.select}\n >\n <!-- svelte-ignore a11y_missing_content -->\n <h4 class=\"{$theme.dayHead}\">\n <time {datetime} use:setContent={$_intlListDay.format(date)}></time>\n <time class=\"{$theme.daySide}\" {datetime} use:setContent={$_intlListDaySide.format(date)}></time>\n </h4>\n {#each chunks as chunk (chunk.event)}\n <Event {chunk}/>\n {/each}\n </div>\n{/if}\n","<script>\n import {getContext} from 'svelte';\n import {addDay, cloneDate, toViewWithLocalDates, setContent, bgEvent, isFunction} from '#lib';\n import Day from './Day.svelte';\n\n let {_bodyEl, _filteredEvents, _view, _viewDates, noEventsClick, noEventsContent, theme} = getContext('state');\n\n let noEvents = $derived.by(() => {\n let noEvents = true;\n if ($_viewDates.length) {\n let start = $_viewDates[0];\n let end = addDay(cloneDate($_viewDates.at(-1)));\n for (let event of $_filteredEvents) {\n if (!bgEvent(event.display) && event.start < end && event.end > start) {\n noEvents = false;\n break;\n }\n }\n }\n return noEvents;\n });\n\n let content = $derived(isFunction($noEventsContent) ? $noEventsContent() : $noEventsContent);\n\n function onclick(jsEvent) {\n if (isFunction($noEventsClick)) {\n $noEventsClick({jsEvent, view: toViewWithLocalDates($_view)});\n }\n }\n</script>\n\n<div bind:this={$_bodyEl} class=\"{$theme.body}\">\n <div class=\"{$theme.content}\">\n {#if noEvents}\n <!-- svelte-ignore a11y_click_events_have_key_events -->\n <!-- svelte-ignore a11y_no_static_element_interactions -->\n <div use:setContent={content} class=\"{$theme.noEvents}\" {onclick}></div>\n {:else}\n {#each $_viewDates as date}\n <Day {date}/>\n {/each}\n {/if}\n </div>\n</div>\n","<script>\n import Body from './Body.svelte';\n</script>\n\n<Body/>\n","import {btnTextDay, btnTextWeek, btnTextMonth, btnTextYear, intl, themeView} from '#lib';\nimport View from './View.svelte';\n\nexport default {\n createOptions(options) {\n // Common options\n options.buttonText.listDay = 'list';\n options.buttonText.listWeek = 'list';\n options.buttonText.listMonth = 'list';\n options.buttonText.listYear = 'list';\n options.listDayFormat = {weekday: 'long'};\n options.listDaySideFormat = {year: 'numeric', month: 'long', day: 'numeric'};\n options.noEventsClick = undefined; // ec option\n options.noEventsContent = 'No events';\n options.theme.daySide = 'ec-day-side';\n options.theme.eventTag = 'ec-event-tag';\n options.theme.noEvents = 'ec-no-events';\n options.view = 'listWeek';\n options.views.listDay = {\n buttonText: btnTextDay,\n component: View,\n duration: {days: 1},\n theme: themeView('ec-list ec-day-view')\n };\n options.views.listWeek = {\n buttonText: btnTextWeek,\n component: View,\n duration: {weeks: 1},\n theme: themeView('ec-list ec-week-view')\n };\n options.views.listMonth = {\n buttonText: btnTextMonth,\n component: View,\n duration: {months: 1},\n theme: themeView('ec-list ec-month-view')\n };\n options.views.listYear = {\n buttonText: btnTextYear,\n component: View,\n duration: {years: 1},\n theme: themeView('ec-list ec-year-view')\n };\n },\n\n createStores(state) {\n state._intlListDay = intl(state.locale, state.listDayFormat);\n state._intlListDaySide = intl(state.locale, state.listDaySideFormat);\n }\n}\n","import {derived} from 'svelte/store';\nimport {createDate, createSlotTimeLimits, createTimes, setMidnight} from '#lib';\n\nexport function times(state) {\n return derived(\n [state.slotDuration, state.slotLabelInterval, state._slotTimeLimits, state._intlSlotLabel],\n args => createTimes(setMidnight(createDate()), ...args)\n );\n}\n\nexport function slotTimeLimits(state) {\n return derived(\n [state.slotMinTime, state.slotMaxTime, state.flexibleSlotTimeLimits, state._viewDates, state._filteredEvents],\n args => createSlotTimeLimits(...args)\n );\n}\n","import {isFunction, sortEventChunks} from '#lib';\n\nexport function groupEventChunks(chunks) {\n if (!chunks.length) {\n return;\n }\n\n sortEventChunks(chunks);\n\n // Group\n let group = {\n columns: [],\n end: chunks[0].end\n };\n for (let chunk of chunks) {\n let c = 0;\n if (chunk.start < group.end) {\n for (; c < group.columns.length; ++c) {\n if (group.columns[c].at(-1).end <= chunk.start) {\n break;\n }\n }\n if (chunk.end > group.end) {\n group.end = chunk.end;\n }\n } else {\n group = {\n columns: [],\n end: chunk.end\n };\n }\n\n if (group.columns.length < c + 1) {\n group.columns.push([]);\n }\n group.columns[c].push(chunk);\n\n chunk.group = group;\n chunk.column = c;\n }\n}\n\nexport function createAllDayContent(allDayContent) {\n let text = 'all-day';\n let content;\n if (allDayContent) {\n content = isFunction(allDayContent) ? allDayContent({text}) : allDayContent;\n if (typeof content === 'string') {\n content = {html: content};\n }\n } else {\n content = {\n html: text\n };\n }\n\n return content;\n}\n","<script>\n import {getContext} from 'svelte';\n import {setContent} from '#lib';\n import {createAllDayContent} from './utils.js';\n\n let {children, lines} = $props();\n\n let {allDayContent, slotLabelInterval, theme, _times} = getContext('state');\n\n let allDayText = $derived(createAllDayContent($allDayContent));\n let showAllTimes = $derived($slotLabelInterval && $slotLabelInterval.seconds <= 0);\n</script>\n\n<div class=\"{$theme.sidebar}\">\n <div class=\"{$theme.sidebarTitle}\" use:setContent={allDayText}></div>\n {#each $_times as time, i}\n <time\n class=\"{$theme.time}{(i || showAllTimes) && time[2] ? '' : ' ' + $theme.minor}\"\n datetime=\"{time[0]}\"\n use:setContent={time[1]}\n ></time>\n {/each}\n</div>\n<div class=\"{$theme.days}\" role=\"row\">\n <div class=\"{$theme.lines}\">{#if lines}{@render lines()}{/if}</div>\n {#if children}\n {@render children()}\n {/if}\n</div>\n","<script>\n import {getContext, untrack} from 'svelte';\n import {observeResize} from '#lib';\n import Section from './Section.svelte';\n\n let {children} = $props();\n\n let {\n _bodyEl, _viewDates, _slotTimeLimits, _times, _recheckScrollable, scrollTime, slotDuration, slotHeight, theme\n } = getContext('state');\n\n let el = $state();\n\n $effect(() => {\n $_bodyEl = el;\n });\n\n $effect(() => {\n $_viewDates;\n $scrollTime;\n untrack(scrollToTime);\n });\n\n function scrollToTime() {\n el.scrollTop = (($scrollTime.seconds - $_slotTimeLimits.min.seconds) / $slotDuration.seconds - 0.5) * $slotHeight;\n }\n</script>\n\n<div\n bind:this={el}\n class=\"{$theme.body}\"\n use:observeResize={() => $_recheckScrollable = true}\n>\n <div class=\"{$theme.content}\">\n <Section {children}>\n {#snippet lines()}\n {#each $_times as time}\n <div class=\"{$theme.line}{time[2] ? '' : ' ' + $theme.minor}\"></div>\n {/each}\n {/snippet}\n </Section>\n </div>\n</div>\n","<script>\n import {getContext} from 'svelte';\n import {bgEvent, ghostEvent, helperEvent} from '#lib';\n import {InteractableEvent} from '#components';\n\n let {date, chunk} = $props();\n\n let {slotEventOverlap, slotDuration, slotHeight, _slotTimeLimits} = getContext('state');\n\n let display = $derived(chunk.event.display);\n\n // Style\n let styles = $derived(style => {\n let step = $slotDuration.seconds;\n let offset = $_slotTimeLimits.min.seconds;\n let start = (chunk.start - date) / 1000;\n let end = (chunk.end - date) / 1000;\n let top = (start - offset) / step * $slotHeight;\n let height = (end - start) / step * $slotHeight || $slotHeight;\n let maxHeight = ($_slotTimeLimits.max.seconds - start) / step * $slotHeight;\n style['top'] = `${top}px`;\n style['min-height'] = `${height}px`;\n style['height'] = `${height}px`;\n style['max-height'] = `${maxHeight}px`;\n if (!bgEvent(display) && !helperEvent(display) || ghostEvent(display)) {\n style['z-index'] = `${chunk.column + 1}`;\n style['left'] = `${100 / chunk.group.columns.length * chunk.column}%`;\n style['width'] = `${100 / chunk.group.columns.length * ($slotEventOverlap ? 0.5 * (1 + chunk.group.columns.length - chunk.column) : 1)}%`;\n }\n return style;\n });\n</script>\n\n<InteractableEvent {chunk} {styles} axis=\"y\" />\n","<script>\n import {getContext} from 'svelte';\n\n let {slotDuration, slotHeight, theme, _now, _today, _slotTimeLimits} = getContext('state');\n\n let start = $derived(($_now - $_today) / 1000);\n // Style\n let top = $derived.by(() => {\n let step = $slotDuration.seconds;\n let offset = $_slotTimeLimits.min.seconds;\n return (start - offset) / step * $slotHeight;\n });\n</script>\n\n<div\n class=\"{$theme.nowIndicator}\"\n style=\"top:{top}px\"\n></div>\n","<script>\n import {getContext, onMount} from 'svelte';\n import {\n addDuration, bgEvent, cloneDate, createEventChunk, datesEqual, eventIntersects, floor, outsideRange, rect,\n setPayload\n } from '#lib';\n import {groupEventChunks} from './utils.js';\n import Event from './Event.svelte';\n import NowIndicator from './NowIndicator.svelte';\n\n let {date, resource = undefined} = $props();\n\n let {_filteredEvents, _iEvents, highlightedDates, nowIndicator, slotDuration, slotHeight, filterEventsWithResources,\n theme, resources, validRange, _interaction, _today, _slotTimeLimits} = getContext('state');\n\n let el = $state();\n\n let isToday = $derived(datesEqual(date, $_today));\n let highlight = $derived($highlightedDates.some(d => datesEqual(d, date)));\n let disabled = $derived(outsideRange(date, $validRange));\n\n let start = $derived(addDuration(cloneDate(date), $_slotTimeLimits.min));\n let end = $derived(addDuration(cloneDate(date), $_slotTimeLimits.max));\n\n let resourceFilter = $derived(resource ?? ($filterEventsWithResources ? $resources : undefined));\n\n let [chunks, bgChunks] = $derived.by(() => {\n if (disabled) {\n return [[], []];\n }\n let chunks = [];\n let bgChunks = [];\n for (let event of $_filteredEvents) {\n if ((!event.allDay || bgEvent(event.display)) && eventIntersects(event, start, end, resourceFilter)) {\n let chunk = createEventChunk(event, start, end);\n switch (event.display) {\n case 'background': bgChunks.push(chunk); break;\n default: chunks.push(chunk);\n }\n }\n }\n groupEventChunks(chunks);\n return [chunks, bgChunks];\n });\n\n let iChunks = $derived.by(() => {\n if (disabled) {\n return [];\n }\n return $_iEvents.map(\n event => event && eventIntersects(event, start, end, resource) ? createEventChunk(event, start, end) : null\n );\n });\n\n function dateFromPoint(x, y) {\n y -= rect(el).top;\n return {\n allDay: false,\n date: addDuration(\n addDuration(cloneDate(date), $_slotTimeLimits.min),\n $slotDuration,\n floor(y / $slotHeight)\n ),\n resource,\n dayEl: el,\n disabled\n };\n }\n\n onMount(() => {\n setPayload(el, dateFromPoint);\n });\n</script>\n\n<div\n bind:this={el}\n class=\"{$theme.day} {$theme.weekdays?.[date.getUTCDay()]}{isToday ? ' ' + $theme.today : ''}{highlight ? ' ' + $theme.highlight : ''}{disabled ? ' ' + $theme.disabled : ''}\"\n role=\"cell\"\n onpointerdown={!disabled ? $_interaction.action?.select : undefined}\n>\n <div class=\"{$theme.bgEvents}\">\n {#if !disabled}\n {#each bgChunks as chunk (chunk.event)}\n <Event {date} {chunk}/>\n {/each}\n {/if}\n </div>\n <div class=\"{$theme.events}\">\n {#if !disabled}\n <!-- Pointer -->\n {#if iChunks[1]}\n <Event {date} chunk={iChunks[1]}/>\n {/if}\n {#each chunks as chunk (chunk.event)}\n <Event {date} {chunk}/>\n {/each}\n <!-- Drag, Resize & Select -->\n {#if iChunks[0] && !iChunks[0].event.allDay}\n <Event {date} chunk={iChunks[0]}/>\n {/if}\n {/if}\n </div>\n <div class=\"{$theme.extra}\">\n <!-- Now indicator -->\n {#if $nowIndicator && isToday && !disabled}\n <NowIndicator />\n {/if}\n </div>\n</div>\n","<script>\n import {ancestor, bgEvent, height, rect, repositionEvent} from '#lib';\n import {InteractableEvent} from '#components';\n\n let {chunk, longChunks = {}} = $props();\n\n let el = $state();\n let margin = $state(1);\n let event = $derived(chunk.event);\n let display = $derived(chunk.event.display);\n\n // Style\n let styles = $derived(style => {\n if (bgEvent(display)) {\n style['width'] = `calc(${chunk.days * 100}% + ${(chunk.days - 1)}px)`;\n } else {\n style['width'] = `calc(${chunk.days * 100}% + ${(chunk.days - 1) * 7}px)`;\n style['margin-top'] = `${event._margin ?? margin}px`;\n }\n return style;\n });\n\n export function reposition() {\n if (!el) {\n return;\n }\n margin = repositionEvent(chunk, longChunks, height(el));\n }\n</script>\n\n<InteractableEvent\n bind:el\n {chunk}\n {styles}\n axis=\"x\"\n forceMargin={() => rect(el).top - rect(ancestor(el, 1)).top}\n/>\n","<script>\n import {getContext, onMount} from 'svelte';\n import {datesEqual, outsideRange, runReposition, setPayload} from '../../../lib';\n import Event from './Event.svelte';\n\n let {date, chunks, bgChunks, longChunks, iChunks = [], resource = undefined} = $props();\n\n let {highlightedDates, theme, validRange, _interaction, _today} = getContext('state');\n\n let el = $state();\n let refs = [];\n\n let dayChunks = $derived(chunks.filter(chunk => datesEqual(chunk.date, date)));\n let dayBgChunks = $derived(bgChunks.filter(bgChunk => datesEqual(bgChunk.date, date)));\n\n let isToday = $derived(datesEqual(date, $_today));\n let highlight = $derived($highlightedDates.some(d => datesEqual(d, date)));\n let disabled = $derived(outsideRange(date, $validRange));\n\n // dateFromPoint\n onMount(() => {\n setPayload(el, () => ({\n allDay: true,\n date,\n resource,\n dayEl: el,\n disabled\n }));\n });\n\n export function reposition() {\n if (!disabled) {\n runReposition(refs, dayChunks);\n }\n }\n</script>\n\n<div\n bind:this={el}\n class=\"{$theme.day} {$theme.weekdays?.[date.getUTCDay()]}{isToday ? ' ' + $theme.today : ''}{highlight ? ' ' + $theme.highlight : ''}{disabled ? ' ' + $theme.disabled : ''}\"\n role=\"cell\"\n onpointerdown={!disabled ? $_interaction.action?.select : undefined}\n>\n <div class=\"{$theme.bgEvents}\">\n {#if !disabled}\n {#each dayBgChunks as chunk (chunk.event)}\n <Event {chunk}/>\n {/each}\n {/if}\n </div>\n <!-- Drag, Resize & Select -->\n {#if iChunks[0] && datesEqual(iChunks[0].date, date) && !disabled}\n <div class=\"{$theme.events} {$theme.preview}\">\n <Event chunk={iChunks[0]}/>\n </div>\n {/if}\n <div class=\"{$theme.events}\">\n {#if !disabled}\n {#each dayChunks as chunk, i (chunk.event)}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Event {chunk} {longChunks} bind:this={refs[i]}/>\n {/each}\n {/if}\n </div>\n</div>\n","<script>\n import {getContext, untrack} from 'svelte';\n import {\n addDay, bgEvent, cloneDate, createEventChunk, eventIntersects, limitToRange, prepareEventChunks, runReposition\n } from '../../../lib';\n import Day from './Day.svelte';\n\n let {dates, resource = undefined} = $props();\n\n let {_filteredEvents, _iEvents, hiddenDays, resources, filterEventsWithResources, validRange } = getContext('state');\n\n let refs = [];\n\n let start = $derived(limitToRange(dates[0], $validRange));\n let end = $derived(addDay(cloneDate(limitToRange(dates.at(-1), $validRange))));\n\n let resourceFilter = $derived(resource ?? (\n $filterEventsWithResources ? $resources : undefined\n ));\n\n let [chunks, bgChunks, longChunks] = $derived.by(() => {\n let chunks = [];\n let bgChunks = [];\n for (let event of $_filteredEvents) {\n if (event.allDay && eventIntersects(event, start, end, resourceFilter)) {\n let chunk = createEventChunk(event, start, end);\n if (bgEvent(event.display)) {\n bgChunks.push(chunk);\n } else {\n chunks.push(chunk);\n }\n }\n }\n prepareEventChunks(bgChunks, $hiddenDays);\n let longChunks = prepareEventChunks(chunks, $hiddenDays);\n return [chunks, bgChunks, longChunks];\n });\n\n function reposition() {\n runReposition(refs, dates);\n }\n $effect(() => {\n chunks;\n untrack(reposition);\n });\n\n let iChunks = $derived($_iEvents.map(event => {\n let chunk;\n if (event && event.allDay && eventIntersects(event, start, end, resource)) {\n chunk = createEventChunk(event, start, end);\n prepareEventChunks([chunk], $hiddenDays);\n } else {\n chunk = null;\n }\n return chunk;\n }));\n</script>\n\n{#each dates as date, i}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Day {date} {chunks} {bgChunks} {longChunks} {iChunks} {resource} bind:this={refs[i]} />\n{/each}\n\n<svelte:window on:resize={reposition}/>\n","<script>\n import {getContext} from 'svelte';\n import {datesEqual, setContent, toISOString} from '#lib';\n import Section from './Section.svelte';\n import Body from './Body.svelte';\n import Day from './Day.svelte';\n import Week from './all-day/Week.svelte';\n\n let {_viewDates, _intlDayHeader, _intlDayHeaderAL, _today, allDaySlot, theme} = getContext('state');\n</script>\n\n<div class=\"{$theme.header}\">\n <Section>\n {#each $_viewDates as date}\n <div\n class=\"{$theme.day} {$theme.weekdays?.[date.getUTCDay()]}{datesEqual(date, $_today) ? ' ' + $theme.today : ''}\"\n role=\"columnheader\"\n >\n <time\n datetime=\"{toISOString(date, 10)}\"\n aria-label=\"{$_intlDayHeaderAL.format(date)}\"\n use:setContent={$_intlDayHeader.format(date)}\n ></time>\n </div>\n {/each}\n </Section>\n <div class=\"{$theme.hiddenScroll}\"></div>\n</div>\n{#if $allDaySlot}\n <div class=\"{$theme.allDay}\">\n <div class=\"{$theme.content}\">\n <Section>\n <Week dates={$_viewDates}/>\n </Section>\n <div class=\"{$theme.hiddenScroll}\"></div>\n </div>\n </div>\n{/if}\n<Body>\n{#each $_viewDates as date}\n <Day {date}/>\n{/each}\n</Body>\n","import {btnTextDay, btnTextWeek, themeView} from '#lib';\nimport {slotTimeLimits, times} from './stores.js';\nimport View from './View.svelte';\n\nexport {default as Section} from './Section.svelte';\nexport {default as Body} from './Body.svelte';\nexport {default as Day} from './Day.svelte';\nexport {default as Week} from './all-day/Week.svelte';\n\nexport default {\n createOptions(options) {\n // Common options\n options.buttonText.timeGridDay = 'day';\n options.buttonText.timeGridWeek = 'week';\n options.view = 'timeGridWeek';\n options.views.timeGridDay = {\n buttonText: btnTextDay,\n component: View,\n dayHeaderFormat: {weekday: 'long'},\n duration: {days: 1},\n theme: themeView('ec-time-grid ec-day-view'),\n titleFormat: {year: 'numeric', month: 'long', day: 'numeric'}\n };\n options.views.timeGridWeek = {\n buttonText: btnTextWeek,\n component: View,\n duration: {weeks: 1},\n theme: themeView('ec-time-grid ec-week-view')\n };\n },\n\n createStores(state) {\n state._slotTimeLimits = slotTimeLimits(state); // flexible limits\n state._times = times(state);\n }\n}\n","<script>\n import {getContext, onMount, untrack} from 'svelte';\n import {setContent, toLocalDate, isFunction} from '#lib';\n\n let {resource, date = undefined, setLabel = undefined} = $props();\n\n let {resourceLabelContent, resourceLabelDidMount, _intlDayHeaderAL} = getContext('state');\n\n let el = $state();\n // Content\n let content = $derived.by(() => {\n if ($resourceLabelContent) {\n return isFunction($resourceLabelContent)\n ? $resourceLabelContent({\n resource,\n date: date ? toLocalDate(date) : undefined,\n })\n : $resourceLabelContent;\n } else {\n return resource.title;\n }\n });\n // Aria-label\n let ariaLabel = $state();\n $effect(() => {\n content;\n untrack(() => {\n if (date) {\n ariaLabel = $_intlDayHeaderAL.format(date) + ', ' + el.innerText;\n } else if (setLabel) {\n ariaLabel = undefined;\n setLabel(el.innerText);\n }\n });\n });\n\n onMount(() => {\n if (isFunction($resourceLabelDidMount)) {\n $resourceLabelDidMount({\n resource,\n date: date ? toLocalDate(date) : undefined,\n el\n });\n }\n });\n</script>\n\n<span\n bind:this={el}\n aria-label=\"{ariaLabel}\"\n use:setContent={content}\n></span>\n","<script>\n import {getContext} from 'svelte';\n import {datesEqual, setContent, toISOString} from '#lib';\n import {Section, Body, Day, Week} from '../time-grid/index.js';\n import Label from './Label.svelte';\n\n let {\n datesAboveResources, _today, _viewDates, _viewResources, _intlDayHeader, _intlDayHeaderAL, allDaySlot, theme\n } = getContext('state');\n\n let loops = $derived($datesAboveResources ? [$_viewDates, $_viewResources] : [$_viewResources, $_viewDates]);\n\n let resourceLabels = $state([]);\n</script>\n\n<div class=\"{$theme.header}\">\n <Section>\n {#each loops[0] as item0, i}\n <div class=\"{$theme.resource}\">\n {#if $datesAboveResources}\n <div class=\"{$theme.day} {$theme.weekdays?.[item0.getUTCDay()]}{datesEqual(item0, $_today) ? ' ' + $theme.today : ''}\">\n <time\n datetime=\"{toISOString(item0, 10)}\"\n aria-label=\"{$_intlDayHeaderAL.format(item0)}\"\n use:setContent={$_intlDayHeader.format(item0)}\n ></time>\n </div>\n {:else}\n <div class=\"{$theme.day}\">\n <Label resource={item0} setLabel={e => resourceLabels[i] = e.detail + ', '} />\n </div>\n {/if}\n {#if loops[1].length > 1}\n <div class=\"{$theme.days}\">\n {#each loops[1] as item1}\n {#if $datesAboveResources}\n <div class=\"{$theme.day}\" role=\"columnheader\">\n <Label resource={item1} date={item0} />\n </div>\n {:else}\n <div\n class=\"{$theme.day} {$theme.weekdays?.[item1.getUTCDay()]}{datesEqual(item1, $_today) ? ' ' + $theme.today : ''}\"\n role=\"columnheader\"\n >\n <time\n datetime=\"{toISOString(item1, 10)}\"\n aria-label=\"{resourceLabels[i]}{$_intlDayHeaderAL.format(item1)}\"\n use:setContent={$_intlDayHeader.format(item1)}\n ></time>\n </div>\n {/if}\n {/each}\n </div>\n {/if}\n </div>\n {/each}\n </Section>\n <div class=\"{$theme.hiddenScroll}\"></div>\n</div>\n{#if $allDaySlot}\n <div class=\"{$theme.allDay}\">\n <div class=\"{$theme.content}\">\n <Section>\n {#if $datesAboveResources}\n {#each $_viewDates as date}\n <div class=\"{$theme.resource}\">\n {#each $_viewResources as resource}\n <Week dates={[date]} {resource}/>\n {/each}\n </div>\n {/each}\n {:else}\n {#each $_viewResources as resource}\n <div class=\"{$theme.resource}\">\n <Week dates={$_viewDates} {resource}/>\n </div>\n {/each}\n {/if}\n </Section>\n <div class=\"{$theme.hiddenScroll}\"></div>\n </div>\n </div>\n{/if}\n<Body>\n{#each loops[0] as item0}\n <div class=\"{$theme.resource}\">\n {#each loops[1] as item1}\n <Day\n date={$datesAboveResources ? item0 : item1}\n resource={$datesAboveResources ? item1 : item0}\n />\n {/each}\n </div>\n{/each}\n</Body>\n","import {btnTextDay, btnTextWeek, themeView, viewResources} from '#lib';\nimport TimeGrid from '../time-grid/index.js';\nimport View from './View.svelte';\n\nexport default {\n createOptions(options) {\n options.datesAboveResources = false;\n // Common options\n options.buttonText.resourceTimeGridDay = 'resources';\n options.buttonText.resourceTimeGridWeek = 'resources';\n options.view = 'resourceTimeGridWeek';\n options.views.resourceTimeGridDay = {\n buttonText: btnTextDay,\n component: View,\n duration: {days: 1},\n theme: themeView('ec-time-grid ec-resource-day-view')\n };\n options.views.resourceTimeGridWeek = {\n buttonText: btnTextWeek,\n component: View,\n duration: {weeks: 1},\n theme: themeView('ec-time-grid ec-resource-week-view')\n };\n },\n\n createStores(state) {\n if (!('_times' in state)) {\n TimeGrid.createStores(state);\n }\n if (!('_viewResources' in state)) {\n state._viewResources = viewResources(state);\n }\n }\n}\n","import {derived} from 'svelte/store';\nimport {createSlotTimeLimits, createTimes, getPayload} from '#lib';\n\n// slotTimeLimits per day\nexport function dayTimeLimits(state) {\n return derived(\n [state.slotMinTime, state.slotMaxTime, state.flexibleSlotTimeLimits, state._viewDates, state._filteredEvents],\n ([$slotMinTime, $slotMaxTime, $flexibleSlotTimeLimits, $_viewDates, $_filteredEvents]) => {\n let dayTimeLimits = {};\n for (let date of $_viewDates) {\n dayTimeLimits[date.getTime()] = createSlotTimeLimits(\n $slotMinTime,\n $slotMaxTime,\n $flexibleSlotTimeLimits,\n [date],\n $_filteredEvents\n );\n }\n\n return dayTimeLimits;\n }\n );\n}\n\nexport function dayTimes(state) {\n return derived(\n [state._viewDates, state.slotDuration, state.slotLabelInterval, state._dayTimeLimits, state._intlSlotLabel],\n ([$_viewDates, $slotDuration, $slotLabelInterval, $_dayTimeLimits, $_intlSlotLabel]) => {\n let dayTimes = {};\n for (let date of $_viewDates) {\n let time = date.getTime();\n dayTimes[time] = time in $_dayTimeLimits\n ? createTimes(date, $slotDuration, $slotLabelInterval, $_dayTimeLimits[time], $_intlSlotLabel)\n : [];\n }\n\n return dayTimes;\n }\n );\n}\n\nexport function nestedResources(state) {\n return derived(state.resources, $resources => $resources.some(resource => getPayload(resource).children.length));\n}\n","<script>\n import {getContext, onMount, untrack} from 'svelte';\n import {ceil, height, setContent, toLocalDate, isFunction} from '#lib';\n\n let {resource, date = undefined} = $props();\n\n let {resourceLabelContent, resourceLabelDidMount, _resHs} = getContext('state');\n\n let el = $state();\n // Content\n let content = $derived.by(() => {\n if ($resourceLabelContent) {\n return isFunction($resourceLabelContent)\n ? $resourceLabelContent({\n resource,\n date: date ? toLocalDate(date) : undefined,\n })\n : $resourceLabelContent;\n } else {\n return resource.title;\n }\n });\n\n $effect(() => {\n content;\n untrack(() => {\n $_resHs.set(resource, ceil(height(el) + 10));\n $_resHs = $_resHs;\n });\n });\n\n onMount(() => {\n if (isFunction($resourceLabelDidMount)) {\n $resourceLabelDidMount({\n resource,\n date: date ? toLocalDate(date) : undefined,\n el\n });\n }\n });\n</script>\n\n<span\n bind:this={el}\n use:setContent={content}\n></span>\n","<script>\n import {getContext} from 'svelte';\n import {getPayload, identity} from '#lib';\n\n let {resource} = $props();\n\n let {resources, theme} = getContext('state');\n\n let payload = $state.raw({});\n let expanded = $state(true);\n\n $effect.pre(() => {\n payload = getPayload(resource);\n expanded = payload.expanded;\n });\n\n function onclick() {\n expanded = !expanded;\n payload.expanded = expanded;\n toggle(payload.children, expanded);\n resources.update(identity);\n }\n\n function toggle(children, expand) {\n for (let child of children) {\n let payload = getPayload(child);\n payload.hidden = !expand;\n if (payload.expanded) {\n toggle(payload.children, expand);\n }\n }\n }\n</script>\n\n{#each Array(payload.level) as level}\n <span class=\"{$theme.expander}\"></span>\n{/each}\n\n<span class=\"{$theme.expander}\">\n {#if payload.children?.length}\n <button class=\"{$theme.button}\" {onclick}>\n {#if expanded}&minus;{:else}&plus;{/if}\n </button>\n {/if}\n</span>\n","<script>\n import {getContext, untrack} from 'svelte';\n import {max} from '#lib';\n import Label from './Label.svelte';\n import Expander from './Expander.svelte';\n\n let {_viewResources, _headerHeight, _bodyEl, _daysHs, _resHs, _sidebarEl, _nestedResources, theme} = getContext('state');\n\n $effect.pre(() => {\n $_viewResources;\n untrack(() => {\n $_resHs.clear();\n });\n });\n\n function onwheel(jsEvent) {\n $_bodyEl.scrollBy({\n top: jsEvent.deltaY < 0 ? -30 : 30\n });\n }\n</script>\n\n<div class=\"{$theme.sidebar}\">\n <div class=\"{$theme.sidebarTitle}\" style=\"flex-basis: {$_headerHeight}px\"></div>\n <div class=\"{$theme.content}\" bind:this={$_sidebarEl} {onwheel}>\n {#each $_viewResources as resource}\n <div class=\"{$theme.resource}\" style=\"flex-basis: {max($_daysHs.get(resource) ?? 0, $_resHs.get(resource) ?? 0, 34)}px\" role=\"rowheader\">\n {#if $_nestedResources}\n <Expander {resource} />\n {/if}\n <Label {resource}/>\n </div>\n {/each}\n </div>\n</div>\n","<script>\n import {getContext} from 'svelte';\n import {datesEqual, setContent, toISOString, toSeconds, observeResize} from '#lib';\n\n let {_headerEl, _headerHeight, _intlDayHeader, _intlDayHeaderAL, _dayTimes, _today, _viewDates,\n slotDuration, theme} = getContext('state');\n</script>\n\n<div class=\"{$theme.header}\" bind:this={$_headerEl} use:observeResize={() => $_headerHeight = $_headerEl.clientHeight}>\n <div class=\"{$theme.days}\" role=\"row\">\n {#each $_viewDates as date}\n <div class=\"{$theme.day} {$theme.weekdays?.[date.getUTCDay()]}{datesEqual(date, $_today) ? ' ' + $theme.today : ''}\">\n {#if toSeconds($slotDuration)}\n <div class=\"{$theme.dayHead}\">\n <time\n datetime=\"{toISOString(date, 10)}\"\n aria-label=\"{$_intlDayHeaderAL.format(date)}\"\n use:setContent={$_intlDayHeader.format(date)}\n ></time>\n </div>\n <div class=\"{$theme.times}\">\n {#each $_dayTimes[date.getTime()] as time}\n <div class=\"{$theme.time}{time[2] ? '' : ' ' + $theme.minor}\" role=\"columnheader\">\n <time\n datetime=\"{time[0]}\"\n use:setContent={time[1]}\n ></time>\n </div>\n {/each}\n </div>\n {:else}\n <div class=\"{$theme.time}\" role=\"columnheader\">\n <time\n datetime=\"{toISOString(date, 10)}\"\n aria-label=\"{$_intlDayHeaderAL.format(date)}\"\n use:setContent={$_intlDayHeader.format(date)}\n ></time>\n </div>\n {/if}\n </div>\n {/each}\n </div>\n <div class=\"{$theme.hiddenScroll}\"></div>\n</div>\n","import {addDay, addDuration, cloneDate, createDuration, datesEqual, sortEventChunks, toSeconds} from '#lib';\n\nexport function prepareEventChunks(chunks, $_viewDates, $_dayTimeLimits, $slotDuration) {\n let longChunks = {};\n let filteredChunks = [];\n\n if (chunks.length) {\n sortEventChunks(chunks);\n\n let step = toSeconds($slotDuration);\n let prevChunk;\n for (let chunk of chunks) {\n let prevDayEnd;\n if (step) {\n let slots = 0;\n for (let i = 0; i < $_viewDates.length; ++i) {\n let slotTimeLimits = getSlotTimeLimits($_dayTimeLimits, $_viewDates[i]);\n let dayStart = addDuration(cloneDate($_viewDates[i]), slotTimeLimits.min);\n let dayEnd = addDuration(cloneDate($_viewDates[i]), slotTimeLimits.max);\n if (!chunk.date) {\n if (chunk.start < dayEnd && chunk.end > dayStart) {\n // The first day is found\n chunk.date = $_viewDates[i];\n if (chunk.start < dayStart) {\n // Adjust chunk start\n chunk.start = dayStart;\n }\n // Calculate offset\n chunk.offset = (chunk.start - dayStart) / 1000 / step;\n // Calculate slots\n if (chunk.end > dayEnd) {\n slots += dayEnd - chunk.start;\n } else {\n slots += chunk.end - chunk.start || step * 1000;\n break;\n }\n }\n } else {\n if (chunk.end <= dayStart) {\n // Adjust chunk end\n chunk.end = prevDayEnd;\n break;\n }\n // The chunk is long one\n let key = $_viewDates[i].getTime();\n if (longChunks[key]) {\n longChunks[key].push(chunk);\n } else {\n longChunks[key] = [chunk];\n }\n // Calculate slots\n if (chunk.end > dayEnd) {\n slots += dayEnd - dayStart;\n } else {\n slots += chunk.end - dayStart;\n break;\n }\n }\n prevDayEnd = dayEnd;\n }\n chunk.slots = slots / 1000 / step;\n } else {\n // Month view\n let days = 0;\n for (let i = 0; i < $_viewDates.length; ++i) {\n let dayStart = $_viewDates[i];\n let dayEnd = addDay(cloneDate(dayStart));\n if (!chunk.date) {\n if (chunk.start < dayEnd) {\n // The first day is found\n chunk.date = dayStart;\n if (chunk.start < dayStart) {\n // Adjust chunk start\n chunk.start = dayStart;\n }\n ++days;\n }\n } else {\n if (chunk.end <= dayStart) {\n // Adjust chunk end\n chunk.end = prevDayEnd;\n break;\n }\n // The chunk is long one\n let key = dayStart.getTime();\n if (longChunks[key]) {\n longChunks[key].push(chunk);\n } else {\n longChunks[key] = [chunk];\n }\n ++days;\n }\n prevDayEnd = dayEnd;\n }\n chunk.days = days;\n }\n\n if (!chunk.date) {\n // Chunk is outside the slot time limits, so skip it\n continue;\n }\n\n if (prevChunk && datesEqual(prevChunk.date, chunk.date)) {\n chunk.prev = prevChunk;\n }\n prevChunk = chunk;\n filteredChunks.push(chunk);\n }\n }\n\n return [filteredChunks, longChunks];\n}\n\nexport function repositionEvent(chunk, dayChunks, longChunks, height, allDay) {\n chunk.top = 0;\n chunk.bottom = height;\n let margin = 1;\n let key = chunk.date.getTime();\n longChunks = longChunks?.[key] ?? [];\n let chunks = [...dayChunks, ...longChunks];\n chunks.sort((a, b) => (a.top ?? 0) - (b.top ?? 0) || a.start - b.start || b.event.allDay - a.event.allDay);\n for (let dayChunk of chunks) {\n if (dayChunk === chunk) {\n continue;\n }\n if ((allDay || chunk.start < dayChunk.end && chunk.end > dayChunk.start) && chunk.top < dayChunk.bottom && chunk.bottom > dayChunk.top) {\n let offset = dayChunk.bottom - chunk.top + 1;\n margin += offset;\n chunk.top += offset;\n chunk.bottom += offset;\n }\n }\n\n return margin;\n}\n\nexport function getSlotTimeLimits($_dayTimeLimits, date) {\n return $_dayTimeLimits[date.getTime()] ?? {min: createDuration(0), max: createDuration(0)};\n}\n","<script>\n import {getContext} from 'svelte';\n import {height, helperEvent, toSeconds} from '#lib';\n import {repositionEvent} from './lib.js';\n import {InteractableEvent} from '#components';\n\n let {chunk, dayChunks = [], longChunks = {}, resource = undefined} = $props();\n\n let {slotDuration, slotWidth} = getContext('state');\n\n let el = $state();\n let margin = $state(helperEvent(chunk.event.display) ? 1 : 0);\n let event = $derived(chunk.event);\n // Style\n let width = $derived('slots' in chunk ? chunk.slots * $slotWidth : chunk.days * 100);\n let styles = $derived(style => {\n if ('slots' in chunk) {\n let left = chunk.offset * $slotWidth;\n style['left'] = `${left}px`;\n style['width'] = `${width}px`;\n } else {\n // Month view\n style['width'] = `${width}%`;\n }\n let marginTop = margin;\n if (event._margin) {\n // Force margin for helper events\n let [_margin, _resource] = event._margin;\n if (resource === _resource) {\n marginTop = _margin;\n }\n }\n style['margin-top'] = `${marginTop}px`;\n return style;\n });\n\n export function reposition() {\n if (!el) {\n return 0;\n }\n let h = height(el);\n margin = repositionEvent(chunk, dayChunks, longChunks, h, !toSeconds($slotDuration));\n return margin + h;\n }\n</script>\n\n{#if width > 0}\n <InteractableEvent bind:el {chunk} {styles} axis=\"x\" forceMargin={() => [margin, resource]} />\n{/if}\n","<script>\n import {getContext} from 'svelte';\n import {\n addDuration, ceil, cloneDate, datesEqual, floor, max, outsideRange, rect, runReposition, setPayload, toSeconds\n } from '#lib';\n import {getSlotTimeLimits} from './lib.js';\n import Event from './Event.svelte';\n\n let {date, resource, chunks, bgChunks, longChunks, iChunks = []} = $props();\n\n let {\n highlightedDates, slotDuration, slotWidth, theme, validRange, _interaction, _today, _dayTimeLimits\n } = getContext('state');\n\n let el = $state();\n let refs = [];\n\n let isToday = $derived(datesEqual(date, $_today));\n let highlight = $derived($highlightedDates.some(d => datesEqual(d, date)));\n let disabled = $derived(outsideRange(date, $validRange));\n\n let slotTimeLimits = $derived(getSlotTimeLimits($_dayTimeLimits, date));\n let allDay = $derived(!toSeconds($slotDuration));\n let pointerIdx = $derived(allDay ? 2 : 1);\n\n let dayChunks = $derived(chunks.filter(chunkIntersects));\n let dayBgChunks = $derived(bgChunks.filter(bgChunk => (!allDay || bgChunk.event.allDay) && chunkIntersects(bgChunk)));\n\n function chunkIntersects(chunk) {\n return datesEqual(chunk.date, date);\n }\n\n function dateFromPoint(x, y) {\n x -= rect(el).left;\n return {\n allDay,\n date: allDay\n ? cloneDate(date)\n : addDuration(\n addDuration(cloneDate(date), slotTimeLimits.min),\n $slotDuration,\n floor(x / $slotWidth)\n ),\n resource,\n dayEl: el,\n disabled\n };\n }\n $effect(() => {\n setPayload(el, dateFromPoint);\n });\n\n export function reposition() {\n return max(...runReposition(refs, dayChunks));\n }\n</script>\n\n<div\n bind:this={el}\n class=\"{$theme.day} {$theme.weekdays?.[date.getUTCDay()]}{isToday ? ' ' + $theme.today : ''}{highlight ? ' ' + $theme.highlight : ''}{disabled ? ' ' + $theme.disabled : ''}\"\n style=\"flex-grow: {allDay ? null : ceil((toSeconds(slotTimeLimits.max) - toSeconds(slotTimeLimits.min)) / toSeconds($slotDuration))}\"\n role=\"cell\"\n onpointerdown={$_interaction.action?.select}\n>\n <div class=\"{$theme.events}\">\n {#if !disabled}\n {#each dayBgChunks as chunk (chunk.event)}\n <Event {chunk}/>\n {/each}\n <!-- Pointer -->\n {#if iChunks[pointerIdx] && chunkIntersects(iChunks[pointerIdx])}\n <Event chunk={iChunks[pointerIdx]}/>\n {/if}\n {#each dayChunks as chunk, i (chunk.event)}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Event {chunk} {dayChunks} {longChunks} {resource} bind:this={refs[i]}/>\n {/each}\n <!-- Drag, Resize & Select -->\n {#if iChunks[0] && chunkIntersects(iChunks[0])}\n <Event chunk={iChunks[0]} {resource}/>\n {/if}\n {/if}\n </div>\n</div>\n","<script>\n import {getContext} from 'svelte';\n import {\n addDay, addDuration, bgEvent, ceil, cloneDate, createEventChunk, DAY_IN_SECONDS, eventIntersects,\n limitToRange, max, runReposition\n } from '#lib';\n import {getSlotTimeLimits, prepareEventChunks} from './lib.js';\n import Day from './Day.svelte';\n\n let {resource} = $props();\n\n let {\n _viewDates, _filteredEvents, _iEvents, _dayTimeLimits, _daysHs, _resHs, slotDuration, theme, validRange\n } = getContext('state');\n\n let refs = [];\n\n let [start, end] = $derived.by(() => {\n let start = cloneDate(limitToRange($_viewDates[0], $validRange));\n let end = cloneDate(limitToRange($_viewDates.at(-1), $validRange));\n let slotTimeLimits = getSlotTimeLimits($_dayTimeLimits, start);\n addDuration(start, slotTimeLimits.min);\n slotTimeLimits = getSlotTimeLimits($_dayTimeLimits, end);\n if (slotTimeLimits.max.seconds > DAY_IN_SECONDS) {\n addDuration(end, slotTimeLimits.max) /** @see https://github.com/vkurko/calendar/issues/333 */\n } else {\n addDay(end);\n }\n return [start, end];\n });\n\n let [chunks, bgChunks, longChunks] = $derived.by(() => {\n let chunks = [];\n let bgChunks = [];\n let longChunks;\n for (let event of $_filteredEvents) {\n if (eventIntersects(event, start, end, resource)) {\n let chunk = createEventChunk(event, start, end);\n if (bgEvent(event.display)) {\n bgChunks.push(chunk);\n } else {\n chunks.push(chunk);\n }\n }\n }\n [bgChunks] = prepareEventChunks(bgChunks, $_viewDates, $_dayTimeLimits, $slotDuration);\n [chunks, longChunks] = prepareEventChunks(chunks, $_viewDates, $_dayTimeLimits, $slotDuration);\n return [chunks, bgChunks, longChunks];\n });\n\n let iChunks = $derived($_iEvents.map(event => {\n let chunk;\n if (event && eventIntersects(event, start, end, resource)) {\n chunk = createEventChunk(event, start, end);\n [[chunk]] = prepareEventChunks([chunk], $_viewDates, $_dayTimeLimits, $slotDuration);\n } else {\n chunk = null;\n }\n return chunk;\n }));\n\n export function reposition() {\n $_daysHs.set(resource, ceil(max(...runReposition(refs, $_viewDates))) + 10);\n $_daysHs = $_daysHs;\n }\n</script>\n\n<div class=\"{$theme.days}\" style=\"flex-basis: {max($_daysHs.get(resource) ?? 0, $_resHs.get(resource) ?? 0, 34)}px\" role=\"row\">\n {#each $_viewDates as date, i}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Day {date} {resource} {chunks} {bgChunks} {longChunks} {iChunks} bind:this={refs[i]}/>\n {/each}\n</div>\n","<script>\n import {getContext, untrack} from 'svelte';\n import {observeResize, runReposition, toSeconds} from '#lib';\n import {getSlotTimeLimits} from './lib.js';\n import Days from './Days.svelte';\n\n let {_bodyEl, _bodyHeight, _bodyWidth, _bodyScrollLeft, _headerEl, _filteredEvents, _sidebarEl, _dayTimes, _dayTimeLimits,\n _recheckScrollable, _daysHs, _viewResources, _viewDates, scrollTime, slotDuration, slotWidth, theme} = getContext('state');\n\n let refs = [];\n\n function scrollToTime() {\n let slotTimeLimits = getSlotTimeLimits($_dayTimeLimits, $_viewDates[0]);\n $_bodyEl.scrollLeft = (toSeconds($scrollTime) - toSeconds(slotTimeLimits.min)) / toSeconds($slotDuration) * $slotWidth;\n $_bodyScrollLeft = $_bodyEl.scrollLeft;\n }\n $effect(() => {\n $_viewDates;\n $scrollTime;\n untrack(scrollToTime);\n });\n\n function reposition() {\n $_daysHs.clear();\n runReposition(refs, $_viewResources);\n }\n $effect(() => {\n $_filteredEvents;\n $_viewResources;\n untrack(reposition);\n });\n\n function onscroll() {\n $_headerEl.scrollLeft = $_bodyEl.scrollLeft;\n $_sidebarEl.scrollTop = $_bodyEl.scrollTop;\n $_bodyScrollLeft = $_bodyEl.scrollLeft;\n }\n\n function onresize() {\n $_bodyHeight = $_bodyEl.clientHeight;\n $_bodyWidth = $_bodyEl.clientWidth;\n $_recheckScrollable = true;\n }\n</script>\n\n<div\n bind:this={$_bodyEl}\n class=\"{$theme.body}\"\n {onscroll}\n use:observeResize={onresize}\n>\n <div class=\"{$theme.content}\">\n <div class=\"{$theme.lines}\">\n {#each $_viewDates as date}\n {#each $_dayTimes[date.getTime()] as time}\n <div class=\"{$theme.line}{time[2] ? '' : ' ' + $theme.minor}\"></div>\n {/each}\n {/each}\n </div>\n {#each $_viewResources as resource, i}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Days {resource} bind:this={refs[i]}/>\n {/each}\n </div>\n</div>\n\n<svelte:window on:resize={reposition}/>\n","<script>\n import {getContext} from 'svelte';\n import {addDuration, cloneDate, datesEqual} from '#lib';\n import {getSlotTimeLimits} from './lib.js';\n\n let {slotDuration, slotWidth, theme, _bodyHeight, _bodyWidth, _bodyScrollLeft,\n _headerHeight, _dayTimeLimits, _now, _today, _viewDates} = getContext('state');\n\n // Style\n let left = $derived.by(() => {\n let offset = 0;\n for (let i = 0; i < $_viewDates.length; ++i) {\n let slotTimeLimits = getSlotTimeLimits($_dayTimeLimits, $_viewDates[i]);\n if (datesEqual($_viewDates[i], $_today)) {\n let dayStart = addDuration(cloneDate($_viewDates[i]), slotTimeLimits.min);\n let dayEnd = addDuration(cloneDate($_viewDates[i]), slotTimeLimits.max);\n if ($_now >= dayStart && $_now <= dayEnd) {\n offset += ($_now - dayStart) / 1000;\n break;\n } else {\n return null;\n }\n } else {\n offset += slotTimeLimits.max.seconds - slotTimeLimits.min.seconds;\n }\n }\n let step = $slotDuration.seconds;\n return offset / step * $slotWidth - $_bodyScrollLeft;\n });\n</script>\n\n{#if left !== null && left >= 3 && left <= $_bodyWidth - 3}\n <div\n class=\"{$theme.nowIndicator}\"\n style:top=\"{$_headerHeight+2}px\"\n style:left=\"{left}px\"\n style:height=\"{$_bodyHeight-1}px\"\n ></div>\n{/if}\n","<script>\n import {getContext} from 'svelte';\n import Sidebar from './Sidebar.svelte';\n import Header from './Header.svelte';\n import Body from './Body.svelte';\n import NowIndicator from './NowIndicator.svelte';\n\n let {nowIndicator, theme} = getContext('state');\n</script>\n\n<div class=\"{$theme.container}\">\n <Sidebar/>\n <div class=\"{$theme.main}\">\n <Header/>\n <Body/>\n {#if $nowIndicator}\n <NowIndicator/>\n {/if}\n </div>\n</div>\n","import {writable} from 'svelte/store';\nimport {btnTextDay, btnTextMonth, btnTextWeek, themeView, viewResources} from '#lib';\nimport {dayTimeLimits, dayTimes, nestedResources} from './stores.js';\nimport View from './View.svelte';\n\nexport default {\n\tcreateOptions(options) {\n\t\t// Common options\n\t\toptions.buttonText.resourceTimelineDay = 'timeline';\n\t\toptions.buttonText.resourceTimelineWeek = 'timeline';\n\t\toptions.buttonText.resourceTimelineMonth = 'timeline';\n\t\toptions.theme.expander = 'ec-expander';\n\t\toptions.theme.main = 'ec-main';\n\t\toptions.theme.times = 'ec-times';\n\t\toptions.theme.container = 'ec-container';\n\t\toptions.view = 'resourceTimelineWeek';\n\t\toptions.views.resourceTimelineDay = {\n\t\t\tbuttonText: btnTextDay,\n\t\t\tcomponent: View,\n\t\t\tdisplayEventEnd: false,\n\t\t\tdayHeaderFormat: {weekday: 'long'},\n\t\t\tduration: {days: 1},\n\t\t\tslotDuration: '01:00',\n\t\t\ttheme: themeView('ec-timeline ec-resource-day-view'),\n\t\t\ttitleFormat: {year: 'numeric', month: 'long', day: 'numeric'}\n\t\t};\n\t\toptions.views.resourceTimelineWeek = {\n\t\t\tbuttonText: btnTextWeek,\n\t\t\tcomponent: View,\n\t\t\tdisplayEventEnd: false,\n\t\t\tduration: {weeks: 1},\n\t\t\tslotDuration: '01:00',\n\t\t\ttheme: themeView('ec-timeline ec-resource-week-view')\n\t\t};\n\t\toptions.views.resourceTimelineMonth = {\n\t\t\tbuttonText: btnTextMonth,\n\t\t\tcomponent: View,\n\t\t\tdisplayEventEnd: false,\n\t\t\tdayHeaderFormat: {\n\t\t\t\tweekday: 'short',\n\t\t\t\tday: 'numeric'\n\t\t\t},\n\t\t\tduration: {months: 1},\n\t\t\tslotDuration: {days: 1},\n\t\t\ttheme: themeView('ec-timeline ec-resource-month-view'),\n\t\t\ttitleFormat: {year: 'numeric', month: 'long'}\n\t\t};\n\t},\n\n\tcreateStores(state) {\n\t\tif (!('_viewResources' in state)) {\n\t\t\tstate._viewResources = viewResources(state);\n\t\t}\n\t\tstate._bodyHeight = writable(0);\n\t\tstate._bodyWidth = writable(0);\n\t\tstate._bodyScrollLeft = writable(0);\n\t\tstate._headerEl = writable(undefined);\n\t\tstate._headerHeight = writable(0);\n\t\tstate._dayTimeLimits = dayTimeLimits(state); // flexible time limits per day\n\t\tstate._dayTimes = dayTimes(state);\n\t\tstate._daysHs = writable(new Map()); // days row heights\n\t\tstate._nestedResources = nestedResources(state);\n\t\tstate._resHs = writable(new Map()); // resource row heights\n\t\tstate._sidebarEl = writable(undefined);\n\t}\n}\n","import {mount, unmount} from 'svelte';\nimport {Calendar} from './index.svelte.js';\n\nexport function createCalendar(target, plugins, options) {\n return mount(Calendar, {\n target,\n props: {\n plugins,\n options\n }\n });\n}\n\nexport function destroyCalendar(calendar) {\n return unmount(calendar);\n}\n\nexport {\n DayGrid,\n Interaction,\n List,\n ResourceTimeGrid,\n ResourceTimeline,\n TimeGrid\n} from './index.svelte.js';\n","import {createCalendar, DayGrid, Interaction, List, ResourceTimeGrid, ResourceTimeline, TimeGrid} from './index.es.js';\n\nexport function create(target, options) {\n return createCalendar(target, [\n DayGrid,\n Interaction,\n List,\n ResourceTimeGrid,\n ResourceTimeline,\n TimeGrid\n ], options);\n}\n\nexport {destroyCalendar as destroy} from './index.es.js';\n"],"names":["is_array","index_of","array_from","define_property","get_descriptor","get_descriptors","object_prototype","array_prototype","get_prototype_of","is_extensible","noop","run","fn","run_all","arr","i","deferred","resolve","reject","promise","res","rej","to_array","value","n","array","element","DERIVED","EFFECT","RENDER_EFFECT","BLOCK_EFFECT","BRANCH_EFFECT","ROOT_EFFECT","BOUNDARY_EFFECT","UNOWNED","DISCONNECTED","CLEAN","DIRTY","MAYBE_DIRTY","INERT","DESTROYED","EFFECT_RAN","EFFECT_TRANSPARENT","INSPECT_EFFECT","HEAD_EFFECT","EFFECT_PRESERVED","USER_EFFECT","REACTION_IS_UPDATING","ASYNC","ERROR_VALUE","STATE_SYMBOL","LEGACY_PROPS","LOADING_ATTR_SYMBOL","STALE_REACTION","__publicField","await_outside_boundary","lifecycle_outside_component","name","async_derived_orphan","effect_in_teardown","rune","effect_in_unowned_derived","effect_orphan","effect_update_depth_exceeded","props_invalid_value","key","state_descriptors_fixed","state_prototype_fixed","state_unsafe_mutation","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","TEMPLATE_FRAGMENT","TEMPLATE_USE_IMPORT_NODE","UNINITIALIZED","NAMESPACE_HTML","hydrating","equals","safe_not_equal","a","b","safe_equals","legacy_mode_flag","tracing_mode_flag","enable_legacy_mode_flag","component_context","set_component_context","context","getContext","get_or_init_context_map","setContext","push","props","runes","pop","component","effects","create_user_effect","is_runes","e.lifecycle_outside_component","get_parent_context","parent","context_map","adjustments","handle_error","error","effect","active_effect","active_reaction","apply_adjustments","invoke_error_boundary","e","adjusted","micro_tasks","idle_tasks","run_micro_tasks","tasks","run_idle_tasks","queue_micro_task","flush_tasks","get_pending_boundary","boundary","e.await_outside_boundary","derived","flags","parent_derived","async_derived","location","e.async_derived_orphan","signal","source","prev","should_suspend","async_effect","p","r","batch","current_batch","pending","handler","internal_set","unset_context","fulfil","next","go","user_derived","d","push_reaction_value","derived_safe_equal","destroy_derived_effects","destroy_effect","get_derived_parent_effect","execute_derived","prev_active_effect","set_active_effect","update_reaction","update_derived","increment_write_version","is_destroying_effect","batch_deriveds","status","skip_reaction","set_signal_status","flatten","sync","async","restore","capture","expression","result","previous_effect","previous_reaction","previous_component_context","set_active_reaction","batches","effect_pending_updates","dequeue","task","queued_root_effects","last_scheduled_effect","is_flushing","is_flushing_sync","_Batch","__privateAdd","_Batch_instances","_previous","_callbacks","_pending","_deferred","_neutered","_async_effects","_boundary_async_effects","_render_effects","_effects","_block_effects","_dirty_effects","_maybe_dirty_effects","root_effects","current_values","current","previous","__privateGet","root","__privateMethod","traverse_effect_tree_fn","commit_fn","render_effects","__privateSet","flush_queued_effects","_a","defer_effects_fn","v","wv","update_effect","update","flush_effects","schedule_effect","is_branch","is_skippable_branch","skip","is_dirty","child","Batch","flushSync","was_flushing_sync","was_updating_effect","is_updating_effect","flush_count","set_is_updating_effect","updates","entry","infinite_loop_guard","old_values","e.effect_update_depth_exceeded","eager_block_effects","length","unlink_effect","stack","state","s","mutable_source","initial_value","immutable","trackable","set","should_proxy","untracking","current_sources","e.state_unsafe_mutation","new_value","proxy","old_value","mark_reactions","untracked_writes","set_untracked_writes","increment","reactions","reaction","not_dirty","prototype","sources","is_proxied_array","version","parent_version","update_version","with_parent","set_update_version","_","prop","descriptor","e.state_descriptors_fixed","target","receiver","exists","get","has","other_s","ls","own_keys","e.state_prototype_fixed","$window","is_firefox","first_child_getter","next_sibling_getter","init_operations","element_prototype","node_prototype","text_prototype","create_text","get_first_child","node","get_next_sibling","is_text","first_child","fragment","first","sibling","count","next_sibling","clear_text_content","should_defer_append","without_reactive_context","validate_effect","e.effect_orphan","e.effect_in_unowned_derived","e.effect_in_teardown","push_effect","parent_effect","parent_last","create_effect","type","inert","teardown","user_effect","defer","user_pre_effect","component_root","options","pause_effect","legacy_pre_effect","deps","token","render_effect","untrack","legacy_pre_effect_reset","template_effect","values","block","branch","execute_effect_teardown","previously_destroying_effect","set_is_destroying_effect","destroy_effect_children","remove_dom","controller","destroy_block_effect_children","removed","remove_effect_dom","remove_reactions","transitions","transition","end","callback","pause_children","run_out_transitions","remaining","check","local","transparent","resume_effect","resume_children","new_deps","skipped_deps","write_version","read_version","dependencies","is_unowned","dependency","is_disconnected","is_unowned_connected","schedule_possible_effect_self_invalidation","previous_deps","previous_skipped_deps","previous_untracked_writes","previous_skip_reaction","previous_sources","previous_untracking","previous_update_version","remove_reaction","index","new_length","start_index","dep","tick","is_derived","destroyed","depends_on_old_values","STATUS_MASK","deep_read_state","deep_read","visited","proto","descriptors","PASSIVE_EVENTS","is_passive_event","all_registered_events","root_event_handles","create_event","event_name","dom","target_handler","event","handle_event_propagation","passive","delegate","events","last_propagated_event","handler_element","owner_document","path","current_target","path_idx","handled_at","at_idx","handler_idx","throw_error","other_errors","parent_element","delegated","data","create_fragment_from_html","html","elem","assign_nodes","start","from_html","content","is_fragment","use_import_node","has_start","clone","text","comment","frag","anchor","append","set_text","str","mount","_mount","document_listeners","Component","intro","registered_events","event_handle","unmount","anchor_node","ctx","mounted_components","if_block","elseif","consequent_effect","alternate_effect","condition","has_branch","set_branch","flag","update_branch","offscreen_fragment","commit","active","inactive","new_condition","pause_effects","items","controlled_anchor","items_map","is_controlled","parent_node","link","item","each","get_collection","get_key","render_fn","fallback_fn","fallback","was_empty","offscreen_items","each_array","collection","each_effect","reconcile","keys","existing","update_item","create_item","is_animated","should_update","seen","to_animate","matched","stashed","move","child_anchor","_b","j","to_destroy","destroy_length","_c","_d","unused","reactive","mutable","dest","next_node","snippet","get_snippet","args","snippet_effect","get_component","pending_effect","action","get_value","payload","inited","f","o","clsx","_clsx","to_class","hash","directives","classname","append_styles","styles","important","separator","css","to_css_name","to_style","new_style","normal_styles","important_styles","in_str","in_apo","in_comment","reserved_names","name_index","len","c","property","set_class","is_html","prev_classes","next_classes","next_class_name","update_styles","priority","set_style","prev_styles","next_styles","next_style_attr","IS_CUSTOM_ELEMENT","IS_HTML","set_attribute","attribute","skip_warning","attributes","get_attributes","get_setters","setters_cache","setters","element_proto","bind_prop","desc","is_bound_this","bound_value","element_or_component","bind_this","get_parts","old_parts","parts","init","callbacks","changed","observe_all","fns","subscribe_to_store","store","invalidate","unsub","subscriber_queue","readable","writable","stop","subscribers","run_queue","subscriber","subscribe","stores","single","stores_array","auto","started","cleanup","unsubscribers","is_store_binding","IS_UNMOUNTED","store_get","store_name","is_synchronous_callback","get_store","store_set","setup_stores","store_mutate","capture_store_binding","previous_is_store_binding","bindable","lazy","fallback_value","fallback_dirty","get_fallback","setter","is_entry_props","is_store_sub","e.props_invalid_value","getter","legacy_parent","mutation","overridden","onMount","init_update_callbacks","l","PUBLIC_VERSION","keyEnter","setContent","actions","outsideEvent","handlePointerDown","jsEvent","observeResize","resizeObserver","entries","DAY_IN_SECONDS","createDate","input","_fromLocalDate","_fromISOString","createDuration","seconds","exp","part","weeks","cloneDate","date","addDuration","duration","x","month","subtractDay","subtractDuration","addDay","setMidnight","toLocalDate","toISOString","datesEqual","date1","dates2","date2","nextClosestDay","day","diff","prevClosestDay","noTimePart","copyTime","toDate","fromDate","toSeconds","nextDate","prevDate","hiddenDays","getWeekNumber","firstDay","yearStart","assign","object","floor","ceil","min","max","symbol","isArray","isFunction","runAll","identity","stopPropagation","debounce","handle","queueStore","queue","flushDebounce","payloadProp","setPayload","obj","hasPayload","getPayload","createElement","tag","className","attrs","el","attr","hasYScroll","rect","ancestor","up","height","getElementWithPayload","y","processed","shadowEl","listen","createView","view","_viewTitle","_currentRange","_activeRange","toViewWithLocalDates","listView","timelineView","eventId","createEvents","toArrayProp","propName","createEventSources","createEventChunk","chunk","sortEventChunks","chunks","createEventContent","displayEventEnd","eventContent","theme","_intlEventTime","_view","timeText","toEventWithLocalDates","domNodes","createTimeElement","createEventClasses","eventClassNames","_cloneEvent","cloneEvent","dateFn","prepareEventChunks","longChunks","prevChunk","dates","maxEnd","repositionEvent","margin","longChunk","offset","runReposition","refs","ref","eventIntersects","resources","resource","helperEvent","display","previewEvent","ghostEvent","pointerEvent","bgEvent","btnTextDay","btnText","btnTextWeek","btnTextMonth","btnTextYear","period","themeView","createDateRange","outsideRange","range","limitToRange","createResources","_createResources","level","flat","createResource","resourceBackgroundColor","findResource","resourceTextColor","intl","locale","format","$locale","$format","intlRange","formatRange","_getParts","viewResources","$resources","$filterResourcesWithEvents","$_filteredEvents","$_activeRange","createTimes","$slotDuration","$slotLabelInterval","$_slotTimeLimits","$_intlSlotLabel","times","label","createSlotTimeLimits","$slotMinTime","$slotMaxTime","$flexibleSlotTimeLimits","$_viewDates","minMin","minFn","maxFn","maxMax","filter","loop","minStart","createOptions","plugins","plugin","createParsers","parsers","days","prevOptions","dayGrid","$view","activeRange","$_currentRange","$firstDay","$_dayGrid","start2","currentRange","$date","$duration","viewDates","$hiddenDays","viewTitle","$_intlTitle","_events","abortController","fetching","debounceHandle","$events","$eventSources","$_fetchedRange","$lazyFetching","$loading","stopLoading","failure","success","startStr","endStr","params","url","headers","body","response","filteredEvents","$_view","$_events","$eventFilter","now","interval","today","$_now","State","parseOpts","option","view2","validKey","views","defOpts","mergeOpts","opts","filterOpts","_set","rest","newView","override","buttons","$.prop","$$props","_viewDates","buttonText","customButtons","validRange","prevDisabled","$.mutable_source","nextDisabled","todayDisabled","running","isRunning","test","$validRange","$.store_set","$.set","currentDate","$.each","button","$_viewTitle","$.template_effect","$.set_class","h2","$theme","$.untrack","$.get","$.set_attribute","button_1","$buttonText","button_2","$.event","button_3","$customButtons","$$args","button_5","$$render","consequent_5","consequent_3","alternate_1","consequent_2","alternate_2","consequent_1","alternate_3","consequent","alternate_4","headerToolbar","sections","$.derived","$headerToolbar","group","$.index","$$anchor","div_1","alternate","nav","datesSet","eventAllUpdated","_auxiliary","_filteredEvents","_scrollable","_bodyEl","_tasks","_recheckScrollable","_queue","$.user_effect","$datesSet","$eventAllUpdated","$_queue","$_recheckScrollable","$_bodyEl","$_auxiliary","_viewComponent","_interaction","_iClass","setOption","getOption","refetchEvents","getEvents","getEventById","id","addEvent","updateEvent","idx","$.store_mutate","removeEventById","getView","unselect","$_interaction","dateFromPoint","dayEl","info","View","$_viewComponent","$_scrollable","$_iClass","$height","_intlDayHeader","_intlDayHeaderAL","_days","$_days","$_intlDayHeader","div_2","$0","$_intlDayHeaderAL","div","div_3","read_methods","set_like_methods","_SvelteSet","_SvelteSet_instances","_sources","_version","_size","_update_version","init_fn","source_fn","deleted","set_proto","method","SvelteSet","classes","eventBackgroundColor","eventColor","eventClick","eventDidMount","eventMouseEnter","eventMouseLeave","eventTextColor","bgColor","$eventBackgroundColor","$eventColor","txtColor","$eventTextColor","style","classNames","$eventClassNames","$displayEventEnd","$eventContent","$_intlEventTime","$$array","$eventDidMount","createHandler","onclick","$eventClick","onkeydown","onmouseenter","$eventMouseEnter","onmouseleave","$eventMouseLeave","$.clsx","defaultBody","$.bind_this","article","$$value","_iClasses","$_iClasses","createDragHandler","onpointerdown","Resizer","$.noop","inPopup","dayMaxEvents","_hiddenEvents","_popupDate","$.state","hidden","marginTop","_margin","_dates","reposition","$dayMaxEvents","hide","h","footHeight","hiddenEvents","$_hiddenEvents","size","$_popupDate","_intlDayPopover","_popupChunks","position","bodyEl","popupRect","dayRect","bodyRect","left","right","top","bottom","$_popupChunks","close","handlePointerDownOutside","$_intlDayPopover","event_handler_1","event_handler_2","iChunks","highlightedDates","moreLinkContent","weekNumbers","weekNumberContent","_intlDayCell","_today","$.user_pre_effect","isToday","$_today","otherMonth","$currentDate","highlight","$highlightedDates","disabled","dayBgChunks","bgChunk","dayChunks","moreLink","$moreLinkContent","showMore","showPopup","setPopupChunks","nextDay","showWeekNumber","$weekNumbers","weekNumber","week","$weekNumberContent","$.action","time","$$node","$$action_arg","$_intlDayCell","span","node_2","div_4","consequent_4","node_9","consequent_6","event_handler","consequent_7","div_5","div_6","_iEvents","filterEventsWithResources","$$d","bgChunks","$filterEventsWithResources","$_iEvents","DayGrid","eventDraggable","$eventStartEditable","$editable","eventResizable","$eventDurationEditable","busy","animate","limit","minLimit","maxLimit","_dayGrid","datesAboveResources","dateClick","dragConstraint","dragScroll","editable","eventStartEditable","eventDragMinDistance","eventDragStart","eventDragStop","eventDrop","eventLongPressDelay","eventResizeStart","eventResizeStop","eventResize","longPressDelay","resizeConstraint","selectable","selectFn","selectBackgroundColor","selectConstraint","selectLongPressDelay","selectMinDistance","slotDuration","slotHeight","slotWidth","unselectFn","unselectAuto","unselectCancel","ACTION_DRAG","ACTION_RESIZE_END","ACTION_RESIZE_START","ACTION_SELECT","ACTION_CLICK","ACTION_NO_ACTION","interacting","newDate","newResource","fromX","fromY","toX","toY","clipEl","clipRect","delta","allDay","iClass","minResize","selectStep","selected","noDateClick","timer","viewport","extraDuration","draggable","drag","eventToDrag","forceDate","forceMargin","validJsEvent","complexAction","common","resize","eventToResize","axis","zeroDuration","resizingStart","select","$selectable","noAction","dragging","$datesAboveResources","calcViewport","selecting","$selectLongPressDelay","$eventLongPressDelay","$longPressDelay","distance","$selectMinDistance","$eventDragMinDistance","createIEventSelect","createIEvent","resizing","$eventResizeStart","$eventDragStart","findPayload","findDayEl","newAllDay","candidate","copyIEventData","constraintFn","$resizeConstraint","$selectConstraint","$dragConstraint","createSelectCallbackInfo","createCallbackInfo","$dragScroll","thresholdY","$slotHeight","thresholdX","$slotWidth","handleScroll","handlePointerMove","handlePointerUp","$unselectAuto","$unselectCancel","$selectFn","$eventResizeStop","$eventDragStop","oldEvent","destroyIEvent","$eventResize","$eventDrop","eventRef","clicking","$dateClick","$selectBackgroundColor","$unselectFn","noClick","handleTouchStart","stops","createPreventDefaultHandler","removePointerEvent","createPointerEvent","validEvent","eventDurationEditable","eventResizableFromStart","resizable","createResizeHandler","$eventResizableFromStart","pointer","bodyScrollHandler","Action","Pointer","$pointer","Interaction","Auxiliary","_intlListDay","_intlListDaySide","datetime","$_intlListDay","time_1","$_intlListDaySide","node_1","h4","$noEventsClick","noEventsClick","noEventsContent","noEvents","$noEventsContent","List","slotTimeLimits","groupEventChunks","createAllDayContent","allDayContent","slotLabelInterval","_times","allDayText","$allDayContent","showAllTimes","$_times","_slotTimeLimits","scrollTime","$scrollTime","scrollToTime","slotEventOverlap","step","maxHeight","$slotEventOverlap","_now","nowIndicator","resourceFilter","node_4","$nowIndicator","node_5","allDaySlot","$1","$allDaySlot","TimeGrid","setLabel","resourceLabelContent","resourceLabelDidMount","$resourceLabelContent","ariaLabel","$resourceLabelDidMount","_viewResources","loops","$_viewResources","resourceLabels","$.proxy","item0","item1","$3","node_10","div_10","node_11","div_11","div_8","div_9","div_12","div_13","div_7","ResourceTimeGrid","dayTimeLimits","dayTimes","$_dayTimeLimits","nestedResources","_resHs","$_resHs","expanded","toggle","children","expand","span_1","_headerHeight","_daysHs","_sidebarEl","_nestedResources","onwheel","$_nestedResources","$_daysHs","$_sidebarEl","$_headerHeight","_headerEl","_dayTimes","$_dayTimes","time_2","$_headerEl","filteredChunks","prevDayEnd","slots","getSlotTimeLimits","dayStart","dayEnd","dayChunk","width","_resource","_dayTimeLimits","pointerIdx","chunkIntersects","node_3","$$d_1","$$array_3","_bodyHeight","_bodyWidth","_bodyScrollLeft","onscroll","onresize","$_bodyScrollLeft","$_bodyHeight","$_bodyWidth","ResourceTimeline","createCalendar","Calendar","destroyCalendar","calendar","create"],"mappings":"quBAEO,IAAIA,GAAW,MAAM,QACjBC,GAAW,MAAM,UAAU,QAC3BC,GAAa,MAAM,KAEnBC,GAAkB,OAAO,eACzBC,GAAiB,OAAO,yBACxBC,GAAkB,OAAO,0BACzBC,GAAmB,OAAO,UAC1BC,GAAkB,MAAM,UACxBC,GAAmB,OAAO,eAC1BC,GAAgB,OAAO,aAU3B,MAAMC,GAAO,IAAM,CAAE,EAerB,SAASC,GAAIC,EAAI,CACvB,OAAOA,EAAI,CACZ,CAGO,SAASC,GAAQC,EAAK,CAC5B,QAASC,EAAI,EAAGA,EAAID,EAAI,OAAQC,IAC/BD,EAAIC,CAAC,EAAG,CAEV,CAMO,SAASC,IAAW,CAE1B,IAAIC,EAGAC,EAGAC,EAAU,IAAI,QAAQ,CAACC,EAAKC,IAAQ,CACvCJ,EAAUG,EACVF,EAASG,CACX,CAAE,EAGD,MAAO,CAAE,QAAAF,EAAS,QAAAF,EAAS,OAAAC,CAAQ,CACpC,CA0BO,SAASI,GAASC,EAAOC,EAAG,CAElC,GAAI,MAAM,QAAQD,CAAK,EACtB,OAAOA,EAMR,GAAIC,IAAM,QAAa,EAAE,OAAO,YAAYD,GAC3C,OAAO,MAAM,KAAKA,CAAK,EAMxB,MAAME,EAAQ,CAAE,EAEhB,UAAWC,KAAWH,EAErB,GADAE,EAAM,KAAKC,CAAO,EACdD,EAAM,SAAWD,EAAG,MAGzB,OAAOC,CACR,CCrHO,MAAME,GAAU,EACVC,GAAS,EACTC,GAAgB,EAChBC,GAAe,GACfC,GAAgB,GAChBC,GAAc,GACdC,GAAkB,IAClBC,GAAU,IACVC,GAAe,IACfC,GAAQ,KACRC,GAAQ,KACRC,GAAc,KACdC,GAAQ,KACRC,GAAY,MACZC,GAAa,MAEbC,GAAqB,MACrBC,GAAiB,GAAK,GACtBC,GAAc,GAAK,GACnBC,G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zE,EACH,EAAE39B,CAAO,CACd","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,63,70]}
1
+ {"version":3,"file":"event-calendar.min.js","sources":["../../../node_modules/svelte/src/internal/shared/utils.js","../../../node_modules/svelte/src/internal/client/constants.js","../../../node_modules/svelte/src/internal/shared/errors.js","../../../node_modules/svelte/src/internal/client/errors.js","../../../node_modules/svelte/src/constants.js","../../../node_modules/svelte/src/internal/client/dom/hydration.js","../../../node_modules/svelte/src/internal/client/reactivity/equality.js","../../../node_modules/svelte/src/internal/flags/index.js","../../../node_modules/svelte/src/internal/client/context.js","../../../node_modules/svelte/src/internal/client/error-handling.js","../../../node_modules/svelte/src/internal/client/dom/task.js","../../../node_modules/svelte/src/internal/client/dom/blocks/boundary.js","../../../node_modules/svelte/src/internal/client/reactivity/deriveds.js","../../../node_modules/svelte/src/internal/client/reactivity/async.js","../../../node_modules/svelte/src/internal/client/reactivity/batch.js","../../../node_modules/svelte/src/internal/client/reactivity/sources.js","../../../node_modules/svelte/src/internal/client/proxy.js","../../../node_modules/svelte/src/internal/client/dom/operations.js","../../../node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js","../../../node_modules/svelte/src/internal/client/reactivity/effects.js","../../../node_modules/svelte/src/internal/client/runtime.js","../../../node_modules/svelte/src/utils.js","../../../node_modules/svelte/src/internal/client/dom/elements/events.js","../../../node_modules/svelte/src/internal/client/dom/reconciler.js","../../../node_modules/svelte/src/internal/client/dom/template.js","../../../node_modules/svelte/src/internal/client/render.js","../../../node_modules/svelte/src/internal/client/dom/blocks/if.js","../../../node_modules/svelte/src/internal/client/dom/blocks/each.js","../../../node_modules/svelte/src/internal/client/dom/blocks/snippet.js","../../../node_modules/svelte/src/internal/client/dom/blocks/svelte-component.js","../../../node_modules/svelte/src/internal/client/dom/elements/actions.js","../../../node_modules/clsx/dist/clsx.mjs","../../../node_modules/svelte/src/internal/shared/attributes.js","../../../node_modules/svelte/src/internal/client/dom/elements/class.js","../../../node_modules/svelte/src/internal/client/dom/elements/style.js","../../../node_modules/svelte/src/internal/client/dom/elements/attributes.js","../../../node_modules/svelte/src/internal/client/dom/elements/bindings/props.js","../../../node_modules/svelte/src/internal/client/dom/elements/bindings/this.js","../../../node_modules/svelte/src/internal/client/dom/legacy/lifecycle.js","../../../node_modules/svelte/src/store/utils.js","../../../node_modules/svelte/src/store/shared/index.js","../../../node_modules/svelte/src/internal/client/reactivity/store.js","../../../node_modules/svelte/src/internal/client/reactivity/props.js","../../../node_modules/svelte/src/index-client.js","../../../node_modules/svelte/src/version.js","../../../node_modules/svelte/src/internal/disclose-version.js","../../core/src/lib/a11y.js","../../core/src/lib/actions.js","../../core/src/lib/date.js","../../core/src/lib/utils.js","../../core/src/lib/debounce.js","../../core/src/lib/payload.js","../../core/src/lib/dom.js","../../core/src/lib/view.js","../../core/src/lib/events.js","../../core/src/lib/options.js","../../core/src/lib/range.js","../../core/src/lib/resources.js","../../core/src/lib/stores.js","../../core/src/lib/times.js","../../core/src/storage/options.js","../../core/src/storage/stores.js","../../core/src/storage/state.js","../../../node_modules/svelte/src/internal/flags/legacy.js","../../core/src/Buttons.svelte","../../core/src/Toolbar.svelte","../../core/src/Auxiliary.svelte","../../core/src/Calendar.svelte","../../core/src/plugins/day-grid/stores.js","../../core/src/plugins/day-grid/Header.svelte","../../../node_modules/svelte/src/reactivity/set.js","../../core/src/lib/components/BaseEvent.svelte","../../core/src/lib/components/InteractableEvent.svelte","../../core/src/plugins/day-grid/Event.svelte","../../core/src/plugins/day-grid/Popup.svelte","../../core/src/plugins/day-grid/Day.svelte","../../core/src/plugins/day-grid/Week.svelte","../../core/src/plugins/day-grid/Body.svelte","../../core/src/plugins/day-grid/View.svelte","../../core/src/plugins/day-grid/index.js","../../core/src/plugins/interaction/lib/events.js","../../core/src/plugins/interaction/lib/utils.js","../../core/src/plugins/interaction/Action.svelte","../../core/src/plugins/interaction/Pointer.svelte","../../core/src/plugins/interaction/Resizer.svelte","../../core/src/plugins/interaction/Auxiliary.svelte","../../core/src/plugins/interaction/index.js","../../core/src/plugins/list/Event.svelte","../../core/src/plugins/list/Day.svelte","../../core/src/plugins/list/Body.svelte","../../core/src/plugins/list/View.svelte","../../core/src/plugins/list/index.js","../../core/src/plugins/time-grid/stores.js","../../core/src/plugins/time-grid/utils.js","../../core/src/plugins/time-grid/Section.svelte","../../core/src/plugins/time-grid/Body.svelte","../../core/src/plugins/time-grid/Event.svelte","../../core/src/plugins/time-grid/NowIndicator.svelte","../../core/src/plugins/time-grid/Day.svelte","../../core/src/plugins/time-grid/all-day/Event.svelte","../../core/src/plugins/time-grid/all-day/Day.svelte","../../core/src/plugins/time-grid/all-day/Week.svelte","../../core/src/plugins/time-grid/View.svelte","../../core/src/plugins/time-grid/index.js","../../core/src/plugins/resource-time-grid/Label.svelte","../../core/src/plugins/resource-time-grid/View.svelte","../../core/src/plugins/resource-time-grid/index.js","../../core/src/plugins/resource-timeline/stores.js","../../core/src/plugins/resource-timeline/Label.svelte","../../core/src/plugins/resource-timeline/Expander.svelte","../../core/src/plugins/resource-timeline/Sidebar.svelte","../../core/src/plugins/resource-timeline/Header.svelte","../../core/src/plugins/resource-timeline/lib.js","../../core/src/plugins/resource-timeline/Event.svelte","../../core/src/plugins/resource-timeline/Day.svelte","../../core/src/plugins/resource-timeline/Days.svelte","../../core/src/plugins/resource-timeline/Body.svelte","../../core/src/plugins/resource-timeline/NowIndicator.svelte","../../core/src/plugins/resource-timeline/View.svelte","../../core/src/plugins/resource-timeline/index.js","../../core/src/index.es.js","../../core/src/index.iife.js"],"sourcesContent":["// Store the references to globals in case someone tries to monkey patch these, causing the below\n// to de-opt (this occurs often when using popular extensions).\nexport var is_array = Array.isArray;\nexport var index_of = Array.prototype.indexOf;\nexport var array_from = Array.from;\nexport var object_keys = Object.keys;\nexport var define_property = Object.defineProperty;\nexport var get_descriptor = Object.getOwnPropertyDescriptor;\nexport var get_descriptors = Object.getOwnPropertyDescriptors;\nexport var object_prototype = Object.prototype;\nexport var array_prototype = Array.prototype;\nexport var get_prototype_of = Object.getPrototypeOf;\nexport var is_extensible = Object.isExtensible;\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\nexport const noop = () => {};\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n\n/**\n * @template [T=any]\n * @param {any} value\n * @returns {value is PromiseLike<T>}\n */\nexport function is_promise(value) {\n\treturn typeof value?.then === 'function';\n}\n\n/** @param {Function} fn */\nexport function run(fn) {\n\treturn fn();\n}\n\n/** @param {Array<() => void>} arr */\nexport function run_all(arr) {\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tarr[i]();\n\t}\n}\n\n/**\n * TODO replace with Promise.withResolvers once supported widely enough\n * @template T\n */\nexport function deferred() {\n\t/** @type {(value: T) => void} */\n\tvar resolve;\n\n\t/** @type {(reason: any) => void} */\n\tvar reject;\n\n\t/** @type {Promise<T>} */\n\tvar promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\n\t// @ts-expect-error\n\treturn { promise, resolve, reject };\n}\n\n/**\n * @template V\n * @param {V} value\n * @param {V | (() => V)} fallback\n * @param {boolean} [lazy]\n * @returns {V}\n */\nexport function fallback(value, fallback, lazy = false) {\n\treturn value === undefined\n\t\t? lazy\n\t\t\t? /** @type {() => V} */ (fallback)()\n\t\t\t: /** @type {V} */ (fallback)\n\t\t: value;\n}\n\n/**\n * When encountering a situation like `let [a, b, c] = $derived(blah())`,\n * we need to stash an intermediate value that `a`, `b`, and `c` derive\n * from, in case it's an iterable\n * @template T\n * @param {ArrayLike<T> | Iterable<T>} value\n * @param {number} [n]\n * @returns {Array<T>}\n */\nexport function to_array(value, n) {\n\t// return arrays unchanged\n\tif (Array.isArray(value)) {\n\t\treturn value;\n\t}\n\n\t// if value is not iterable, or `n` is unspecified (indicates a rest\n\t// element, which means we're not concerned about unbounded iterables)\n\t// convert to an array with `Array.from`\n\tif (n === undefined || !(Symbol.iterator in value)) {\n\t\treturn Array.from(value);\n\t}\n\n\t// otherwise, populate an array with `n` values\n\n\t/** @type {T[]} */\n\tconst array = [];\n\n\tfor (const element of value) {\n\t\tarray.push(element);\n\t\tif (array.length === n) break;\n\t}\n\n\treturn array;\n}\n","export const DERIVED = 1 << 1;\nexport const EFFECT = 1 << 2;\nexport const RENDER_EFFECT = 1 << 3;\nexport const BLOCK_EFFECT = 1 << 4;\nexport const BRANCH_EFFECT = 1 << 5;\nexport const ROOT_EFFECT = 1 << 6;\nexport const BOUNDARY_EFFECT = 1 << 7;\nexport const UNOWNED = 1 << 8;\nexport const DISCONNECTED = 1 << 9;\nexport const CLEAN = 1 << 10;\nexport const DIRTY = 1 << 11;\nexport const MAYBE_DIRTY = 1 << 12;\nexport const INERT = 1 << 13;\nexport const DESTROYED = 1 << 14;\nexport const EFFECT_RAN = 1 << 15;\n/** 'Transparent' effects do not create a transition boundary */\nexport const EFFECT_TRANSPARENT = 1 << 16;\nexport const INSPECT_EFFECT = 1 << 17;\nexport const HEAD_EFFECT = 1 << 18;\nexport const EFFECT_PRESERVED = 1 << 19;\nexport const USER_EFFECT = 1 << 20;\n\n// Flags used for async\nexport const REACTION_IS_UPDATING = 1 << 21;\nexport const ASYNC = 1 << 22;\n\nexport const ERROR_VALUE = 1 << 23;\n\nexport const STATE_SYMBOL = Symbol('$state');\nexport const LEGACY_PROPS = Symbol('legacy props');\nexport const LOADING_ATTR_SYMBOL = Symbol('');\nexport const PROXY_PATH_SYMBOL = Symbol('proxy path');\n\n/** allow users to ignore aborted signal errors if `reason.name === 'StaleReactionError` */\nexport const STALE_REACTION = new (class StaleReactionError extends Error {\n\tname = 'StaleReactionError';\n\tmessage = 'The reaction that called `getAbortSignal()` was re-run or destroyed';\n})();\n\nexport const ELEMENT_NODE = 1;\nexport const TEXT_NODE = 3;\nexport const COMMENT_NODE = 8;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\n/**\n * Cannot await outside a `<svelte:boundary>` with a `pending` snippet\n * @returns {never}\n */\nexport function await_outside_boundary() {\n\tif (DEV) {\n\t\tconst error = new Error(`await_outside_boundary\\nCannot await outside a \\`<svelte:boundary>\\` with a \\`pending\\` snippet\\nhttps://svelte.dev/e/await_outside_boundary`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/await_outside_boundary`);\n\t}\n}\n\n/**\n * Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead\n * @returns {never}\n */\nexport function invalid_default_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_default_snippet\\nCannot use \\`{@render children(...)}\\` if the parent component uses \\`let:\\` directives. Consider using a named snippet instead\\nhttps://svelte.dev/e/invalid_default_snippet`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_default_snippet`);\n\t}\n}\n\n/**\n * A snippet function was passed invalid arguments. Snippets should only be instantiated via `{@render ...}`\n * @returns {never}\n */\nexport function invalid_snippet_arguments() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_snippet_arguments\\nA snippet function was passed invalid arguments. Snippets should only be instantiated via \\`{@render ...}\\`\\nhttps://svelte.dev/e/invalid_snippet_arguments`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_snippet_arguments`);\n\t}\n}\n\n/**\n * `%name%(...)` can only be used during component initialisation\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_outside_component(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_outside_component\\n\\`${name}(...)\\` can only be used during component initialisation\\nhttps://svelte.dev/e/lifecycle_outside_component`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_outside_component`);\n\t}\n}\n\n/**\n * Attempted to render a snippet without a `{@render}` block. This would cause the snippet code to be stringified instead of its content being rendered to the DOM. To fix this, change `{snippet}` to `{@render snippet()}`.\n * @returns {never}\n */\nexport function snippet_without_render_tag() {\n\tif (DEV) {\n\t\tconst error = new Error(`snippet_without_render_tag\\nAttempted to render a snippet without a \\`{@render}\\` block. This would cause the snippet code to be stringified instead of its content being rendered to the DOM. To fix this, change \\`{snippet}\\` to \\`{@render snippet()}\\`.\\nhttps://svelte.dev/e/snippet_without_render_tag`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/snippet_without_render_tag`);\n\t}\n}\n\n/**\n * `%name%` is not a store with a `subscribe` method\n * @param {string} name\n * @returns {never}\n */\nexport function store_invalid_shape(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`store_invalid_shape\\n\\`${name}\\` is not a store with a \\`subscribe\\` method\\nhttps://svelte.dev/e/store_invalid_shape`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/store_invalid_shape`);\n\t}\n}\n\n/**\n * The `this` prop on `<svelte:element>` must be a string, if defined\n * @returns {never}\n */\nexport function svelte_element_invalid_this_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`svelte_element_invalid_this_value\\nThe \\`this\\` prop on \\`<svelte:element>\\` must be a string, if defined\\nhttps://svelte.dev/e/svelte_element_invalid_this_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/svelte_element_invalid_this_value`);\n\t}\n}","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\nexport * from '../shared/errors.js';\n\n/**\n * Cannot create a `$derived(...)` with an `await` expression outside of an effect tree\n * @returns {never}\n */\nexport function async_derived_orphan() {\n\tif (DEV) {\n\t\tconst error = new Error(`async_derived_orphan\\nCannot create a \\`$derived(...)\\` with an \\`await\\` expression outside of an effect tree\\nhttps://svelte.dev/e/async_derived_orphan`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/async_derived_orphan`);\n\t}\n}\n\n/**\n * Using `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\n * @returns {never}\n */\nexport function bind_invalid_checkbox_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_checkbox_value\\nUsing \\`bind:value\\` together with a checkbox input is not allowed. Use \\`bind:checked\\` instead\\nhttps://svelte.dev/e/bind_invalid_checkbox_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_checkbox_value`);\n\t}\n}\n\n/**\n * 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%`)\n * @param {string} component\n * @param {string} key\n * @param {string} name\n * @returns {never}\n */\nexport function bind_invalid_export(component, key, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_export\\nComponent ${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}\\`)\\nhttps://svelte.dev/e/bind_invalid_export`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_export`);\n\t}\n}\n\n/**\n * 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()`\n * @param {string} key\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function bind_not_bindable(key, component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_not_bindable\\nA 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()\\`\\nhttps://svelte.dev/e/bind_not_bindable`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_not_bindable`);\n\t}\n}\n\n/**\n * Calling `%method%` on a component instance (of %component%) is no longer valid in Svelte 5\n * @param {string} method\n * @param {string} component\n * @returns {never}\n */\nexport function component_api_changed(method, component) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_changed\\nCalling \\`${method}\\` on a component instance (of ${component}) is no longer valid in Svelte 5\\nhttps://svelte.dev/e/component_api_changed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_changed`);\n\t}\n}\n\n/**\n * 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.\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function component_api_invalid_new(component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_invalid_new\\nAttempted 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.\\nhttps://svelte.dev/e/component_api_invalid_new`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_invalid_new`);\n\t}\n}\n\n/**\n * A derived value cannot reference itself recursively\n * @returns {never}\n */\nexport function derived_references_self() {\n\tif (DEV) {\n\t\tconst error = new Error(`derived_references_self\\nA derived value cannot reference itself recursively\\nhttps://svelte.dev/e/derived_references_self`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/derived_references_self`);\n\t}\n}\n\n/**\n * Keyed each block has duplicate key `%value%` at indexes %a% and %b%\n * @param {string} a\n * @param {string} b\n * @param {string | undefined | null} [value]\n * @returns {never}\n */\nexport function each_key_duplicate(a, b, value) {\n\tif (DEV) {\n\t\tconst error = new Error(`each_key_duplicate\\n${value\n\t\t\t? `Keyed each block has duplicate key \\`${value}\\` at indexes ${a} and ${b}`\n\t\t\t: `Keyed each block has duplicate key at indexes ${a} and ${b}`}\\nhttps://svelte.dev/e/each_key_duplicate`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/each_key_duplicate`);\n\t}\n}\n\n/**\n * `%rune%` cannot be used inside an effect cleanup function\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_in_teardown(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_teardown\\n\\`${rune}\\` cannot be used inside an effect cleanup function\\nhttps://svelte.dev/e/effect_in_teardown`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_teardown`);\n\t}\n}\n\n/**\n * Effect cannot be created inside a `$derived` value that was not itself created inside an effect\n * @returns {never}\n */\nexport function effect_in_unowned_derived() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_unowned_derived\\nEffect cannot be created inside a \\`$derived\\` value that was not itself created inside an effect\\nhttps://svelte.dev/e/effect_in_unowned_derived`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_unowned_derived`);\n\t}\n}\n\n/**\n * `%rune%` can only be used inside an effect (e.g. during component initialisation)\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_orphan(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_orphan\\n\\`${rune}\\` can only be used inside an effect (e.g. during component initialisation)\\nhttps://svelte.dev/e/effect_orphan`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_orphan`);\n\t}\n}\n\n/**\n * `$effect.pending()` can only be called inside an effect or derived\n * @returns {never}\n */\nexport function effect_pending_outside_reaction() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_pending_outside_reaction\\n\\`$effect.pending()\\` can only be called inside an effect or derived\\nhttps://svelte.dev/e/effect_pending_outside_reaction`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_pending_outside_reaction`);\n\t}\n}\n\n/**\n * Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state\n * @returns {never}\n */\nexport function effect_update_depth_exceeded() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_update_depth_exceeded\\nMaximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state\\nhttps://svelte.dev/e/effect_update_depth_exceeded`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);\n\t}\n}\n\n/**\n * Cannot use `flushSync` inside an effect\n * @returns {never}\n */\nexport function flush_sync_in_effect() {\n\tif (DEV) {\n\t\tconst error = new Error(`flush_sync_in_effect\\nCannot use \\`flushSync\\` inside an effect\\nhttps://svelte.dev/e/flush_sync_in_effect`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/flush_sync_in_effect`);\n\t}\n}\n\n/**\n * `getAbortSignal()` can only be called inside an effect or derived\n * @returns {never}\n */\nexport function get_abort_signal_outside_reaction() {\n\tif (DEV) {\n\t\tconst error = new Error(`get_abort_signal_outside_reaction\\n\\`getAbortSignal()\\` can only be called inside an effect or derived\\nhttps://svelte.dev/e/get_abort_signal_outside_reaction`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/get_abort_signal_outside_reaction`);\n\t}\n}\n\n/**\n * Failed to hydrate the application\n * @returns {never}\n */\nexport function hydration_failed() {\n\tif (DEV) {\n\t\tconst error = new Error(`hydration_failed\\nFailed to hydrate the application\\nhttps://svelte.dev/e/hydration_failed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/hydration_failed`);\n\t}\n}\n\n/**\n * Could not `{@render}` snippet due to the expression being `null` or `undefined`. Consider using optional chaining `{@render snippet?.()}`\n * @returns {never}\n */\nexport function invalid_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_snippet\\nCould not \\`{@render}\\` snippet due to the expression being \\`null\\` or \\`undefined\\`. Consider using optional chaining \\`{@render snippet?.()}\\`\\nhttps://svelte.dev/e/invalid_snippet`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_snippet`);\n\t}\n}\n\n/**\n * `%name%(...)` cannot be used in runes mode\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_legacy_only(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_legacy_only\\n\\`${name}(...)\\` cannot be used in runes mode\\nhttps://svelte.dev/e/lifecycle_legacy_only`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_legacy_only`);\n\t}\n}\n\n/**\n * Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value\n * @param {string} key\n * @returns {never}\n */\nexport function props_invalid_value(key) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_invalid_value\\nCannot do \\`bind:${key}={undefined}\\` when \\`${key}\\` has a fallback value\\nhttps://svelte.dev/e/props_invalid_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_invalid_value`);\n\t}\n}\n\n/**\n * Rest element properties of `$props()` such as `%property%` are readonly\n * @param {string} property\n * @returns {never}\n */\nexport function props_rest_readonly(property) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_rest_readonly\\nRest element properties of \\`$props()\\` such as \\`${property}\\` are readonly\\nhttps://svelte.dev/e/props_rest_readonly`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_rest_readonly`);\n\t}\n}\n\n/**\n * The `%rune%` rune is only available inside `.svelte` and `.svelte.js/ts` files\n * @param {string} rune\n * @returns {never}\n */\nexport function rune_outside_svelte(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`rune_outside_svelte\\nThe \\`${rune}\\` rune is only available inside \\`.svelte\\` and \\`.svelte.js/ts\\` files\\nhttps://svelte.dev/e/rune_outside_svelte`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/rune_outside_svelte`);\n\t}\n}\n\n/**\n * `setContext` must be called when a component first initializes, not in a subsequent effect or after an `await` expression\n * @returns {never}\n */\nexport function set_context_after_init() {\n\tif (DEV) {\n\t\tconst error = new Error(`set_context_after_init\\n\\`setContext\\` must be called when a component first initializes, not in a subsequent effect or after an \\`await\\` expression\\nhttps://svelte.dev/e/set_context_after_init`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/set_context_after_init`);\n\t}\n}\n\n/**\n * Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\n * @returns {never}\n */\nexport function state_descriptors_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_descriptors_fixed\\nProperty descriptors defined on \\`$state\\` objects must contain \\`value\\` and always be \\`enumerable\\`, \\`configurable\\` and \\`writable\\`.\\nhttps://svelte.dev/e/state_descriptors_fixed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_descriptors_fixed`);\n\t}\n}\n\n/**\n * Cannot set prototype of `$state` object\n * @returns {never}\n */\nexport function state_prototype_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_prototype_fixed\\nCannot set prototype of \\`$state\\` object\\nhttps://svelte.dev/e/state_prototype_fixed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_prototype_fixed`);\n\t}\n}\n\n/**\n * Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\n * @returns {never}\n */\nexport function state_unsafe_mutation() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_unsafe_mutation\\nUpdating state inside \\`$derived(...)\\`, \\`$inspect(...)\\` or a template expression is forbidden. If the value should not be reactive, declare it without \\`$state\\`\\nhttps://svelte.dev/e/state_unsafe_mutation`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_unsafe_mutation`);\n\t}\n}\n\n/**\n * A `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\n * @returns {never}\n */\nexport function svelte_boundary_reset_onerror() {\n\tif (DEV) {\n\t\tconst error = new Error(`svelte_boundary_reset_onerror\\nA \\`<svelte:boundary>\\` \\`reset\\` function cannot be called while an error is still being handled\\nhttps://svelte.dev/e/svelte_boundary_reset_onerror`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);\n\t}\n}","export const EACH_ITEM_REACTIVE = 1;\nexport const EACH_INDEX_REACTIVE = 1 << 1;\n/** See EachBlock interface metadata.is_controlled for an explanation what this is */\nexport const EACH_IS_CONTROLLED = 1 << 2;\nexport const EACH_IS_ANIMATED = 1 << 3;\nexport const EACH_ITEM_IMMUTABLE = 1 << 4;\n\nexport const PROPS_IS_IMMUTABLE = 1;\nexport const PROPS_IS_RUNES = 1 << 1;\nexport const PROPS_IS_UPDATED = 1 << 2;\nexport const PROPS_IS_BINDABLE = 1 << 3;\nexport const PROPS_IS_LAZY_INITIAL = 1 << 4;\n\nexport const TRANSITION_IN = 1;\nexport const TRANSITION_OUT = 1 << 1;\nexport const TRANSITION_GLOBAL = 1 << 2;\n\nexport const TEMPLATE_FRAGMENT = 1;\nexport const TEMPLATE_USE_IMPORT_NODE = 1 << 1;\nexport const TEMPLATE_USE_SVG = 1 << 2;\nexport const TEMPLATE_USE_MATHML = 1 << 3;\n\nexport const HYDRATION_START = '[';\n/** used to indicate that an `{:else}...` block was rendered */\nexport const HYDRATION_START_ELSE = '[!';\nexport const HYDRATION_END = ']';\nexport const HYDRATION_ERROR = {};\n\nexport const ELEMENT_IS_NAMESPACED = 1;\nexport const ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;\n\nexport const UNINITIALIZED = Symbol();\n\n// Dev-time component properties\nexport const FILENAME = Symbol('filename');\nexport const HMR = Symbol('hmr');\n\nexport const NAMESPACE_HTML = 'http://www.w3.org/1999/xhtml';\nexport const NAMESPACE_SVG = 'http://www.w3.org/2000/svg';\nexport const NAMESPACE_MATHML = 'http://www.w3.org/1998/Math/MathML';\n\n// we use a list of ignorable runtime warnings because not every runtime warning\n// can be ignored and we want to keep the validation for svelte-ignore in place\nexport const IGNORABLE_RUNTIME_WARNINGS = /** @type {const} */ ([\n\t'await_waterfall',\n\t'await_reactivity_loss',\n\t'state_snapshot_uncloneable',\n\t'binding_property_non_reactive',\n\t'hydration_attribute_changed',\n\t'hydration_html_changed',\n\t'ownership_invalid_binding',\n\t'ownership_invalid_mutation'\n]);\n\n/**\n * Whitespace inside one of these elements will not result in\n * a whitespace node being created in any circumstances. (This\n * list is almost certainly very incomplete)\n * TODO this is currently unused\n */\nexport const ELEMENTS_WITHOUT_TEXT = ['audio', 'datalist', 'dl', 'optgroup', 'select', 'video'];\n\nexport const ATTACHMENT_KEY = '@attach';\n","/** @import { TemplateNode } from '#client' */\n\nimport { COMMENT_NODE } from '#client/constants';\nimport {\n\tHYDRATION_END,\n\tHYDRATION_ERROR,\n\tHYDRATION_START,\n\tHYDRATION_START_ELSE\n} from '../../../constants.js';\nimport * as w from '../warnings.js';\nimport { get_next_sibling } from './operations.js';\n\n/**\n * Use this variable to guard everything related to hydration code so it can be treeshaken out\n * if the user doesn't use the `hydrate` method and these code paths are therefore not needed.\n */\nexport let hydrating = false;\n\n/** @param {boolean} value */\nexport function set_hydrating(value) {\n\thydrating = value;\n}\n\n/**\n * The node that is currently being hydrated. This starts out as the first node inside the opening\n * <!--[--> comment, and updates each time a component calls `$.child(...)` or `$.sibling(...)`.\n * When entering a block (e.g. `{#if ...}`), `hydrate_node` is the block opening comment; by the\n * time we leave the block it is the closing comment, which serves as the block's anchor.\n * @type {TemplateNode}\n */\nexport let hydrate_node;\n\n/** @param {TemplateNode} node */\nexport function set_hydrate_node(node) {\n\tif (node === null) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\treturn (hydrate_node = node);\n}\n\nexport function hydrate_next() {\n\treturn set_hydrate_node(/** @type {TemplateNode} */ (get_next_sibling(hydrate_node)));\n}\n\n/** @param {TemplateNode} node */\nexport function reset(node) {\n\tif (!hydrating) return;\n\n\t// If the node has remaining siblings, something has gone wrong\n\tif (get_next_sibling(hydrate_node) !== null) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\thydrate_node = node;\n}\n\n/**\n * @param {HTMLTemplateElement} template\n */\nexport function hydrate_template(template) {\n\tif (hydrating) {\n\t\t// @ts-expect-error TemplateNode doesn't include DocumentFragment, but it's actually fine\n\t\thydrate_node = template.content;\n\t}\n}\n\nexport function next(count = 1) {\n\tif (hydrating) {\n\t\tvar i = count;\n\t\tvar node = hydrate_node;\n\n\t\twhile (i--) {\n\t\t\tnode = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\t}\n\n\t\thydrate_node = node;\n\t}\n}\n\n/**\n * Removes all nodes starting at `hydrate_node` up until the next hydration end comment\n */\nexport function remove_nodes() {\n\tvar depth = 0;\n\tvar node = hydrate_node;\n\n\twhile (true) {\n\t\tif (node.nodeType === COMMENT_NODE) {\n\t\t\tvar data = /** @type {Comment} */ (node).data;\n\n\t\t\tif (data === HYDRATION_END) {\n\t\t\t\tif (depth === 0) return node;\n\t\t\t\tdepth -= 1;\n\t\t\t} else if (data === HYDRATION_START || data === HYDRATION_START_ELSE) {\n\t\t\t\tdepth += 1;\n\t\t\t}\n\t\t}\n\n\t\tvar next = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tnode.remove();\n\t\tnode = next;\n\t}\n}\n\n/**\n *\n * @param {TemplateNode} node\n */\nexport function read_hydration_instruction(node) {\n\tif (!node || node.nodeType !== COMMENT_NODE) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\treturn /** @type {Comment} */ (node).data;\n}\n","/** @import { Equals } from '#client' */\n\n/** @type {Equals} */\nexport function equals(value) {\n\treturn value === this.v;\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function safe_not_equal(a, b) {\n\treturn a != a\n\t\t? b == b\n\t\t: a !== b || (a !== null && typeof a === 'object') || typeof a === 'function';\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function not_equal(a, b) {\n\treturn a !== b;\n}\n\n/** @type {Equals} */\nexport function safe_equals(value) {\n\treturn !safe_not_equal(value, this.v);\n}\n","export let async_mode_flag = false;\nexport let legacy_mode_flag = false;\nexport let tracing_mode_flag = false;\n\nexport function enable_async_mode_flag() {\n\tasync_mode_flag = true;\n}\n\n/** ONLY USE THIS DURING TESTING */\nexport function disable_async_mode_flag() {\n\tasync_mode_flag = false;\n}\n\nexport function enable_legacy_mode_flag() {\n\tlegacy_mode_flag = true;\n}\n\nexport function enable_tracing_mode_flag() {\n\ttracing_mode_flag = true;\n}\n","/** @import { ComponentContext, DevStackEntry, Effect } from '#client' */\nimport { DEV } from 'esm-env';\nimport * as e from './errors.js';\nimport { active_effect, active_reaction } from './runtime.js';\nimport { create_user_effect } from './reactivity/effects.js';\nimport { async_mode_flag, legacy_mode_flag } from '../flags/index.js';\nimport { FILENAME } from '../../constants.js';\nimport { BRANCH_EFFECT, EFFECT_RAN } from './constants.js';\n\n/** @type {ComponentContext | null} */\nexport let component_context = null;\n\n/** @param {ComponentContext | null} context */\nexport function set_component_context(context) {\n\tcomponent_context = context;\n}\n\n/** @type {DevStackEntry | null} */\nexport let dev_stack = null;\n\n/** @param {DevStackEntry | null} stack */\nexport function set_dev_stack(stack) {\n\tdev_stack = stack;\n}\n\n/**\n * Execute a callback with a new dev stack entry\n * @param {() => any} callback - Function to execute\n * @param {DevStackEntry['type']} type - Type of block/component\n * @param {any} component - Component function\n * @param {number} line - Line number\n * @param {number} column - Column number\n * @param {Record<string, any>} [additional] - Any additional properties to add to the dev stack entry\n * @returns {any}\n */\nexport function add_svelte_meta(callback, type, component, line, column, additional) {\n\tconst parent = dev_stack;\n\n\tdev_stack = {\n\t\ttype,\n\t\tfile: component[FILENAME],\n\t\tline,\n\t\tcolumn,\n\t\tparent,\n\t\t...additional\n\t};\n\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tdev_stack = parent;\n\t}\n}\n\n/**\n * The current component function. Different from current component context:\n * ```html\n * <!-- App.svelte -->\n * <Foo>\n * <Bar /> <!-- context == Foo.svelte, function == App.svelte -->\n * </Foo>\n * ```\n * @type {ComponentContext['function']}\n */\nexport let dev_current_component_function = null;\n\n/** @param {ComponentContext['function']} fn */\nexport function set_dev_current_component_function(fn) {\n\tdev_current_component_function = fn;\n}\n\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * @template T\n * @param {any} key\n * @returns {T}\n */\nexport function getContext(key) {\n\tconst context_map = get_or_init_context_map('getContext');\n\tconst result = /** @type {T} */ (context_map.get(key));\n\treturn result;\n}\n\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * @template T\n * @param {any} key\n * @param {T} context\n * @returns {T}\n */\nexport function setContext(key, context) {\n\tconst context_map = get_or_init_context_map('setContext');\n\n\tif (async_mode_flag) {\n\t\tvar flags = /** @type {Effect} */ (active_effect).f;\n\t\tvar valid = !active_reaction && (flags & BRANCH_EFFECT) !== 0 && (flags & EFFECT_RAN) === 0;\n\n\t\tif (!valid) {\n\t\t\te.set_context_after_init();\n\t\t}\n\t}\n\n\tcontext_map.set(key, context);\n\treturn context;\n}\n\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * @param {any} key\n * @returns {boolean}\n */\nexport function hasContext(key) {\n\tconst context_map = get_or_init_context_map('hasContext');\n\treturn context_map.has(key);\n}\n\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * @template {Map<any, any>} [T=Map<any, any>]\n * @returns {T}\n */\nexport function getAllContexts() {\n\tconst context_map = get_or_init_context_map('getAllContexts');\n\treturn /** @type {T} */ (context_map);\n}\n\n/**\n * @param {Record<string, unknown>} props\n * @param {any} runes\n * @param {Function} [fn]\n * @returns {void}\n */\nexport function push(props, runes = false, fn) {\n\tcomponent_context = {\n\t\tp: component_context,\n\t\tc: null,\n\t\te: null,\n\t\ts: props,\n\t\tx: null,\n\t\tl: legacy_mode_flag && !runes ? { s: null, u: null, $: [] } : null\n\t};\n\n\tif (DEV) {\n\t\t// component function\n\t\tcomponent_context.function = fn;\n\t\tdev_current_component_function = fn;\n\t}\n}\n\n/**\n * @template {Record<string, any>} T\n * @param {T} [component]\n * @returns {T}\n */\nexport function pop(component) {\n\tvar context = /** @type {ComponentContext} */ (component_context);\n\tvar effects = context.e;\n\n\tif (effects !== null) {\n\t\tcontext.e = null;\n\n\t\tfor (var fn of effects) {\n\t\t\tcreate_user_effect(fn);\n\t\t}\n\t}\n\n\tif (component !== undefined) {\n\t\tcontext.x = component;\n\t}\n\n\tcomponent_context = context.p;\n\n\tif (DEV) {\n\t\tdev_current_component_function = component_context?.function ?? null;\n\t}\n\n\treturn component ?? /** @type {T} */ ({});\n}\n\n/** @returns {boolean} */\nexport function is_runes() {\n\treturn !legacy_mode_flag || (component_context !== null && component_context.l === null);\n}\n\n/**\n * @param {string} name\n * @returns {Map<unknown, unknown>}\n */\nfunction get_or_init_context_map(name) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component(name);\n\t}\n\n\treturn (component_context.c ??= new Map(get_parent_context(component_context) || undefined));\n}\n\n/**\n * @param {ComponentContext} component_context\n * @returns {Map<unknown, unknown> | null}\n */\nfunction get_parent_context(component_context) {\n\tlet parent = component_context.p;\n\twhile (parent !== null) {\n\t\tconst context_map = parent.c;\n\t\tif (context_map !== null) {\n\t\t\treturn context_map;\n\t\t}\n\t\tparent = parent.p;\n\t}\n\treturn null;\n}\n","/** @import { Derived, Effect } from '#client' */\n/** @import { Boundary } from './dom/blocks/boundary.js' */\nimport { DEV } from 'esm-env';\nimport { FILENAME } from '../../constants.js';\nimport { is_firefox } from './dom/operations.js';\nimport { ERROR_VALUE, BOUNDARY_EFFECT, EFFECT_RAN } from './constants.js';\nimport { define_property, get_descriptor } from '../shared/utils.js';\nimport { active_effect, active_reaction } from './runtime.js';\n\nconst adjustments = new WeakMap();\n\n/**\n * @param {unknown} error\n */\nexport function handle_error(error) {\n\tvar effect = active_effect;\n\n\t// for unowned deriveds, don't throw until we read the value\n\tif (effect === null) {\n\t\t/** @type {Derived} */ (active_reaction).f |= ERROR_VALUE;\n\t\treturn error;\n\t}\n\n\tif (DEV && error instanceof Error && !adjustments.has(error)) {\n\t\tadjustments.set(error, get_adjustments(error, effect));\n\t}\n\n\tif ((effect.f & EFFECT_RAN) === 0) {\n\t\t// if the error occurred while creating this subtree, we let it\n\t\t// bubble up until it hits a boundary that can handle it\n\t\tif ((effect.f & BOUNDARY_EFFECT) === 0) {\n\t\t\tif (!effect.parent && error instanceof Error) {\n\t\t\t\tapply_adjustments(error);\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\n\t\t/** @type {Boundary} */ (effect.b).error(error);\n\t} else {\n\t\t// otherwise we bubble up the effect tree ourselves\n\t\tinvoke_error_boundary(error, effect);\n\t}\n}\n\n/**\n * @param {unknown} error\n * @param {Effect | null} effect\n */\nexport function invoke_error_boundary(error, effect) {\n\twhile (effect !== null) {\n\t\tif ((effect.f & BOUNDARY_EFFECT) !== 0) {\n\t\t\ttry {\n\t\t\t\t/** @type {Boundary} */ (effect.b).error(error);\n\t\t\t\treturn;\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\n\t\teffect = effect.parent;\n\t}\n\n\tif (error instanceof Error) {\n\t\tapply_adjustments(error);\n\t}\n\n\tthrow error;\n}\n\n/**\n * Add useful information to the error message/stack in development\n * @param {Error} error\n * @param {Effect} effect\n */\nfunction get_adjustments(error, effect) {\n\tconst message_descriptor = get_descriptor(error, 'message');\n\n\t// if the message was already changed and it's not configurable we can't change it\n\t// or it will throw a different error swallowing the original error\n\tif (message_descriptor && !message_descriptor.configurable) return;\n\n\tvar indent = is_firefox ? ' ' : '\\t';\n\tvar component_stack = `\\n${indent}in ${effect.fn?.name || '<unknown>'}`;\n\tvar context = effect.ctx;\n\n\twhile (context !== null) {\n\t\tcomponent_stack += `\\n${indent}in ${context.function?.[FILENAME].split('/').pop()}`;\n\t\tcontext = context.p;\n\t}\n\n\treturn {\n\t\tmessage: error.message + `\\n${component_stack}\\n`,\n\t\tstack: error.stack\n\t\t\t?.split('\\n')\n\t\t\t.filter((line) => !line.includes('svelte/src/internal'))\n\t\t\t.join('\\n')\n\t};\n}\n\n/**\n * @param {Error} error\n */\nfunction apply_adjustments(error) {\n\tconst adjusted = adjustments.get(error);\n\n\tif (adjusted) {\n\t\tdefine_property(error, 'message', {\n\t\t\tvalue: adjusted.message\n\t\t});\n\n\t\tdefine_property(error, 'stack', {\n\t\t\tvalue: adjusted.stack\n\t\t});\n\t}\n}\n","import { run_all } from '../../shared/utils.js';\n\n// Fallback for when requestIdleCallback is not available\nconst request_idle_callback =\n\ttypeof requestIdleCallback === 'undefined'\n\t\t? (/** @type {() => void} */ cb) => setTimeout(cb, 1)\n\t\t: requestIdleCallback;\n\n/** @type {Array<() => void>} */\nlet micro_tasks = [];\n\n/** @type {Array<() => void>} */\nlet idle_tasks = [];\n\nfunction run_micro_tasks() {\n\tvar tasks = micro_tasks;\n\tmicro_tasks = [];\n\trun_all(tasks);\n}\n\nfunction run_idle_tasks() {\n\tvar tasks = idle_tasks;\n\tidle_tasks = [];\n\trun_all(tasks);\n}\n\n/**\n * @param {() => void} fn\n */\nexport function queue_micro_task(fn) {\n\tif (micro_tasks.length === 0) {\n\t\tqueueMicrotask(run_micro_tasks);\n\t}\n\n\tmicro_tasks.push(fn);\n}\n\n/**\n * @param {() => void} fn\n */\nexport function queue_idle_task(fn) {\n\tif (idle_tasks.length === 0) {\n\t\trequest_idle_callback(run_idle_tasks);\n\t}\n\n\tidle_tasks.push(fn);\n}\n\n/**\n * Synchronously run any queued tasks.\n */\nexport function flush_tasks() {\n\tif (micro_tasks.length > 0) {\n\t\trun_micro_tasks();\n\t}\n\n\tif (idle_tasks.length > 0) {\n\t\trun_idle_tasks();\n\t}\n}\n","/** @import { Effect, Source, TemplateNode, } from '#client' */\nimport {\n\tBOUNDARY_EFFECT,\n\tEFFECT_PRESERVED,\n\tEFFECT_RAN,\n\tEFFECT_TRANSPARENT\n} from '#client/constants';\nimport { component_context, set_component_context } from '../../context.js';\nimport { handle_error, invoke_error_boundary } from '../../error-handling.js';\nimport { block, branch, destroy_effect, pause_effect } from '../../reactivity/effects.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tget,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tnext,\n\tremove_nodes,\n\tset_hydrate_node\n} from '../hydration.js';\nimport { get_next_sibling } from '../operations.js';\nimport { queue_micro_task } from '../task.js';\nimport * as e from '../../errors.js';\nimport * as w from '../../warnings.js';\nimport { DEV } from 'esm-env';\nimport { Batch, effect_pending_updates } from '../../reactivity/batch.js';\nimport { internal_set, source } from '../../reactivity/sources.js';\nimport { tag } from '../../dev/tracing.js';\nimport { createSubscriber } from '../../../../reactivity/create-subscriber.js';\n\n/**\n * @typedef {{\n * \t onerror?: (error: unknown, reset: () => void) => void;\n * failed?: (anchor: Node, error: () => unknown, reset: () => () => void) => void;\n * pending?: (anchor: Node) => void;\n * }} BoundaryProps\n */\n\nvar flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED | BOUNDARY_EFFECT;\n\n/**\n * @param {TemplateNode} node\n * @param {BoundaryProps} props\n * @param {((anchor: Node) => void)} children\n * @returns {void}\n */\nexport function boundary(node, props, children) {\n\tnew Boundary(node, props, children);\n}\n\nexport class Boundary {\n\tpending = false;\n\n\t/** @type {Boundary | null} */\n\tparent;\n\n\t/** @type {TemplateNode} */\n\t#anchor;\n\n\t/** @type {TemplateNode} */\n\t#hydrate_open;\n\n\t/** @type {BoundaryProps} */\n\t#props;\n\n\t/** @type {((anchor: Node) => void)} */\n\t#children;\n\n\t/** @type {Effect} */\n\t#effect;\n\n\t/** @type {Effect | null} */\n\t#main_effect = null;\n\n\t/** @type {Effect | null} */\n\t#pending_effect = null;\n\n\t/** @type {Effect | null} */\n\t#failed_effect = null;\n\n\t/** @type {DocumentFragment | null} */\n\t#offscreen_fragment = null;\n\n\t#pending_count = 0;\n\t#is_creating_fallback = false;\n\n\t/**\n\t * A source containing the number of pending async deriveds/expressions.\n\t * Only created if `$effect.pending()` is used inside the boundary,\n\t * otherwise updating the source results in needless `Batch.ensure()`\n\t * calls followed by no-op flushes\n\t * @type {Source<number> | null}\n\t */\n\t#effect_pending = null;\n\n\t#effect_pending_update = () => {\n\t\tif (this.#effect_pending) {\n\t\t\tinternal_set(this.#effect_pending, this.#pending_count);\n\t\t}\n\t};\n\n\t#effect_pending_subscriber = createSubscriber(() => {\n\t\tthis.#effect_pending = source(this.#pending_count);\n\n\t\tif (DEV) {\n\t\t\ttag(this.#effect_pending, '$effect.pending()');\n\t\t}\n\n\t\treturn () => {\n\t\t\tthis.#effect_pending = null;\n\t\t};\n\t});\n\n\t/**\n\t * @param {TemplateNode} node\n\t * @param {BoundaryProps} props\n\t * @param {((anchor: Node) => void)} children\n\t */\n\tconstructor(node, props, children) {\n\t\tthis.#anchor = node;\n\t\tthis.#props = props;\n\t\tthis.#children = children;\n\n\t\tthis.#hydrate_open = hydrate_node;\n\n\t\tthis.parent = /** @type {Effect} */ (active_effect).b;\n\n\t\tthis.pending = !!this.#props.pending;\n\n\t\tthis.#effect = block(() => {\n\t\t\t/** @type {Effect} */ (active_effect).b = this;\n\n\t\t\tif (hydrating) {\n\t\t\t\thydrate_next();\n\t\t\t}\n\n\t\t\tconst pending = this.#props.pending;\n\n\t\t\tif (hydrating && pending) {\n\t\t\t\tthis.#pending_effect = branch(() => pending(this.#anchor));\n\n\t\t\t\t// future work: when we have some form of async SSR, we will\n\t\t\t\t// need to use hydration boundary comments to report whether\n\t\t\t\t// the pending or main block was rendered for a given\n\t\t\t\t// boundary, and hydrate accordingly\n\t\t\t\tBatch.enqueue(() => {\n\t\t\t\t\tthis.#main_effect = this.#run(() => {\n\t\t\t\t\t\tBatch.ensure();\n\t\t\t\t\t\treturn branch(() => this.#children(this.#anchor));\n\t\t\t\t\t});\n\n\t\t\t\t\tif (this.#pending_count > 0) {\n\t\t\t\t\t\tthis.#show_pending_snippet();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpause_effect(/** @type {Effect} */ (this.#pending_effect), () => {\n\t\t\t\t\t\t\tthis.#pending_effect = null;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tthis.pending = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tthis.#main_effect = branch(() => children(this.#anchor));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.error(error);\n\t\t\t\t}\n\n\t\t\t\tif (this.#pending_count > 0) {\n\t\t\t\t\tthis.#show_pending_snippet();\n\t\t\t\t} else {\n\t\t\t\t\tthis.pending = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}, flags);\n\n\t\tif (hydrating) {\n\t\t\tthis.#anchor = hydrate_node;\n\t\t}\n\t}\n\n\thas_pending_snippet() {\n\t\treturn !!this.#props.pending;\n\t}\n\n\t/**\n\t * @param {() => Effect | null} fn\n\t */\n\t#run(fn) {\n\t\tvar previous_effect = active_effect;\n\t\tvar previous_reaction = active_reaction;\n\t\tvar previous_ctx = component_context;\n\n\t\tset_active_effect(this.#effect);\n\t\tset_active_reaction(this.#effect);\n\t\tset_component_context(this.#effect.ctx);\n\n\t\ttry {\n\t\t\treturn fn();\n\t\t} catch (e) {\n\t\t\thandle_error(e);\n\t\t\treturn null;\n\t\t} finally {\n\t\t\tset_active_effect(previous_effect);\n\t\t\tset_active_reaction(previous_reaction);\n\t\t\tset_component_context(previous_ctx);\n\t\t}\n\t}\n\n\t#show_pending_snippet() {\n\t\tconst pending = /** @type {(anchor: Node) => void} */ (this.#props.pending);\n\n\t\tif (this.#main_effect !== null) {\n\t\t\tthis.#offscreen_fragment = document.createDocumentFragment();\n\t\t\tmove_effect(this.#main_effect, this.#offscreen_fragment);\n\t\t}\n\n\t\tif (this.#pending_effect === null) {\n\t\t\tthis.#pending_effect = branch(() => pending(this.#anchor));\n\t\t}\n\t}\n\n\t/** @param {1 | -1} d */\n\t#update_pending_count(d) {\n\t\tthis.#pending_count += d;\n\n\t\tif (this.#pending_count === 0) {\n\t\t\tthis.pending = false;\n\n\t\t\tif (this.#pending_effect) {\n\t\t\t\tpause_effect(this.#pending_effect, () => {\n\t\t\t\t\tthis.#pending_effect = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (this.#offscreen_fragment) {\n\t\t\t\tthis.#anchor.before(this.#offscreen_fragment);\n\t\t\t\tthis.#offscreen_fragment = null;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @param {1 | -1} d */\n\tupdate_pending_count(d) {\n\t\tif (this.has_pending_snippet()) {\n\t\t\tthis.#update_pending_count(d);\n\t\t} else if (this.parent) {\n\t\t\tthis.parent.#update_pending_count(d);\n\t\t}\n\n\t\teffect_pending_updates.add(this.#effect_pending_update);\n\t}\n\n\tget_effect_pending() {\n\t\tthis.#effect_pending_subscriber();\n\t\treturn get(/** @type {Source<number>} */ (this.#effect_pending));\n\t}\n\n\t/** @param {unknown} error */\n\terror(error) {\n\t\tvar onerror = this.#props.onerror;\n\t\tlet failed = this.#props.failed;\n\n\t\tif (this.#main_effect) {\n\t\t\tdestroy_effect(this.#main_effect);\n\t\t\tthis.#main_effect = null;\n\t\t}\n\n\t\tif (this.#pending_effect) {\n\t\t\tdestroy_effect(this.#pending_effect);\n\t\t\tthis.#pending_effect = null;\n\t\t}\n\n\t\tif (this.#failed_effect) {\n\t\t\tdestroy_effect(this.#failed_effect);\n\t\t\tthis.#failed_effect = null;\n\t\t}\n\n\t\tif (hydrating) {\n\t\t\tset_hydrate_node(this.#hydrate_open);\n\t\t\tnext();\n\t\t\tset_hydrate_node(remove_nodes());\n\t\t}\n\n\t\tvar did_reset = false;\n\t\tvar calling_on_error = false;\n\n\t\tconst reset = () => {\n\t\t\tif (did_reset) {\n\t\t\t\tw.svelte_boundary_reset_noop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdid_reset = true;\n\n\t\t\tif (calling_on_error) {\n\t\t\t\te.svelte_boundary_reset_onerror();\n\t\t\t}\n\n\t\t\tthis.#pending_count = 0;\n\n\t\t\tif (this.#failed_effect !== null) {\n\t\t\t\tpause_effect(this.#failed_effect, () => {\n\t\t\t\t\tthis.#failed_effect = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis.pending = true;\n\n\t\t\tthis.#main_effect = this.#run(() => {\n\t\t\t\tthis.#is_creating_fallback = false;\n\t\t\t\treturn branch(() => this.#children(this.#anchor));\n\t\t\t});\n\n\t\t\tif (this.#pending_count > 0) {\n\t\t\t\tthis.#show_pending_snippet();\n\t\t\t} else {\n\t\t\t\tthis.pending = false;\n\t\t\t}\n\t\t};\n\n\t\t// If we have nothing to capture the error, or if we hit an error while\n\t\t// rendering the fallback, re-throw for another boundary to handle\n\t\tif (this.#is_creating_fallback || (!onerror && !failed)) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tvar previous_reaction = active_reaction;\n\n\t\ttry {\n\t\t\tset_active_reaction(null);\n\t\t\tcalling_on_error = true;\n\t\t\tonerror?.(error, reset);\n\t\t\tcalling_on_error = false;\n\t\t} catch (error) {\n\t\t\tinvoke_error_boundary(error, this.#effect && this.#effect.parent);\n\t\t} finally {\n\t\t\tset_active_reaction(previous_reaction);\n\t\t}\n\n\t\tif (failed) {\n\t\t\tqueue_micro_task(() => {\n\t\t\t\tthis.#failed_effect = this.#run(() => {\n\t\t\t\t\tthis.#is_creating_fallback = true;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn branch(() => {\n\t\t\t\t\t\t\tfailed(\n\t\t\t\t\t\t\t\tthis.#anchor,\n\t\t\t\t\t\t\t\t() => error,\n\t\t\t\t\t\t\t\t() => reset\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tinvoke_error_boundary(error, /** @type {Effect} */ (this.#effect.parent));\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tthis.#is_creating_fallback = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\n/**\n *\n * @param {Effect} effect\n * @param {DocumentFragment} fragment\n */\nfunction move_effect(effect, fragment) {\n\tvar node = effect.nodes_start;\n\tvar end = effect.nodes_end;\n\n\twhile (node !== null) {\n\t\t/** @type {TemplateNode | null} */\n\t\tvar next = node === end ? null : /** @type {TemplateNode} */ (get_next_sibling(node));\n\n\t\tfragment.append(node);\n\t\tnode = next;\n\t}\n}\n\nexport function get_pending_boundary() {\n\tvar boundary = /** @type {Effect} */ (active_effect).b;\n\n\twhile (boundary !== null && !boundary.has_pending_snippet()) {\n\t\tboundary = boundary.parent;\n\t}\n\n\tif (boundary === null) {\n\t\te.await_outside_boundary();\n\t}\n\n\treturn boundary;\n}\n\nexport function pending() {\n\tif (active_effect === null) {\n\t\te.effect_pending_outside_reaction();\n\t}\n\n\tvar boundary = active_effect.b;\n\n\tif (boundary === null) {\n\t\treturn 0; // TODO eventually we will need this to be global\n\t}\n\n\treturn boundary.get_effect_pending();\n}\n","/** @import { Derived, Effect, Source } from '#client' */\n/** @import { Batch } from './batch.js'; */\nimport { DEV } from 'esm-env';\nimport {\n\tERROR_VALUE,\n\tCLEAN,\n\tDERIVED,\n\tDIRTY,\n\tEFFECT_PRESERVED,\n\tMAYBE_DIRTY,\n\tSTALE_REACTION,\n\tUNOWNED,\n\tASYNC\n} from '#client/constants';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tset_signal_status,\n\tskip_reaction,\n\tupdate_reaction,\n\tincrement_write_version,\n\tset_active_effect,\n\tpush_reaction_value,\n\tis_destroying_effect\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport * as e from '../errors.js';\nimport * as w from '../warnings.js';\nimport { async_effect, destroy_effect } from './effects.js';\nimport { inspect_effects, internal_set, set_inspect_effects, source } from './sources.js';\nimport { get_stack } from '../dev/tracing.js';\nimport { tracing_mode_flag } from '../../flags/index.js';\nimport { Boundary } from '../dom/blocks/boundary.js';\nimport { component_context } from '../context.js';\nimport { UNINITIALIZED } from '../../../constants.js';\nimport { batch_deriveds, current_batch } from './batch.js';\nimport { unset_context } from './async.js';\n\n/** @type {Effect | null} */\nexport let current_async_effect = null;\n\n/** @param {Effect | null} v */\nexport function set_from_async_derived(v) {\n\tcurrent_async_effect = v;\n}\n\nexport const recent_async_deriveds = new Set();\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived<V>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived(fn) {\n\tvar flags = DERIVED | DIRTY;\n\tvar parent_derived =\n\t\tactive_reaction !== null && (active_reaction.f & DERIVED) !== 0\n\t\t\t? /** @type {Derived} */ (active_reaction)\n\t\t\t: null;\n\n\tif (active_effect === null || (parent_derived !== null && (parent_derived.f & UNOWNED) !== 0)) {\n\t\tflags |= UNOWNED;\n\t} else {\n\t\t// Since deriveds are evaluated lazily, any effects created inside them are\n\t\t// created too late to ensure that the parent effect is added to the tree\n\t\tactive_effect.f |= EFFECT_PRESERVED;\n\t}\n\n\t/** @type {Derived<V>} */\n\tconst signal = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\teffects: null,\n\t\tequals,\n\t\tf: flags,\n\t\tfn,\n\t\treactions: null,\n\t\trv: 0,\n\t\tv: /** @type {V} */ (UNINITIALIZED),\n\t\twv: 0,\n\t\tparent: parent_derived ?? active_effect,\n\t\tac: null\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = get_stack('CreatedAt');\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {() => V | Promise<V>} fn\n * @param {string} [location] If provided, print a warning if the value is not read immediately after update\n * @returns {Promise<Source<V>>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function async_derived(fn, location) {\n\tlet parent = /** @type {Effect | null} */ (active_effect);\n\n\tif (parent === null) {\n\t\te.async_derived_orphan();\n\t}\n\n\tvar boundary = /** @type {Boundary} */ (parent.b);\n\n\tvar promise = /** @type {Promise<V>} */ (/** @type {unknown} */ (undefined));\n\tvar signal = source(/** @type {V} */ (UNINITIALIZED));\n\n\t/** @type {Promise<V> | null} */\n\tvar prev = null;\n\n\t// only suspend in async deriveds created on initialisation\n\tvar should_suspend = !active_reaction;\n\n\tasync_effect(() => {\n\t\tif (DEV) current_async_effect = active_effect;\n\n\t\ttry {\n\t\t\tvar p = fn();\n\t\t} catch (error) {\n\t\t\tp = Promise.reject(error);\n\t\t}\n\n\t\tif (DEV) current_async_effect = null;\n\n\t\tvar r = () => p;\n\t\tpromise = prev?.then(r, r) ?? Promise.resolve(p);\n\n\t\tprev = promise;\n\n\t\tvar batch = /** @type {Batch} */ (current_batch);\n\t\tvar pending = boundary.pending;\n\n\t\tif (should_suspend) {\n\t\t\tboundary.update_pending_count(1);\n\t\t\tif (!pending) batch.increment();\n\t\t}\n\n\t\t/**\n\t\t * @param {any} value\n\t\t * @param {unknown} error\n\t\t */\n\t\tconst handler = (value, error = undefined) => {\n\t\t\tprev = null;\n\n\t\t\tcurrent_async_effect = null;\n\n\t\t\tif (!pending) batch.activate();\n\n\t\t\tif (error) {\n\t\t\t\tif (error !== STALE_REACTION) {\n\t\t\t\t\tsignal.f |= ERROR_VALUE;\n\n\t\t\t\t\t// @ts-expect-error the error is the wrong type, but we don't care\n\t\t\t\t\tinternal_set(signal, error);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ((signal.f & ERROR_VALUE) !== 0) {\n\t\t\t\t\tsignal.f ^= ERROR_VALUE;\n\t\t\t\t}\n\n\t\t\t\tinternal_set(signal, value);\n\n\t\t\t\tif (DEV && location !== undefined) {\n\t\t\t\t\trecent_async_deriveds.add(signal);\n\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tif (recent_async_deriveds.has(signal)) {\n\t\t\t\t\t\t\tw.await_waterfall(/** @type {string} */ (signal.label), location);\n\t\t\t\t\t\t\trecent_async_deriveds.delete(signal);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (should_suspend) {\n\t\t\t\tboundary.update_pending_count(-1);\n\t\t\t\tif (!pending) batch.decrement();\n\t\t\t}\n\n\t\t\tunset_context();\n\t\t};\n\n\t\tpromise.then(handler, (e) => handler(null, e || 'unknown'));\n\n\t\tif (batch) {\n\t\t\treturn () => {\n\t\t\t\tqueueMicrotask(() => batch.neuter());\n\t\t\t};\n\t\t}\n\t});\n\n\tif (DEV) {\n\t\t// add a flag that lets this be printed as a derived\n\t\t// when using `$inspect.trace()`\n\t\tsignal.f |= ASYNC;\n\t}\n\n\treturn new Promise((fulfil) => {\n\t\t/** @param {Promise<V>} p */\n\t\tfunction next(p) {\n\t\t\tfunction go() {\n\t\t\t\tif (p === promise) {\n\t\t\t\t\tfulfil(signal);\n\t\t\t\t} else {\n\t\t\t\t\t// if the effect re-runs before the initial promise\n\t\t\t\t\t// resolves, delay resolution until we have a value\n\t\t\t\t\tnext(promise);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tp.then(go, go);\n\t\t}\n\n\t\tnext(promise);\n\t});\n}\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived<V>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function user_derived(fn) {\n\tconst d = derived(fn);\n\n\tpush_reaction_value(d);\n\n\treturn d;\n}\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived<V>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived_safe_equal(fn) {\n\tconst signal = derived(fn);\n\tsignal.equals = safe_equals;\n\treturn signal;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function destroy_derived_effects(derived) {\n\tvar effects = derived.effects;\n\n\tif (effects !== null) {\n\t\tderived.effects = null;\n\n\t\tfor (var i = 0; i < effects.length; i += 1) {\n\t\t\tdestroy_effect(/** @type {Effect} */ (effects[i]));\n\t\t}\n\t}\n}\n\n/**\n * The currently updating deriveds, used to detect infinite recursion\n * in dev mode and provide a nicer error than 'too much recursion'\n * @type {Derived[]}\n */\nlet stack = [];\n\n/**\n * @param {Derived} derived\n * @returns {Effect | null}\n */\nfunction get_derived_parent_effect(derived) {\n\tvar parent = derived.parent;\n\twhile (parent !== null) {\n\t\tif ((parent.f & DERIVED) === 0) {\n\t\t\treturn /** @type {Effect} */ (parent);\n\t\t}\n\t\tparent = parent.parent;\n\t}\n\treturn null;\n}\n\n/**\n * @template T\n * @param {Derived} derived\n * @returns {T}\n */\nexport function execute_derived(derived) {\n\tvar value;\n\tvar prev_active_effect = active_effect;\n\n\tset_active_effect(get_derived_parent_effect(derived));\n\n\tif (DEV) {\n\t\tlet prev_inspect_effects = inspect_effects;\n\t\tset_inspect_effects(new Set());\n\t\ttry {\n\t\t\tif (stack.includes(derived)) {\n\t\t\t\te.derived_references_self();\n\t\t\t}\n\n\t\t\tstack.push(derived);\n\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t\tset_inspect_effects(prev_inspect_effects);\n\t\t\tstack.pop();\n\t\t}\n\t} else {\n\t\ttry {\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t}\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function update_derived(derived) {\n\tvar value = execute_derived(derived);\n\n\tif (!derived.equals(value)) {\n\t\tderived.v = value;\n\t\tderived.wv = increment_write_version();\n\t}\n\n\t// don't mark derived clean if we're reading it inside a\n\t// cleanup function, or it will cache a stale value\n\tif (is_destroying_effect) {\n\t\treturn;\n\t}\n\n\tif (batch_deriveds !== null) {\n\t\tbatch_deriveds.set(derived, derived.v);\n\t} else {\n\t\tvar status =\n\t\t\t(skip_reaction || (derived.f & UNOWNED) !== 0) && derived.deps !== null ? MAYBE_DIRTY : CLEAN;\n\n\t\tset_signal_status(derived, status);\n\t}\n}\n","/** @import { Effect, Value } from '#client' */\n\nimport { DESTROYED } from '#client/constants';\nimport { DEV } from 'esm-env';\nimport { component_context, is_runes, set_component_context } from '../context.js';\nimport { get_pending_boundary } from '../dom/blocks/boundary.js';\nimport { invoke_error_boundary } from '../error-handling.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../runtime.js';\nimport { current_batch } from './batch.js';\nimport {\n\tasync_derived,\n\tcurrent_async_effect,\n\tderived,\n\tderived_safe_equal,\n\tset_from_async_derived\n} from './deriveds.js';\n\n/**\n *\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise<any>>} async\n * @param {(values: Value[]) => any} fn\n */\nexport function flatten(sync, async, fn) {\n\tconst d = is_runes() ? derived : derived_safe_equal;\n\n\tif (async.length === 0) {\n\t\tfn(sync.map(d));\n\t\treturn;\n\t}\n\n\tvar batch = current_batch;\n\tvar parent = /** @type {Effect} */ (active_effect);\n\n\tvar restore = capture();\n\tvar boundary = get_pending_boundary();\n\n\tPromise.all(async.map((expression) => async_derived(expression)))\n\t\t.then((result) => {\n\t\t\tbatch?.activate();\n\n\t\t\trestore();\n\n\t\t\ttry {\n\t\t\t\tfn([...sync.map(d), ...result]);\n\t\t\t} catch (error) {\n\t\t\t\t// ignore errors in blocks that have already been destroyed\n\t\t\t\tif ((parent.f & DESTROYED) === 0) {\n\t\t\t\t\tinvoke_error_boundary(error, parent);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbatch?.deactivate();\n\t\t\tunset_context();\n\t\t})\n\t\t.catch((error) => {\n\t\t\tboundary.error(error);\n\t\t});\n}\n\n/**\n * Captures the current effect context so that we can restore it after\n * some asynchronous work has happened (so that e.g. `await a + b`\n * causes `b` to be registered as a dependency).\n */\nfunction capture() {\n\tvar previous_effect = active_effect;\n\tvar previous_reaction = active_reaction;\n\tvar previous_component_context = component_context;\n\n\treturn function restore() {\n\t\tset_active_effect(previous_effect);\n\t\tset_active_reaction(previous_reaction);\n\t\tset_component_context(previous_component_context);\n\n\t\tif (DEV) {\n\t\t\tset_from_async_derived(null);\n\t\t}\n\t};\n}\n\n/**\n * Wraps an `await` expression in such a way that the effect context that was\n * active before the expression evaluated can be reapplied afterwards —\n * `await a + b` becomes `(await $.save(a))() + b`\n * @template T\n * @param {Promise<T>} promise\n * @returns {Promise<() => T>}\n */\nexport async function save(promise) {\n\tvar restore = capture();\n\tvar value = await promise;\n\n\treturn () => {\n\t\trestore();\n\t\treturn value;\n\t};\n}\n\n/**\n * Reset `current_async_effect` after the `promise` resolves, so\n * that we can emit `await_reactivity_loss` warnings\n * @template T\n * @param {Promise<T>} promise\n * @returns {Promise<() => T>}\n */\nexport async function track_reactivity_loss(promise) {\n\tvar previous_async_effect = current_async_effect;\n\tvar value = await promise;\n\n\treturn () => {\n\t\tset_from_async_derived(previous_async_effect);\n\t\treturn value;\n\t};\n}\n\n/**\n * Used in `for await` loops in DEV, so\n * that we can emit `await_reactivity_loss` warnings\n * after each `async_iterator` result resolves and\n * after the `async_iterator` return resolves (if it runs)\n * @template T\n * @template TReturn\n * @param {Iterable<T> | AsyncIterable<T>} iterable\n * @returns {AsyncGenerator<T, TReturn | undefined>}\n */\nexport async function* for_await_track_reactivity_loss(iterable) {\n\t// This is based on the algorithms described in ECMA-262:\n\t// ForIn/OfBodyEvaluation\n\t// https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset\n\t// AsyncIteratorClose\n\t// https://tc39.es/ecma262/multipage/abstract-operations.html#sec-asynciteratorclose\n\n\t/** @type {AsyncIterator<T, TReturn>} */\n\t// @ts-ignore\n\tconst iterator = iterable[Symbol.asyncIterator]?.() ?? iterable[Symbol.iterator]?.();\n\n\tif (iterator === undefined) {\n\t\tthrow new TypeError('value is not async iterable');\n\t}\n\n\t/** Whether the completion of the iterator was \"normal\", meaning it wasn't ended via `break` or a similar method */\n\tlet normal_completion = false;\n\ttry {\n\t\twhile (true) {\n\t\t\tconst { done, value } = (await track_reactivity_loss(iterator.next()))();\n\t\t\tif (done) {\n\t\t\t\tnormal_completion = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tyield value;\n\t\t}\n\t} finally {\n\t\t// If the iterator had a normal completion and `return` is defined on the iterator, call it and return the value\n\t\tif (normal_completion && iterator.return !== undefined) {\n\t\t\t// eslint-disable-next-line no-unsafe-finally\n\t\t\treturn /** @type {TReturn} */ ((await track_reactivity_loss(iterator.return()))().value);\n\t\t}\n\t}\n}\n\nexport function unset_context() {\n\tset_active_effect(null);\n\tset_active_reaction(null);\n\tset_component_context(null);\n\tif (DEV) set_from_async_derived(null);\n}\n","/** @import { Derived, Effect, Source } from '#client' */\nimport {\n\tBLOCK_EFFECT,\n\tBRANCH_EFFECT,\n\tCLEAN,\n\tDESTROYED,\n\tDIRTY,\n\tEFFECT,\n\tASYNC,\n\tINERT,\n\tRENDER_EFFECT,\n\tROOT_EFFECT,\n\tUSER_EFFECT,\n\tMAYBE_DIRTY\n} from '#client/constants';\nimport { async_mode_flag } from '../../flags/index.js';\nimport { deferred, define_property } from '../../shared/utils.js';\nimport { get_pending_boundary } from '../dom/blocks/boundary.js';\nimport {\n\tactive_effect,\n\tis_dirty,\n\tis_updating_effect,\n\tset_is_updating_effect,\n\tset_signal_status,\n\tupdate_effect\n} from '../runtime.js';\nimport * as e from '../errors.js';\nimport { flush_tasks } from '../dom/task.js';\nimport { DEV } from 'esm-env';\nimport { invoke_error_boundary } from '../error-handling.js';\nimport { old_values } from './sources.js';\nimport { unlink_effect } from './effects.js';\nimport { unset_context } from './async.js';\n\n/** @type {Set<Batch>} */\nconst batches = new Set();\n\n/** @type {Batch | null} */\nexport let current_batch = null;\n\n/**\n * This is needed to avoid overwriting inputs in non-async mode\n * TODO 6.0 remove this, as non-async mode will go away\n * @type {Batch | null}\n */\nexport let previous_batch = null;\n\n/**\n * When time travelling, we re-evaluate deriveds based on the temporary\n * values of their dependencies rather than their actual values, and cache\n * the results in this map rather than on the deriveds themselves\n * @type {Map<Derived, any> | null}\n */\nexport let batch_deriveds = null;\n\n/** @type {Set<() => void>} */\nexport let effect_pending_updates = new Set();\n\n/** @type {Array<() => void>} */\nlet tasks = [];\n\nfunction dequeue() {\n\tconst task = /** @type {() => void} */ (tasks.shift());\n\n\tif (tasks.length > 0) {\n\t\tqueueMicrotask(dequeue);\n\t}\n\n\ttask();\n}\n\n/** @type {Effect[]} */\nlet queued_root_effects = [];\n\n/** @type {Effect | null} */\nlet last_scheduled_effect = null;\n\nlet is_flushing = false;\n\nlet is_flushing_sync = false;\nexport class Batch {\n\t/**\n\t * The current values of any sources that are updated in this batch\n\t * They keys of this map are identical to `this.#previous`\n\t * @type {Map<Source, any>}\n\t */\n\tcurrent = new Map();\n\n\t/**\n\t * The values of any sources that are updated in this batch _before_ those updates took place.\n\t * They keys of this map are identical to `this.#current`\n\t * @type {Map<Source, any>}\n\t */\n\t#previous = new Map();\n\n\t/**\n\t * When the batch is committed (and the DOM is updated), we need to remove old branches\n\t * and append new ones by calling the functions added inside (if/each/key/etc) blocks\n\t * @type {Set<() => void>}\n\t */\n\t#callbacks = new Set();\n\n\t/**\n\t * The number of async effects that are currently in flight\n\t */\n\t#pending = 0;\n\n\t/**\n\t * A deferred that resolves when the batch is committed, used with `settled()`\n\t * TODO replace with Promise.withResolvers once supported widely enough\n\t * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}\n\t */\n\t#deferred = null;\n\n\t/**\n\t * True if an async effect inside this batch resolved and\n\t * its parent branch was already deleted\n\t */\n\t#neutered = false;\n\n\t/**\n\t * Async effects (created inside `async_derived`) encountered during processing.\n\t * These run after the rest of the batch has updated, since they should\n\t * always have the latest values\n\t * @type {Effect[]}\n\t */\n\t#async_effects = [];\n\n\t/**\n\t * The same as `#async_effects`, but for effects inside a newly-created\n\t * `<svelte:boundary>` — these do not prevent the batch from committing\n\t * @type {Effect[]}\n\t */\n\t#boundary_async_effects = [];\n\n\t/**\n\t * Template effects and `$effect.pre` effects, which run when\n\t * a batch is committed\n\t * @type {Effect[]}\n\t */\n\t#render_effects = [];\n\n\t/**\n\t * The same as `#render_effects`, but for `$effect` (which runs after)\n\t * @type {Effect[]}\n\t */\n\t#effects = [];\n\n\t/**\n\t * Block effects, which may need to re-run on subsequent flushes\n\t * in order to update internal sources (e.g. each block items)\n\t * @type {Effect[]}\n\t */\n\t#block_effects = [];\n\n\t/**\n\t * Deferred effects (which run after async work has completed) that are DIRTY\n\t * @type {Effect[]}\n\t */\n\t#dirty_effects = [];\n\n\t/**\n\t * Deferred effects that are MAYBE_DIRTY\n\t * @type {Effect[]}\n\t */\n\t#maybe_dirty_effects = [];\n\n\t/**\n\t * A set of branches that still exist, but will be destroyed when this batch\n\t * is committed — we skip over these during `process`\n\t * @type {Set<Effect>}\n\t */\n\tskipped_effects = new Set();\n\n\t/**\n\t *\n\t * @param {Effect[]} root_effects\n\t */\n\tprocess(root_effects) {\n\t\tqueued_root_effects = [];\n\n\t\tprevious_batch = null;\n\n\t\t/** @type {Map<Source, { v: unknown, wv: number }> | null} */\n\t\tvar current_values = null;\n\n\t\t// if there are multiple batches, we are 'time travelling' —\n\t\t// we need to undo the changes belonging to any batch\n\t\t// other than the current one\n\t\tif (batches.size > 1) {\n\t\t\tcurrent_values = new Map();\n\t\t\tbatch_deriveds = new Map();\n\n\t\t\tfor (const [source, current] of this.current) {\n\t\t\t\tcurrent_values.set(source, { v: source.v, wv: source.wv });\n\t\t\t\tsource.v = current;\n\t\t\t}\n\n\t\t\tfor (const batch of batches) {\n\t\t\t\tif (batch === this) continue;\n\n\t\t\t\tfor (const [source, previous] of batch.#previous) {\n\t\t\t\t\tif (!current_values.has(source)) {\n\t\t\t\t\t\tcurrent_values.set(source, { v: source.v, wv: source.wv });\n\t\t\t\t\t\tsource.v = previous;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const root of root_effects) {\n\t\t\tthis.#traverse_effect_tree(root);\n\t\t}\n\n\t\t// if we didn't start any new async work, and no async work\n\t\t// is outstanding from a previous flush, commit\n\t\tif (this.#async_effects.length === 0 && this.#pending === 0) {\n\t\t\tthis.#commit();\n\n\t\t\tvar render_effects = this.#render_effects;\n\t\t\tvar effects = this.#effects;\n\n\t\t\tthis.#render_effects = [];\n\t\t\tthis.#effects = [];\n\t\t\tthis.#block_effects = [];\n\n\t\t\t// If sources are written to, then work needs to happen in a separate batch, else prior sources would be mixed with\n\t\t\t// newly updated sources, which could lead to infinite loops when effects run over and over again.\n\t\t\tprevious_batch = current_batch;\n\t\t\tcurrent_batch = null;\n\n\t\t\tflush_queued_effects(render_effects);\n\t\t\tflush_queued_effects(effects);\n\n\t\t\t// Reinstate the current batch if there was no new one created, as `process()` runs in a loop in `flush_effects()`.\n\t\t\t// That method expects `current_batch` to be set, and could run the loop again if effects result in new effects\n\t\t\t// being scheduled but without writes happening in which case no new batch is created.\n\t\t\tif (current_batch === null) {\n\t\t\t\tcurrent_batch = this;\n\t\t\t} else {\n\t\t\t\tbatches.delete(this);\n\t\t\t}\n\n\t\t\tthis.#deferred?.resolve();\n\t\t} else {\n\t\t\tthis.#defer_effects(this.#render_effects);\n\t\t\tthis.#defer_effects(this.#effects);\n\t\t\tthis.#defer_effects(this.#block_effects);\n\t\t}\n\n\t\tif (current_values) {\n\t\t\tfor (const [source, { v, wv }] of current_values) {\n\t\t\t\t// reset the source to the current value (unless\n\t\t\t\t// it got a newer value as a result of effects running)\n\t\t\t\tif (source.wv <= wv) {\n\t\t\t\t\tsource.v = v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbatch_deriveds = null;\n\t\t}\n\n\t\tfor (const effect of this.#async_effects) {\n\t\t\tupdate_effect(effect);\n\t\t}\n\n\t\tfor (const effect of this.#boundary_async_effects) {\n\t\t\tupdate_effect(effect);\n\t\t}\n\n\t\tthis.#async_effects = [];\n\t\tthis.#boundary_async_effects = [];\n\t}\n\n\t/**\n\t * Traverse the effect tree, executing effects or stashing\n\t * them for later execution as appropriate\n\t * @param {Effect} root\n\t */\n\t#traverse_effect_tree(root) {\n\t\troot.f ^= CLEAN;\n\n\t\tvar effect = root.first;\n\n\t\twhile (effect !== null) {\n\t\t\tvar flags = effect.f;\n\t\t\tvar is_branch = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;\n\t\t\tvar is_skippable_branch = is_branch && (flags & CLEAN) !== 0;\n\n\t\t\tvar skip = is_skippable_branch || (flags & INERT) !== 0 || this.skipped_effects.has(effect);\n\n\t\t\tif (!skip && effect.fn !== null) {\n\t\t\t\tif (is_branch) {\n\t\t\t\t\teffect.f ^= CLEAN;\n\t\t\t\t} else if ((flags & EFFECT) !== 0) {\n\t\t\t\t\tthis.#effects.push(effect);\n\t\t\t\t} else if (async_mode_flag && (flags & RENDER_EFFECT) !== 0) {\n\t\t\t\t\tthis.#render_effects.push(effect);\n\t\t\t\t} else if ((flags & CLEAN) === 0) {\n\t\t\t\t\tif ((flags & ASYNC) !== 0) {\n\t\t\t\t\t\tvar effects = effect.b?.pending ? this.#boundary_async_effects : this.#async_effects;\n\t\t\t\t\t\teffects.push(effect);\n\t\t\t\t\t} else if (is_dirty(effect)) {\n\t\t\t\t\t\tif ((effect.f & BLOCK_EFFECT) !== 0) this.#block_effects.push(effect);\n\t\t\t\t\t\tupdate_effect(effect);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar child = effect.first;\n\n\t\t\t\tif (child !== null) {\n\t\t\t\t\teffect = child;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar parent = effect.parent;\n\t\t\teffect = effect.next;\n\n\t\t\twhile (effect === null && parent !== null) {\n\t\t\t\teffect = parent.next;\n\t\t\t\tparent = parent.parent;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param {Effect[]} effects\n\t */\n\t#defer_effects(effects) {\n\t\tfor (const e of effects) {\n\t\t\tconst target = (e.f & DIRTY) !== 0 ? this.#dirty_effects : this.#maybe_dirty_effects;\n\t\t\ttarget.push(e);\n\n\t\t\t// mark as clean so they get scheduled if they depend on pending async state\n\t\t\tset_signal_status(e, CLEAN);\n\t\t}\n\n\t\teffects.length = 0;\n\t}\n\n\t/**\n\t * Associate a change to a given source with the current\n\t * batch, noting its previous and current values\n\t * @param {Source} source\n\t * @param {any} value\n\t */\n\tcapture(source, value) {\n\t\tif (!this.#previous.has(source)) {\n\t\t\tthis.#previous.set(source, value);\n\t\t}\n\n\t\tthis.current.set(source, source.v);\n\t}\n\n\tactivate() {\n\t\tcurrent_batch = this;\n\t}\n\n\tdeactivate() {\n\t\tcurrent_batch = null;\n\t\tprevious_batch = null;\n\n\t\tfor (const update of effect_pending_updates) {\n\t\t\teffect_pending_updates.delete(update);\n\t\t\tupdate();\n\n\t\t\tif (current_batch !== null) {\n\t\t\t\t// only do one at a time\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tneuter() {\n\t\tthis.#neutered = true;\n\t}\n\n\tflush() {\n\t\tif (queued_root_effects.length > 0) {\n\t\t\tflush_effects();\n\t\t} else {\n\t\t\tthis.#commit();\n\t\t}\n\n\t\tif (current_batch !== this) {\n\t\t\t// this can happen if a `flushSync` occurred during `flush_effects()`,\n\t\t\t// which is permitted in legacy mode despite being a terrible idea\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.#pending === 0) {\n\t\t\tbatches.delete(this);\n\t\t}\n\n\t\tthis.deactivate();\n\t}\n\n\t/**\n\t * Append and remove branches to/from the DOM\n\t */\n\t#commit() {\n\t\tif (!this.#neutered) {\n\t\t\tfor (const fn of this.#callbacks) {\n\t\t\t\tfn();\n\t\t\t}\n\t\t}\n\n\t\tthis.#callbacks.clear();\n\t}\n\n\tincrement() {\n\t\tthis.#pending += 1;\n\t}\n\n\tdecrement() {\n\t\tthis.#pending -= 1;\n\n\t\tif (this.#pending === 0) {\n\t\t\tfor (const e of this.#dirty_effects) {\n\t\t\t\tset_signal_status(e, DIRTY);\n\t\t\t\tschedule_effect(e);\n\t\t\t}\n\n\t\t\tfor (const e of this.#maybe_dirty_effects) {\n\t\t\t\tset_signal_status(e, MAYBE_DIRTY);\n\t\t\t\tschedule_effect(e);\n\t\t\t}\n\n\t\t\tthis.#render_effects = [];\n\t\t\tthis.#effects = [];\n\n\t\t\tthis.flush();\n\t\t} else {\n\t\t\tthis.deactivate();\n\t\t}\n\t}\n\n\t/** @param {() => void} fn */\n\tadd_callback(fn) {\n\t\tthis.#callbacks.add(fn);\n\t}\n\n\tsettled() {\n\t\treturn (this.#deferred ??= deferred()).promise;\n\t}\n\n\tstatic ensure() {\n\t\tif (current_batch === null) {\n\t\t\tconst batch = (current_batch = new Batch());\n\t\t\tbatches.add(current_batch);\n\n\t\t\tif (!is_flushing_sync) {\n\t\t\t\tBatch.enqueue(() => {\n\t\t\t\t\tif (current_batch !== batch) {\n\t\t\t\t\t\t// a flushSync happened in the meantime\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tbatch.flush();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn current_batch;\n\t}\n\n\t/** @param {() => void} task */\n\tstatic enqueue(task) {\n\t\tif (tasks.length === 0) {\n\t\t\tqueueMicrotask(dequeue);\n\t\t}\n\n\t\ttasks.unshift(task);\n\t}\n}\n\n/**\n * Synchronously flush any pending updates.\n * Returns void if no callback is provided, otherwise returns the result of calling the callback.\n * @template [T=void]\n * @param {(() => T) | undefined} [fn]\n * @returns {T}\n */\nexport function flushSync(fn) {\n\tif (async_mode_flag && active_effect !== null) {\n\t\te.flush_sync_in_effect();\n\t}\n\n\tvar was_flushing_sync = is_flushing_sync;\n\tis_flushing_sync = true;\n\n\ttry {\n\t\tvar result;\n\n\t\tif (fn) {\n\t\t\tflush_effects();\n\t\t\tresult = fn();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tflush_tasks();\n\n\t\t\tif (queued_root_effects.length === 0) {\n\t\t\t\tcurrent_batch?.flush();\n\n\t\t\t\t// we need to check again, in case we just updated an `$effect.pending()`\n\t\t\t\tif (queued_root_effects.length === 0) {\n\t\t\t\t\t// this would be reset in `flush_effects()` but since we are early returning here,\n\t\t\t\t\t// we need to reset it here as well in case the first time there's 0 queued root effects\n\t\t\t\t\tlast_scheduled_effect = null;\n\n\t\t\t\t\treturn /** @type {T} */ (result);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tflush_effects();\n\t\t}\n\t} finally {\n\t\tis_flushing_sync = was_flushing_sync;\n\t}\n}\n\nfunction flush_effects() {\n\tvar was_updating_effect = is_updating_effect;\n\tis_flushing = true;\n\n\ttry {\n\t\tvar flush_count = 0;\n\t\tset_is_updating_effect(true);\n\n\t\twhile (queued_root_effects.length > 0) {\n\t\t\tvar batch = Batch.ensure();\n\n\t\t\tif (flush_count++ > 1000) {\n\t\t\t\tif (DEV) {\n\t\t\t\t\tvar updates = new Map();\n\n\t\t\t\t\tfor (const source of batch.current.keys()) {\n\t\t\t\t\t\tfor (const [stack, update] of source.updated ?? []) {\n\t\t\t\t\t\t\tvar entry = updates.get(stack);\n\n\t\t\t\t\t\t\tif (!entry) {\n\t\t\t\t\t\t\t\tentry = { error: update.error, count: 0 };\n\t\t\t\t\t\t\t\tupdates.set(stack, entry);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tentry.count += update.count;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (const update of updates.values()) {\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.error(update.error);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tinfinite_loop_guard();\n\t\t\t}\n\n\t\t\tbatch.process(queued_root_effects);\n\t\t\told_values.clear();\n\t\t}\n\t} finally {\n\t\tis_flushing = false;\n\t\tset_is_updating_effect(was_updating_effect);\n\n\t\tlast_scheduled_effect = null;\n\t}\n}\n\nfunction infinite_loop_guard() {\n\ttry {\n\t\te.effect_update_depth_exceeded();\n\t} catch (error) {\n\t\tif (DEV) {\n\t\t\t// stack contains no useful information, replace it\n\t\t\tdefine_property(error, 'stack', { value: '' });\n\t\t}\n\n\t\t// Best effort: invoke the boundary nearest the most recent\n\t\t// effect and hope that it's relevant to the infinite loop\n\t\tinvoke_error_boundary(error, last_scheduled_effect);\n\t}\n}\n\n/** @type {Effect[] | null} */\nexport let eager_block_effects = null;\n\n/**\n * @param {Array<Effect>} effects\n * @returns {void}\n */\nfunction flush_queued_effects(effects) {\n\tvar length = effects.length;\n\tif (length === 0) return;\n\n\tvar i = 0;\n\n\twhile (i < length) {\n\t\tvar effect = effects[i++];\n\n\t\tif ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) {\n\t\t\teager_block_effects = [];\n\n\t\t\tupdate_effect(effect);\n\n\t\t\t// Effects with no dependencies or teardown do not get added to the effect tree.\n\t\t\t// Deferred effects (e.g. `$effect(...)`) _are_ added to the tree because we\n\t\t\t// don't know if we need to keep them until they are executed. Doing the check\n\t\t\t// here (rather than in `update_effect`) allows us to skip the work for\n\t\t\t// immediate effects.\n\t\t\tif (effect.deps === null && effect.first === null && effect.nodes_start === null) {\n\t\t\t\t// if there's no teardown or abort controller we completely unlink\n\t\t\t\t// the effect from the graph\n\t\t\t\tif (effect.teardown === null && effect.ac === null) {\n\t\t\t\t\t// remove this effect from the graph\n\t\t\t\t\tunlink_effect(effect);\n\t\t\t\t} else {\n\t\t\t\t\t// keep the effect in the graph, but free up some memory\n\t\t\t\t\teffect.fn = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (eager_block_effects.length > 0) {\n\t\t\t\t// TODO this feels incorrect! it gets the tests passing\n\t\t\t\told_values.clear();\n\n\t\t\t\tfor (const e of eager_block_effects) {\n\t\t\t\t\tupdate_effect(e);\n\t\t\t\t}\n\n\t\t\t\teager_block_effects = [];\n\t\t\t}\n\t\t}\n\t}\n\n\teager_block_effects = null;\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function schedule_effect(signal) {\n\tvar effect = (last_scheduled_effect = signal);\n\n\twhile (effect.parent !== null) {\n\t\teffect = effect.parent;\n\t\tvar flags = effect.f;\n\n\t\t// if the effect is being scheduled because a parent (each/await/etc) block\n\t\t// updated an internal source, bail out or we'll cause a second flush\n\t\tif (is_flushing && effect === active_effect && (flags & BLOCK_EFFECT) !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {\n\t\t\tif ((flags & CLEAN) === 0) return;\n\t\t\teffect.f ^= CLEAN;\n\t\t}\n\t}\n\n\tqueued_root_effects.push(effect);\n}\n\nexport function suspend() {\n\tvar boundary = get_pending_boundary();\n\tvar batch = /** @type {Batch} */ (current_batch);\n\tvar pending = boundary.pending;\n\n\tboundary.update_pending_count(1);\n\tif (!pending) batch.increment();\n\n\treturn function unsuspend() {\n\t\tboundary.update_pending_count(-1);\n\n\t\tif (!pending) {\n\t\t\tbatch.activate();\n\t\t\tbatch.decrement();\n\t\t}\n\n\t\tunset_context();\n\t};\n}\n\n/**\n * Forcibly remove all current batches, to prevent cross-talk between tests\n */\nexport function clear() {\n\tbatches.clear();\n}\n","/** @import { Derived, Effect, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tuntracked_writes,\n\tget,\n\tset_untracked_writes,\n\tset_signal_status,\n\tuntrack,\n\tincrement_write_version,\n\tupdate_effect,\n\tcurrent_sources,\n\tis_dirty,\n\tuntracking,\n\tis_destroying_effect,\n\tpush_reaction_value\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport {\n\tCLEAN,\n\tDERIVED,\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tINSPECT_EFFECT,\n\tUNOWNED,\n\tMAYBE_DIRTY,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tASYNC\n} from '#client/constants';\nimport * as e from '../errors.js';\nimport { legacy_mode_flag, tracing_mode_flag } from '../../flags/index.js';\nimport { get_stack, tag_proxy } from '../dev/tracing.js';\nimport { component_context, is_runes } from '../context.js';\nimport { Batch, eager_block_effects, schedule_effect } from './batch.js';\nimport { proxy } from '../proxy.js';\nimport { execute_derived } from './deriveds.js';\n\n/** @type {Set<any>} */\nexport let inspect_effects = new Set();\n\n/** @type {Map<Source, any>} */\nexport const old_values = new Map();\n\n/**\n * @param {Set<any>} v\n */\nexport function set_inspect_effects(v) {\n\tinspect_effects = v;\n}\n\nlet inspect_effects_deferred = false;\n\nexport function set_inspect_effects_deferred() {\n\tinspect_effects_deferred = true;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {Error | null} [stack]\n * @returns {Source<V>}\n */\n// TODO rename this to `state` throughout the codebase\nexport function source(v, stack) {\n\t/** @type {Value} */\n\tvar signal = {\n\t\tf: 0, // TODO ideally we could skip this altogether, but it causes type errors\n\t\tv,\n\t\treactions: null,\n\t\tequals,\n\t\trv: 0,\n\t\twv: 0\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = stack ?? get_stack('CreatedAt');\n\t\tsignal.updated = null;\n\t\tsignal.set_during_effect = false;\n\t\tsignal.trace = null;\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {Error | null} [stack]\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function state(v, stack) {\n\tconst s = source(v, stack);\n\n\tpush_reaction_value(s);\n\n\treturn s;\n}\n\n/**\n * @template V\n * @param {V} initial_value\n * @param {boolean} [immutable]\n * @returns {Source<V>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function mutable_source(initial_value, immutable = false, trackable = true) {\n\tconst s = source(initial_value);\n\tif (!immutable) {\n\t\ts.equals = safe_equals;\n\t}\n\n\t// bind the signal to the component context, in case we need to\n\t// track updates to trigger beforeUpdate/afterUpdate callbacks\n\tif (legacy_mode_flag && trackable && component_context !== null && component_context.l !== null) {\n\t\t(component_context.l.s ??= []).push(s);\n\t}\n\n\treturn s;\n}\n\n/**\n * @template V\n * @param {Value<V>} source\n * @param {V} value\n */\nexport function mutate(source, value) {\n\tset(\n\t\tsource,\n\t\tuntrack(() => get(source))\n\t);\n\treturn value;\n}\n\n/**\n * @template V\n * @param {Source<V>} source\n * @param {V} value\n * @param {boolean} [should_proxy]\n * @returns {V}\n */\nexport function set(source, value, should_proxy = false) {\n\tif (\n\t\tactive_reaction !== null &&\n\t\t// since we are untracking the function inside `$inspect.with` we need to add this check\n\t\t// to ensure we error if state is set inside an inspect effect\n\t\t(!untracking || (active_reaction.f & INSPECT_EFFECT) !== 0) &&\n\t\tis_runes() &&\n\t\t(active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | INSPECT_EFFECT)) !== 0 &&\n\t\t!current_sources?.includes(source)\n\t) {\n\t\te.state_unsafe_mutation();\n\t}\n\n\tlet new_value = should_proxy ? proxy(value) : value;\n\n\tif (DEV) {\n\t\ttag_proxy(new_value, /** @type {string} */ (source.label));\n\t}\n\n\treturn internal_set(source, new_value);\n}\n\n/**\n * @template V\n * @param {Source<V>} source\n * @param {V} value\n * @returns {V}\n */\nexport function internal_set(source, value) {\n\tif (!source.equals(value)) {\n\t\tvar old_value = source.v;\n\n\t\tif (is_destroying_effect) {\n\t\t\told_values.set(source, value);\n\t\t} else {\n\t\t\told_values.set(source, old_value);\n\t\t}\n\n\t\tsource.v = value;\n\n\t\tvar batch = Batch.ensure();\n\t\tbatch.capture(source, old_value);\n\n\t\tif (DEV) {\n\t\t\tif (tracing_mode_flag || active_effect !== null) {\n\t\t\t\tconst error = get_stack('UpdatedAt');\n\n\t\t\t\tif (error !== null) {\n\t\t\t\t\tsource.updated ??= new Map();\n\t\t\t\t\tlet entry = source.updated.get(error.stack);\n\n\t\t\t\t\tif (!entry) {\n\t\t\t\t\t\tentry = { error, count: 0 };\n\t\t\t\t\t\tsource.updated.set(error.stack, entry);\n\t\t\t\t\t}\n\n\t\t\t\t\tentry.count++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (active_effect !== null) {\n\t\t\t\tsource.set_during_effect = true;\n\t\t\t}\n\t\t}\n\n\t\tif ((source.f & DERIVED) !== 0) {\n\t\t\t// if we are assigning to a dirty derived we set it to clean/maybe dirty but we also eagerly execute it to track the dependencies\n\t\t\tif ((source.f & DIRTY) !== 0) {\n\t\t\t\texecute_derived(/** @type {Derived} */ (source));\n\t\t\t}\n\t\t\tset_signal_status(source, (source.f & UNOWNED) === 0 ? CLEAN : MAYBE_DIRTY);\n\t\t}\n\n\t\tsource.wv = increment_write_version();\n\n\t\tmark_reactions(source, DIRTY);\n\n\t\t// It's possible that the current reaction might not have up-to-date dependencies\n\t\t// whilst it's actively running. So in the case of ensuring it registers the reaction\n\t\t// properly for itself, we need to ensure the current effect actually gets\n\t\t// scheduled. i.e: `$effect(() => x++)`\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tactive_effect !== null &&\n\t\t\t(active_effect.f & CLEAN) !== 0 &&\n\t\t\t(active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0\n\t\t) {\n\t\t\tif (untracked_writes === null) {\n\t\t\t\tset_untracked_writes([source]);\n\t\t\t} else {\n\t\t\t\tuntracked_writes.push(source);\n\t\t\t}\n\t\t}\n\n\t\tif (DEV && inspect_effects.size > 0 && !inspect_effects_deferred) {\n\t\t\tflush_inspect_effects();\n\t\t}\n\t}\n\n\treturn value;\n}\n\nexport function flush_inspect_effects() {\n\tinspect_effects_deferred = false;\n\n\tconst inspects = Array.from(inspect_effects);\n\n\tfor (const effect of inspects) {\n\t\t// Mark clean inspect-effects as maybe dirty and then check their dirtiness\n\t\t// instead of just updating the effects - this way we avoid overfiring.\n\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t}\n\n\t\tif (is_dirty(effect)) {\n\t\t\tupdate_effect(effect);\n\t\t}\n\t}\n\n\tinspect_effects.clear();\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source<T>} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update(source, d = 1) {\n\tvar value = get(source);\n\tvar result = d === 1 ? value++ : value--;\n\n\tset(source, value);\n\n\t// @ts-expect-error\n\treturn result;\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source<T>} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update_pre(source, d = 1) {\n\tvar value = get(source);\n\n\t// @ts-expect-error\n\treturn set(source, d === 1 ? ++value : --value);\n}\n\n/**\n * Silently (without using `get`) increment a source\n * @param {Source<number>} source\n */\nexport function increment(source) {\n\tset(source, source.v + 1);\n}\n\n/**\n * @param {Value} signal\n * @param {number} status should be DIRTY or MAYBE_DIRTY\n * @returns {void}\n */\nfunction mark_reactions(signal, status) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tvar runes = is_runes();\n\tvar length = reactions.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tvar reaction = reactions[i];\n\t\tvar flags = reaction.f;\n\n\t\t// In legacy mode, skip the current effect to prevent infinite loops\n\t\tif (!runes && reaction === active_effect) continue;\n\n\t\t// Inspect effects need to run immediately, so that the stack trace makes sense\n\t\tif (DEV && (flags & INSPECT_EFFECT) !== 0) {\n\t\t\tinspect_effects.add(reaction);\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar not_dirty = (flags & DIRTY) === 0;\n\n\t\t// don't set a DIRTY reaction to MAYBE_DIRTY\n\t\tif (not_dirty) {\n\t\t\tset_signal_status(reaction, status);\n\t\t}\n\n\t\tif ((flags & DERIVED) !== 0) {\n\t\t\tmark_reactions(/** @type {Derived} */ (reaction), MAYBE_DIRTY);\n\t\t} else if (not_dirty) {\n\t\t\tif ((flags & BLOCK_EFFECT) !== 0) {\n\t\t\t\tif (eager_block_effects !== null) {\n\t\t\t\t\teager_block_effects.push(/** @type {Effect} */ (reaction));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n","/** @import { Source } from '#client' */\nimport { DEV } from 'esm-env';\nimport {\n\tget,\n\tactive_effect,\n\tupdate_version,\n\tactive_reaction,\n\tset_update_version,\n\tset_active_reaction\n} from './runtime.js';\nimport {\n\tarray_prototype,\n\tget_descriptor,\n\tget_prototype_of,\n\tis_array,\n\tobject_prototype\n} from '../shared/utils.js';\nimport {\n\tstate as source,\n\tset,\n\tincrement,\n\tflush_inspect_effects,\n\tset_inspect_effects_deferred\n} from './reactivity/sources.js';\nimport { PROXY_PATH_SYMBOL, STATE_SYMBOL } from '#client/constants';\nimport { UNINITIALIZED } from '../../constants.js';\nimport * as e from './errors.js';\nimport { get_stack, tag } from './dev/tracing.js';\nimport { tracing_mode_flag } from '../flags/index.js';\n\n// TODO move all regexes into shared module?\nconst regex_is_valid_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;\n\n/**\n * @template T\n * @param {T} value\n * @returns {T}\n */\nexport function proxy(value) {\n\t// if non-proxyable, or is already a proxy, return `value`\n\tif (typeof value !== 'object' || value === null || STATE_SYMBOL in value) {\n\t\treturn value;\n\t}\n\n\tconst prototype = get_prototype_of(value);\n\n\tif (prototype !== object_prototype && prototype !== array_prototype) {\n\t\treturn value;\n\t}\n\n\t/** @type {Map<any, Source<any>>} */\n\tvar sources = new Map();\n\tvar is_proxied_array = is_array(value);\n\tvar version = source(0);\n\n\tvar stack = DEV && tracing_mode_flag ? get_stack('CreatedAt') : null;\n\tvar parent_version = update_version;\n\n\t/**\n\t * Executes the proxy in the context of the reaction it was originally created in, if any\n\t * @template T\n\t * @param {() => T} fn\n\t */\n\tvar with_parent = (fn) => {\n\t\tif (update_version === parent_version) {\n\t\t\treturn fn();\n\t\t}\n\n\t\t// child source is being created after the initial proxy —\n\t\t// prevent it from being associated with the current reaction\n\t\tvar reaction = active_reaction;\n\t\tvar version = update_version;\n\n\t\tset_active_reaction(null);\n\t\tset_update_version(parent_version);\n\n\t\tvar result = fn();\n\n\t\tset_active_reaction(reaction);\n\t\tset_update_version(version);\n\n\t\treturn result;\n\t};\n\n\tif (is_proxied_array) {\n\t\t// We need to create the length source eagerly to ensure that\n\t\t// mutations to the array are properly synced with our proxy\n\t\tsources.set('length', source(/** @type {any[]} */ (value).length, stack));\n\t\tif (DEV) {\n\t\t\tvalue = /** @type {any} */ (inspectable_array(/** @type {any[]} */ (value)));\n\t\t}\n\t}\n\n\t/** Used in dev for $inspect.trace() */\n\tvar path = '';\n\tlet updating = false;\n\t/** @param {string} new_path */\n\tfunction update_path(new_path) {\n\t\tif (updating) return;\n\t\tupdating = true;\n\t\tpath = new_path;\n\n\t\ttag(version, `${path} version`);\n\n\t\t// rename all child sources and child proxies\n\t\tfor (const [prop, source] of sources) {\n\t\t\ttag(source, get_label(path, prop));\n\t\t}\n\t\tupdating = false;\n\t}\n\n\treturn new Proxy(/** @type {any} */ (value), {\n\t\tdefineProperty(_, prop, descriptor) {\n\t\t\tif (\n\t\t\t\t!('value' in descriptor) ||\n\t\t\t\tdescriptor.configurable === false ||\n\t\t\t\tdescriptor.enumerable === false ||\n\t\t\t\tdescriptor.writable === false\n\t\t\t) {\n\t\t\t\t// we disallow non-basic descriptors, because unless they are applied to the\n\t\t\t\t// target object — which we avoid, so that state can be forked — we will run\n\t\t\t\t// afoul of the various invariants\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/getOwnPropertyDescriptor#invariants\n\t\t\t\te.state_descriptors_fixed();\n\t\t\t}\n\t\t\tvar s = sources.get(prop);\n\t\t\tif (s === undefined) {\n\t\t\t\ts = with_parent(() => {\n\t\t\t\t\tvar s = source(descriptor.value, stack);\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t\tif (DEV && typeof prop === 'string') {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t\treturn s;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tset(s, descriptor.value, true);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tdeleteProperty(target, prop) {\n\t\t\tvar s = sources.get(prop);\n\n\t\t\tif (s === undefined) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst s = with_parent(() => source(UNINITIALIZED, stack));\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t\tincrement(version);\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tset(s, UNINITIALIZED);\n\t\t\t\tincrement(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tget(target, prop, receiver) {\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tif (DEV && prop === PROXY_PATH_SYMBOL) {\n\t\t\t\treturn update_path;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar exists = prop in target;\n\n\t\t\t// create a source, but only if it's an own property and not a prototype property\n\t\t\tif (s === undefined && (!exists || get_descriptor(target, prop)?.writable)) {\n\t\t\t\ts = with_parent(() => {\n\t\t\t\t\tvar p = proxy(exists ? target[prop] : UNINITIALIZED);\n\t\t\t\t\tvar s = source(p, stack);\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn s;\n\t\t\t\t});\n\n\t\t\t\tsources.set(prop, s);\n\t\t\t}\n\n\t\t\tif (s !== undefined) {\n\t\t\t\tvar v = get(s);\n\t\t\t\treturn v === UNINITIALIZED ? undefined : v;\n\t\t\t}\n\n\t\t\treturn Reflect.get(target, prop, receiver);\n\t\t},\n\n\t\tgetOwnPropertyDescriptor(target, prop) {\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\tif (descriptor && 'value' in descriptor) {\n\t\t\t\tvar s = sources.get(prop);\n\t\t\t\tif (s) descriptor.value = get(s);\n\t\t\t} else if (descriptor === undefined) {\n\t\t\t\tvar source = sources.get(prop);\n\t\t\t\tvar value = source?.v;\n\n\t\t\t\tif (source !== undefined && value !== UNINITIALIZED) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\twritable: true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn descriptor;\n\t\t},\n\n\t\thas(target, prop) {\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = (s !== undefined && s.v !== UNINITIALIZED) || Reflect.has(target, prop);\n\n\t\t\tif (\n\t\t\t\ts !== undefined ||\n\t\t\t\t(active_effect !== null && (!has || get_descriptor(target, prop)?.writable))\n\t\t\t) {\n\t\t\t\tif (s === undefined) {\n\t\t\t\t\ts = with_parent(() => {\n\t\t\t\t\t\tvar p = has ? proxy(target[prop]) : UNINITIALIZED;\n\t\t\t\t\t\tvar s = source(p, stack);\n\n\t\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn s;\n\t\t\t\t\t});\n\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\n\t\t\t\tvar value = get(s);\n\t\t\t\tif (value === UNINITIALIZED) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn has;\n\t\t},\n\n\t\tset(target, prop, value, receiver) {\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = prop in target;\n\n\t\t\t// variable.length = value -> clear all signals with index >= value\n\t\t\tif (is_proxied_array && prop === 'length') {\n\t\t\t\tfor (var i = value; i < /** @type {Source<number>} */ (s).v; i += 1) {\n\t\t\t\t\tvar other_s = sources.get(i + '');\n\t\t\t\t\tif (other_s !== undefined) {\n\t\t\t\t\t\tset(other_s, UNINITIALIZED);\n\t\t\t\t\t} else if (i in target) {\n\t\t\t\t\t\t// If the item exists in the original, we need to create a uninitialized source,\n\t\t\t\t\t\t// else a later read of the property would result in a source being created with\n\t\t\t\t\t\t// the value of the original item at that index.\n\t\t\t\t\t\tother_s = with_parent(() => source(UNINITIALIZED, stack));\n\t\t\t\t\t\tsources.set(i + '', other_s);\n\n\t\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\t\ttag(other_s, get_label(path, i));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we haven't yet created a source for this property, we need to ensure\n\t\t\t// we do so otherwise if we read it later, then the write won't be tracked and\n\t\t\t// the heuristics of effects will be different vs if we had read the proxied\n\t\t\t// object property before writing to that property.\n\t\t\tif (s === undefined) {\n\t\t\t\tif (!has || get_descriptor(target, prop)?.writable) {\n\t\t\t\t\ts = with_parent(() => source(undefined, stack));\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t\tset(s, proxy(value));\n\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thas = s.v !== UNINITIALIZED;\n\n\t\t\t\tvar p = with_parent(() => proxy(value));\n\t\t\t\tset(s, p);\n\t\t\t}\n\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\t// Set the new value before updating any signals so that any listeners get the new value\n\t\t\tif (descriptor?.set) {\n\t\t\t\tdescriptor.set.call(receiver, value);\n\t\t\t}\n\n\t\t\tif (!has) {\n\t\t\t\t// If we have mutated an array directly, we might need to\n\t\t\t\t// signal that length has also changed. Do it before updating metadata\n\t\t\t\t// to ensure that iterating over the array as a result of a metadata update\n\t\t\t\t// will not cause the length to be out of sync.\n\t\t\t\tif (is_proxied_array && typeof prop === 'string') {\n\t\t\t\t\tvar ls = /** @type {Source<number>} */ (sources.get('length'));\n\t\t\t\t\tvar n = Number(prop);\n\n\t\t\t\t\tif (Number.isInteger(n) && n >= ls.v) {\n\t\t\t\t\t\tset(ls, n + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tincrement(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\townKeys(target) {\n\t\t\tget(version);\n\n\t\t\tvar own_keys = Reflect.ownKeys(target).filter((key) => {\n\t\t\t\tvar source = sources.get(key);\n\t\t\t\treturn source === undefined || source.v !== UNINITIALIZED;\n\t\t\t});\n\n\t\t\tfor (var [key, source] of sources) {\n\t\t\t\tif (source.v !== UNINITIALIZED && !(key in target)) {\n\t\t\t\t\town_keys.push(key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn own_keys;\n\t\t},\n\n\t\tsetPrototypeOf() {\n\t\t\te.state_prototype_fixed();\n\t\t}\n\t});\n}\n\n/**\n * @param {string} path\n * @param {string | symbol} prop\n */\nfunction get_label(path, prop) {\n\tif (typeof prop === 'symbol') return `${path}[Symbol(${prop.description ?? ''})]`;\n\tif (regex_is_valid_identifier.test(prop)) return `${path}.${prop}`;\n\treturn /^\\d+$/.test(prop) ? `${path}[${prop}]` : `${path}['${prop}']`;\n}\n\n/**\n * @param {any} value\n */\nexport function get_proxied_value(value) {\n\ttry {\n\t\tif (value !== null && typeof value === 'object' && STATE_SYMBOL in value) {\n\t\t\treturn value[STATE_SYMBOL];\n\t\t}\n\t} catch {\n\t\t// the above if check can throw an error if the value in question\n\t\t// is the contentWindow of an iframe on another domain, in which\n\t\t// case we want to just return the value (because it's definitely\n\t\t// not a proxied value) so we don't break any JavaScript interacting\n\t\t// with that iframe (such as various payment companies client side\n\t\t// JavaScript libraries interacting with their iframes on the same\n\t\t// domain)\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {any} a\n * @param {any} b\n */\nexport function is(a, b) {\n\treturn Object.is(get_proxied_value(a), get_proxied_value(b));\n}\n\nconst ARRAY_MUTATING_METHODS = new Set([\n\t'copyWithin',\n\t'fill',\n\t'pop',\n\t'push',\n\t'reverse',\n\t'shift',\n\t'sort',\n\t'splice',\n\t'unshift'\n]);\n\n/**\n * Wrap array mutating methods so $inspect is triggered only once and\n * to prevent logging an array in intermediate state (e.g. with an empty slot)\n * @param {any[]} array\n */\nfunction inspectable_array(array) {\n\treturn new Proxy(array, {\n\t\tget(target, prop, receiver) {\n\t\t\tvar value = Reflect.get(target, prop, receiver);\n\t\t\tif (!ARRAY_MUTATING_METHODS.has(/** @type {string} */ (prop))) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @this {any[]}\n\t\t\t * @param {any[]} args\n\t\t\t */\n\t\t\treturn function (...args) {\n\t\t\t\tset_inspect_effects_deferred();\n\t\t\t\tvar result = value.apply(this, args);\n\t\t\t\tflush_inspect_effects();\n\t\t\t\treturn result;\n\t\t\t};\n\t\t}\n\t});\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport { DEV } from 'esm-env';\nimport { init_array_prototype_warnings } from '../dev/equality.js';\nimport { get_descriptor, is_extensible } from '../../shared/utils.js';\nimport { active_effect } from '../runtime.js';\nimport { async_mode_flag } from '../../flags/index.js';\nimport { TEXT_NODE, EFFECT_RAN } from '#client/constants';\nimport { eager_block_effects } from '../reactivity/batch.js';\n\n// export these for reference in the compiled code, making global name deduplication unnecessary\n/** @type {Window} */\nexport var $window;\n\n/** @type {Document} */\nexport var $document;\n\n/** @type {boolean} */\nexport var is_firefox;\n\n/** @type {() => Node | null} */\nvar first_child_getter;\n/** @type {() => Node | null} */\nvar next_sibling_getter;\n\n/**\n * Initialize these lazily to avoid issues when using the runtime in a server context\n * where these globals are not available while avoiding a separate server entry point\n */\nexport function init_operations() {\n\tif ($window !== undefined) {\n\t\treturn;\n\t}\n\n\t$window = window;\n\t$document = document;\n\tis_firefox = /Firefox/.test(navigator.userAgent);\n\n\tvar element_prototype = Element.prototype;\n\tvar node_prototype = Node.prototype;\n\tvar text_prototype = Text.prototype;\n\n\t// @ts-ignore\n\tfirst_child_getter = get_descriptor(node_prototype, 'firstChild').get;\n\t// @ts-ignore\n\tnext_sibling_getter = get_descriptor(node_prototype, 'nextSibling').get;\n\n\tif (is_extensible(element_prototype)) {\n\t\t// the following assignments improve perf of lookups on DOM nodes\n\t\t// @ts-expect-error\n\t\telement_prototype.__click = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__className = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__attributes = null;\n\t\t// @ts-expect-error\n\t\telement_prototype.__style = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__e = undefined;\n\t}\n\n\tif (is_extensible(text_prototype)) {\n\t\t// @ts-expect-error\n\t\ttext_prototype.__t = undefined;\n\t}\n\n\tif (DEV) {\n\t\t// @ts-expect-error\n\t\telement_prototype.__svelte_meta = null;\n\n\t\tinit_array_prototype_warnings();\n\t}\n}\n\n/**\n * @param {string} value\n * @returns {Text}\n */\nexport function create_text(value = '') {\n\treturn document.createTextNode(value);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {Node | null}\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_first_child(node) {\n\treturn first_child_getter.call(node);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {Node | null}\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_next_sibling(node) {\n\treturn next_sibling_getter.call(node);\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @template {Node} N\n * @param {N} node\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function child(node, is_text) {\n\tif (!hydrating) {\n\t\treturn get_first_child(node);\n\t}\n\n\tvar child = /** @type {TemplateNode} */ (get_first_child(hydrate_node));\n\n\t// Child can be null if we have an element with a single child, like `<p>{text}</p>`, where `text` is empty\n\tif (child === null) {\n\t\tchild = hydrate_node.appendChild(create_text());\n\t} else if (is_text && child.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\t\tchild?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tset_hydrate_node(child);\n\treturn child;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {DocumentFragment | TemplateNode[]} fragment\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function first_child(fragment, is_text) {\n\tif (!hydrating) {\n\t\t// when not hydrating, `fragment` is a `DocumentFragment` (the result of calling `open_frag`)\n\t\tvar first = /** @type {DocumentFragment} */ (get_first_child(/** @type {Node} */ (fragment)));\n\n\t\t// TODO prevent user comments with the empty string when preserveComments is true\n\t\tif (first instanceof Comment && first.data === '') return get_next_sibling(first);\n\n\t\treturn first;\n\t}\n\n\t// if an {expression} is empty during SSR, there might be no\n\t// text node to hydrate — we must therefore create one\n\tif (is_text && hydrate_node?.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\n\t\thydrate_node?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\treturn hydrate_node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {TemplateNode} node\n * @param {number} count\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function sibling(node, count = 1, is_text = false) {\n\tlet next_sibling = hydrating ? hydrate_node : node;\n\tvar last_sibling;\n\n\twhile (count--) {\n\t\tlast_sibling = next_sibling;\n\t\tnext_sibling = /** @type {TemplateNode} */ (get_next_sibling(next_sibling));\n\t}\n\n\tif (!hydrating) {\n\t\treturn next_sibling;\n\t}\n\n\t// if a sibling {expression} is empty during SSR, there might be no\n\t// text node to hydrate — we must therefore create one\n\tif (is_text && next_sibling?.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\t\t// If the next sibling is `null` and we're handling text then it's because\n\t\t// the SSR content was empty for the text, so we need to generate a new text\n\t\t// node and insert it after the last sibling\n\t\tif (next_sibling === null) {\n\t\t\tlast_sibling?.after(text);\n\t\t} else {\n\t\t\tnext_sibling.before(text);\n\t\t}\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tset_hydrate_node(next_sibling);\n\treturn /** @type {TemplateNode} */ (next_sibling);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {void}\n */\nexport function clear_text_content(node) {\n\tnode.textContent = '';\n}\n\n/**\n * Returns `true` if we're updating the current block, for example `condition` in\n * an `{#if condition}` block just changed. In this case, the branch should be\n * appended (or removed) at the same time as other updates within the\n * current `<svelte:boundary>`\n */\nexport function should_defer_append() {\n\tif (!async_mode_flag) return false;\n\tif (eager_block_effects !== null) return false;\n\n\tvar flags = /** @type {Effect} */ (active_effect).f;\n\treturn (flags & EFFECT_RAN) !== 0;\n}\n\n/**\n *\n * @param {string} tag\n * @param {string} [namespace]\n * @param {string} [is]\n * @returns\n */\nexport function create_element(tag, namespace, is) {\n\tlet options = is ? { is } : undefined;\n\tif (namespace) {\n\t\treturn document.createElementNS(namespace, tag, options);\n\t}\n\treturn document.createElement(tag, options);\n}\n\nexport function create_fragment() {\n\treturn document.createDocumentFragment();\n}\n\n/**\n * @param {string} data\n * @returns\n */\nexport function create_comment(data = '') {\n\treturn document.createComment(data);\n}\n\n/**\n * @param {Element} element\n * @param {string} key\n * @param {string} value\n * @returns\n */\nexport function set_attribute(element, key, value = '') {\n\tif (key.startsWith('xlink:')) {\n\t\telement.setAttributeNS('http://www.w3.org/1999/xlink', key, value);\n\t\treturn;\n\t}\n\treturn element.setAttribute(key, value);\n}\n","import { teardown } from '../../../reactivity/effects.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../../runtime.js';\nimport { add_form_reset_listener } from '../misc.js';\n\n/**\n * Fires the handler once immediately (unless corresponding arg is set to `false`),\n * then listens to the given events until the render effect context is destroyed\n * @param {EventTarget} target\n * @param {Array<string>} events\n * @param {(event?: Event) => void} handler\n * @param {any} call_handler_immediately\n */\nexport function listen(target, events, handler, call_handler_immediately = true) {\n\tif (call_handler_immediately) {\n\t\thandler();\n\t}\n\n\tfor (var name of events) {\n\t\ttarget.addEventListener(name, handler);\n\t}\n\n\tteardown(() => {\n\t\tfor (var name of events) {\n\t\t\ttarget.removeEventListener(name, handler);\n\t\t}\n\t});\n}\n\n/**\n * @template T\n * @param {() => T} fn\n */\nexport function without_reactive_context(fn) {\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\ttry {\n\t\treturn fn();\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * Listen to the given event, and then instantiate a global form reset listener if not already done,\n * to notify all bindings when the form is reset\n * @param {HTMLElement} element\n * @param {string} event\n * @param {(is_reset?: true) => void} handler\n * @param {(is_reset?: true) => void} [on_reset]\n */\nexport function listen_to_event_and_reset_event(element, event, handler, on_reset = handler) {\n\telement.addEventListener(event, () => without_reactive_context(handler));\n\t// @ts-expect-error\n\tconst prev = element.__on_r;\n\tif (prev) {\n\t\t// special case for checkbox that can have multiple binds (group & checked)\n\t\t// @ts-expect-error\n\t\telement.__on_r = () => {\n\t\t\tprev();\n\t\t\ton_reset(true);\n\t\t};\n\t} else {\n\t\t// @ts-expect-error\n\t\telement.__on_r = () => on_reset(true);\n\t}\n\n\tadd_form_reset_listener();\n}\n","/** @import { ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */\nimport {\n\tis_dirty,\n\tactive_effect,\n\tactive_reaction,\n\tupdate_effect,\n\tget,\n\tis_destroying_effect,\n\tremove_reactions,\n\tset_active_reaction,\n\tset_is_destroying_effect,\n\tset_signal_status,\n\tuntrack,\n\tuntracking\n} from '../runtime.js';\nimport {\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tRENDER_EFFECT,\n\tEFFECT,\n\tDESTROYED,\n\tINERT,\n\tEFFECT_RAN,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tEFFECT_TRANSPARENT,\n\tDERIVED,\n\tUNOWNED,\n\tCLEAN,\n\tINSPECT_EFFECT,\n\tHEAD_EFFECT,\n\tMAYBE_DIRTY,\n\tEFFECT_PRESERVED,\n\tSTALE_REACTION,\n\tUSER_EFFECT,\n\tASYNC\n} from '#client/constants';\nimport * as e from '../errors.js';\nimport { DEV } from 'esm-env';\nimport { define_property } from '../../shared/utils.js';\nimport { get_next_sibling } from '../dom/operations.js';\nimport { component_context, dev_current_component_function, dev_stack } from '../context.js';\nimport { Batch, schedule_effect } from './batch.js';\nimport { flatten } from './async.js';\nimport { without_reactive_context } from '../dom/elements/bindings/shared.js';\n\n/**\n * @param {'$effect' | '$effect.pre' | '$inspect'} rune\n */\nexport function validate_effect(rune) {\n\tif (active_effect === null && active_reaction === null) {\n\t\te.effect_orphan(rune);\n\t}\n\n\tif (active_reaction !== null && (active_reaction.f & UNOWNED) !== 0 && active_effect === null) {\n\t\te.effect_in_unowned_derived();\n\t}\n\n\tif (is_destroying_effect) {\n\t\te.effect_in_teardown(rune);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {Effect} parent_effect\n */\nfunction push_effect(effect, parent_effect) {\n\tvar parent_last = parent_effect.last;\n\tif (parent_last === null) {\n\t\tparent_effect.last = parent_effect.first = effect;\n\t} else {\n\t\tparent_last.next = effect;\n\t\teffect.prev = parent_last;\n\t\tparent_effect.last = effect;\n\t}\n}\n\n/**\n * @param {number} type\n * @param {null | (() => void | (() => void))} fn\n * @param {boolean} sync\n * @param {boolean} push\n * @returns {Effect}\n */\nfunction create_effect(type, fn, sync, push = true) {\n\tvar parent = active_effect;\n\n\tif (DEV) {\n\t\t// Ensure the parent is never an inspect effect\n\t\twhile (parent !== null && (parent.f & INSPECT_EFFECT) !== 0) {\n\t\t\tparent = parent.parent;\n\t\t}\n\t}\n\n\tif (parent !== null && (parent.f & INERT) !== 0) {\n\t\ttype |= INERT;\n\t}\n\n\t/** @type {Effect} */\n\tvar effect = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\tnodes_start: null,\n\t\tnodes_end: null,\n\t\tf: type | DIRTY,\n\t\tfirst: null,\n\t\tfn,\n\t\tlast: null,\n\t\tnext: null,\n\t\tparent,\n\t\tb: parent && parent.b,\n\t\tprev: null,\n\t\tteardown: null,\n\t\ttransitions: null,\n\t\twv: 0,\n\t\tac: null\n\t};\n\n\tif (DEV) {\n\t\teffect.component_function = dev_current_component_function;\n\t}\n\n\tif (sync) {\n\t\ttry {\n\t\t\tupdate_effect(effect);\n\t\t\teffect.f |= EFFECT_RAN;\n\t\t} catch (e) {\n\t\t\tdestroy_effect(effect);\n\t\t\tthrow e;\n\t\t}\n\t} else if (fn !== null) {\n\t\tschedule_effect(effect);\n\t}\n\n\t// if an effect has no dependencies, no DOM and no teardown function,\n\t// don't bother adding it to the effect tree\n\tvar inert =\n\t\tsync &&\n\t\teffect.deps === null &&\n\t\teffect.first === null &&\n\t\teffect.nodes_start === null &&\n\t\teffect.teardown === null &&\n\t\t(effect.f & EFFECT_PRESERVED) === 0;\n\n\tif (!inert && push) {\n\t\tif (parent !== null) {\n\t\t\tpush_effect(effect, parent);\n\t\t}\n\n\t\t// if we're in a derived, add the effect there too\n\t\tif (\n\t\t\tactive_reaction !== null &&\n\t\t\t(active_reaction.f & DERIVED) !== 0 &&\n\t\t\t(type & ROOT_EFFECT) === 0\n\t\t) {\n\t\t\tvar derived = /** @type {Derived} */ (active_reaction);\n\t\t\t(derived.effects ??= []).push(effect);\n\t\t}\n\t}\n\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect.tracking()`\n * @returns {boolean}\n */\nexport function effect_tracking() {\n\treturn active_reaction !== null && !untracking;\n}\n\n/**\n * @param {() => void} fn\n */\nexport function teardown(fn) {\n\tconst effect = create_effect(RENDER_EFFECT, null, false);\n\tset_signal_status(effect, CLEAN);\n\teffect.teardown = fn;\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect(...)`\n * @param {() => void | (() => void)} fn\n */\nexport function user_effect(fn) {\n\tvalidate_effect('$effect');\n\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect'\n\t\t});\n\t}\n\n\t// Non-nested `$effect(...)` in a component should be deferred\n\t// until the component is mounted\n\tvar flags = /** @type {Effect} */ (active_effect).f;\n\tvar defer = !active_reaction && (flags & BRANCH_EFFECT) !== 0 && (flags & EFFECT_RAN) === 0;\n\n\tif (defer) {\n\t\t// Top-level `$effect(...)` in an unmounted component — defer until mount\n\t\tvar context = /** @type {ComponentContext} */ (component_context);\n\t\t(context.e ??= []).push(fn);\n\t} else {\n\t\t// Everything else — create immediately\n\t\treturn create_user_effect(fn);\n\t}\n}\n\n/**\n * @param {() => void | (() => void)} fn\n */\nexport function create_user_effect(fn) {\n\treturn create_effect(EFFECT | USER_EFFECT, fn, false);\n}\n\n/**\n * Internal representation of `$effect.pre(...)`\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function user_pre_effect(fn) {\n\tvalidate_effect('$effect.pre');\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect.pre'\n\t\t});\n\t}\n\treturn create_effect(RENDER_EFFECT | USER_EFFECT, fn, true);\n}\n\n/** @param {() => void | (() => void)} fn */\nexport function inspect_effect(fn) {\n\treturn create_effect(INSPECT_EFFECT, fn, true);\n}\n\n/**\n * Internal representation of `$effect.root(...)`\n * @param {() => void | (() => void)} fn\n * @returns {() => void}\n */\nexport function effect_root(fn) {\n\tBatch.ensure();\n\tconst effect = create_effect(ROOT_EFFECT, fn, true);\n\n\treturn () => {\n\t\tdestroy_effect(effect);\n\t};\n}\n\n/**\n * An effect root whose children can transition out\n * @param {() => void} fn\n * @returns {(options?: { outro?: boolean }) => Promise<void>}\n */\nexport function component_root(fn) {\n\tBatch.ensure();\n\tconst effect = create_effect(ROOT_EFFECT, fn, true);\n\n\treturn (options = {}) => {\n\t\treturn new Promise((fulfil) => {\n\t\t\tif (options.outro) {\n\t\t\t\tpause_effect(effect, () => {\n\t\t\t\t\tdestroy_effect(effect);\n\t\t\t\t\tfulfil(undefined);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tdestroy_effect(effect);\n\t\t\t\tfulfil(undefined);\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function effect(fn) {\n\treturn create_effect(EFFECT, fn, false);\n}\n\n/**\n * Internal representation of `$: ..`\n * @param {() => any} deps\n * @param {() => void | (() => void)} fn\n */\nexport function legacy_pre_effect(deps, fn) {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\t/** @type {{ effect: null | Effect, ran: boolean, deps: () => any }} */\n\tvar token = { effect: null, ran: false, deps };\n\n\tcontext.l.$.push(token);\n\n\ttoken.effect = render_effect(() => {\n\t\tdeps();\n\n\t\t// If this legacy pre effect has already run before the end of the reset, then\n\t\t// bail out to emulate the same behavior.\n\t\tif (token.ran) return;\n\n\t\ttoken.ran = true;\n\t\tuntrack(fn);\n\t});\n}\n\nexport function legacy_pre_effect_reset() {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\trender_effect(() => {\n\t\t// Run dirty `$:` statements\n\t\tfor (var token of context.l.$) {\n\t\t\ttoken.deps();\n\n\t\t\tvar effect = token.effect;\n\n\t\t\t// If the effect is CLEAN, then make it MAYBE_DIRTY. This ensures we traverse through\n\t\t\t// the effects dependencies and correctly ensure each dependency is up-to-date.\n\t\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t\t}\n\n\t\t\tif (is_dirty(effect)) {\n\t\t\t\tupdate_effect(effect);\n\t\t\t}\n\n\t\t\ttoken.ran = false;\n\t\t}\n\t});\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function async_effect(fn) {\n\treturn create_effect(ASYNC | EFFECT_PRESERVED, fn, true);\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function render_effect(fn, flags = 0) {\n\treturn create_effect(RENDER_EFFECT | flags, fn, true);\n}\n\n/**\n * @param {(...expressions: any) => void | (() => void)} fn\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise<any>>} async\n */\nexport function template_effect(fn, sync = [], async = []) {\n\tflatten(sync, async, (values) => {\n\t\tcreate_effect(RENDER_EFFECT, () => fn(...values.map(get)), true);\n\t});\n}\n\n/**\n * @param {(() => void)} fn\n * @param {number} flags\n */\nexport function block(fn, flags = 0) {\n\tvar effect = create_effect(BLOCK_EFFECT | flags, fn, true);\n\tif (DEV) {\n\t\teffect.dev_stack = dev_stack;\n\t}\n\treturn effect;\n}\n\n/**\n * @param {(() => void)} fn\n * @param {boolean} [push]\n */\nexport function branch(fn, push = true) {\n\treturn create_effect(BRANCH_EFFECT, fn, true, push);\n}\n\n/**\n * @param {Effect} effect\n */\nexport function execute_effect_teardown(effect) {\n\tvar teardown = effect.teardown;\n\tif (teardown !== null) {\n\t\tconst previously_destroying_effect = is_destroying_effect;\n\t\tconst previous_reaction = active_reaction;\n\t\tset_is_destroying_effect(true);\n\t\tset_active_reaction(null);\n\t\ttry {\n\t\t\tteardown.call(null);\n\t\t} finally {\n\t\t\tset_is_destroying_effect(previously_destroying_effect);\n\t\t\tset_active_reaction(previous_reaction);\n\t\t}\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @param {boolean} remove_dom\n * @returns {void}\n */\nexport function destroy_effect_children(signal, remove_dom = false) {\n\tvar effect = signal.first;\n\tsignal.first = signal.last = null;\n\n\twhile (effect !== null) {\n\t\tconst controller = effect.ac;\n\n\t\tif (controller !== null) {\n\t\t\twithout_reactive_context(() => {\n\t\t\t\tcontroller.abort(STALE_REACTION);\n\t\t\t});\n\t\t}\n\n\t\tvar next = effect.next;\n\n\t\tif ((effect.f & ROOT_EFFECT) !== 0) {\n\t\t\t// this is now an independent root\n\t\t\teffect.parent = null;\n\t\t} else {\n\t\t\tdestroy_effect(effect, remove_dom);\n\t\t}\n\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function destroy_block_effect_children(signal) {\n\tvar effect = signal.first;\n\n\twhile (effect !== null) {\n\t\tvar next = effect.next;\n\t\tif ((effect.f & BRANCH_EFFECT) === 0) {\n\t\t\tdestroy_effect(effect);\n\t\t}\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} [remove_dom]\n * @returns {void}\n */\nexport function destroy_effect(effect, remove_dom = true) {\n\tvar removed = false;\n\n\tif (\n\t\t(remove_dom || (effect.f & HEAD_EFFECT) !== 0) &&\n\t\teffect.nodes_start !== null &&\n\t\teffect.nodes_end !== null\n\t) {\n\t\tremove_effect_dom(effect.nodes_start, /** @type {TemplateNode} */ (effect.nodes_end));\n\t\tremoved = true;\n\t}\n\n\tdestroy_effect_children(effect, remove_dom && !removed);\n\tremove_reactions(effect, 0);\n\tset_signal_status(effect, DESTROYED);\n\n\tvar transitions = effect.transitions;\n\n\tif (transitions !== null) {\n\t\tfor (const transition of transitions) {\n\t\t\ttransition.stop();\n\t\t}\n\t}\n\n\texecute_effect_teardown(effect);\n\n\tvar parent = effect.parent;\n\n\t// If the parent doesn't have any children, then skip this work altogether\n\tif (parent !== null && parent.first !== null) {\n\t\tunlink_effect(effect);\n\t}\n\n\tif (DEV) {\n\t\teffect.component_function = null;\n\t}\n\n\t// `first` and `child` are nulled out in destroy_effect_children\n\t// we don't null out `parent` so that error propagation can work correctly\n\teffect.next =\n\t\teffect.prev =\n\t\teffect.teardown =\n\t\teffect.ctx =\n\t\teffect.deps =\n\t\teffect.fn =\n\t\teffect.nodes_start =\n\t\teffect.nodes_end =\n\t\teffect.ac =\n\t\t\tnull;\n}\n\n/**\n *\n * @param {TemplateNode | null} node\n * @param {TemplateNode} end\n */\nexport function remove_effect_dom(node, end) {\n\twhile (node !== null) {\n\t\t/** @type {TemplateNode | null} */\n\t\tvar next = node === end ? null : /** @type {TemplateNode} */ (get_next_sibling(node));\n\n\t\tnode.remove();\n\t\tnode = next;\n\t}\n}\n\n/**\n * Detach an effect from the effect tree, freeing up memory and\n * reducing the amount of work that happens on subsequent traversals\n * @param {Effect} effect\n */\nexport function unlink_effect(effect) {\n\tvar parent = effect.parent;\n\tvar prev = effect.prev;\n\tvar next = effect.next;\n\n\tif (prev !== null) prev.next = next;\n\tif (next !== null) next.prev = prev;\n\n\tif (parent !== null) {\n\t\tif (parent.first === effect) parent.first = next;\n\t\tif (parent.last === effect) parent.last = prev;\n\t}\n}\n\n/**\n * When a block effect is removed, we don't immediately destroy it or yank it\n * out of the DOM, because it might have transitions. Instead, we 'pause' it.\n * It stays around (in memory, and in the DOM) until outro transitions have\n * completed, and if the state change is reversed then we _resume_ it.\n * A paused effect does not update, and the DOM subtree becomes inert.\n * @param {Effect} effect\n * @param {() => void} [callback]\n */\nexport function pause_effect(effect, callback) {\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\n\tpause_children(effect, transitions, true);\n\n\trun_out_transitions(transitions, () => {\n\t\tdestroy_effect(effect);\n\t\tif (callback) callback();\n\t});\n}\n\n/**\n * @param {TransitionManager[]} transitions\n * @param {() => void} fn\n */\nexport function run_out_transitions(transitions, fn) {\n\tvar remaining = transitions.length;\n\tif (remaining > 0) {\n\t\tvar check = () => --remaining || fn();\n\t\tfor (var transition of transitions) {\n\t\t\ttransition.out(check);\n\t\t}\n\t} else {\n\t\tfn();\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {TransitionManager[]} transitions\n * @param {boolean} local\n */\nexport function pause_children(effect, transitions, local) {\n\tif ((effect.f & INERT) !== 0) return;\n\teffect.f ^= INERT;\n\n\tif (effect.transitions !== null) {\n\t\tfor (const transition of effect.transitions) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransitions.push(transition);\n\t\t\t}\n\t\t}\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;\n\t\t// TODO we don't need to call pause_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tpause_children(child, transitions, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n}\n\n/**\n * The opposite of `pause_effect`. We call this if (for example)\n * `x` becomes falsy then truthy: `{#if x}...{/if}`\n * @param {Effect} effect\n */\nexport function resume_effect(effect) {\n\tresume_children(effect, true);\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} local\n */\nfunction resume_children(effect, local) {\n\tif ((effect.f & INERT) === 0) return;\n\teffect.f ^= INERT;\n\n\t// If a dependency of this effect changed while it was paused,\n\t// schedule the effect to update. we don't use `is_dirty`\n\t// here because we don't want to eagerly recompute a derived like\n\t// `{#if foo}{foo.bar()}{/if}` if `foo` is now `undefined\n\tif ((effect.f & CLEAN) === 0) {\n\t\tset_signal_status(effect, DIRTY);\n\t\tschedule_effect(effect);\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;\n\t\t// TODO we don't need to call resume_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tresume_children(child, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n\n\tif (effect.transitions !== null) {\n\t\tfor (const transition of effect.transitions) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransition.in();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function aborted() {\n\tvar effect = /** @type {Effect} */ (active_effect);\n\treturn (effect.f & DESTROYED) !== 0;\n}\n","/** @import { Derived, Effect, Reaction, Signal, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport { get_descriptors, get_prototype_of, index_of } from '../shared/utils.js';\nimport {\n\tdestroy_block_effect_children,\n\tdestroy_effect_children,\n\texecute_effect_teardown\n} from './reactivity/effects.js';\nimport {\n\tDIRTY,\n\tMAYBE_DIRTY,\n\tCLEAN,\n\tDERIVED,\n\tUNOWNED,\n\tDESTROYED,\n\tBRANCH_EFFECT,\n\tSTATE_SYMBOL,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tDISCONNECTED,\n\tREACTION_IS_UPDATING,\n\tSTALE_REACTION,\n\tERROR_VALUE\n} from './constants.js';\nimport { old_values } from './reactivity/sources.js';\nimport {\n\tdestroy_derived_effects,\n\texecute_derived,\n\tcurrent_async_effect,\n\trecent_async_deriveds,\n\tupdate_derived\n} from './reactivity/deriveds.js';\nimport { async_mode_flag, tracing_mode_flag } from '../flags/index.js';\nimport { tracing_expressions, get_stack } from './dev/tracing.js';\nimport {\n\tcomponent_context,\n\tdev_current_component_function,\n\tdev_stack,\n\tis_runes,\n\tset_component_context,\n\tset_dev_current_component_function,\n\tset_dev_stack\n} from './context.js';\nimport * as w from './warnings.js';\nimport { Batch, batch_deriveds, flushSync, schedule_effect } from './reactivity/batch.js';\nimport { handle_error } from './error-handling.js';\nimport { UNINITIALIZED } from '../../constants.js';\nimport { captured_signals } from './legacy.js';\nimport { without_reactive_context } from './dom/elements/bindings/shared.js';\n\nexport let is_updating_effect = false;\n\n/** @param {boolean} value */\nexport function set_is_updating_effect(value) {\n\tis_updating_effect = value;\n}\n\nexport let is_destroying_effect = false;\n\n/** @param {boolean} value */\nexport function set_is_destroying_effect(value) {\n\tis_destroying_effect = value;\n}\n\n/** @type {null | Reaction} */\nexport let active_reaction = null;\n\nexport let untracking = false;\n\n/** @param {null | Reaction} reaction */\nexport function set_active_reaction(reaction) {\n\tactive_reaction = reaction;\n}\n\n/** @type {null | Effect} */\nexport let active_effect = null;\n\n/** @param {null | Effect} effect */\nexport function set_active_effect(effect) {\n\tactive_effect = effect;\n}\n\n/**\n * When sources are created within a reaction, reading and writing\n * them within that reaction should not cause a re-run\n * @type {null | Source[]}\n */\nexport let current_sources = null;\n\n/** @param {Value} value */\nexport function push_reaction_value(value) {\n\tif (active_reaction !== null && (!async_mode_flag || (active_reaction.f & DERIVED) !== 0)) {\n\t\tif (current_sources === null) {\n\t\t\tcurrent_sources = [value];\n\t\t} else {\n\t\t\tcurrent_sources.push(value);\n\t\t}\n\t}\n}\n\n/**\n * The dependencies of the reaction that is currently being executed. In many cases,\n * the dependencies are unchanged between runs, and so this will be `null` unless\n * and until a new dependency is accessed — we track this via `skipped_deps`\n * @type {null | Value[]}\n */\nlet new_deps = null;\n\nlet skipped_deps = 0;\n\n/**\n * Tracks writes that the effect it's executed in doesn't listen to yet,\n * so that the dependency can be added to the effect later on if it then reads it\n * @type {null | Source[]}\n */\nexport let untracked_writes = null;\n\n/** @param {null | Source[]} value */\nexport function set_untracked_writes(value) {\n\tuntracked_writes = value;\n}\n\n/**\n * @type {number} Used by sources and deriveds for handling updates.\n * Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing\n **/\nexport let write_version = 1;\n\n/** @type {number} Used to version each read of a source of derived to avoid duplicating depedencies inside a reaction */\nlet read_version = 0;\n\nexport let update_version = read_version;\n\n/** @param {number} value */\nexport function set_update_version(value) {\n\tupdate_version = value;\n}\n\n// If we are working with a get() chain that has no active container,\n// to prevent memory leaks, we skip adding the reaction.\nexport let skip_reaction = false;\n\nexport function increment_write_version() {\n\treturn ++write_version;\n}\n\n/**\n * Determines whether a derived or effect is dirty.\n * If it is MAYBE_DIRTY, will set the status to CLEAN\n * @param {Reaction} reaction\n * @returns {boolean}\n */\nexport function is_dirty(reaction) {\n\tvar flags = reaction.f;\n\n\tif ((flags & DIRTY) !== 0) {\n\t\treturn true;\n\t}\n\n\tif ((flags & MAYBE_DIRTY) !== 0) {\n\t\tvar dependencies = reaction.deps;\n\t\tvar is_unowned = (flags & UNOWNED) !== 0;\n\n\t\tif (dependencies !== null) {\n\t\t\tvar i;\n\t\t\tvar dependency;\n\t\t\tvar is_disconnected = (flags & DISCONNECTED) !== 0;\n\t\t\tvar is_unowned_connected = is_unowned && active_effect !== null && !skip_reaction;\n\t\t\tvar length = dependencies.length;\n\n\t\t\t// If we are working with a disconnected or an unowned signal that is now connected (due to an active effect)\n\t\t\t// then we need to re-connect the reaction to the dependency, unless the effect has already been destroyed\n\t\t\t// (which can happen if the derived is read by an async derived)\n\t\t\tif (\n\t\t\t\t(is_disconnected || is_unowned_connected) &&\n\t\t\t\t(active_effect === null || (active_effect.f & DESTROYED) === 0)\n\t\t\t) {\n\t\t\t\tvar derived = /** @type {Derived} */ (reaction);\n\t\t\t\tvar parent = derived.parent;\n\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tdependency = dependencies[i];\n\n\t\t\t\t\t// We always re-add all reactions (even duplicates) if the derived was\n\t\t\t\t\t// previously disconnected, however we don't if it was unowned as we\n\t\t\t\t\t// de-duplicate dependencies in that case\n\t\t\t\t\tif (is_disconnected || !dependency?.reactions?.includes(derived)) {\n\t\t\t\t\t\t(dependency.reactions ??= []).push(derived);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (is_disconnected) {\n\t\t\t\t\tderived.f ^= DISCONNECTED;\n\t\t\t\t}\n\t\t\t\t// If the unowned derived is now fully connected to the graph again (it's unowned and reconnected, has a parent\n\t\t\t\t// and the parent is not unowned), then we can mark it as connected again, removing the need for the unowned\n\t\t\t\t// flag\n\t\t\t\tif (is_unowned_connected && parent !== null && (parent.f & UNOWNED) === 0) {\n\t\t\t\t\tderived.f ^= UNOWNED;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\tdependency = dependencies[i];\n\n\t\t\t\tif (is_dirty(/** @type {Derived} */ (dependency))) {\n\t\t\t\t\tupdate_derived(/** @type {Derived} */ (dependency));\n\t\t\t\t}\n\n\t\t\t\tif (dependency.wv > reaction.wv) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Unowned signals should never be marked as clean unless they\n\t\t// are used within an active_effect without skip_reaction\n\t\tif (!is_unowned || (active_effect !== null && !skip_reaction)) {\n\t\t\tset_signal_status(reaction, CLEAN);\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * @param {Value} signal\n * @param {Effect} effect\n * @param {boolean} [root]\n */\nfunction schedule_possible_effect_self_invalidation(signal, effect, root = true) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tif (!async_mode_flag && current_sources?.includes(signal)) {\n\t\treturn;\n\t}\n\n\tfor (var i = 0; i < reactions.length; i++) {\n\t\tvar reaction = reactions[i];\n\n\t\tif ((reaction.f & DERIVED) !== 0) {\n\t\t\tschedule_possible_effect_self_invalidation(/** @type {Derived} */ (reaction), effect, false);\n\t\t} else if (effect === reaction) {\n\t\t\tif (root) {\n\t\t\t\tset_signal_status(reaction, DIRTY);\n\t\t\t} else if ((reaction.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(reaction, MAYBE_DIRTY);\n\t\t\t}\n\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n\n/** @param {Reaction} reaction */\nexport function update_reaction(reaction) {\n\tvar previous_deps = new_deps;\n\tvar previous_skipped_deps = skipped_deps;\n\tvar previous_untracked_writes = untracked_writes;\n\tvar previous_reaction = active_reaction;\n\tvar previous_skip_reaction = skip_reaction;\n\tvar previous_sources = current_sources;\n\tvar previous_component_context = component_context;\n\tvar previous_untracking = untracking;\n\tvar previous_update_version = update_version;\n\n\tvar flags = reaction.f;\n\n\tnew_deps = /** @type {null | Value[]} */ (null);\n\tskipped_deps = 0;\n\tuntracked_writes = null;\n\tskip_reaction =\n\t\t(flags & UNOWNED) !== 0 && (untracking || !is_updating_effect || active_reaction === null);\n\tactive_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;\n\n\tcurrent_sources = null;\n\tset_component_context(reaction.ctx);\n\tuntracking = false;\n\tupdate_version = ++read_version;\n\n\tif (reaction.ac !== null) {\n\t\twithout_reactive_context(() => {\n\t\t\t/** @type {AbortController} */ (reaction.ac).abort(STALE_REACTION);\n\t\t});\n\n\t\treaction.ac = null;\n\t}\n\n\ttry {\n\t\treaction.f |= REACTION_IS_UPDATING;\n\t\tvar fn = /** @type {Function} */ (reaction.fn);\n\t\tvar result = fn();\n\t\tvar deps = reaction.deps;\n\n\t\tif (new_deps !== null) {\n\t\t\tvar i;\n\n\t\t\tremove_reactions(reaction, skipped_deps);\n\n\t\t\tif (deps !== null && skipped_deps > 0) {\n\t\t\t\tdeps.length = skipped_deps + new_deps.length;\n\t\t\t\tfor (i = 0; i < new_deps.length; i++) {\n\t\t\t\t\tdeps[skipped_deps + i] = new_deps[i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treaction.deps = deps = new_deps;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!skip_reaction ||\n\t\t\t\t// Deriveds that already have reactions can cleanup, so we still add them as reactions\n\t\t\t\t((flags & DERIVED) !== 0 &&\n\t\t\t\t\t/** @type {import('#client').Derived} */ (reaction).reactions !== null)\n\t\t\t) {\n\t\t\t\tfor (i = skipped_deps; i < deps.length; i++) {\n\t\t\t\t\t(deps[i].reactions ??= []).push(reaction);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (deps !== null && skipped_deps < deps.length) {\n\t\t\tremove_reactions(reaction, skipped_deps);\n\t\t\tdeps.length = skipped_deps;\n\t\t}\n\n\t\t// If we're inside an effect and we have untracked writes, then we need to\n\t\t// ensure that if any of those untracked writes result in re-invalidation\n\t\t// of the current effect, then that happens accordingly\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tuntracked_writes !== null &&\n\t\t\t!untracking &&\n\t\t\tdeps !== null &&\n\t\t\t(reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0\n\t\t) {\n\t\t\tfor (i = 0; i < /** @type {Source[]} */ (untracked_writes).length; i++) {\n\t\t\t\tschedule_possible_effect_self_invalidation(\n\t\t\t\t\tuntracked_writes[i],\n\t\t\t\t\t/** @type {Effect} */ (reaction)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// If we are returning to an previous reaction then\n\t\t// we need to increment the read version to ensure that\n\t\t// any dependencies in this reaction aren't marked with\n\t\t// the same version\n\t\tif (previous_reaction !== null && previous_reaction !== reaction) {\n\t\t\tread_version++;\n\n\t\t\tif (untracked_writes !== null) {\n\t\t\t\tif (previous_untracked_writes === null) {\n\t\t\t\t\tprevious_untracked_writes = untracked_writes;\n\t\t\t\t} else {\n\t\t\t\t\tprevious_untracked_writes.push(.../** @type {Source[]} */ (untracked_writes));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ((reaction.f & ERROR_VALUE) !== 0) {\n\t\t\treaction.f ^= ERROR_VALUE;\n\t\t}\n\n\t\treturn result;\n\t} catch (error) {\n\t\treturn handle_error(error);\n\t} finally {\n\t\treaction.f ^= REACTION_IS_UPDATING;\n\t\tnew_deps = previous_deps;\n\t\tskipped_deps = previous_skipped_deps;\n\t\tuntracked_writes = previous_untracked_writes;\n\t\tactive_reaction = previous_reaction;\n\t\tskip_reaction = previous_skip_reaction;\n\t\tcurrent_sources = previous_sources;\n\t\tset_component_context(previous_component_context);\n\t\tuntracking = previous_untracking;\n\t\tupdate_version = previous_update_version;\n\t}\n}\n\n/**\n * @template V\n * @param {Reaction} signal\n * @param {Value<V>} dependency\n * @returns {void}\n */\nfunction remove_reaction(signal, dependency) {\n\tlet reactions = dependency.reactions;\n\tif (reactions !== null) {\n\t\tvar index = index_of.call(reactions, signal);\n\t\tif (index !== -1) {\n\t\t\tvar new_length = reactions.length - 1;\n\t\t\tif (new_length === 0) {\n\t\t\t\treactions = dependency.reactions = null;\n\t\t\t} else {\n\t\t\t\t// Swap with last element and then remove.\n\t\t\t\treactions[index] = reactions[new_length];\n\t\t\t\treactions.pop();\n\t\t\t}\n\t\t}\n\t}\n\n\t// If the derived has no reactions, then we can disconnect it from the graph,\n\t// allowing it to either reconnect in the future, or be GC'd by the VM.\n\tif (\n\t\treactions === null &&\n\t\t(dependency.f & DERIVED) !== 0 &&\n\t\t// Destroying a child effect while updating a parent effect can cause a dependency to appear\n\t\t// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`\n\t\t// allows us to skip the expensive work of disconnecting and immediately reconnecting it\n\t\t(new_deps === null || !new_deps.includes(dependency))\n\t) {\n\t\tset_signal_status(dependency, MAYBE_DIRTY);\n\t\t// If we are working with a derived that is owned by an effect, then mark it as being\n\t\t// disconnected.\n\t\tif ((dependency.f & (UNOWNED | DISCONNECTED)) === 0) {\n\t\t\tdependency.f ^= DISCONNECTED;\n\t\t}\n\t\t// Disconnect any reactions owned by this reaction\n\t\tdestroy_derived_effects(/** @type {Derived} **/ (dependency));\n\t\tremove_reactions(/** @type {Derived} **/ (dependency), 0);\n\t}\n}\n\n/**\n * @param {Reaction} signal\n * @param {number} start_index\n * @returns {void}\n */\nexport function remove_reactions(signal, start_index) {\n\tvar dependencies = signal.deps;\n\tif (dependencies === null) return;\n\n\tfor (var i = start_index; i < dependencies.length; i++) {\n\t\tremove_reaction(signal, dependencies[i]);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @returns {void}\n */\nexport function update_effect(effect) {\n\tvar flags = effect.f;\n\n\tif ((flags & DESTROYED) !== 0) {\n\t\treturn;\n\t}\n\n\tset_signal_status(effect, CLEAN);\n\n\tvar previous_effect = active_effect;\n\tvar was_updating_effect = is_updating_effect;\n\n\tactive_effect = effect;\n\tis_updating_effect = true;\n\n\tif (DEV) {\n\t\tvar previous_component_fn = dev_current_component_function;\n\t\tset_dev_current_component_function(effect.component_function);\n\t\tvar previous_stack = /** @type {any} */ (dev_stack);\n\t\t// only block effects have a dev stack, keep the current one otherwise\n\t\tset_dev_stack(effect.dev_stack ?? dev_stack);\n\t}\n\n\ttry {\n\t\tif ((flags & BLOCK_EFFECT) !== 0) {\n\t\t\tdestroy_block_effect_children(effect);\n\t\t} else {\n\t\t\tdestroy_effect_children(effect);\n\t\t}\n\n\t\texecute_effect_teardown(effect);\n\t\tvar teardown = update_reaction(effect);\n\t\teffect.teardown = typeof teardown === 'function' ? teardown : null;\n\t\teffect.wv = write_version;\n\n\t\t// In DEV, increment versions of any sources that were written to during the effect,\n\t\t// so that they are correctly marked as dirty when the effect re-runs\n\t\tif (DEV && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) {\n\t\t\tfor (var dep of effect.deps) {\n\t\t\t\tif (dep.set_during_effect) {\n\t\t\t\t\tdep.wv = increment_write_version();\n\t\t\t\t\tdep.set_during_effect = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tis_updating_effect = was_updating_effect;\n\t\tactive_effect = previous_effect;\n\n\t\tif (DEV) {\n\t\t\tset_dev_current_component_function(previous_component_fn);\n\t\t\tset_dev_stack(previous_stack);\n\t\t}\n\t}\n}\n\n/**\n * Returns a promise that resolves once any pending state changes have been applied.\n * @returns {Promise<void>}\n */\nexport async function tick() {\n\tif (async_mode_flag) {\n\t\treturn new Promise((f) => requestAnimationFrame(() => f()));\n\t}\n\n\tawait Promise.resolve();\n\n\t// By calling flushSync we guarantee that any pending state changes are applied after one tick.\n\t// TODO look into whether we can make flushing subsequent updates synchronously in the future.\n\tflushSync();\n}\n\n/**\n * Returns a promise that resolves once any state changes, and asynchronous work resulting from them,\n * have resolved and the DOM has been updated\n * @returns {Promise<void>}\n * @since 5.36\n */\nexport function settled() {\n\treturn Batch.ensure().settled();\n}\n\n/**\n * @template V\n * @param {Value<V>} signal\n * @returns {V}\n */\nexport function get(signal) {\n\tvar flags = signal.f;\n\tvar is_derived = (flags & DERIVED) !== 0;\n\n\tcaptured_signals?.add(signal);\n\n\t// Register the dependency on the current reaction signal.\n\tif (active_reaction !== null && !untracking) {\n\t\t// if we're in a derived that is being read inside an _async_ derived,\n\t\t// it's possible that the effect was already destroyed. In this case,\n\t\t// we don't add the dependency, because that would create a memory leak\n\t\tvar destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;\n\n\t\tif (!destroyed && !current_sources?.includes(signal)) {\n\t\t\tvar deps = active_reaction.deps;\n\n\t\t\tif ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {\n\t\t\t\t// we're in the effect init/update cycle\n\t\t\t\tif (signal.rv < read_version) {\n\t\t\t\t\tsignal.rv = read_version;\n\n\t\t\t\t\t// If the signal is accessing the same dependencies in the same\n\t\t\t\t\t// order as it did last time, increment `skipped_deps`\n\t\t\t\t\t// rather than updating `new_deps`, which creates GC cost\n\t\t\t\t\tif (new_deps === null && deps !== null && deps[skipped_deps] === signal) {\n\t\t\t\t\t\tskipped_deps++;\n\t\t\t\t\t} else if (new_deps === null) {\n\t\t\t\t\t\tnew_deps = [signal];\n\t\t\t\t\t} else if (!skip_reaction || !new_deps.includes(signal)) {\n\t\t\t\t\t\t// Normally we can push duplicated dependencies to `new_deps`, but if we're inside\n\t\t\t\t\t\t// an unowned derived because skip_reaction is true, then we need to ensure that\n\t\t\t\t\t\t// we don't have duplicates\n\t\t\t\t\t\tnew_deps.push(signal);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// we're adding a dependency outside the init/update cycle\n\t\t\t\t// (i.e. after an `await`)\n\t\t\t\t(active_reaction.deps ??= []).push(signal);\n\n\t\t\t\tvar reactions = signal.reactions;\n\n\t\t\t\tif (reactions === null) {\n\t\t\t\t\tsignal.reactions = [active_reaction];\n\t\t\t\t} else if (!reactions.includes(active_reaction)) {\n\t\t\t\t\treactions.push(active_reaction);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (\n\t\tis_derived &&\n\t\t/** @type {Derived} */ (signal).deps === null &&\n\t\t/** @type {Derived} */ (signal).effects === null\n\t) {\n\t\tvar derived = /** @type {Derived} */ (signal);\n\t\tvar parent = derived.parent;\n\n\t\tif (parent !== null && (parent.f & UNOWNED) === 0) {\n\t\t\t// If the derived is owned by another derived then mark it as unowned\n\t\t\t// as the derived value might have been referenced in a different context\n\t\t\t// since and thus its parent might not be its true owner anymore\n\t\t\tderived.f ^= UNOWNED;\n\t\t}\n\t}\n\n\tif (DEV) {\n\t\tif (current_async_effect) {\n\t\t\tvar tracking = (current_async_effect.f & REACTION_IS_UPDATING) !== 0;\n\t\t\tvar was_read = current_async_effect.deps?.includes(signal);\n\n\t\t\tif (!tracking && !untracking && !was_read) {\n\t\t\t\tw.await_reactivity_loss(/** @type {string} */ (signal.label));\n\n\t\t\t\tvar trace = get_stack('TracedAt');\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tif (trace) console.warn(trace);\n\t\t\t}\n\t\t}\n\n\t\trecent_async_deriveds.delete(signal);\n\n\t\tif (\n\t\t\ttracing_mode_flag &&\n\t\t\t!untracking &&\n\t\t\ttracing_expressions !== null &&\n\t\t\tactive_reaction !== null &&\n\t\t\ttracing_expressions.reaction === active_reaction\n\t\t) {\n\t\t\t// Used when mapping state between special blocks like `each`\n\t\t\tif (signal.trace) {\n\t\t\t\tsignal.trace();\n\t\t\t} else {\n\t\t\t\ttrace = get_stack('TracedAt');\n\n\t\t\t\tif (trace) {\n\t\t\t\t\tvar entry = tracing_expressions.entries.get(signal);\n\n\t\t\t\t\tif (entry === undefined) {\n\t\t\t\t\t\tentry = { traces: [] };\n\t\t\t\t\t\ttracing_expressions.entries.set(signal, entry);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar last = entry.traces[entry.traces.length - 1];\n\n\t\t\t\t\t// traces can be duplicated, e.g. by `snapshot` invoking both\n\t\t\t\t\t// both `getOwnPropertyDescriptor` and `get` traps at once\n\t\t\t\t\tif (trace.stack !== last?.stack) {\n\t\t\t\t\t\tentry.traces.push(trace);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (is_destroying_effect) {\n\t\tif (old_values.has(signal)) {\n\t\t\treturn old_values.get(signal);\n\t\t}\n\n\t\tif (is_derived) {\n\t\t\tderived = /** @type {Derived} */ (signal);\n\n\t\t\tvar value = derived.v;\n\n\t\t\t// if the derived is dirty and has reactions, or depends on the values that just changed, re-execute\n\t\t\t// (a derived can be maybe_dirty due to the effect destroy removing its last reaction)\n\t\t\tif (\n\t\t\t\t((derived.f & CLEAN) === 0 && derived.reactions !== null) ||\n\t\t\t\tdepends_on_old_values(derived)\n\t\t\t) {\n\t\t\t\tvalue = execute_derived(derived);\n\t\t\t}\n\n\t\t\told_values.set(derived, value);\n\n\t\t\treturn value;\n\t\t}\n\t} else if (is_derived) {\n\t\tderived = /** @type {Derived} */ (signal);\n\n\t\tif (batch_deriveds?.has(derived)) {\n\t\t\treturn batch_deriveds.get(derived);\n\t\t}\n\n\t\tif (is_dirty(derived)) {\n\t\t\tupdate_derived(derived);\n\t\t}\n\t}\n\n\tif ((signal.f & ERROR_VALUE) !== 0) {\n\t\tthrow signal.v;\n\t}\n\n\treturn signal.v;\n}\n\n/** @param {Derived} derived */\nfunction depends_on_old_values(derived) {\n\tif (derived.v === UNINITIALIZED) return true; // we don't know, so assume the worst\n\tif (derived.deps === null) return false;\n\n\tfor (const dep of derived.deps) {\n\t\tif (old_values.has(dep)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ((dep.f & DERIVED) !== 0 && depends_on_old_values(/** @type {Derived} */ (dep))) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Like `get`, but checks for `undefined`. Used for `var` declarations because they can be accessed before being declared\n * @template V\n * @param {Value<V> | undefined} signal\n * @returns {V | undefined}\n */\nexport function safe_get(signal) {\n\treturn signal && get(signal);\n}\n\n/**\n * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),\n * any state read inside `fn` will not be treated as a dependency.\n *\n * ```ts\n * $effect(() => {\n * // this will run when `data` changes, but not when `time` changes\n * save(data, {\n * timestamp: untrack(() => time)\n * });\n * });\n * ```\n * @template T\n * @param {() => T} fn\n * @returns {T}\n */\nexport function untrack(fn) {\n\tvar previous_untracking = untracking;\n\ttry {\n\t\tuntracking = true;\n\t\treturn fn();\n\t} finally {\n\t\tuntracking = previous_untracking;\n\t}\n}\n\nconst STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);\n\n/**\n * @param {Signal} signal\n * @param {number} status\n * @returns {void}\n */\nexport function set_signal_status(signal, status) {\n\tsignal.f = (signal.f & STATUS_MASK) | status;\n}\n\n/**\n * @param {Record<string, unknown>} obj\n * @param {string[]} keys\n * @returns {Record<string, unknown>}\n */\nexport function exclude_from_object(obj, keys) {\n\t/** @type {Record<string, unknown>} */\n\tvar result = {};\n\n\tfor (var key in obj) {\n\t\tif (!keys.includes(key)) {\n\t\t\tresult[key] = obj[key];\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Possibly traverse an object and read all its properties so that they're all reactive in case this is `$state`.\n * Does only check first level of an object for performance reasons (heuristic should be good for 99% of all cases).\n * @param {any} value\n * @returns {void}\n */\nexport function deep_read_state(value) {\n\tif (typeof value !== 'object' || !value || value instanceof EventTarget) {\n\t\treturn;\n\t}\n\n\tif (STATE_SYMBOL in value) {\n\t\tdeep_read(value);\n\t} else if (!Array.isArray(value)) {\n\t\tfor (let key in value) {\n\t\t\tconst prop = value[key];\n\t\t\tif (typeof prop === 'object' && prop && STATE_SYMBOL in prop) {\n\t\t\t\tdeep_read(prop);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Deeply traverse an object and read all its properties\n * so that they're all reactive in case this is `$state`\n * @param {any} value\n * @param {Set<any>} visited\n * @returns {void}\n */\nexport function deep_read(value, visited = new Set()) {\n\tif (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t// We don't want to traverse DOM elements\n\t\t!(value instanceof EventTarget) &&\n\t\t!visited.has(value)\n\t) {\n\t\tvisited.add(value);\n\t\t// When working with a possible SvelteDate, this\n\t\t// will ensure we capture changes to it.\n\t\tif (value instanceof Date) {\n\t\t\tvalue.getTime();\n\t\t}\n\t\tfor (let key in value) {\n\t\t\ttry {\n\t\t\t\tdeep_read(value[key], visited);\n\t\t\t} catch (e) {\n\t\t\t\t// continue\n\t\t\t}\n\t\t}\n\t\tconst proto = get_prototype_of(value);\n\t\tif (\n\t\t\tproto !== Object.prototype &&\n\t\t\tproto !== Array.prototype &&\n\t\t\tproto !== Map.prototype &&\n\t\t\tproto !== Set.prototype &&\n\t\t\tproto !== Date.prototype\n\t\t) {\n\t\t\tconst descriptors = get_descriptors(proto);\n\t\t\tfor (let key in descriptors) {\n\t\t\t\tconst get = descriptors[key].get;\n\t\t\t\tif (get) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tget.call(value);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t// continue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","const regex_return_characters = /\\r/g;\n\n/**\n * @param {string} str\n * @returns {string}\n */\nexport function hash(str) {\n\tstr = str.replace(regex_return_characters, '');\n\tlet hash = 5381;\n\tlet i = str.length;\n\n\twhile (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n\treturn (hash >>> 0).toString(36);\n}\n\nconst VOID_ELEMENT_NAMES = [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr'\n];\n\n/**\n * Returns `true` if `name` is of a void element\n * @param {string} name\n */\nexport function is_void(name) {\n\treturn VOID_ELEMENT_NAMES.includes(name) || name.toLowerCase() === '!doctype';\n}\n\nconst RESERVED_WORDS = [\n\t'arguments',\n\t'await',\n\t'break',\n\t'case',\n\t'catch',\n\t'class',\n\t'const',\n\t'continue',\n\t'debugger',\n\t'default',\n\t'delete',\n\t'do',\n\t'else',\n\t'enum',\n\t'eval',\n\t'export',\n\t'extends',\n\t'false',\n\t'finally',\n\t'for',\n\t'function',\n\t'if',\n\t'implements',\n\t'import',\n\t'in',\n\t'instanceof',\n\t'interface',\n\t'let',\n\t'new',\n\t'null',\n\t'package',\n\t'private',\n\t'protected',\n\t'public',\n\t'return',\n\t'static',\n\t'super',\n\t'switch',\n\t'this',\n\t'throw',\n\t'true',\n\t'try',\n\t'typeof',\n\t'var',\n\t'void',\n\t'while',\n\t'with',\n\t'yield'\n];\n\n/**\n * Returns `true` if `word` is a reserved JavaScript keyword\n * @param {string} word\n */\nexport function is_reserved(word) {\n\treturn RESERVED_WORDS.includes(word);\n}\n\n/**\n * @param {string} name\n */\nexport function is_capture_event(name) {\n\treturn name.endsWith('capture') && name !== 'gotpointercapture' && name !== 'lostpointercapture';\n}\n\n/** List of Element events that will be delegated */\nconst DELEGATED_EVENTS = [\n\t'beforeinput',\n\t'click',\n\t'change',\n\t'dblclick',\n\t'contextmenu',\n\t'focusin',\n\t'focusout',\n\t'input',\n\t'keydown',\n\t'keyup',\n\t'mousedown',\n\t'mousemove',\n\t'mouseout',\n\t'mouseover',\n\t'mouseup',\n\t'pointerdown',\n\t'pointermove',\n\t'pointerout',\n\t'pointerover',\n\t'pointerup',\n\t'touchend',\n\t'touchmove',\n\t'touchstart'\n];\n\n/**\n * Returns `true` if `event_name` is a delegated event\n * @param {string} event_name\n */\nexport function is_delegated(event_name) {\n\treturn DELEGATED_EVENTS.includes(event_name);\n}\n\n/**\n * Attributes that are boolean, i.e. they are present or not present.\n */\nconst DOM_BOOLEAN_ATTRIBUTES = [\n\t'allowfullscreen',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'disabled',\n\t'formnovalidate',\n\t'hidden',\n\t'indeterminate',\n\t'inert',\n\t'ismap',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'seamless',\n\t'selected',\n\t'webkitdirectory',\n\t'defer',\n\t'disablepictureinpicture',\n\t'disableremoteplayback'\n];\n\n/**\n * Returns `true` if `name` is a boolean attribute\n * @param {string} name\n */\nexport function is_boolean_attribute(name) {\n\treturn DOM_BOOLEAN_ATTRIBUTES.includes(name);\n}\n\n/**\n * @type {Record<string, string>}\n * List of attribute names that should be aliased to their property names\n * because they behave differently between setting them as an attribute and\n * setting them as a property.\n */\nconst ATTRIBUTE_ALIASES = {\n\t// no `class: 'className'` because we handle that separately\n\tformnovalidate: 'formNoValidate',\n\tismap: 'isMap',\n\tnomodule: 'noModule',\n\tplaysinline: 'playsInline',\n\treadonly: 'readOnly',\n\tdefaultvalue: 'defaultValue',\n\tdefaultchecked: 'defaultChecked',\n\tsrcobject: 'srcObject',\n\tnovalidate: 'noValidate',\n\tallowfullscreen: 'allowFullscreen',\n\tdisablepictureinpicture: 'disablePictureInPicture',\n\tdisableremoteplayback: 'disableRemotePlayback'\n};\n\n/**\n * @param {string} name\n */\nexport function normalize_attribute(name) {\n\tname = name.toLowerCase();\n\treturn ATTRIBUTE_ALIASES[name] ?? name;\n}\n\nconst DOM_PROPERTIES = [\n\t...DOM_BOOLEAN_ATTRIBUTES,\n\t'formNoValidate',\n\t'isMap',\n\t'noModule',\n\t'playsInline',\n\t'readOnly',\n\t'value',\n\t'volume',\n\t'defaultValue',\n\t'defaultChecked',\n\t'srcObject',\n\t'noValidate',\n\t'allowFullscreen',\n\t'disablePictureInPicture',\n\t'disableRemotePlayback'\n];\n\n/**\n * @param {string} name\n */\nexport function is_dom_property(name) {\n\treturn DOM_PROPERTIES.includes(name);\n}\n\nconst NON_STATIC_PROPERTIES = ['autofocus', 'muted', 'defaultValue', 'defaultChecked'];\n\n/**\n * Returns `true` if the given attribute cannot be set through the template\n * string, i.e. needs some kind of JavaScript handling to work.\n * @param {string} name\n */\nexport function cannot_be_set_statically(name) {\n\treturn NON_STATIC_PROPERTIES.includes(name);\n}\n\n/**\n * Subset of delegated events which should be passive by default.\n * These two are already passive via browser defaults on window, document and body.\n * But since\n * - we're delegating them\n * - they happen often\n * - they apply to mobile which is generally less performant\n * we're marking them as passive by default for other elements, too.\n */\nconst PASSIVE_EVENTS = ['touchstart', 'touchmove'];\n\n/**\n * Returns `true` if `name` is a passive event\n * @param {string} name\n */\nexport function is_passive_event(name) {\n\treturn PASSIVE_EVENTS.includes(name);\n}\n\nconst CONTENT_EDITABLE_BINDINGS = ['textContent', 'innerHTML', 'innerText'];\n\n/** @param {string} name */\nexport function is_content_editable_binding(name) {\n\treturn CONTENT_EDITABLE_BINDINGS.includes(name);\n}\n\nconst LOAD_ERROR_ELEMENTS = [\n\t'body',\n\t'embed',\n\t'iframe',\n\t'img',\n\t'link',\n\t'object',\n\t'script',\n\t'style',\n\t'track'\n];\n\n/**\n * Returns `true` if the element emits `load` and `error` events\n * @param {string} name\n */\nexport function is_load_error_element(name) {\n\treturn LOAD_ERROR_ELEMENTS.includes(name);\n}\n\nconst SVG_ELEMENTS = [\n\t'altGlyph',\n\t'altGlyphDef',\n\t'altGlyphItem',\n\t'animate',\n\t'animateColor',\n\t'animateMotion',\n\t'animateTransform',\n\t'circle',\n\t'clipPath',\n\t'color-profile',\n\t'cursor',\n\t'defs',\n\t'desc',\n\t'discard',\n\t'ellipse',\n\t'feBlend',\n\t'feColorMatrix',\n\t'feComponentTransfer',\n\t'feComposite',\n\t'feConvolveMatrix',\n\t'feDiffuseLighting',\n\t'feDisplacementMap',\n\t'feDistantLight',\n\t'feDropShadow',\n\t'feFlood',\n\t'feFuncA',\n\t'feFuncB',\n\t'feFuncG',\n\t'feFuncR',\n\t'feGaussianBlur',\n\t'feImage',\n\t'feMerge',\n\t'feMergeNode',\n\t'feMorphology',\n\t'feOffset',\n\t'fePointLight',\n\t'feSpecularLighting',\n\t'feSpotLight',\n\t'feTile',\n\t'feTurbulence',\n\t'filter',\n\t'font',\n\t'font-face',\n\t'font-face-format',\n\t'font-face-name',\n\t'font-face-src',\n\t'font-face-uri',\n\t'foreignObject',\n\t'g',\n\t'glyph',\n\t'glyphRef',\n\t'hatch',\n\t'hatchpath',\n\t'hkern',\n\t'image',\n\t'line',\n\t'linearGradient',\n\t'marker',\n\t'mask',\n\t'mesh',\n\t'meshgradient',\n\t'meshpatch',\n\t'meshrow',\n\t'metadata',\n\t'missing-glyph',\n\t'mpath',\n\t'path',\n\t'pattern',\n\t'polygon',\n\t'polyline',\n\t'radialGradient',\n\t'rect',\n\t'set',\n\t'solidcolor',\n\t'stop',\n\t'svg',\n\t'switch',\n\t'symbol',\n\t'text',\n\t'textPath',\n\t'tref',\n\t'tspan',\n\t'unknown',\n\t'use',\n\t'view',\n\t'vkern'\n];\n\n/** @param {string} name */\nexport function is_svg(name) {\n\treturn SVG_ELEMENTS.includes(name);\n}\n\nconst MATHML_ELEMENTS = [\n\t'annotation',\n\t'annotation-xml',\n\t'maction',\n\t'math',\n\t'merror',\n\t'mfrac',\n\t'mi',\n\t'mmultiscripts',\n\t'mn',\n\t'mo',\n\t'mover',\n\t'mpadded',\n\t'mphantom',\n\t'mprescripts',\n\t'mroot',\n\t'mrow',\n\t'ms',\n\t'mspace',\n\t'msqrt',\n\t'mstyle',\n\t'msub',\n\t'msubsup',\n\t'msup',\n\t'mtable',\n\t'mtd',\n\t'mtext',\n\t'mtr',\n\t'munder',\n\t'munderover',\n\t'semantics'\n];\n\n/** @param {string} name */\nexport function is_mathml(name) {\n\treturn MATHML_ELEMENTS.includes(name);\n}\n\nconst STATE_CREATION_RUNES = /** @type {const} */ ([\n\t'$state',\n\t'$state.raw',\n\t'$derived',\n\t'$derived.by'\n]);\n\nconst RUNES = /** @type {const} */ ([\n\t...STATE_CREATION_RUNES,\n\t'$state.snapshot',\n\t'$props',\n\t'$props.id',\n\t'$bindable',\n\t'$effect',\n\t'$effect.pre',\n\t'$effect.tracking',\n\t'$effect.root',\n\t'$effect.pending',\n\t'$inspect',\n\t'$inspect().with',\n\t'$inspect.trace',\n\t'$host'\n]);\n\n/** @typedef {typeof RUNES[number]} RuneName */\n\n/**\n * @param {string} name\n * @returns {name is RuneName}\n */\nexport function is_rune(name) {\n\treturn RUNES.includes(/** @type {RuneName} */ (name));\n}\n\n/** @typedef {typeof STATE_CREATION_RUNES[number]} StateCreationRuneName */\n\n/**\n * @param {string} name\n * @returns {name is StateCreationRuneName}\n */\nexport function is_state_creation_rune(name) {\n\treturn STATE_CREATION_RUNES.includes(/** @type {StateCreationRuneName} */ (name));\n}\n\n/** List of elements that require raw contents and should not have SSR comments put in them */\nconst RAW_TEXT_ELEMENTS = /** @type {const} */ (['textarea', 'script', 'style', 'title']);\n\n/** @param {string} name */\nexport function is_raw_text_element(name) {\n\treturn RAW_TEXT_ELEMENTS.includes(/** @type {typeof RAW_TEXT_ELEMENTS[number]} */ (name));\n}\n\n/**\n * Prevent devtools trying to make `location` a clickable link by inserting a zero-width space\n * @template {string | undefined} T\n * @param {T} location\n * @returns {T};\n */\nexport function sanitize_location(location) {\n\treturn /** @type {T} */ (location?.replace(/\\//g, '/\\u200b'));\n}\n","import { teardown } from '../../reactivity/effects.js';\nimport { define_property, is_array } from '../../../shared/utils.js';\nimport { hydrating } from '../hydration.js';\nimport { queue_micro_task } from '../task.js';\nimport { FILENAME } from '../../../../constants.js';\nimport * as w from '../../warnings.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { without_reactive_context } from './bindings/shared.js';\n\n/** @type {Set<string>} */\nexport const all_registered_events = new Set();\n\n/** @type {Set<(events: Array<string>) => void>} */\nexport const root_event_handles = new Set();\n\n/**\n * SSR adds onload and onerror attributes to catch those events before the hydration.\n * This function detects those cases, removes the attributes and replays the events.\n * @param {HTMLElement} dom\n */\nexport function replay_events(dom) {\n\tif (!hydrating) return;\n\n\tdom.removeAttribute('onload');\n\tdom.removeAttribute('onerror');\n\t// @ts-expect-error\n\tconst event = dom.__e;\n\tif (event !== undefined) {\n\t\t// @ts-expect-error\n\t\tdom.__e = undefined;\n\t\tqueueMicrotask(() => {\n\t\t\tif (dom.isConnected) {\n\t\t\t\tdom.dispatchEvent(event);\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * @param {string} event_name\n * @param {EventTarget} dom\n * @param {EventListener} [handler]\n * @param {AddEventListenerOptions} [options]\n */\nexport function create_event(event_name, dom, handler, options = {}) {\n\t/**\n\t * @this {EventTarget}\n\t */\n\tfunction target_handler(/** @type {Event} */ event) {\n\t\tif (!options.capture) {\n\t\t\t// Only call in the bubble phase, else delegated events would be called before the capturing events\n\t\t\thandle_event_propagation.call(dom, event);\n\t\t}\n\t\tif (!event.cancelBubble) {\n\t\t\treturn without_reactive_context(() => {\n\t\t\t\treturn handler?.call(this, event);\n\t\t\t});\n\t\t}\n\t}\n\n\t// Chrome has a bug where pointer events don't work when attached to a DOM element that has been cloned\n\t// with cloneNode() and the DOM element is disconnected from the document. To ensure the event works, we\n\t// defer the attachment till after it's been appended to the document. TODO: remove this once Chrome fixes\n\t// this bug. The same applies to wheel events and touch events.\n\tif (\n\t\tevent_name.startsWith('pointer') ||\n\t\tevent_name.startsWith('touch') ||\n\t\tevent_name === 'wheel'\n\t) {\n\t\tqueue_micro_task(() => {\n\t\t\tdom.addEventListener(event_name, target_handler, options);\n\t\t});\n\t} else {\n\t\tdom.addEventListener(event_name, target_handler, options);\n\t}\n\n\treturn target_handler;\n}\n\n/**\n * Attaches an event handler to an element and returns a function that removes the handler. Using this\n * rather than `addEventListener` will preserve the correct order relative to handlers added declaratively\n * (with attributes like `onclick`), which use event delegation for performance reasons\n *\n * @param {EventTarget} element\n * @param {string} type\n * @param {EventListener} handler\n * @param {AddEventListenerOptions} [options]\n */\nexport function on(element, type, handler, options = {}) {\n\tvar target_handler = create_event(type, element, handler, options);\n\n\treturn () => {\n\t\telement.removeEventListener(type, target_handler, options);\n\t};\n}\n\n/**\n * @param {string} event_name\n * @param {Element} dom\n * @param {EventListener} [handler]\n * @param {boolean} [capture]\n * @param {boolean} [passive]\n * @returns {void}\n */\nexport function event(event_name, dom, handler, capture, passive) {\n\tvar options = { capture, passive };\n\tvar target_handler = create_event(event_name, dom, handler, options);\n\n\tif (\n\t\tdom === document.body ||\n\t\t// @ts-ignore\n\t\tdom === window ||\n\t\t// @ts-ignore\n\t\tdom === document ||\n\t\t// Firefox has quirky behavior, it can happen that we still get \"canplay\" events when the element is already removed\n\t\tdom instanceof HTMLMediaElement\n\t) {\n\t\tteardown(() => {\n\t\t\tdom.removeEventListener(event_name, target_handler, options);\n\t\t});\n\t}\n}\n\n/**\n * @param {Array<string>} events\n * @returns {void}\n */\nexport function delegate(events) {\n\tfor (var i = 0; i < events.length; i++) {\n\t\tall_registered_events.add(events[i]);\n\t}\n\n\tfor (var fn of root_event_handles) {\n\t\tfn(events);\n\t}\n}\n\n// used to store the reference to the currently propagated event\n// to prevent garbage collection between microtasks in Firefox\n// If the event object is GCed too early, the expando __root property\n// set on the event object is lost, causing the event delegation\n// to process the event twice\nlet last_propagated_event = null;\n\n/**\n * @this {EventTarget}\n * @param {Event} event\n * @returns {void}\n */\nexport function handle_event_propagation(event) {\n\tvar handler_element = this;\n\tvar owner_document = /** @type {Node} */ (handler_element).ownerDocument;\n\tvar event_name = event.type;\n\tvar path = event.composedPath?.() || [];\n\tvar current_target = /** @type {null | Element} */ (path[0] || event.target);\n\n\tlast_propagated_event = event;\n\n\t// composedPath contains list of nodes the event has propagated through.\n\t// We check __root to skip all nodes below it in case this is a\n\t// parent of the __root node, which indicates that there's nested\n\t// mounted apps. In this case we don't want to trigger events multiple times.\n\tvar path_idx = 0;\n\n\t// the `last_propagated_event === event` check is redundant, but\n\t// without it the variable will be DCE'd and things will\n\t// fail mysteriously in Firefox\n\t// @ts-expect-error is added below\n\tvar handled_at = last_propagated_event === event && event.__root;\n\n\tif (handled_at) {\n\t\tvar at_idx = path.indexOf(handled_at);\n\t\tif (\n\t\t\tat_idx !== -1 &&\n\t\t\t(handler_element === document || handler_element === /** @type {any} */ (window))\n\t\t) {\n\t\t\t// This is the fallback document listener or a window listener, but the event was already handled\n\t\t\t// -> ignore, but set handle_at to document/window so that we're resetting the event\n\t\t\t// chain in case someone manually dispatches the same event object again.\n\t\t\t// @ts-expect-error\n\t\t\tevent.__root = handler_element;\n\t\t\treturn;\n\t\t}\n\n\t\t// We're deliberately not skipping if the index is higher, because\n\t\t// someone could create an event programmatically and emit it multiple times,\n\t\t// in which case we want to handle the whole propagation chain properly each time.\n\t\t// (this will only be a false negative if the event is dispatched multiple times and\n\t\t// the fallback document listener isn't reached in between, but that's super rare)\n\t\tvar handler_idx = path.indexOf(handler_element);\n\t\tif (handler_idx === -1) {\n\t\t\t// handle_idx can theoretically be -1 (happened in some JSDOM testing scenarios with an event listener on the window object)\n\t\t\t// so guard against that, too, and assume that everything was handled at this point.\n\t\t\treturn;\n\t\t}\n\n\t\tif (at_idx <= handler_idx) {\n\t\t\tpath_idx = at_idx;\n\t\t}\n\t}\n\n\tcurrent_target = /** @type {Element} */ (path[path_idx] || event.target);\n\t// there can only be one delegated event per element, and we either already handled the current target,\n\t// or this is the very first target in the chain which has a non-delegated listener, in which case it's safe\n\t// to handle a possible delegated event on it later (through the root delegation listener for example).\n\tif (current_target === handler_element) return;\n\n\t// Proxy currentTarget to correct target\n\tdefine_property(event, 'currentTarget', {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn current_target || owner_document;\n\t\t}\n\t});\n\n\t// This started because of Chromium issue https://chromestatus.com/feature/5128696823545856,\n\t// where removal or moving of of the DOM can cause sync `blur` events to fire, which can cause logic\n\t// to run inside the current `active_reaction`, which isn't what we want at all. However, on reflection,\n\t// it's probably best that all event handled by Svelte have this behaviour, as we don't really want\n\t// an event handler to run in the context of another reaction or effect.\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\n\ttry {\n\t\t/**\n\t\t * @type {unknown}\n\t\t */\n\t\tvar throw_error;\n\t\t/**\n\t\t * @type {unknown[]}\n\t\t */\n\t\tvar other_errors = [];\n\n\t\twhile (current_target !== null) {\n\t\t\t/** @type {null | Element} */\n\t\t\tvar parent_element =\n\t\t\t\tcurrent_target.assignedSlot ||\n\t\t\t\tcurrent_target.parentNode ||\n\t\t\t\t/** @type {any} */ (current_target).host ||\n\t\t\t\tnull;\n\n\t\t\ttry {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tvar delegated = current_target['__' + event_name];\n\n\t\t\t\tif (\n\t\t\t\t\tdelegated != null &&\n\t\t\t\t\t(!(/** @type {any} */ (current_target).disabled) ||\n\t\t\t\t\t\t// DOM could've been updated already by the time this is reached, so we check this as well\n\t\t\t\t\t\t// -> the target could not have been disabled because it emits the event in the first place\n\t\t\t\t\t\tevent.target === current_target)\n\t\t\t\t) {\n\t\t\t\t\tif (is_array(delegated)) {\n\t\t\t\t\t\tvar [fn, ...data] = delegated;\n\t\t\t\t\t\tfn.apply(current_target, [event, ...data]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdelegated.call(current_target, event);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (throw_error) {\n\t\t\t\t\tother_errors.push(error);\n\t\t\t\t} else {\n\t\t\t\t\tthrow_error = error;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (event.cancelBubble || parent_element === handler_element || parent_element === null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcurrent_target = parent_element;\n\t\t}\n\n\t\tif (throw_error) {\n\t\t\tfor (let error of other_errors) {\n\t\t\t\t// Throw the rest of the errors, one-by-one on a microtask\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow throw_error;\n\t\t}\n\t} finally {\n\t\t// @ts-expect-error is used above\n\t\tevent.__root = handler_element;\n\t\t// @ts-ignore remove proxy on currentTarget\n\t\tdelete event.currentTarget;\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * In dev, warn if an event handler is not a function, as it means the\n * user probably called the handler or forgot to add a `() =>`\n * @param {() => (event: Event, ...args: any) => void} thunk\n * @param {EventTarget} element\n * @param {[Event, ...any]} args\n * @param {any} component\n * @param {[number, number]} [loc]\n * @param {boolean} [remove_parens]\n */\nexport function apply(\n\tthunk,\n\telement,\n\targs,\n\tcomponent,\n\tloc,\n\thas_side_effects = false,\n\tremove_parens = false\n) {\n\tlet handler;\n\tlet error;\n\n\ttry {\n\t\thandler = thunk();\n\t} catch (e) {\n\t\terror = e;\n\t}\n\n\tif (typeof handler !== 'function' && (has_side_effects || handler != null || error)) {\n\t\tconst filename = component?.[FILENAME];\n\t\tconst location = loc ? ` at ${filename}:${loc[0]}:${loc[1]}` : ` in ${filename}`;\n\t\tconst phase = args[0]?.eventPhase < Event.BUBBLING_PHASE ? 'capture' : '';\n\t\tconst event_name = args[0]?.type + phase;\n\t\tconst description = `\\`${event_name}\\` handler${location}`;\n\t\tconst suggestion = remove_parens ? 'remove the trailing `()`' : 'add a leading `() =>`';\n\n\t\tw.event_handler_invalid(description, suggestion);\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\t}\n\thandler?.apply(element, args);\n}\n","/** @param {string} html */\nexport function create_fragment_from_html(html) {\n\tvar elem = document.createElement('template');\n\telem.innerHTML = html.replaceAll('<!>', '<!---->'); // XHTML compliance\n\treturn elem.content;\n}\n","/** @import { Effect, TemplateNode } from '#client' */\n/** @import { TemplateStructure } from './types' */\nimport { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport {\n\tcreate_text,\n\tget_first_child,\n\tis_firefox,\n\tcreate_element,\n\tcreate_fragment,\n\tcreate_comment,\n\tset_attribute\n} from './operations.js';\nimport { create_fragment_from_html } from './reconciler.js';\nimport { active_effect } from '../runtime.js';\nimport {\n\tNAMESPACE_MATHML,\n\tNAMESPACE_SVG,\n\tTEMPLATE_FRAGMENT,\n\tTEMPLATE_USE_IMPORT_NODE,\n\tTEMPLATE_USE_MATHML,\n\tTEMPLATE_USE_SVG\n} from '../../../constants.js';\nimport { COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, TEXT_NODE } from '#client/constants';\n\n/**\n * @param {TemplateNode} start\n * @param {TemplateNode | null} end\n */\nexport function assign_nodes(start, end) {\n\tvar effect = /** @type {Effect} */ (active_effect);\n\tif (effect.nodes_start === null) {\n\t\teffect.nodes_start = start;\n\t\teffect.nodes_end = end;\n\t}\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_html(content, flags) {\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;\n\n\t/** @type {Node} */\n\tvar node;\n\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('<!>');\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (node === undefined) {\n\t\t\tnode = create_fragment_from_html(has_start ? content : '<!>' + content);\n\t\t\tif (!is_fragment) node = /** @type {Node} */ (get_first_child(node));\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (\n\t\t\tuse_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)\n\t\t);\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @param {'svg' | 'math'} ns\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nfunction from_namespace(content, flags, ns = 'svg') {\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('<!>');\n\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar wrapped = `<${ns}>${has_start ? content : '<!>' + content}</${ns}>`;\n\n\t/** @type {Element | DocumentFragment} */\n\tvar node;\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (!node) {\n\t\t\tvar fragment = /** @type {DocumentFragment} */ (create_fragment_from_html(wrapped));\n\t\t\tvar root = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (is_fragment) {\n\t\t\t\tnode = document.createDocumentFragment();\n\t\t\t\twhile (get_first_child(root)) {\n\t\t\t\t\tnode.appendChild(/** @type {Node} */ (get_first_child(root)));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode = /** @type {Element} */ (get_first_child(root));\n\t\t\t}\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (node.cloneNode(true));\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_svg(content, flags) {\n\treturn from_namespace(content, flags, 'svg');\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_mathml(content, flags) {\n\treturn from_namespace(content, flags, 'math');\n}\n\n/**\n * @param {TemplateStructure[]} structure\n * @param {typeof NAMESPACE_SVG | typeof NAMESPACE_MATHML | undefined} [ns]\n */\nfunction fragment_from_tree(structure, ns) {\n\tvar fragment = create_fragment();\n\n\tfor (var item of structure) {\n\t\tif (typeof item === 'string') {\n\t\t\tfragment.append(create_text(item));\n\t\t\tcontinue;\n\t\t}\n\n\t\t// if `preserveComments === true`, comments are represented as `['// <data>']`\n\t\tif (item === undefined || item[0][0] === '/') {\n\t\t\tfragment.append(create_comment(item ? item[0].slice(3) : ''));\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst [name, attributes, ...children] = item;\n\n\t\tconst namespace = name === 'svg' ? NAMESPACE_SVG : name === 'math' ? NAMESPACE_MATHML : ns;\n\n\t\tvar element = create_element(name, namespace, attributes?.is);\n\n\t\tfor (var key in attributes) {\n\t\t\tset_attribute(element, key, attributes[key]);\n\t\t}\n\n\t\tif (children.length > 0) {\n\t\t\tvar target =\n\t\t\t\telement.tagName === 'TEMPLATE'\n\t\t\t\t\t? /** @type {HTMLTemplateElement} */ (element).content\n\t\t\t\t\t: element;\n\n\t\t\ttarget.append(\n\t\t\t\tfragment_from_tree(children, element.tagName === 'foreignObject' ? undefined : namespace)\n\t\t\t);\n\t\t}\n\n\t\tfragment.append(element);\n\t}\n\n\treturn fragment;\n}\n\n/**\n * @param {TemplateStructure[]} structure\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_tree(structure, flags) {\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;\n\n\t/** @type {Node} */\n\tvar node;\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (node === undefined) {\n\t\t\tconst ns =\n\t\t\t\t(flags & TEMPLATE_USE_SVG) !== 0\n\t\t\t\t\t? NAMESPACE_SVG\n\t\t\t\t\t: (flags & TEMPLATE_USE_MATHML) !== 0\n\t\t\t\t\t\t? NAMESPACE_MATHML\n\t\t\t\t\t\t: undefined;\n\n\t\t\tnode = fragment_from_tree(structure, ns);\n\t\t\tif (!is_fragment) node = /** @type {Node} */ (get_first_child(node));\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (\n\t\t\tuse_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)\n\t\t);\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {() => Element | DocumentFragment} fn\n */\nexport function with_script(fn) {\n\treturn () => run_scripts(fn());\n}\n\n/**\n * Creating a document fragment from HTML that contains script tags will not execute\n * the scripts. We need to replace the script tags with new ones so that they are executed.\n * @param {Element | DocumentFragment} node\n * @returns {Node | Node[]}\n */\nfunction run_scripts(node) {\n\t// scripts were SSR'd, in which case they will run\n\tif (hydrating) return node;\n\n\tconst is_fragment = node.nodeType === DOCUMENT_FRAGMENT_NODE;\n\tconst scripts =\n\t\t/** @type {HTMLElement} */ (node).tagName === 'SCRIPT'\n\t\t\t? [/** @type {HTMLScriptElement} */ (node)]\n\t\t\t: node.querySelectorAll('script');\n\tconst effect = /** @type {Effect} */ (active_effect);\n\n\tfor (const script of scripts) {\n\t\tconst clone = document.createElement('script');\n\t\tfor (var attribute of script.attributes) {\n\t\t\tclone.setAttribute(attribute.name, attribute.value);\n\t\t}\n\n\t\tclone.textContent = script.textContent;\n\n\t\t// The script has changed - if it's at the edges, the effect now points at dead nodes\n\t\tif (is_fragment ? node.firstChild === script : node === script) {\n\t\t\teffect.nodes_start = clone;\n\t\t}\n\t\tif (is_fragment ? node.lastChild === script : node === script) {\n\t\t\teffect.nodes_end = clone;\n\t\t}\n\n\t\tscript.replaceWith(clone);\n\t}\n\treturn node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {any} value\n */\nexport function text(value = '') {\n\tif (!hydrating) {\n\t\tvar t = create_text(value + '');\n\t\tassign_nodes(t, t);\n\t\treturn t;\n\t}\n\n\tvar node = hydrate_node;\n\n\tif (node.nodeType !== TEXT_NODE) {\n\t\t// if an {expression} is empty during SSR, we need to insert an empty text node\n\t\tnode.before((node = create_text()));\n\t\tset_hydrate_node(node);\n\t}\n\n\tassign_nodes(node, node);\n\treturn node;\n}\n\nexport function comment() {\n\t// we're not delegating to `template` here for performance reasons\n\tif (hydrating) {\n\t\tassign_nodes(hydrate_node, null);\n\t\treturn hydrate_node;\n\t}\n\n\tvar frag = document.createDocumentFragment();\n\tvar start = document.createComment('');\n\tvar anchor = create_text();\n\tfrag.append(start, anchor);\n\n\tassign_nodes(start, anchor);\n\n\treturn frag;\n}\n\n/**\n * Assign the created (or in hydration mode, traversed) dom elements to the current block\n * and insert the elements into the dom (in client mode).\n * @param {Text | Comment | Element} anchor\n * @param {DocumentFragment | Element} dom\n */\nexport function append(anchor, dom) {\n\tif (hydrating) {\n\t\t/** @type {Effect} */ (active_effect).nodes_end = hydrate_node;\n\t\thydrate_next();\n\t\treturn;\n\t}\n\n\tif (anchor === null) {\n\t\t// edge case — void `<svelte:element>` with content\n\t\treturn;\n\t}\n\n\tanchor.before(/** @type {Node} */ (dom));\n}\n\n/**\n * Create (or hydrate) an unique UID for the component instance.\n */\nexport function props_id() {\n\tif (\n\t\thydrating &&\n\t\thydrate_node &&\n\t\thydrate_node.nodeType === COMMENT_NODE &&\n\t\thydrate_node.textContent?.startsWith(`#`)\n\t) {\n\t\tconst id = hydrate_node.textContent.substring(1);\n\t\thydrate_next();\n\t\treturn id;\n\t}\n\n\t// @ts-expect-error This way we ensure the id is unique even across Svelte runtimes\n\t(window.__svelte ??= {}).uid ??= 1;\n\n\t// @ts-expect-error\n\treturn `c${window.__svelte.uid++}`;\n}\n","/** @import { ComponentContext, Effect, TemplateNode } from '#client' */\n/** @import { Component, ComponentType, SvelteComponent, MountOptions } from '../../index.js' */\nimport { DEV } from 'esm-env';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tinit_operations\n} from './dom/operations.js';\nimport { HYDRATION_END, HYDRATION_ERROR, HYDRATION_START } from '../../constants.js';\nimport { active_effect } from './runtime.js';\nimport { push, pop, component_context } from './context.js';\nimport { component_root, branch } from './reactivity/effects.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tset_hydrate_node,\n\tset_hydrating\n} from './dom/hydration.js';\nimport { array_from } from '../shared/utils.js';\nimport {\n\tall_registered_events,\n\thandle_event_propagation,\n\troot_event_handles\n} from './dom/elements/events.js';\nimport { reset_head_anchor } from './dom/blocks/svelte-head.js';\nimport * as w from './warnings.js';\nimport * as e from './errors.js';\nimport { assign_nodes } from './dom/template.js';\nimport { is_passive_event } from '../../utils.js';\nimport { COMMENT_NODE } from './constants.js';\n\n/**\n * This is normally true — block effects should run their intro transitions —\n * but is false during hydration (unless `options.intro` is `true`) and\n * when creating the children of a `<svelte:element>` that just changed tag\n */\nexport let should_intro = true;\n\n/** @param {boolean} value */\nexport function set_should_intro(value) {\n\tshould_intro = value;\n}\n\n/**\n * @param {Element} text\n * @param {string} value\n * @returns {void}\n */\nexport function set_text(text, value) {\n\t// For objects, we apply string coercion (which might make things like $state array references in the template reactive) before diffing\n\tvar str = value == null ? '' : typeof value === 'object' ? value + '' : value;\n\t// @ts-expect-error\n\tif (str !== (text.__t ??= text.nodeValue)) {\n\t\t// @ts-expect-error\n\t\ttext.__t = str;\n\t\ttext.nodeValue = str + '';\n\t}\n}\n\n/**\n * Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.\n * Transitions will play during the initial render unless the `intro` option is set to `false`.\n *\n * @template {Record<string, any>} Props\n * @template {Record<string, any>} Exports\n * @param {ComponentType<SvelteComponent<Props>> | Component<Props, Exports, any>} component\n * @param {MountOptions<Props>} options\n * @returns {Exports}\n */\nexport function mount(component, options) {\n\treturn _mount(component, options);\n}\n\n/**\n * Hydrates a component on the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component\n *\n * @template {Record<string, any>} Props\n * @template {Record<string, any>} Exports\n * @param {ComponentType<SvelteComponent<Props>> | Component<Props, Exports, any>} component\n * @param {{} extends Props ? {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops?: Props;\n * \t\tevents?: Record<string, (e: any) => any>;\n * \tcontext?: Map<any, any>;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n * \t} : {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops: Props;\n * \t\tevents?: Record<string, (e: any) => any>;\n * \tcontext?: Map<any, any>;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n * \t}} options\n * @returns {Exports}\n */\nexport function hydrate(component, options) {\n\tinit_operations();\n\toptions.intro = options.intro ?? false;\n\tconst target = options.target;\n\tconst was_hydrating = hydrating;\n\tconst previous_hydrate_node = hydrate_node;\n\n\ttry {\n\t\tvar anchor = /** @type {TemplateNode} */ (get_first_child(target));\n\t\twhile (\n\t\t\tanchor &&\n\t\t\t(anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */ (anchor).data !== HYDRATION_START)\n\t\t) {\n\t\t\tanchor = /** @type {TemplateNode} */ (get_next_sibling(anchor));\n\t\t}\n\n\t\tif (!anchor) {\n\t\t\tthrow HYDRATION_ERROR;\n\t\t}\n\n\t\tset_hydrating(true);\n\t\tset_hydrate_node(/** @type {Comment} */ (anchor));\n\t\thydrate_next();\n\n\t\tconst instance = _mount(component, { ...options, anchor });\n\n\t\tif (\n\t\t\thydrate_node === null ||\n\t\t\thydrate_node.nodeType !== COMMENT_NODE ||\n\t\t\t/** @type {Comment} */ (hydrate_node).data !== HYDRATION_END\n\t\t) {\n\t\t\tw.hydration_mismatch();\n\t\t\tthrow HYDRATION_ERROR;\n\t\t}\n\n\t\tset_hydrating(false);\n\n\t\treturn /** @type {Exports} */ (instance);\n\t} catch (error) {\n\t\t// re-throw Svelte errors - they are certainly not related to hydration\n\t\tif (\n\t\t\terror instanceof Error &&\n\t\t\terror.message.split('\\n').some((line) => line.startsWith('https://svelte.dev/e/'))\n\t\t) {\n\t\t\tthrow error;\n\t\t}\n\t\tif (error !== HYDRATION_ERROR) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('Failed to hydrate: ', error);\n\t\t}\n\n\t\tif (options.recover === false) {\n\t\t\te.hydration_failed();\n\t\t}\n\n\t\t// If an error occured above, the operations might not yet have been initialised.\n\t\tinit_operations();\n\t\tclear_text_content(target);\n\n\t\tset_hydrating(false);\n\t\treturn mount(component, options);\n\t} finally {\n\t\tset_hydrating(was_hydrating);\n\t\tset_hydrate_node(previous_hydrate_node);\n\t\treset_head_anchor();\n\t}\n}\n\n/** @type {Map<string, number>} */\nconst document_listeners = new Map();\n\n/**\n * @template {Record<string, any>} Exports\n * @param {ComponentType<SvelteComponent<any>> | Component<any>} Component\n * @param {MountOptions} options\n * @returns {Exports}\n */\nfunction _mount(Component, { target, anchor, props = {}, events, context, intro = true }) {\n\tinit_operations();\n\n\t/** @type {Set<string>} */\n\tvar registered_events = new Set();\n\n\t/** @param {Array<string>} events */\n\tvar event_handle = (events) => {\n\t\tfor (var i = 0; i < events.length; i++) {\n\t\t\tvar event_name = events[i];\n\n\t\t\tif (registered_events.has(event_name)) continue;\n\t\t\tregistered_events.add(event_name);\n\n\t\t\tvar passive = is_passive_event(event_name);\n\n\t\t\t// Add the event listener to both the container and the document.\n\t\t\t// The container listener ensures we catch events from within in case\n\t\t\t// the outer content stops propagation of the event.\n\t\t\ttarget.addEventListener(event_name, handle_event_propagation, { passive });\n\n\t\t\tvar n = document_listeners.get(event_name);\n\n\t\t\tif (n === undefined) {\n\t\t\t\t// The document listener ensures we catch events that originate from elements that were\n\t\t\t\t// manually moved outside of the container (e.g. via manual portals).\n\t\t\t\tdocument.addEventListener(event_name, handle_event_propagation, { passive });\n\t\t\t\tdocument_listeners.set(event_name, 1);\n\t\t\t} else {\n\t\t\t\tdocument_listeners.set(event_name, n + 1);\n\t\t\t}\n\t\t}\n\t};\n\n\tevent_handle(array_from(all_registered_events));\n\troot_event_handles.add(event_handle);\n\n\t/** @type {Exports} */\n\t// @ts-expect-error will be defined because the render effect runs synchronously\n\tvar component = undefined;\n\n\tvar unmount = component_root(() => {\n\t\tvar anchor_node = anchor ?? target.appendChild(create_text());\n\n\t\tbranch(() => {\n\t\t\tif (context) {\n\t\t\t\tpush({});\n\t\t\t\tvar ctx = /** @type {ComponentContext} */ (component_context);\n\t\t\t\tctx.c = context;\n\t\t\t}\n\n\t\t\tif (events) {\n\t\t\t\t// We can't spread the object or else we'd lose the state proxy stuff, if it is one\n\t\t\t\t/** @type {any} */ (props).$$events = events;\n\t\t\t}\n\n\t\t\tif (hydrating) {\n\t\t\t\tassign_nodes(/** @type {TemplateNode} */ (anchor_node), null);\n\t\t\t}\n\n\t\t\tshould_intro = intro;\n\t\t\t// @ts-expect-error the public typings are not what the actual function looks like\n\t\t\tcomponent = Component(anchor_node, props) || {};\n\t\t\tshould_intro = true;\n\n\t\t\tif (hydrating) {\n\t\t\t\t/** @type {Effect} */ (active_effect).nodes_end = hydrate_node;\n\t\t\t}\n\n\t\t\tif (context) {\n\t\t\t\tpop();\n\t\t\t}\n\t\t});\n\n\t\treturn () => {\n\t\t\tfor (var event_name of registered_events) {\n\t\t\t\ttarget.removeEventListener(event_name, handle_event_propagation);\n\n\t\t\t\tvar n = /** @type {number} */ (document_listeners.get(event_name));\n\n\t\t\t\tif (--n === 0) {\n\t\t\t\t\tdocument.removeEventListener(event_name, handle_event_propagation);\n\t\t\t\t\tdocument_listeners.delete(event_name);\n\t\t\t\t} else {\n\t\t\t\t\tdocument_listeners.set(event_name, n);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\troot_event_handles.delete(event_handle);\n\n\t\t\tif (anchor_node !== anchor) {\n\t\t\t\tanchor_node.parentNode?.removeChild(anchor_node);\n\t\t\t}\n\t\t};\n\t});\n\n\tmounted_components.set(component, unmount);\n\treturn component;\n}\n\n/**\n * References of the components that were mounted or hydrated.\n * Uses a `WeakMap` to avoid memory leaks.\n */\nlet mounted_components = new WeakMap();\n\n/**\n * Unmounts a component that was previously mounted using `mount` or `hydrate`.\n *\n * Since 5.13.0, if `options.outro` is `true`, [transitions](https://svelte.dev/docs/svelte/transition) will play before the component is removed from the DOM.\n *\n * Returns a `Promise` that resolves after transitions have completed if `options.outro` is true, or immediately otherwise (prior to 5.13.0, returns `void`).\n *\n * ```js\n * import { mount, unmount } from 'svelte';\n * import App from './App.svelte';\n *\n * const app = mount(App, { target: document.body });\n *\n * // later...\n * unmount(app, { outro: true });\n * ```\n * @param {Record<string, any>} component\n * @param {{ outro?: boolean }} [options]\n * @returns {Promise<void>}\n */\nexport function unmount(component, options) {\n\tconst fn = mounted_components.get(component);\n\n\tif (fn) {\n\t\tmounted_components.delete(component);\n\t\treturn fn(options);\n\t}\n\n\tif (DEV) {\n\t\tw.lifecycle_double_unmount();\n\t}\n\n\treturn Promise.resolve();\n}\n","/** @import { Effect, TemplateNode } from '#client' */\n/** @import { Batch } from '../../reactivity/batch.js'; */\nimport { EFFECT_TRANSPARENT } from '#client/constants';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tread_hydration_instruction,\n\tremove_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport { block, branch, pause_effect, resume_effect } from '../../reactivity/effects.js';\nimport { HYDRATION_START_ELSE, UNINITIALIZED } from '../../../../constants.js';\nimport { create_text, should_defer_append } from '../operations.js';\nimport { current_batch } from '../../reactivity/batch.js';\n\n// TODO reinstate https://github.com/sveltejs/svelte/pull/15250\n\n/**\n * @param {TemplateNode} node\n * @param {(branch: (fn: (anchor: Node) => void, flag?: boolean) => void) => void} fn\n * @param {boolean} [elseif] True if this is an `{:else if ...}` block rather than an `{#if ...}`, as that affects which transitions are considered 'local'\n * @returns {void}\n */\nexport function if_block(node, fn, elseif = false) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar anchor = node;\n\n\t/** @type {Effect | null} */\n\tvar consequent_effect = null;\n\n\t/** @type {Effect | null} */\n\tvar alternate_effect = null;\n\n\t/** @type {typeof UNINITIALIZED | boolean | null} */\n\tvar condition = UNINITIALIZED;\n\n\tvar flags = elseif ? EFFECT_TRANSPARENT : 0;\n\n\tvar has_branch = false;\n\n\tconst set_branch = (/** @type {(anchor: Node) => void} */ fn, flag = true) => {\n\t\thas_branch = true;\n\t\tupdate_branch(flag, fn);\n\t};\n\n\t/** @type {DocumentFragment | null} */\n\tvar offscreen_fragment = null;\n\n\tfunction commit() {\n\t\tif (offscreen_fragment !== null) {\n\t\t\t// remove the anchor\n\t\t\t/** @type {Text} */ (offscreen_fragment.lastChild).remove();\n\n\t\t\tanchor.before(offscreen_fragment);\n\t\t\toffscreen_fragment = null;\n\t\t}\n\n\t\tvar active = condition ? consequent_effect : alternate_effect;\n\t\tvar inactive = condition ? alternate_effect : consequent_effect;\n\n\t\tif (active) {\n\t\t\tresume_effect(active);\n\t\t}\n\n\t\tif (inactive) {\n\t\t\tpause_effect(inactive, () => {\n\t\t\t\tif (condition) {\n\t\t\t\t\talternate_effect = null;\n\t\t\t\t} else {\n\t\t\t\t\tconsequent_effect = null;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tconst update_branch = (\n\t\t/** @type {boolean | null} */ new_condition,\n\t\t/** @type {null | ((anchor: Node) => void)} */ fn\n\t) => {\n\t\tif (condition === (condition = new_condition)) return;\n\n\t\t/** Whether or not there was a hydration mismatch. Needs to be a `let` or else it isn't treeshaken out */\n\t\tlet mismatch = false;\n\n\t\tif (hydrating) {\n\t\t\tconst is_else = read_hydration_instruction(anchor) === HYDRATION_START_ELSE;\n\n\t\t\tif (!!condition === is_else) {\n\t\t\t\t// Hydration mismatch: remove everything inside the anchor and start fresh.\n\t\t\t\t// This could happen with `{#if browser}...{/if}`, for example\n\t\t\t\tanchor = remove_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tset_hydrating(false);\n\t\t\t\tmismatch = true;\n\t\t\t}\n\t\t}\n\n\t\tvar defer = should_defer_append();\n\t\tvar target = anchor;\n\n\t\tif (defer) {\n\t\t\toffscreen_fragment = document.createDocumentFragment();\n\t\t\toffscreen_fragment.append((target = create_text()));\n\t\t}\n\n\t\tif (condition) {\n\t\t\tconsequent_effect ??= fn && branch(() => fn(target));\n\t\t} else {\n\t\t\talternate_effect ??= fn && branch(() => fn(target));\n\t\t}\n\n\t\tif (defer) {\n\t\t\tvar batch = /** @type {Batch} */ (current_batch);\n\n\t\t\tvar active = condition ? consequent_effect : alternate_effect;\n\t\t\tvar inactive = condition ? alternate_effect : consequent_effect;\n\n\t\t\tif (active) batch.skipped_effects.delete(active);\n\t\t\tif (inactive) batch.skipped_effects.add(inactive);\n\n\t\t\tbatch.add_callback(commit);\n\t\t} else {\n\t\t\tcommit();\n\t\t}\n\n\t\tif (mismatch) {\n\t\t\t// continue in hydration mode\n\t\t\tset_hydrating(true);\n\t\t}\n\t};\n\n\tblock(() => {\n\t\thas_branch = false;\n\t\tfn(set_branch);\n\t\tif (!has_branch) {\n\t\t\tupdate_branch(null, null);\n\t\t}\n\t}, flags);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n","/** @import { EachItem, EachState, Effect, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */\n/** @import { Batch } from '../../reactivity/batch.js'; */\nimport {\n\tEACH_INDEX_REACTIVE,\n\tEACH_IS_ANIMATED,\n\tEACH_IS_CONTROLLED,\n\tEACH_ITEM_IMMUTABLE,\n\tEACH_ITEM_REACTIVE,\n\tHYDRATION_END,\n\tHYDRATION_START_ELSE\n} from '../../../../constants.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tread_hydration_instruction,\n\tremove_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tshould_defer_append\n} from '../operations.js';\nimport {\n\tblock,\n\tbranch,\n\tdestroy_effect,\n\trun_out_transitions,\n\tpause_children,\n\tpause_effect,\n\tresume_effect\n} from '../../reactivity/effects.js';\nimport { source, mutable_source, internal_set } from '../../reactivity/sources.js';\nimport { array_from, is_array } from '../../../shared/utils.js';\nimport { COMMENT_NODE, INERT } from '#client/constants';\nimport { queue_micro_task } from '../task.js';\nimport { active_effect, get } from '../../runtime.js';\nimport { DEV } from 'esm-env';\nimport { derived_safe_equal } from '../../reactivity/deriveds.js';\nimport { current_batch } from '../../reactivity/batch.js';\n\n/**\n * The row of a keyed each block that is currently updating. We track this\n * so that `animate:` directives have something to attach themselves to\n * @type {EachItem | null}\n */\nexport let current_each_item = null;\n\n/** @param {EachItem | null} item */\nexport function set_current_each_item(item) {\n\tcurrent_each_item = item;\n}\n\n/**\n * @param {any} _\n * @param {number} i\n */\nexport function index(_, i) {\n\treturn i;\n}\n\n/**\n * Pause multiple effects simultaneously, and coordinate their\n * subsequent destruction. Used in each blocks\n * @param {EachState} state\n * @param {EachItem[]} items\n * @param {null | Node} controlled_anchor\n */\nfunction pause_effects(state, items, controlled_anchor) {\n\tvar items_map = state.items;\n\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\tvar length = items.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tpause_children(items[i].e, transitions, true);\n\t}\n\n\tvar is_controlled = length > 0 && transitions.length === 0 && controlled_anchor !== null;\n\t// If we have a controlled anchor, it means that the each block is inside a single\n\t// DOM element, so we can apply a fast-path for clearing the contents of the element.\n\tif (is_controlled) {\n\t\tvar parent_node = /** @type {Element} */ (\n\t\t\t/** @type {Element} */ (controlled_anchor).parentNode\n\t\t);\n\t\tclear_text_content(parent_node);\n\t\tparent_node.append(/** @type {Element} */ (controlled_anchor));\n\t\titems_map.clear();\n\t\tlink(state, items[0].prev, items[length - 1].next);\n\t}\n\n\trun_out_transitions(transitions, () => {\n\t\tfor (var i = 0; i < length; i++) {\n\t\t\tvar item = items[i];\n\t\t\tif (!is_controlled) {\n\t\t\t\titems_map.delete(item.k);\n\t\t\t\tlink(state, item.prev, item.next);\n\t\t\t}\n\t\t\tdestroy_effect(item.e, !is_controlled);\n\t\t}\n\t});\n}\n\n/**\n * @template V\n * @param {Element | Comment} node The next sibling node, or the parent node if this is a 'controlled' block\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @param {(value: V, index: number) => any} get_key\n * @param {(anchor: Node, item: MaybeSource<V>, index: MaybeSource<number>) => void} render_fn\n * @param {null | ((anchor: Node) => void)} fallback_fn\n * @returns {void}\n */\nexport function each(node, flags, get_collection, get_key, render_fn, fallback_fn = null) {\n\tvar anchor = node;\n\n\t/** @type {EachState} */\n\tvar state = { flags, items: new Map(), first: null };\n\n\tvar is_controlled = (flags & EACH_IS_CONTROLLED) !== 0;\n\n\tif (is_controlled) {\n\t\tvar parent_node = /** @type {Element} */ (node);\n\n\t\tanchor = hydrating\n\t\t\t? set_hydrate_node(/** @type {Comment | Text} */ (get_first_child(parent_node)))\n\t\t\t: parent_node.appendChild(create_text());\n\t}\n\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\t/** @type {Effect | null} */\n\tvar fallback = null;\n\n\tvar was_empty = false;\n\n\t/** @type {Map<any, EachItem>} */\n\tvar offscreen_items = new Map();\n\n\t// TODO: ideally we could use derived for runes mode but because of the ability\n\t// to use a store which can be mutated, we can't do that here as mutating a store\n\t// will still result in the collection array being the same from the store\n\tvar each_array = derived_safe_equal(() => {\n\t\tvar collection = get_collection();\n\n\t\treturn is_array(collection) ? collection : collection == null ? [] : array_from(collection);\n\t});\n\n\t/** @type {V[]} */\n\tvar array;\n\n\t/** @type {Effect} */\n\tvar each_effect;\n\n\tfunction commit() {\n\t\treconcile(\n\t\t\teach_effect,\n\t\t\tarray,\n\t\t\tstate,\n\t\t\toffscreen_items,\n\t\t\tanchor,\n\t\t\trender_fn,\n\t\t\tflags,\n\t\t\tget_key,\n\t\t\tget_collection\n\t\t);\n\n\t\tif (fallback_fn !== null) {\n\t\t\tif (array.length === 0) {\n\t\t\t\tif (fallback) {\n\t\t\t\t\tresume_effect(fallback);\n\t\t\t\t} else {\n\t\t\t\t\tfallback = branch(() => fallback_fn(anchor));\n\t\t\t\t}\n\t\t\t} else if (fallback !== null) {\n\t\t\t\tpause_effect(fallback, () => {\n\t\t\t\t\tfallback = null;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tblock(() => {\n\t\t// store a reference to the effect so that we can update the start/end nodes in reconciliation\n\t\teach_effect ??= /** @type {Effect} */ (active_effect);\n\n\t\tarray = /** @type {V[]} */ (get(each_array));\n\t\tvar length = array.length;\n\n\t\tif (was_empty && length === 0) {\n\t\t\t// ignore updates if the array is empty,\n\t\t\t// and it already was empty on previous run\n\t\t\treturn;\n\t\t}\n\t\twas_empty = length === 0;\n\n\t\t/** `true` if there was a hydration mismatch. Needs to be a `let` or else it isn't treeshaken out */\n\t\tlet mismatch = false;\n\n\t\tif (hydrating) {\n\t\t\tvar is_else = read_hydration_instruction(anchor) === HYDRATION_START_ELSE;\n\n\t\t\tif (is_else !== (length === 0)) {\n\t\t\t\t// hydration mismatch — remove the server-rendered DOM and start over\n\t\t\t\tanchor = remove_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tset_hydrating(false);\n\t\t\t\tmismatch = true;\n\t\t\t}\n\t\t}\n\n\t\t// this is separate to the previous block because `hydrating` might change\n\t\tif (hydrating) {\n\t\t\t/** @type {EachItem | null} */\n\t\t\tvar prev = null;\n\n\t\t\t/** @type {EachItem} */\n\t\t\tvar item;\n\n\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\tif (\n\t\t\t\t\thydrate_node.nodeType === COMMENT_NODE &&\n\t\t\t\t\t/** @type {Comment} */ (hydrate_node).data === HYDRATION_END\n\t\t\t\t) {\n\t\t\t\t\t// The server rendered fewer items than expected,\n\t\t\t\t\t// so break out and continue appending non-hydrated items\n\t\t\t\t\tanchor = /** @type {Comment} */ (hydrate_node);\n\t\t\t\t\tmismatch = true;\n\t\t\t\t\tset_hydrating(false);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tvar value = array[i];\n\t\t\t\tvar key = get_key(value, i);\n\t\t\t\titem = create_item(\n\t\t\t\t\thydrate_node,\n\t\t\t\t\tstate,\n\t\t\t\t\tprev,\n\t\t\t\t\tnull,\n\t\t\t\t\tvalue,\n\t\t\t\t\tkey,\n\t\t\t\t\ti,\n\t\t\t\t\trender_fn,\n\t\t\t\t\tflags,\n\t\t\t\t\tget_collection\n\t\t\t\t);\n\t\t\t\tstate.items.set(key, item);\n\n\t\t\t\tprev = item;\n\t\t\t}\n\n\t\t\t// remove excess nodes\n\t\t\tif (length > 0) {\n\t\t\t\tset_hydrate_node(remove_nodes());\n\t\t\t}\n\t\t}\n\n\t\tif (hydrating) {\n\t\t\tif (length === 0 && fallback_fn) {\n\t\t\t\tfallback = branch(() => fallback_fn(anchor));\n\t\t\t}\n\t\t} else {\n\t\t\tif (should_defer_append()) {\n\t\t\t\tvar keys = new Set();\n\t\t\t\tvar batch = /** @type {Batch} */ (current_batch);\n\n\t\t\t\tfor (i = 0; i < length; i += 1) {\n\t\t\t\t\tvalue = array[i];\n\t\t\t\t\tkey = get_key(value, i);\n\n\t\t\t\t\tvar existing = state.items.get(key) ?? offscreen_items.get(key);\n\n\t\t\t\t\tif (existing) {\n\t\t\t\t\t\t// update before reconciliation, to trigger any async updates\n\t\t\t\t\t\tif ((flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0) {\n\t\t\t\t\t\t\tupdate_item(existing, value, i, flags);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\titem = create_item(\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\trender_fn,\n\t\t\t\t\t\t\tflags,\n\t\t\t\t\t\t\tget_collection,\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\toffscreen_items.set(key, item);\n\t\t\t\t\t}\n\n\t\t\t\t\tkeys.add(key);\n\t\t\t\t}\n\n\t\t\t\tfor (const [key, item] of state.items) {\n\t\t\t\t\tif (!keys.has(key)) {\n\t\t\t\t\t\tbatch.skipped_effects.add(item.e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbatch.add_callback(commit);\n\t\t\t} else {\n\t\t\t\tcommit();\n\t\t\t}\n\t\t}\n\n\t\tif (mismatch) {\n\t\t\t// continue in hydration mode\n\t\t\tset_hydrating(true);\n\t\t}\n\n\t\t// When we mount the each block for the first time, the collection won't be\n\t\t// connected to this effect as the effect hasn't finished running yet and its deps\n\t\t// won't be assigned. However, it's possible that when reconciling the each block\n\t\t// that a mutation occurred and it's made the collection MAYBE_DIRTY, so reading the\n\t\t// collection again can provide consistency to the reactive graph again as the deriveds\n\t\t// will now be `CLEAN`.\n\t\tget(each_array);\n\t});\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n\n/**\n * Add, remove, or reorder items output by an each block as its input changes\n * @template V\n * @param {Effect} each_effect\n * @param {Array<V>} array\n * @param {EachState} state\n * @param {Map<any, EachItem>} offscreen_items\n * @param {Element | Comment | Text} anchor\n * @param {(anchor: Node, item: MaybeSource<V>, index: number | Source<number>, collection: () => V[]) => void} render_fn\n * @param {number} flags\n * @param {(value: V, index: number) => any} get_key\n * @param {() => V[]} get_collection\n * @returns {void}\n */\nfunction reconcile(\n\teach_effect,\n\tarray,\n\tstate,\n\toffscreen_items,\n\tanchor,\n\trender_fn,\n\tflags,\n\tget_key,\n\tget_collection\n) {\n\tvar is_animated = (flags & EACH_IS_ANIMATED) !== 0;\n\tvar should_update = (flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0;\n\n\tvar length = array.length;\n\tvar items = state.items;\n\tvar first = state.first;\n\tvar current = first;\n\n\t/** @type {undefined | Set<EachItem>} */\n\tvar seen;\n\n\t/** @type {EachItem | null} */\n\tvar prev = null;\n\n\t/** @type {undefined | Set<EachItem>} */\n\tvar to_animate;\n\n\t/** @type {EachItem[]} */\n\tvar matched = [];\n\n\t/** @type {EachItem[]} */\n\tvar stashed = [];\n\n\t/** @type {V} */\n\tvar value;\n\n\t/** @type {any} */\n\tvar key;\n\n\t/** @type {EachItem | undefined} */\n\tvar item;\n\n\t/** @type {number} */\n\tvar i;\n\n\tif (is_animated) {\n\t\tfor (i = 0; i < length; i += 1) {\n\t\t\tvalue = array[i];\n\t\t\tkey = get_key(value, i);\n\t\t\titem = items.get(key);\n\n\t\t\tif (item !== undefined) {\n\t\t\t\titem.a?.measure();\n\t\t\t\t(to_animate ??= new Set()).add(item);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (i = 0; i < length; i += 1) {\n\t\tvalue = array[i];\n\t\tkey = get_key(value, i);\n\n\t\titem = items.get(key);\n\n\t\tif (item === undefined) {\n\t\t\tvar pending = offscreen_items.get(key);\n\n\t\t\tif (pending !== undefined) {\n\t\t\t\toffscreen_items.delete(key);\n\t\t\t\titems.set(key, pending);\n\n\t\t\t\tvar next = prev ? prev.next : current;\n\n\t\t\t\tlink(state, prev, pending);\n\t\t\t\tlink(state, pending, next);\n\n\t\t\t\tmove(pending, next, anchor);\n\t\t\t\tprev = pending;\n\t\t\t} else {\n\t\t\t\tvar child_anchor = current ? /** @type {TemplateNode} */ (current.e.nodes_start) : anchor;\n\n\t\t\t\tprev = create_item(\n\t\t\t\t\tchild_anchor,\n\t\t\t\t\tstate,\n\t\t\t\t\tprev,\n\t\t\t\t\tprev === null ? state.first : prev.next,\n\t\t\t\t\tvalue,\n\t\t\t\t\tkey,\n\t\t\t\t\ti,\n\t\t\t\t\trender_fn,\n\t\t\t\t\tflags,\n\t\t\t\t\tget_collection\n\t\t\t\t);\n\t\t\t}\n\n\t\t\titems.set(key, prev);\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\tcurrent = prev.next;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (should_update) {\n\t\t\tupdate_item(item, value, i, flags);\n\t\t}\n\n\t\tif ((item.e.f & INERT) !== 0) {\n\t\t\tresume_effect(item.e);\n\t\t\tif (is_animated) {\n\t\t\t\titem.a?.unfix();\n\t\t\t\t(to_animate ??= new Set()).delete(item);\n\t\t\t}\n\t\t}\n\n\t\tif (item !== current) {\n\t\t\tif (seen !== undefined && seen.has(item)) {\n\t\t\t\tif (matched.length < stashed.length) {\n\t\t\t\t\t// more efficient to move later items to the front\n\t\t\t\t\tvar start = stashed[0];\n\t\t\t\t\tvar j;\n\n\t\t\t\t\tprev = start.prev;\n\n\t\t\t\t\tvar a = matched[0];\n\t\t\t\t\tvar b = matched[matched.length - 1];\n\n\t\t\t\t\tfor (j = 0; j < matched.length; j += 1) {\n\t\t\t\t\t\tmove(matched[j], start, anchor);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (j = 0; j < stashed.length; j += 1) {\n\t\t\t\t\t\tseen.delete(stashed[j]);\n\t\t\t\t\t}\n\n\t\t\t\t\tlink(state, a.prev, b.next);\n\t\t\t\t\tlink(state, prev, a);\n\t\t\t\t\tlink(state, b, start);\n\n\t\t\t\t\tcurrent = start;\n\t\t\t\t\tprev = b;\n\t\t\t\t\ti -= 1;\n\n\t\t\t\t\tmatched = [];\n\t\t\t\t\tstashed = [];\n\t\t\t\t} else {\n\t\t\t\t\t// more efficient to move earlier items to the back\n\t\t\t\t\tseen.delete(item);\n\t\t\t\t\tmove(item, current, anchor);\n\n\t\t\t\t\tlink(state, item.prev, item.next);\n\t\t\t\t\tlink(state, item, prev === null ? state.first : prev.next);\n\t\t\t\t\tlink(state, prev, item);\n\n\t\t\t\t\tprev = item;\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\twhile (current !== null && current.k !== key) {\n\t\t\t\t// If the each block isn't inert and an item has an effect that is already inert,\n\t\t\t\t// skip over adding it to our seen Set as the item is already being handled\n\t\t\t\tif ((current.e.f & INERT) === 0) {\n\t\t\t\t\t(seen ??= new Set()).add(current);\n\t\t\t\t}\n\t\t\t\tstashed.push(current);\n\t\t\t\tcurrent = current.next;\n\t\t\t}\n\n\t\t\tif (current === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\titem = current;\n\t\t}\n\n\t\tmatched.push(item);\n\t\tprev = item;\n\t\tcurrent = item.next;\n\t}\n\n\tif (current !== null || seen !== undefined) {\n\t\tvar to_destroy = seen === undefined ? [] : array_from(seen);\n\n\t\twhile (current !== null) {\n\t\t\t// If the each block isn't inert, then inert effects are currently outroing and will be removed once the transition is finished\n\t\t\tif ((current.e.f & INERT) === 0) {\n\t\t\t\tto_destroy.push(current);\n\t\t\t}\n\t\t\tcurrent = current.next;\n\t\t}\n\n\t\tvar destroy_length = to_destroy.length;\n\n\t\tif (destroy_length > 0) {\n\t\t\tvar controlled_anchor = (flags & EACH_IS_CONTROLLED) !== 0 && length === 0 ? anchor : null;\n\n\t\t\tif (is_animated) {\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].a?.measure();\n\t\t\t\t}\n\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].a?.fix();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpause_effects(state, to_destroy, controlled_anchor);\n\t\t}\n\t}\n\n\tif (is_animated) {\n\t\tqueue_micro_task(() => {\n\t\t\tif (to_animate === undefined) return;\n\t\t\tfor (item of to_animate) {\n\t\t\t\titem.a?.apply();\n\t\t\t}\n\t\t});\n\t}\n\n\teach_effect.first = state.first && state.first.e;\n\teach_effect.last = prev && prev.e;\n\n\tfor (var unused of offscreen_items.values()) {\n\t\tdestroy_effect(unused.e);\n\t}\n\n\toffscreen_items.clear();\n}\n\n/**\n * @param {EachItem} item\n * @param {any} value\n * @param {number} index\n * @param {number} type\n * @returns {void}\n */\nfunction update_item(item, value, index, type) {\n\tif ((type & EACH_ITEM_REACTIVE) !== 0) {\n\t\tinternal_set(item.v, value);\n\t}\n\n\tif ((type & EACH_INDEX_REACTIVE) !== 0) {\n\t\tinternal_set(/** @type {Value<number>} */ (item.i), index);\n\t} else {\n\t\titem.i = index;\n\t}\n}\n\n/**\n * @template V\n * @param {Node | null} anchor\n * @param {EachState} state\n * @param {EachItem | null} prev\n * @param {EachItem | null} next\n * @param {V} value\n * @param {unknown} key\n * @param {number} index\n * @param {(anchor: Node, item: V | Source<V>, index: number | Value<number>, collection: () => V[]) => void} render_fn\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @param {boolean} [deferred]\n * @returns {EachItem}\n */\nfunction create_item(\n\tanchor,\n\tstate,\n\tprev,\n\tnext,\n\tvalue,\n\tkey,\n\tindex,\n\trender_fn,\n\tflags,\n\tget_collection,\n\tdeferred\n) {\n\tvar previous_each_item = current_each_item;\n\tvar reactive = (flags & EACH_ITEM_REACTIVE) !== 0;\n\tvar mutable = (flags & EACH_ITEM_IMMUTABLE) === 0;\n\n\tvar v = reactive ? (mutable ? mutable_source(value, false, false) : source(value)) : value;\n\tvar i = (flags & EACH_INDEX_REACTIVE) === 0 ? index : source(index);\n\n\tif (DEV && reactive) {\n\t\t// For tracing purposes, we need to link the source signal we create with the\n\t\t// collection + index so that tracing works as intended\n\t\t/** @type {Value} */ (v).trace = () => {\n\t\t\tvar collection_index = typeof i === 'number' ? index : i.v;\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-expressions\n\t\t\tget_collection()[collection_index];\n\t\t};\n\t}\n\n\t/** @type {EachItem} */\n\tvar item = {\n\t\ti,\n\t\tv,\n\t\tk: key,\n\t\ta: null,\n\t\t// @ts-expect-error\n\t\te: null,\n\t\tprev,\n\t\tnext\n\t};\n\n\tcurrent_each_item = item;\n\n\ttry {\n\t\tif (anchor === null) {\n\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\tfragment.append((anchor = create_text()));\n\t\t}\n\n\t\titem.e = branch(() => render_fn(/** @type {Node} */ (anchor), v, i, get_collection), hydrating);\n\n\t\titem.e.prev = prev && prev.e;\n\t\titem.e.next = next && next.e;\n\n\t\tif (prev === null) {\n\t\t\tif (!deferred) {\n\t\t\t\tstate.first = item;\n\t\t\t}\n\t\t} else {\n\t\t\tprev.next = item;\n\t\t\tprev.e.next = item.e;\n\t\t}\n\n\t\tif (next !== null) {\n\t\t\tnext.prev = item;\n\t\t\tnext.e.prev = item.e;\n\t\t}\n\n\t\treturn item;\n\t} finally {\n\t\tcurrent_each_item = previous_each_item;\n\t}\n}\n\n/**\n * @param {EachItem} item\n * @param {EachItem | null} next\n * @param {Text | Element | Comment} anchor\n */\nfunction move(item, next, anchor) {\n\tvar end = item.next ? /** @type {TemplateNode} */ (item.next.e.nodes_start) : anchor;\n\n\tvar dest = next ? /** @type {TemplateNode} */ (next.e.nodes_start) : anchor;\n\tvar node = /** @type {TemplateNode} */ (item.e.nodes_start);\n\n\twhile (node !== null && node !== end) {\n\t\tvar next_node = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tdest.before(node);\n\t\tnode = next_node;\n\t}\n}\n\n/**\n * @param {EachState} state\n * @param {EachItem | null} prev\n * @param {EachItem | null} next\n */\nfunction link(state, prev, next) {\n\tif (prev === null) {\n\t\tstate.first = next;\n\t} else {\n\t\tprev.next = next;\n\t\tprev.e.next = next && next.e;\n\t}\n\n\tif (next !== null) {\n\t\tnext.prev = prev;\n\t\tnext.e.prev = prev && prev.e;\n\t}\n}\n","/** @import { Snippet } from 'svelte' */\n/** @import { Effect, TemplateNode } from '#client' */\n/** @import { Getters } from '#shared' */\nimport { EFFECT_TRANSPARENT, ELEMENT_NODE } from '#client/constants';\nimport { branch, block, destroy_effect, teardown } from '../../reactivity/effects.js';\nimport {\n\tdev_current_component_function,\n\tset_dev_current_component_function\n} from '../../context.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\nimport { create_fragment_from_html } from '../reconciler.js';\nimport { assign_nodes } from '../template.js';\nimport * as w from '../../warnings.js';\nimport * as e from '../../errors.js';\nimport { DEV } from 'esm-env';\nimport { get_first_child, get_next_sibling } from '../operations.js';\nimport { noop } from '../../../shared/utils.js';\nimport { prevent_snippet_stringification } from '../../../shared/validate.js';\n\n/**\n * @template {(node: TemplateNode, ...args: any[]) => void} SnippetFn\n * @param {TemplateNode} node\n * @param {() => SnippetFn | null | undefined} get_snippet\n * @param {(() => any)[]} args\n * @returns {void}\n */\nexport function snippet(node, get_snippet, ...args) {\n\tvar anchor = node;\n\n\t/** @type {SnippetFn | null | undefined} */\n\t// @ts-ignore\n\tvar snippet = noop;\n\n\t/** @type {Effect | null} */\n\tvar snippet_effect;\n\n\tblock(() => {\n\t\tif (snippet === (snippet = get_snippet())) return;\n\n\t\tif (snippet_effect) {\n\t\t\tdestroy_effect(snippet_effect);\n\t\t\tsnippet_effect = null;\n\t\t}\n\n\t\tif (DEV && snippet == null) {\n\t\t\te.invalid_snippet();\n\t\t}\n\n\t\tsnippet_effect = branch(() => /** @type {SnippetFn} */ (snippet)(anchor, ...args));\n\t}, EFFECT_TRANSPARENT);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n\n/**\n * In development, wrap the snippet function so that it passes validation, and so that the\n * correct component context is set for ownership checks\n * @param {any} component\n * @param {(node: TemplateNode, ...args: any[]) => void} fn\n */\nexport function wrap_snippet(component, fn) {\n\tconst snippet = (/** @type {TemplateNode} */ node, /** @type {any[]} */ ...args) => {\n\t\tvar previous_component_function = dev_current_component_function;\n\t\tset_dev_current_component_function(component);\n\n\t\ttry {\n\t\t\treturn fn(node, ...args);\n\t\t} finally {\n\t\t\tset_dev_current_component_function(previous_component_function);\n\t\t}\n\t};\n\n\tprevent_snippet_stringification(snippet);\n\n\treturn snippet;\n}\n\n/**\n * Create a snippet programmatically\n * @template {unknown[]} Params\n * @param {(...params: Getters<Params>) => {\n * render: () => string\n * setup?: (element: Element) => void | (() => void)\n * }} fn\n * @returns {Snippet<Params>}\n */\nexport function createRawSnippet(fn) {\n\t// @ts-expect-error the types are a lie\n\treturn (/** @type {TemplateNode} */ anchor, /** @type {Getters<Params>} */ ...params) => {\n\t\tvar snippet = fn(...params);\n\n\t\t/** @type {Element} */\n\t\tvar element;\n\n\t\tif (hydrating) {\n\t\t\telement = /** @type {Element} */ (hydrate_node);\n\t\t\thydrate_next();\n\t\t} else {\n\t\t\tvar html = snippet.render().trim();\n\t\t\tvar fragment = create_fragment_from_html(html);\n\t\t\telement = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (DEV && (get_next_sibling(element) !== null || element.nodeType !== ELEMENT_NODE)) {\n\t\t\t\tw.invalid_raw_snippet_render();\n\t\t\t}\n\n\t\t\tanchor.before(element);\n\t\t}\n\n\t\tconst result = snippet.setup?.(element);\n\t\tassign_nodes(element, element);\n\n\t\tif (typeof result === 'function') {\n\t\t\tteardown(result);\n\t\t}\n\t};\n}\n","/** @import { TemplateNode, Dom, Effect } from '#client' */\n/** @import { Batch } from '../../reactivity/batch.js'; */\nimport { EFFECT_TRANSPARENT } from '#client/constants';\nimport { block, branch, pause_effect } from '../../reactivity/effects.js';\nimport { current_batch } from '../../reactivity/batch.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\nimport { create_text, should_defer_append } from '../operations.js';\n\n/**\n * @template P\n * @template {(props: P) => void} C\n * @param {TemplateNode} node\n * @param {() => C} get_component\n * @param {(anchor: TemplateNode, component: C) => Dom | void} render_fn\n * @returns {void}\n */\nexport function component(node, get_component, render_fn) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar anchor = node;\n\n\t/** @type {C} */\n\tvar component;\n\n\t/** @type {Effect | null} */\n\tvar effect;\n\n\t/** @type {DocumentFragment | null} */\n\tvar offscreen_fragment = null;\n\n\t/** @type {Effect | null} */\n\tvar pending_effect = null;\n\n\tfunction commit() {\n\t\tif (effect) {\n\t\t\tpause_effect(effect);\n\t\t\teffect = null;\n\t\t}\n\n\t\tif (offscreen_fragment) {\n\t\t\t// remove the anchor\n\t\t\t/** @type {Text} */ (offscreen_fragment.lastChild).remove();\n\n\t\t\tanchor.before(offscreen_fragment);\n\t\t\toffscreen_fragment = null;\n\t\t}\n\n\t\teffect = pending_effect;\n\t\tpending_effect = null;\n\t}\n\n\tblock(() => {\n\t\tif (component === (component = get_component())) return;\n\n\t\tvar defer = should_defer_append();\n\n\t\tif (component) {\n\t\t\tvar target = anchor;\n\n\t\t\tif (defer) {\n\t\t\t\toffscreen_fragment = document.createDocumentFragment();\n\t\t\t\toffscreen_fragment.append((target = create_text()));\n\t\t\t\tif (effect) {\n\t\t\t\t\t/** @type {Batch} */ (current_batch).skipped_effects.add(effect);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpending_effect = branch(() => render_fn(target, component));\n\t\t}\n\n\t\tif (defer) {\n\t\t\t/** @type {Batch} */ (current_batch).add_callback(commit);\n\t\t} else {\n\t\t\tcommit();\n\t\t}\n\t}, EFFECT_TRANSPARENT);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n","/** @import { ActionPayload } from '#client' */\nimport { effect, render_effect } from '../../reactivity/effects.js';\nimport { safe_not_equal } from '../../reactivity/equality.js';\nimport { deep_read_state, untrack } from '../../runtime.js';\n\n/**\n * @template P\n * @param {Element} dom\n * @param {(dom: Element, value?: P) => ActionPayload<P>} action\n * @param {() => P} [get_value]\n * @returns {void}\n */\nexport function action(dom, action, get_value) {\n\teffect(() => {\n\t\tvar payload = untrack(() => action(dom, get_value?.()) || {});\n\n\t\tif (get_value && payload?.update) {\n\t\t\tvar inited = false;\n\t\t\t/** @type {P} */\n\t\t\tvar prev = /** @type {any} */ ({}); // initialize with something so it's never equal on first run\n\n\t\t\trender_effect(() => {\n\t\t\t\tvar value = get_value();\n\n\t\t\t\t// Action's update method is coarse-grained, i.e. when anything in the passed value changes, update.\n\t\t\t\t// This works in legacy mode because of mutable_source being updated as a whole, but when using $state\n\t\t\t\t// together with actions and mutation, it wouldn't notice the change without a deep read.\n\t\t\t\tdeep_read_state(value);\n\n\t\t\t\tif (inited && safe_not_equal(prev, value)) {\n\t\t\t\t\tprev = value;\n\t\t\t\t\t/** @type {Function} */ (payload.update)(value);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tinited = true;\n\t\t}\n\n\t\tif (payload?.destroy) {\n\t\t\treturn () => /** @type {Function} */ (payload.destroy)();\n\t\t}\n\t});\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import { escape_html } from '../../escaping.js';\nimport { clsx as _clsx } from 'clsx';\n\n/**\n * `<div translate={false}>` should be rendered as `<div translate=\"no\">` and _not_\n * `<div translate=\"false\">`, which is equivalent to `<div translate=\"yes\">`. There\n * may be other odd cases that need to be added to this list in future\n * @type {Record<string, Map<any, string>>}\n */\nconst replacements = {\n\ttranslate: new Map([\n\t\t[true, 'yes'],\n\t\t[false, 'no']\n\t])\n};\n\n/**\n * @template V\n * @param {string} name\n * @param {V} value\n * @param {boolean} [is_boolean]\n * @returns {string}\n */\nexport function attr(name, value, is_boolean = false) {\n\tif (value == null || (!value && is_boolean)) return '';\n\tconst normalized = (name in replacements && replacements[name].get(value)) || value;\n\tconst assignment = is_boolean ? '' : `=\"${escape_html(normalized, true)}\"`;\n\treturn ` ${name}${assignment}`;\n}\n\n/**\n * Small wrapper around clsx to preserve Svelte's (weird) handling of falsy values.\n * TODO Svelte 6 revisit this, and likely turn all falsy values into the empty string (what clsx also does)\n * @param {any} value\n */\nexport function clsx(value) {\n\tif (typeof value === 'object') {\n\t\treturn _clsx(value);\n\t} else {\n\t\treturn value ?? '';\n\t}\n}\n\nconst whitespace = [...' \\t\\n\\r\\f\\u00a0\\u000b\\ufeff'];\n\n/**\n * @param {any} value\n * @param {string | null} [hash]\n * @param {Record<string, boolean>} [directives]\n * @returns {string | null}\n */\nexport function to_class(value, hash, directives) {\n\tvar classname = value == null ? '' : '' + value;\n\n\tif (hash) {\n\t\tclassname = classname ? classname + ' ' + hash : hash;\n\t}\n\n\tif (directives) {\n\t\tfor (var key in directives) {\n\t\t\tif (directives[key]) {\n\t\t\t\tclassname = classname ? classname + ' ' + key : key;\n\t\t\t} else if (classname.length) {\n\t\t\t\tvar len = key.length;\n\t\t\t\tvar a = 0;\n\n\t\t\t\twhile ((a = classname.indexOf(key, a)) >= 0) {\n\t\t\t\t\tvar b = a + len;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(a === 0 || whitespace.includes(classname[a - 1])) &&\n\t\t\t\t\t\t(b === classname.length || whitespace.includes(classname[b]))\n\t\t\t\t\t) {\n\t\t\t\t\t\tclassname = (a === 0 ? '' : classname.substring(0, a)) + classname.substring(b + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ta = b;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn classname === '' ? null : classname;\n}\n\n/**\n *\n * @param {Record<string,any>} styles\n * @param {boolean} important\n */\nfunction append_styles(styles, important = false) {\n\tvar separator = important ? ' !important;' : ';';\n\tvar css = '';\n\n\tfor (var key in styles) {\n\t\tvar value = styles[key];\n\t\tif (value != null && value !== '') {\n\t\t\tcss += ' ' + key + ': ' + value + separator;\n\t\t}\n\t}\n\n\treturn css;\n}\n\n/**\n * @param {string} name\n * @returns {string}\n */\nfunction to_css_name(name) {\n\tif (name[0] !== '-' || name[1] !== '-') {\n\t\treturn name.toLowerCase();\n\t}\n\treturn name;\n}\n\n/**\n * @param {any} value\n * @param {Record<string, any> | [Record<string, any>, Record<string, any>]} [styles]\n * @returns {string | null}\n */\nexport function to_style(value, styles) {\n\tif (styles) {\n\t\tvar new_style = '';\n\n\t\t/** @type {Record<string,any> | undefined} */\n\t\tvar normal_styles;\n\n\t\t/** @type {Record<string,any> | undefined} */\n\t\tvar important_styles;\n\n\t\tif (Array.isArray(styles)) {\n\t\t\tnormal_styles = styles[0];\n\t\t\timportant_styles = styles[1];\n\t\t} else {\n\t\t\tnormal_styles = styles;\n\t\t}\n\n\t\tif (value) {\n\t\t\tvalue = String(value)\n\t\t\t\t.replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g, '')\n\t\t\t\t.trim();\n\n\t\t\t/** @type {boolean | '\"' | \"'\"} */\n\t\t\tvar in_str = false;\n\t\t\tvar in_apo = 0;\n\t\t\tvar in_comment = false;\n\n\t\t\tvar reserved_names = [];\n\n\t\t\tif (normal_styles) {\n\t\t\t\treserved_names.push(...Object.keys(normal_styles).map(to_css_name));\n\t\t\t}\n\t\t\tif (important_styles) {\n\t\t\t\treserved_names.push(...Object.keys(important_styles).map(to_css_name));\n\t\t\t}\n\n\t\t\tvar start_index = 0;\n\t\t\tvar name_index = -1;\n\n\t\t\tconst len = value.length;\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\tvar c = value[i];\n\n\t\t\t\tif (in_comment) {\n\t\t\t\t\tif (c === '/' && value[i - 1] === '*') {\n\t\t\t\t\t\tin_comment = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (in_str) {\n\t\t\t\t\tif (in_str === c) {\n\t\t\t\t\t\tin_str = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (c === '/' && value[i + 1] === '*') {\n\t\t\t\t\tin_comment = true;\n\t\t\t\t} else if (c === '\"' || c === \"'\") {\n\t\t\t\t\tin_str = c;\n\t\t\t\t} else if (c === '(') {\n\t\t\t\t\tin_apo++;\n\t\t\t\t} else if (c === ')') {\n\t\t\t\t\tin_apo--;\n\t\t\t\t}\n\n\t\t\t\tif (!in_comment && in_str === false && in_apo === 0) {\n\t\t\t\t\tif (c === ':' && name_index === -1) {\n\t\t\t\t\t\tname_index = i;\n\t\t\t\t\t} else if (c === ';' || i === len - 1) {\n\t\t\t\t\t\tif (name_index !== -1) {\n\t\t\t\t\t\t\tvar name = to_css_name(value.substring(start_index, name_index).trim());\n\n\t\t\t\t\t\t\tif (!reserved_names.includes(name)) {\n\t\t\t\t\t\t\t\tif (c !== ';') {\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar property = value.substring(start_index, i).trim();\n\t\t\t\t\t\t\t\tnew_style += ' ' + property + ';';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart_index = i + 1;\n\t\t\t\t\t\tname_index = -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (normal_styles) {\n\t\t\tnew_style += append_styles(normal_styles);\n\t\t}\n\n\t\tif (important_styles) {\n\t\t\tnew_style += append_styles(important_styles, true);\n\t\t}\n\n\t\tnew_style = new_style.trim();\n\t\treturn new_style === '' ? null : new_style;\n\t}\n\n\treturn value == null ? null : String(value);\n}\n","import { to_class } from '../../../shared/attributes.js';\nimport { hydrating } from '../hydration.js';\n\n/**\n * @param {Element} dom\n * @param {boolean | number} is_html\n * @param {string | null} value\n * @param {string} [hash]\n * @param {Record<string, any>} [prev_classes]\n * @param {Record<string, any>} [next_classes]\n * @returns {Record<string, boolean> | undefined}\n */\nexport function set_class(dom, is_html, value, hash, prev_classes, next_classes) {\n\t// @ts-expect-error need to add __className to patched prototype\n\tvar prev = dom.__className;\n\n\tif (\n\t\thydrating ||\n\t\tprev !== value ||\n\t\tprev === undefined // for edge case of `class={undefined}`\n\t) {\n\t\tvar next_class_name = to_class(value, hash, next_classes);\n\n\t\tif (!hydrating || next_class_name !== dom.getAttribute('class')) {\n\t\t\t// Removing the attribute when the value is only an empty string causes\n\t\t\t// performance issues vs simply making the className an empty string. So\n\t\t\t// we should only remove the class if the value is nullish\n\t\t\t// and there no hash/directives :\n\t\t\tif (next_class_name == null) {\n\t\t\t\tdom.removeAttribute('class');\n\t\t\t} else if (is_html) {\n\t\t\t\tdom.className = next_class_name;\n\t\t\t} else {\n\t\t\t\tdom.setAttribute('class', next_class_name);\n\t\t\t}\n\t\t}\n\n\t\t// @ts-expect-error need to add __className to patched prototype\n\t\tdom.__className = value;\n\t} else if (next_classes && prev_classes !== next_classes) {\n\t\tfor (var key in next_classes) {\n\t\t\tvar is_present = !!next_classes[key];\n\n\t\t\tif (prev_classes == null || is_present !== !!prev_classes[key]) {\n\t\t\t\tdom.classList.toggle(key, is_present);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn next_classes;\n}\n","import { to_style } from '../../../shared/attributes.js';\nimport { hydrating } from '../hydration.js';\n\n/**\n * @param {Element & ElementCSSInlineStyle} dom\n * @param {Record<string, any>} prev\n * @param {Record<string, any>} next\n * @param {string} [priority]\n */\nfunction update_styles(dom, prev = {}, next, priority) {\n\tfor (var key in next) {\n\t\tvar value = next[key];\n\n\t\tif (prev[key] !== value) {\n\t\t\tif (next[key] == null) {\n\t\t\t\tdom.style.removeProperty(key);\n\t\t\t} else {\n\t\t\t\tdom.style.setProperty(key, value, priority);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} dom\n * @param {string | null} value\n * @param {Record<string, any> | [Record<string, any>, Record<string, any>]} [prev_styles]\n * @param {Record<string, any> | [Record<string, any>, Record<string, any>]} [next_styles]\n */\nexport function set_style(dom, value, prev_styles, next_styles) {\n\t// @ts-expect-error\n\tvar prev = dom.__style;\n\n\tif (hydrating || prev !== value) {\n\t\tvar next_style_attr = to_style(value, next_styles);\n\n\t\tif (!hydrating || next_style_attr !== dom.getAttribute('style')) {\n\t\t\tif (next_style_attr == null) {\n\t\t\t\tdom.removeAttribute('style');\n\t\t\t} else {\n\t\t\t\tdom.style.cssText = next_style_attr;\n\t\t\t}\n\t\t}\n\n\t\t// @ts-expect-error\n\t\tdom.__style = value;\n\t} else if (next_styles) {\n\t\tif (Array.isArray(next_styles)) {\n\t\t\tupdate_styles(dom, prev_styles?.[0], next_styles[0]);\n\t\t\tupdate_styles(dom, prev_styles?.[1], next_styles[1], 'important');\n\t\t} else {\n\t\t\tupdate_styles(dom, prev_styles, next_styles);\n\t\t}\n\t}\n\n\treturn next_styles;\n}\n","/** @import { Effect } from '#client' */\nimport { DEV } from 'esm-env';\nimport { hydrating, set_hydrating } from '../hydration.js';\nimport { get_descriptors, get_prototype_of } from '../../../shared/utils.js';\nimport { create_event, delegate } from './events.js';\nimport { add_form_reset_listener, autofocus } from './misc.js';\nimport * as w from '../../warnings.js';\nimport { LOADING_ATTR_SYMBOL } from '#client/constants';\nimport { queue_idle_task } from '../task.js';\nimport { is_capture_event, is_delegated, normalize_attribute } from '../../../../utils.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tget,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { attach } from './attachments.js';\nimport { clsx } from '../../../shared/attributes.js';\nimport { set_class } from './class.js';\nimport { set_style } from './style.js';\nimport { ATTACHMENT_KEY, NAMESPACE_HTML, UNINITIALIZED } from '../../../../constants.js';\nimport { block, branch, destroy_effect, effect } from '../../reactivity/effects.js';\nimport { init_select, select_option } from './bindings/select.js';\nimport { flatten } from '../../reactivity/async.js';\n\nexport const CLASS = Symbol('class');\nexport const STYLE = Symbol('style');\n\nconst IS_CUSTOM_ELEMENT = Symbol('is custom element');\nconst IS_HTML = Symbol('is html');\n\n/**\n * The value/checked attribute in the template actually corresponds to the defaultValue property, so we need\n * to remove it upon hydration to avoid a bug when someone resets the form value.\n * @param {HTMLInputElement} input\n * @returns {void}\n */\nexport function remove_input_defaults(input) {\n\tif (!hydrating) return;\n\n\tvar already_removed = false;\n\n\t// We try and remove the default attributes later, rather than sync during hydration.\n\t// Doing it sync during hydration has a negative impact on performance, but deferring the\n\t// work in an idle task alleviates this greatly. If a form reset event comes in before\n\t// the idle callback, then we ensure the input defaults are cleared just before.\n\tvar remove_defaults = () => {\n\t\tif (already_removed) return;\n\t\talready_removed = true;\n\n\t\t// Remove the attributes but preserve the values\n\t\tif (input.hasAttribute('value')) {\n\t\t\tvar value = input.value;\n\t\t\tset_attribute(input, 'value', null);\n\t\t\tinput.value = value;\n\t\t}\n\n\t\tif (input.hasAttribute('checked')) {\n\t\t\tvar checked = input.checked;\n\t\t\tset_attribute(input, 'checked', null);\n\t\t\tinput.checked = checked;\n\t\t}\n\t};\n\n\t// @ts-expect-error\n\tinput.__on_r = remove_defaults;\n\tqueue_idle_task(remove_defaults);\n\tadd_form_reset_listener();\n}\n\n/**\n * @param {Element} element\n * @param {any} value\n */\nexport function set_value(element, value) {\n\tvar attributes = get_attributes(element);\n\n\tif (\n\t\tattributes.value ===\n\t\t\t(attributes.value =\n\t\t\t\t// treat null and undefined the same for the initial value\n\t\t\t\tvalue ?? undefined) ||\n\t\t// @ts-expect-error\n\t\t// `progress` elements always need their value set when it's `0`\n\t\t(element.value === value && (value !== 0 || element.nodeName !== 'PROGRESS'))\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.value = value ?? '';\n}\n\n/**\n * @param {Element} element\n * @param {boolean} checked\n */\nexport function set_checked(element, checked) {\n\tvar attributes = get_attributes(element);\n\n\tif (\n\t\tattributes.checked ===\n\t\t(attributes.checked =\n\t\t\t// treat null and undefined the same for the initial value\n\t\t\tchecked ?? undefined)\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.checked = checked;\n}\n\n/**\n * Sets the `selected` attribute on an `option` element.\n * Not set through the property because that doesn't reflect to the DOM,\n * which means it wouldn't be taken into account when a form is reset.\n * @param {HTMLOptionElement} element\n * @param {boolean} selected\n */\nexport function set_selected(element, selected) {\n\tif (selected) {\n\t\t// The selected option could've changed via user selection, and\n\t\t// setting the value without this check would set it back.\n\t\tif (!element.hasAttribute('selected')) {\n\t\t\telement.setAttribute('selected', '');\n\t\t}\n\t} else {\n\t\telement.removeAttribute('selected');\n\t}\n}\n\n/**\n * Applies the default checked property without influencing the current checked property.\n * @param {HTMLInputElement} element\n * @param {boolean} checked\n */\nexport function set_default_checked(element, checked) {\n\tconst existing_value = element.checked;\n\telement.defaultChecked = checked;\n\telement.checked = existing_value;\n}\n\n/**\n * Applies the default value property without influencing the current value property.\n * @param {HTMLInputElement | HTMLTextAreaElement} element\n * @param {string} value\n */\nexport function set_default_value(element, value) {\n\tconst existing_value = element.value;\n\telement.defaultValue = value;\n\telement.value = existing_value;\n}\n\n/**\n * @param {Element} element\n * @param {string} attribute\n * @param {string | null} value\n * @param {boolean} [skip_warning]\n */\nexport function set_attribute(element, attribute, value, skip_warning) {\n\tvar attributes = get_attributes(element);\n\n\tif (hydrating) {\n\t\tattributes[attribute] = element.getAttribute(attribute);\n\n\t\tif (\n\t\t\tattribute === 'src' ||\n\t\t\tattribute === 'srcset' ||\n\t\t\t(attribute === 'href' && element.nodeName === 'LINK')\n\t\t) {\n\t\t\tif (!skip_warning) {\n\t\t\t\tcheck_src_in_dev_hydration(element, attribute, value ?? '');\n\t\t\t}\n\n\t\t\t// If we reset these attributes, they would result in another network request, which we want to avoid.\n\t\t\t// We assume they are the same between client and server as checking if they are equal is expensive\n\t\t\t// (we can't just compare the strings as they can be different between client and server but result in the\n\t\t\t// same url, so we would need to create hidden anchor elements to compare them)\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (attributes[attribute] === (attributes[attribute] = value)) return;\n\n\tif (attribute === 'loading') {\n\t\t// @ts-expect-error\n\t\telement[LOADING_ATTR_SYMBOL] = value;\n\t}\n\n\tif (value == null) {\n\t\telement.removeAttribute(attribute);\n\t} else if (typeof value !== 'string' && get_setters(element).includes(attribute)) {\n\t\t// @ts-ignore\n\t\telement[attribute] = value;\n\t} else {\n\t\telement.setAttribute(attribute, value);\n\t}\n}\n\n/**\n * @param {Element} dom\n * @param {string} attribute\n * @param {string} value\n */\nexport function set_xlink_attribute(dom, attribute, value) {\n\tdom.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @param {string} prop\n * @param {any} value\n */\nexport function set_custom_element_data(node, prop, value) {\n\t// We need to ensure that setting custom element props, which can\n\t// invoke lifecycle methods on other custom elements, does not also\n\t// associate those lifecycle methods with the current active reaction\n\t// or effect\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet was_hydrating = hydrating;\n\tif (hydrating) {\n\t\tset_hydrating(false);\n\t}\n\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\n\ttry {\n\t\tif (\n\t\t\t// `style` should use `set_attribute` rather than the setter\n\t\t\tprop !== 'style' &&\n\t\t\t// Don't compute setters for custom elements while they aren't registered yet,\n\t\t\t// because during their upgrade/instantiation they might add more setters.\n\t\t\t// Instead, fall back to a simple \"an object, then set as property\" heuristic.\n\t\t\t(setters_cache.has(node.nodeName) ||\n\t\t\t// customElements may not be available in browser extension contexts\n\t\t\t!customElements ||\n\t\t\tcustomElements.get(node.tagName.toLowerCase())\n\t\t\t\t? get_setters(node).includes(prop)\n\t\t\t\t: value && typeof value === 'object')\n\t\t) {\n\t\t\t// @ts-expect-error\n\t\t\tnode[prop] = value;\n\t\t} else {\n\t\t\t// We did getters etc checks already, stringify before passing to set_attribute\n\t\t\t// to ensure it doesn't invoke the same logic again, and potentially populating\n\t\t\t// the setters cache too early.\n\t\t\tset_attribute(node, prop, value == null ? value : String(value));\n\t\t}\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t\tif (was_hydrating) {\n\t\t\tset_hydrating(true);\n\t\t}\n\t}\n}\n\n/**\n * Spreads attributes onto a DOM element, taking into account the currently set attributes\n * @param {Element & ElementCSSInlineStyle} element\n * @param {Record<string | symbol, any> | undefined} prev\n * @param {Record<string | symbol, any>} next New attributes - this function mutates this object\n * @param {string} [css_hash]\n * @param {boolean} [skip_warning]\n * @returns {Record<string, any>}\n */\nexport function set_attributes(element, prev, next, css_hash, skip_warning = false) {\n\tvar attributes = get_attributes(element);\n\n\tvar is_custom_element = attributes[IS_CUSTOM_ELEMENT];\n\tvar preserve_attribute_case = !attributes[IS_HTML];\n\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet is_hydrating_custom_element = hydrating && is_custom_element;\n\tif (is_hydrating_custom_element) {\n\t\tset_hydrating(false);\n\t}\n\n\tvar current = prev || {};\n\tvar is_option_element = element.tagName === 'OPTION';\n\n\tfor (var key in prev) {\n\t\tif (!(key in next)) {\n\t\t\tnext[key] = null;\n\t\t}\n\t}\n\n\tif (next.class) {\n\t\tnext.class = clsx(next.class);\n\t} else if (css_hash || next[CLASS]) {\n\t\tnext.class = null; /* force call to set_class() */\n\t}\n\n\tif (next[STYLE]) {\n\t\tnext.style ??= null; /* force call to set_style() */\n\t}\n\n\tvar setters = get_setters(element);\n\n\t// since key is captured we use const\n\tfor (const key in next) {\n\t\t// let instead of var because referenced in a closure\n\t\tlet value = next[key];\n\n\t\t// Up here because we want to do this for the initial value, too, even if it's undefined,\n\t\t// and this wouldn't be reached in case of undefined because of the equality check below\n\t\tif (is_option_element && key === 'value' && value == null) {\n\t\t\t// The <option> element is a special case because removing the value attribute means\n\t\t\t// the value is set to the text content of the option element, and setting the value\n\t\t\t// to null or undefined means the value is set to the string \"null\" or \"undefined\".\n\t\t\t// To align with how we handle this case in non-spread-scenarios, this logic is needed.\n\t\t\t// There's a super-edge-case bug here that is left in in favor of smaller code size:\n\t\t\t// Because of the \"set missing props to null\" logic above, we can't differentiate\n\t\t\t// between a missing value and an explicitly set value of null or undefined. That means\n\t\t\t// that once set, the value attribute of an <option> element can't be removed. This is\n\t\t\t// a very rare edge case, and removing the attribute altogether isn't possible either\n\t\t\t// for the <option value={undefined}> case, so we're not losing any functionality here.\n\t\t\t// @ts-ignore\n\t\t\telement.value = element.__value = '';\n\t\t\tcurrent[key] = value;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (key === 'class') {\n\t\t\tvar is_html = element.namespaceURI === 'http://www.w3.org/1999/xhtml';\n\t\t\tset_class(element, is_html, value, css_hash, prev?.[CLASS], next[CLASS]);\n\t\t\tcurrent[key] = value;\n\t\t\tcurrent[CLASS] = next[CLASS];\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (key === 'style') {\n\t\t\tset_style(element, value, prev?.[STYLE], next[STYLE]);\n\t\t\tcurrent[key] = value;\n\t\t\tcurrent[STYLE] = next[STYLE];\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar prev_value = current[key];\n\n\t\t// Skip if value is unchanged, unless it's `undefined` and the element still has the attribute\n\t\tif (value === prev_value && !(value === undefined && element.hasAttribute(key))) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tcurrent[key] = value;\n\n\t\tvar prefix = key[0] + key[1]; // this is faster than key.slice(0, 2)\n\t\tif (prefix === '$$') continue;\n\n\t\tif (prefix === 'on') {\n\t\t\t/** @type {{ capture?: true }} */\n\t\t\tconst opts = {};\n\t\t\tconst event_handle_key = '$$' + key;\n\t\t\tlet event_name = key.slice(2);\n\t\t\tvar delegated = is_delegated(event_name);\n\n\t\t\tif (is_capture_event(event_name)) {\n\t\t\t\tevent_name = event_name.slice(0, -7);\n\t\t\t\topts.capture = true;\n\t\t\t}\n\n\t\t\tif (!delegated && prev_value) {\n\t\t\t\t// Listening to same event but different handler -> our handle function below takes care of this\n\t\t\t\t// If we were to remove and add listeners in this case, it could happen that the event is \"swallowed\"\n\t\t\t\t// (the browser seems to not know yet that a new one exists now) and doesn't reach the handler\n\t\t\t\t// https://github.com/sveltejs/svelte/issues/11903\n\t\t\t\tif (value != null) continue;\n\n\t\t\t\telement.removeEventListener(event_name, current[event_handle_key], opts);\n\t\t\t\tcurrent[event_handle_key] = null;\n\t\t\t}\n\n\t\t\tif (value != null) {\n\t\t\t\tif (!delegated) {\n\t\t\t\t\t/**\n\t\t\t\t\t * @this {any}\n\t\t\t\t\t * @param {Event} evt\n\t\t\t\t\t */\n\t\t\t\t\tfunction handle(evt) {\n\t\t\t\t\t\tcurrent[key].call(this, evt);\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent[event_handle_key] = create_event(event_name, element, handle, opts);\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\telement[`__${event_name}`] = value;\n\t\t\t\t\tdelegate([event_name]);\n\t\t\t\t}\n\t\t\t} else if (delegated) {\n\t\t\t\t// @ts-ignore\n\t\t\t\telement[`__${event_name}`] = undefined;\n\t\t\t}\n\t\t} else if (key === 'style') {\n\t\t\t// avoid using the setter\n\t\t\tset_attribute(element, key, value);\n\t\t} else if (key === 'autofocus') {\n\t\t\tautofocus(/** @type {HTMLElement} */ (element), Boolean(value));\n\t\t} else if (!is_custom_element && (key === '__value' || (key === 'value' && value != null))) {\n\t\t\t// @ts-ignore We're not running this for custom elements because __value is actually\n\t\t\t// how Lit stores the current value on the element, and messing with that would break things.\n\t\t\telement.value = element.__value = value;\n\t\t} else if (key === 'selected' && is_option_element) {\n\t\t\tset_selected(/** @type {HTMLOptionElement} */ (element), value);\n\t\t} else {\n\t\t\tvar name = key;\n\t\t\tif (!preserve_attribute_case) {\n\t\t\t\tname = normalize_attribute(name);\n\t\t\t}\n\n\t\t\tvar is_default = name === 'defaultValue' || name === 'defaultChecked';\n\n\t\t\tif (value == null && !is_custom_element && !is_default) {\n\t\t\t\tattributes[key] = null;\n\n\t\t\t\tif (name === 'value' || name === 'checked') {\n\t\t\t\t\t// removing value/checked also removes defaultValue/defaultChecked — preserve\n\t\t\t\t\tlet input = /** @type {HTMLInputElement} */ (element);\n\t\t\t\t\tconst use_default = prev === undefined;\n\t\t\t\t\tif (name === 'value') {\n\t\t\t\t\t\tlet previous = input.defaultValue;\n\t\t\t\t\t\tinput.removeAttribute(name);\n\t\t\t\t\t\tinput.defaultValue = previous;\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tinput.value = input.__value = use_default ? previous : null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet previous = input.defaultChecked;\n\t\t\t\t\t\tinput.removeAttribute(name);\n\t\t\t\t\t\tinput.defaultChecked = previous;\n\t\t\t\t\t\tinput.checked = use_default ? previous : false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\telement.removeAttribute(key);\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tis_default ||\n\t\t\t\t(setters.includes(name) && (is_custom_element || typeof value !== 'string'))\n\t\t\t) {\n\t\t\t\t// @ts-ignore\n\t\t\t\telement[name] = value;\n\t\t\t\t// remove it from attributes's cache\n\t\t\t\tif (name in attributes) attributes[name] = UNINITIALIZED;\n\t\t\t} else if (typeof value !== 'function') {\n\t\t\t\tset_attribute(element, name, value, skip_warning);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (is_hydrating_custom_element) {\n\t\tset_hydrating(true);\n\t}\n\n\treturn current;\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} element\n * @param {(...expressions: any) => Record<string | symbol, any>} fn\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise<any>>} async\n * @param {string} [css_hash]\n * @param {boolean} [skip_warning]\n */\nexport function attribute_effect(\n\telement,\n\tfn,\n\tsync = [],\n\tasync = [],\n\tcss_hash,\n\tskip_warning = false\n) {\n\tflatten(sync, async, (values) => {\n\t\t/** @type {Record<string | symbol, any> | undefined} */\n\t\tvar prev = undefined;\n\n\t\t/** @type {Record<symbol, Effect>} */\n\t\tvar effects = {};\n\n\t\tvar is_select = element.nodeName === 'SELECT';\n\t\tvar inited = false;\n\n\t\tblock(() => {\n\t\t\tvar next = fn(...values.map(get));\n\t\t\t/** @type {Record<string | symbol, any>} */\n\t\t\tvar current = set_attributes(element, prev, next, css_hash, skip_warning);\n\n\t\t\tif (inited && is_select && 'value' in next) {\n\t\t\t\tselect_option(/** @type {HTMLSelectElement} */ (element), next.value);\n\t\t\t}\n\n\t\t\tfor (let symbol of Object.getOwnPropertySymbols(effects)) {\n\t\t\t\tif (!next[symbol]) destroy_effect(effects[symbol]);\n\t\t\t}\n\n\t\t\tfor (let symbol of Object.getOwnPropertySymbols(next)) {\n\t\t\t\tvar n = next[symbol];\n\n\t\t\t\tif (symbol.description === ATTACHMENT_KEY && (!prev || n !== prev[symbol])) {\n\t\t\t\t\tif (effects[symbol]) destroy_effect(effects[symbol]);\n\t\t\t\t\teffects[symbol] = branch(() => attach(element, () => n));\n\t\t\t\t}\n\n\t\t\t\tcurrent[symbol] = n;\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t});\n\n\t\tif (is_select) {\n\t\t\tvar select = /** @type {HTMLSelectElement} */ (element);\n\n\t\t\teffect(() => {\n\t\t\t\tselect_option(select, /** @type {Record<string | symbol, any>} */ (prev).value, true);\n\t\t\t\tinit_select(select);\n\t\t\t});\n\t\t}\n\n\t\tinited = true;\n\t});\n}\n\n/**\n *\n * @param {Element} element\n */\nfunction get_attributes(element) {\n\treturn /** @type {Record<string | symbol, unknown>} **/ (\n\t\t// @ts-expect-error\n\t\telement.__attributes ??= {\n\t\t\t[IS_CUSTOM_ELEMENT]: element.nodeName.includes('-'),\n\t\t\t[IS_HTML]: element.namespaceURI === NAMESPACE_HTML\n\t\t}\n\t);\n}\n\n/** @type {Map<string, string[]>} */\nvar setters_cache = new Map();\n\n/** @param {Element} element */\nfunction get_setters(element) {\n\tvar setters = setters_cache.get(element.nodeName);\n\tif (setters) return setters;\n\tsetters_cache.set(element.nodeName, (setters = []));\n\n\tvar descriptors;\n\tvar proto = element; // In the case of custom elements there might be setters on the instance\n\tvar element_proto = Element.prototype;\n\n\t// Stop at Element, from there on there's only unnecessary setters we're not interested in\n\t// Do not use contructor.name here as that's unreliable in some browser environments\n\twhile (element_proto !== proto) {\n\t\tdescriptors = get_descriptors(proto);\n\n\t\tfor (var key in descriptors) {\n\t\t\tif (descriptors[key].set) {\n\t\t\t\tsetters.push(key);\n\t\t\t}\n\t\t}\n\n\t\tproto = get_prototype_of(proto);\n\t}\n\n\treturn setters;\n}\n\n/**\n * @param {any} element\n * @param {string} attribute\n * @param {string} value\n */\nfunction check_src_in_dev_hydration(element, attribute, value) {\n\tif (!DEV) return;\n\tif (attribute === 'srcset' && srcset_url_equal(element, value)) return;\n\tif (src_url_equal(element.getAttribute(attribute) ?? '', value)) return;\n\n\tw.hydration_attribute_changed(\n\t\tattribute,\n\t\telement.outerHTML.replace(element.innerHTML, element.innerHTML && '...'),\n\t\tString(value)\n\t);\n}\n\n/**\n * @param {string} element_src\n * @param {string} url\n * @returns {boolean}\n */\nfunction src_url_equal(element_src, url) {\n\tif (element_src === url) return true;\n\treturn new URL(element_src, document.baseURI).href === new URL(url, document.baseURI).href;\n}\n\n/** @param {string} srcset */\nfunction split_srcset(srcset) {\n\treturn srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean));\n}\n\n/**\n * @param {HTMLSourceElement | HTMLImageElement} element\n * @param {string} srcset\n * @returns {boolean}\n */\nfunction srcset_url_equal(element, srcset) {\n\tvar element_urls = split_srcset(element.srcset);\n\tvar urls = split_srcset(srcset);\n\n\treturn (\n\t\turls.length === element_urls.length &&\n\t\turls.every(\n\t\t\t([url, width], i) =>\n\t\t\t\twidth === element_urls[i][1] &&\n\t\t\t\t// We need to test both ways because Vite will create an a full URL with\n\t\t\t\t// `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the\n\t\t\t\t// relative URLs inside srcset are not automatically resolved to absolute URLs by\n\t\t\t\t// browsers (in contrast to img.src). This means both SSR and DOM code could\n\t\t\t\t// contain relative or absolute URLs.\n\t\t\t\t(src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0]))\n\t\t)\n\t);\n}\n","import { teardown } from '../../../reactivity/effects.js';\nimport { get_descriptor } from '../../../../shared/utils.js';\n\n/**\n * Makes an `export`ed (non-prop) variable available on the `$$props` object\n * so that consumers can do `bind:x` on the component.\n * @template V\n * @param {Record<string, unknown>} props\n * @param {string} prop\n * @param {V} value\n * @returns {void}\n */\nexport function bind_prop(props, prop, value) {\n\tvar desc = get_descriptor(props, prop);\n\n\tif (desc && desc.set) {\n\t\tprops[prop] = value;\n\t\tteardown(() => {\n\t\t\tprops[prop] = null;\n\t\t});\n\t}\n}\n","import { STATE_SYMBOL } from '#client/constants';\nimport { effect, render_effect } from '../../../reactivity/effects.js';\nimport { untrack } from '../../../runtime.js';\nimport { queue_micro_task } from '../../task.js';\n\n/**\n * @param {any} bound_value\n * @param {Element} element_or_component\n * @returns {boolean}\n */\nfunction is_bound_this(bound_value, element_or_component) {\n\treturn (\n\t\tbound_value === element_or_component || bound_value?.[STATE_SYMBOL] === element_or_component\n\t);\n}\n\n/**\n * @param {any} element_or_component\n * @param {(value: unknown, ...parts: unknown[]) => void} update\n * @param {(...parts: unknown[]) => unknown} get_value\n * @param {() => unknown[]} [get_parts] Set if the this binding is used inside an each block,\n * \t\t\t\t\t\t\t\t\t\treturns all the parts of the each block context that are used in the expression\n * @returns {void}\n */\nexport function bind_this(element_or_component = {}, update, get_value, get_parts) {\n\teffect(() => {\n\t\t/** @type {unknown[]} */\n\t\tvar old_parts;\n\n\t\t/** @type {unknown[]} */\n\t\tvar parts;\n\n\t\trender_effect(() => {\n\t\t\told_parts = parts;\n\t\t\t// We only track changes to the parts, not the value itself to avoid unnecessary reruns.\n\t\t\tparts = get_parts?.() || [];\n\n\t\t\tuntrack(() => {\n\t\t\t\tif (element_or_component !== get_value(...parts)) {\n\t\t\t\t\tupdate(element_or_component, ...parts);\n\t\t\t\t\t// If this is an effect rerun (cause: each block context changes), then nullfiy the binding at\n\t\t\t\t\t// the previous position if it isn't already taken over by a different effect.\n\t\t\t\t\tif (old_parts && is_bound_this(get_value(...old_parts), element_or_component)) {\n\t\t\t\t\t\tupdate(null, ...old_parts);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\treturn () => {\n\t\t\t// We cannot use effects in the teardown phase, we we use a microtask instead.\n\t\t\tqueue_micro_task(() => {\n\t\t\t\tif (parts && is_bound_this(get_value(...parts), element_or_component)) {\n\t\t\t\t\tupdate(null, ...parts);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t});\n\n\treturn element_or_component;\n}\n","/** @import { ComponentContextLegacy } from '#client' */\nimport { run, run_all } from '../../../shared/utils.js';\nimport { component_context } from '../../context.js';\nimport { derived } from '../../reactivity/deriveds.js';\nimport { user_pre_effect, user_effect } from '../../reactivity/effects.js';\nimport { deep_read_state, get, untrack } from '../../runtime.js';\n\n/**\n * Legacy-mode only: Call `onMount` callbacks and set up `beforeUpdate`/`afterUpdate` effects\n * @param {boolean} [immutable]\n */\nexport function init(immutable = false) {\n\tconst context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\tconst callbacks = context.l.u;\n\tif (!callbacks) return;\n\n\tlet props = () => deep_read_state(context.s);\n\n\tif (immutable) {\n\t\tlet version = 0;\n\t\tlet prev = /** @type {Record<string, any>} */ ({});\n\n\t\t// In legacy immutable mode, before/afterUpdate only fire if the object identity of a prop changes\n\t\tconst d = derived(() => {\n\t\t\tlet changed = false;\n\t\t\tconst props = context.s;\n\t\t\tfor (const key in props) {\n\t\t\t\tif (props[key] !== prev[key]) {\n\t\t\t\t\tprev[key] = props[key];\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (changed) version++;\n\t\t\treturn version;\n\t\t});\n\n\t\tprops = () => get(d);\n\t}\n\n\t// beforeUpdate\n\tif (callbacks.b.length) {\n\t\tuser_pre_effect(() => {\n\t\t\tobserve_all(context, props);\n\t\t\trun_all(callbacks.b);\n\t\t});\n\t}\n\n\t// onMount (must run before afterUpdate)\n\tuser_effect(() => {\n\t\tconst fns = untrack(() => callbacks.m.map(run));\n\t\treturn () => {\n\t\t\tfor (const fn of fns) {\n\t\t\t\tif (typeof fn === 'function') {\n\t\t\t\t\tfn();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t});\n\n\t// afterUpdate\n\tif (callbacks.a.length) {\n\t\tuser_effect(() => {\n\t\t\tobserve_all(context, props);\n\t\t\trun_all(callbacks.a);\n\t\t});\n\t}\n}\n\n/**\n * Invoke the getter of all signals associated with a component\n * so they can be registered to the effect this function is called in.\n * @param {ComponentContextLegacy} context\n * @param {(() => void)} props\n */\nfunction observe_all(context, props) {\n\tif (context.l.s) {\n\t\tfor (const signal of context.l.s) get(signal);\n\t}\n\n\tprops();\n}\n","/** @import { Readable } from './public' */\nimport { untrack } from '../index-client.js';\nimport { noop } from '../internal/shared/utils.js';\n\n/**\n * @template T\n * @param {Readable<T> | null | undefined} store\n * @param {(value: T) => void} run\n * @param {(value: T) => void} [invalidate]\n * @returns {() => void}\n */\nexport function subscribe_to_store(store, run, invalidate) {\n\tif (store == null) {\n\t\t// @ts-expect-error\n\t\trun(undefined);\n\n\t\t// @ts-expect-error\n\t\tif (invalidate) invalidate(undefined);\n\n\t\treturn noop;\n\t}\n\n\t// Svelte store takes a private second argument\n\t// StartStopNotifier could mutate state, and we want to silence the corresponding validation error\n\tconst unsub = untrack(() =>\n\t\tstore.subscribe(\n\t\t\trun,\n\t\t\t// @ts-expect-error\n\t\t\tinvalidate\n\t\t)\n\t);\n\n\t// Also support RxJS\n\t// @ts-expect-error TODO fix this in the types?\n\treturn unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\n","/** @import { Readable, StartStopNotifier, Subscriber, Unsubscriber, Updater, Writable } from '../public.js' */\n/** @import { Stores, StoresValues, SubscribeInvalidateTuple } from '../private.js' */\nimport { noop, run_all } from '../../internal/shared/utils.js';\nimport { safe_not_equal } from '../../internal/client/reactivity/equality.js';\nimport { subscribe_to_store } from '../utils.js';\n\n/**\n * @type {Array<SubscribeInvalidateTuple<any> | any>}\n */\nconst subscriber_queue = [];\n\n/**\n * Creates a `Readable` store that allows reading by subscription.\n *\n * @template T\n * @param {T} [value] initial value\n * @param {StartStopNotifier<T>} [start]\n * @returns {Readable<T>}\n */\nexport function readable(value, start) {\n\treturn {\n\t\tsubscribe: writable(value, start).subscribe\n\t};\n}\n\n/**\n * Create a `Writable` store that allows both updating and reading by subscription.\n *\n * @template T\n * @param {T} [value] initial value\n * @param {StartStopNotifier<T>} [start]\n * @returns {Writable<T>}\n */\nexport function writable(value, start = noop) {\n\t/** @type {Unsubscriber | null} */\n\tlet stop = null;\n\n\t/** @type {Set<SubscribeInvalidateTuple<T>>} */\n\tconst subscribers = new Set();\n\n\t/**\n\t * @param {T} new_value\n\t * @returns {void}\n\t */\n\tfunction set(new_value) {\n\t\tif (safe_not_equal(value, new_value)) {\n\t\t\tvalue = new_value;\n\t\t\tif (stop) {\n\t\t\t\t// store is ready\n\t\t\t\tconst run_queue = !subscriber_queue.length;\n\t\t\t\tfor (const subscriber of subscribers) {\n\t\t\t\t\tsubscriber[1]();\n\t\t\t\t\tsubscriber_queue.push(subscriber, value);\n\t\t\t\t}\n\t\t\t\tif (run_queue) {\n\t\t\t\t\tfor (let i = 0; i < subscriber_queue.length; i += 2) {\n\t\t\t\t\t\tsubscriber_queue[i][0](subscriber_queue[i + 1]);\n\t\t\t\t\t}\n\t\t\t\t\tsubscriber_queue.length = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param {Updater<T>} fn\n\t * @returns {void}\n\t */\n\tfunction update(fn) {\n\t\tset(fn(/** @type {T} */ (value)));\n\t}\n\n\t/**\n\t * @param {Subscriber<T>} run\n\t * @param {() => void} [invalidate]\n\t * @returns {Unsubscriber}\n\t */\n\tfunction subscribe(run, invalidate = noop) {\n\t\t/** @type {SubscribeInvalidateTuple<T>} */\n\t\tconst subscriber = [run, invalidate];\n\t\tsubscribers.add(subscriber);\n\t\tif (subscribers.size === 1) {\n\t\t\tstop = start(set, update) || noop;\n\t\t}\n\t\trun(/** @type {T} */ (value));\n\t\treturn () => {\n\t\t\tsubscribers.delete(subscriber);\n\t\t\tif (subscribers.size === 0 && stop) {\n\t\t\t\tstop();\n\t\t\t\tstop = null;\n\t\t\t}\n\t\t};\n\t}\n\treturn { set, update, subscribe };\n}\n\n/**\n * Derived value store by synchronizing one or more readable stores and\n * applying an aggregation function over its input values.\n *\n * @template {Stores} S\n * @template T\n * @overload\n * @param {S} stores\n * @param {(values: StoresValues<S>, set: (value: T) => void, update: (fn: Updater<T>) => void) => Unsubscriber | void} fn\n * @param {T} [initial_value]\n * @returns {Readable<T>}\n */\n/**\n * Derived value store by synchronizing one or more readable stores and\n * applying an aggregation function over its input values.\n *\n * @template {Stores} S\n * @template T\n * @overload\n * @param {S} stores\n * @param {(values: StoresValues<S>) => T} fn\n * @param {T} [initial_value]\n * @returns {Readable<T>}\n */\n/**\n * @template {Stores} S\n * @template T\n * @param {S} stores\n * @param {Function} fn\n * @param {T} [initial_value]\n * @returns {Readable<T>}\n */\nexport function derived(stores, fn, initial_value) {\n\tconst single = !Array.isArray(stores);\n\t/** @type {Array<Readable<any>>} */\n\tconst stores_array = single ? [stores] : stores;\n\tif (!stores_array.every(Boolean)) {\n\t\tthrow new Error('derived() expects stores as input, got a falsy value');\n\t}\n\tconst auto = fn.length < 2;\n\treturn readable(initial_value, (set, update) => {\n\t\tlet started = false;\n\t\t/** @type {T[]} */\n\t\tconst values = [];\n\t\tlet pending = 0;\n\t\tlet cleanup = noop;\n\t\tconst sync = () => {\n\t\t\tif (pending) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcleanup();\n\t\t\tconst result = fn(single ? values[0] : values, set, update);\n\t\t\tif (auto) {\n\t\t\t\tset(result);\n\t\t\t} else {\n\t\t\t\tcleanup = typeof result === 'function' ? result : noop;\n\t\t\t}\n\t\t};\n\t\tconst unsubscribers = stores_array.map((store, i) =>\n\t\t\tsubscribe_to_store(\n\t\t\t\tstore,\n\t\t\t\t(value) => {\n\t\t\t\t\tvalues[i] = value;\n\t\t\t\t\tpending &= ~(1 << i);\n\t\t\t\t\tif (started) {\n\t\t\t\t\t\tsync();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tpending |= 1 << i;\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t\tstarted = true;\n\t\tsync();\n\t\treturn function stop() {\n\t\t\trun_all(unsubscribers);\n\t\t\tcleanup();\n\t\t\t// We need to set this to false because callbacks can still happen despite having unsubscribed:\n\t\t\t// Callbacks might already be placed in the queue which doesn't know it should no longer\n\t\t\t// invoke this derived store.\n\t\t\tstarted = false;\n\t\t};\n\t});\n}\n\n/**\n * Takes a store and returns a new one derived from the old one that is readable.\n *\n * @template T\n * @param {Readable<T>} store - store to make readonly\n * @returns {Readable<T>}\n */\nexport function readonly(store) {\n\treturn {\n\t\t// @ts-expect-error TODO i suspect the bind is unnecessary\n\t\tsubscribe: store.subscribe.bind(store)\n\t};\n}\n\n/**\n * Get the current value from a store by subscribing and immediately unsubscribing.\n *\n * @template T\n * @param {Readable<T>} store\n * @returns {T}\n */\nexport function get(store) {\n\tlet value;\n\tsubscribe_to_store(store, (_) => (value = _))();\n\t// @ts-expect-error\n\treturn value;\n}\n","/** @import { StoreReferencesContainer } from '#client' */\n/** @import { Store } from '#shared' */\nimport { subscribe_to_store } from '../../../store/utils.js';\nimport { get as get_store } from '../../../store/shared/index.js';\nimport { define_property, noop } from '../../shared/utils.js';\nimport { get } from '../runtime.js';\nimport { teardown } from './effects.js';\nimport { mutable_source, set } from './sources.js';\nimport { DEV } from 'esm-env';\n\n/**\n * Whether or not the prop currently being read is a store binding, as in\n * `<Child bind:x={$y} />`. If it is, we treat the prop as mutable even in\n * runes mode, and skip `binding_property_non_reactive` validation\n */\nlet is_store_binding = false;\n\nlet IS_UNMOUNTED = Symbol();\n\n/**\n * Gets the current value of a store. If the store isn't subscribed to yet, it will create a proxy\n * signal that will be updated when the store is. The store references container is needed to\n * track reassignments to stores and to track the correct component context.\n * @template V\n * @param {Store<V> | null | undefined} store\n * @param {string} store_name\n * @param {StoreReferencesContainer} stores\n * @returns {V}\n */\nexport function store_get(store, store_name, stores) {\n\tconst entry = (stores[store_name] ??= {\n\t\tstore: null,\n\t\tsource: mutable_source(undefined),\n\t\tunsubscribe: noop\n\t});\n\n\tif (DEV) {\n\t\tentry.source.label = store_name;\n\t}\n\n\t// if the component that setup this is already unmounted we don't want to register a subscription\n\tif (entry.store !== store && !(IS_UNMOUNTED in stores)) {\n\t\tentry.unsubscribe();\n\t\tentry.store = store ?? null;\n\n\t\tif (store == null) {\n\t\t\tentry.source.v = undefined; // see synchronous callback comment below\n\t\t\tentry.unsubscribe = noop;\n\t\t} else {\n\t\t\tvar is_synchronous_callback = true;\n\n\t\t\tentry.unsubscribe = subscribe_to_store(store, (v) => {\n\t\t\t\tif (is_synchronous_callback) {\n\t\t\t\t\t// If the first updates to the store value (possibly multiple of them) are synchronously\n\t\t\t\t\t// inside a derived, we will hit the `state_unsafe_mutation` error if we `set` the value\n\t\t\t\t\tentry.source.v = v;\n\t\t\t\t} else {\n\t\t\t\t\tset(entry.source, v);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tis_synchronous_callback = false;\n\t\t}\n\t}\n\n\t// if the component that setup this stores is already unmounted the source will be out of sync\n\t// so we just use the `get` for the stores, less performant but it avoids to create a memory leak\n\t// and it will keep the value consistent\n\tif (store && IS_UNMOUNTED in stores) {\n\t\treturn get_store(store);\n\t}\n\n\treturn get(entry.source);\n}\n\n/**\n * Unsubscribe from a store if it's not the same as the one in the store references container.\n * We need this in addition to `store_get` because someone could unsubscribe from a store but\n * then never subscribe to the new one (if any), causing the subscription to stay open wrongfully.\n * @param {Store<any> | null | undefined} store\n * @param {string} store_name\n * @param {StoreReferencesContainer} stores\n */\nexport function store_unsub(store, store_name, stores) {\n\t/** @type {StoreReferencesContainer[''] | undefined} */\n\tlet entry = stores[store_name];\n\n\tif (entry && entry.store !== store) {\n\t\t// Don't reset store yet, so that store_get above can resubscribe to new store if necessary\n\t\tentry.unsubscribe();\n\t\tentry.unsubscribe = noop;\n\t}\n\n\treturn store;\n}\n\n/**\n * Sets the new value of a store and returns that value.\n * @template V\n * @param {Store<V>} store\n * @param {V} value\n * @returns {V}\n */\nexport function store_set(store, value) {\n\tstore.set(value);\n\treturn value;\n}\n\n/**\n * @param {StoreReferencesContainer} stores\n * @param {string} store_name\n */\nexport function invalidate_store(stores, store_name) {\n\tvar entry = stores[store_name];\n\tif (entry.store !== null) {\n\t\tstore_set(entry.store, entry.source.v);\n\t}\n}\n\n/**\n * Unsubscribes from all auto-subscribed stores on destroy\n * @returns {[StoreReferencesContainer, ()=>void]}\n */\nexport function setup_stores() {\n\t/** @type {StoreReferencesContainer} */\n\tconst stores = {};\n\n\tfunction cleanup() {\n\t\tteardown(() => {\n\t\t\tfor (var store_name in stores) {\n\t\t\t\tconst ref = stores[store_name];\n\t\t\t\tref.unsubscribe();\n\t\t\t}\n\t\t\tdefine_property(stores, IS_UNMOUNTED, {\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: true\n\t\t\t});\n\t\t});\n\t}\n\n\treturn [stores, cleanup];\n}\n\n/**\n * Updates a store with a new value.\n * @param {Store<V>} store the store to update\n * @param {any} expression the expression that mutates the store\n * @param {V} new_value the new store value\n * @template V\n */\nexport function store_mutate(store, expression, new_value) {\n\tstore.set(new_value);\n\treturn expression;\n}\n\n/**\n * @param {Store<number>} store\n * @param {number} store_value\n * @param {1 | -1} [d]\n * @returns {number}\n */\nexport function update_store(store, store_value, d = 1) {\n\tstore.set(store_value + d);\n\treturn store_value;\n}\n\n/**\n * @param {Store<number>} store\n * @param {number} store_value\n * @param {1 | -1} [d]\n * @returns {number}\n */\nexport function update_pre_store(store, store_value, d = 1) {\n\tconst value = store_value + d;\n\tstore.set(value);\n\treturn value;\n}\n\n/**\n * Called inside prop getters to communicate that the prop is a store binding\n */\nexport function mark_store_binding() {\n\tis_store_binding = true;\n}\n\n/**\n * Returns a tuple that indicates whether `fn()` reads a prop that is a store binding.\n * Used to prevent `binding_property_non_reactive` validation false positives and\n * ensure that these props are treated as mutable even in runes mode\n * @template T\n * @param {() => T} fn\n * @returns {[T, boolean]}\n */\nexport function capture_store_binding(fn) {\n\tvar previous_is_store_binding = is_store_binding;\n\n\ttry {\n\t\tis_store_binding = false;\n\t\treturn [fn(), is_store_binding];\n\t} finally {\n\t\tis_store_binding = previous_is_store_binding;\n\t}\n}\n","/** @import { Effect, Source } from './types.js' */\nimport { DEV } from 'esm-env';\nimport {\n\tPROPS_IS_BINDABLE,\n\tPROPS_IS_IMMUTABLE,\n\tPROPS_IS_LAZY_INITIAL,\n\tPROPS_IS_RUNES,\n\tPROPS_IS_UPDATED\n} from '../../../constants.js';\nimport { get_descriptor, is_function } from '../../shared/utils.js';\nimport { set, source, update } from './sources.js';\nimport { derived, derived_safe_equal } from './deriveds.js';\nimport {\n\tactive_effect,\n\tget,\n\tis_destroying_effect,\n\tset_active_effect,\n\tuntrack\n} from '../runtime.js';\nimport * as e from '../errors.js';\nimport { DESTROYED, LEGACY_PROPS, STATE_SYMBOL } from '#client/constants';\nimport { proxy } from '../proxy.js';\nimport { capture_store_binding } from './store.js';\nimport { legacy_mode_flag } from '../../flags/index.js';\n\n/**\n * @param {((value?: number) => number)} fn\n * @param {1 | -1} [d]\n * @returns {number}\n */\nexport function update_prop(fn, d = 1) {\n\tconst value = fn();\n\tfn(value + d);\n\treturn value;\n}\n\n/**\n * @param {((value?: number) => number)} fn\n * @param {1 | -1} [d]\n * @returns {number}\n */\nexport function update_pre_prop(fn, d = 1) {\n\tconst value = fn() + d;\n\tfn(value);\n\treturn value;\n}\n\n/**\n * The proxy handler for rest props (i.e. `const { x, ...rest } = $props()`).\n * Is passed the full `$$props` object and excludes the named props.\n * @type {ProxyHandler<{ props: Record<string | symbol, unknown>, exclude: Array<string | symbol>, name?: string }>}}\n */\nconst rest_props_handler = {\n\tget(target, key) {\n\t\tif (target.exclude.includes(key)) return;\n\t\treturn target.props[key];\n\t},\n\tset(target, key) {\n\t\tif (DEV) {\n\t\t\t// TODO should this happen in prod too?\n\t\t\te.props_rest_readonly(`${target.name}.${String(key)}`);\n\t\t}\n\n\t\treturn false;\n\t},\n\tgetOwnPropertyDescriptor(target, key) {\n\t\tif (target.exclude.includes(key)) return;\n\t\tif (key in target.props) {\n\t\t\treturn {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: target.props[key]\n\t\t\t};\n\t\t}\n\t},\n\thas(target, key) {\n\t\tif (target.exclude.includes(key)) return false;\n\t\treturn key in target.props;\n\t},\n\townKeys(target) {\n\t\treturn Reflect.ownKeys(target.props).filter((key) => !target.exclude.includes(key));\n\t}\n};\n\n/**\n * @param {Record<string, unknown>} props\n * @param {string[]} exclude\n * @param {string} [name]\n * @returns {Record<string, unknown>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function rest_props(props, exclude, name) {\n\treturn new Proxy(\n\t\tDEV ? { props, exclude, name, other: {}, to_proxy: [] } : { props, exclude },\n\t\trest_props_handler\n\t);\n}\n\n/**\n * The proxy handler for legacy $$restProps and $$props\n * @type {ProxyHandler<{ props: Record<string | symbol, unknown>, exclude: Array<string | symbol>, special: Record<string | symbol, (v?: unknown) => unknown>, version: Source<number>, parent_effect: Effect }>}}\n */\nconst legacy_rest_props_handler = {\n\tget(target, key) {\n\t\tif (target.exclude.includes(key)) return;\n\t\tget(target.version);\n\t\treturn key in target.special ? target.special[key]() : target.props[key];\n\t},\n\tset(target, key, value) {\n\t\tif (!(key in target.special)) {\n\t\t\tvar previous_effect = active_effect;\n\n\t\t\ttry {\n\t\t\t\tset_active_effect(target.parent_effect);\n\n\t\t\t\t// Handle props that can temporarily get out of sync with the parent\n\t\t\t\t/** @type {Record<string, (v?: unknown) => unknown>} */\n\t\t\t\ttarget.special[key] = prop(\n\t\t\t\t\t{\n\t\t\t\t\t\tget [key]() {\n\t\t\t\t\t\t\treturn target.props[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t/** @type {string} */ (key),\n\t\t\t\t\tPROPS_IS_UPDATED\n\t\t\t\t);\n\t\t\t} finally {\n\t\t\t\tset_active_effect(previous_effect);\n\t\t\t}\n\t\t}\n\n\t\ttarget.special[key](value);\n\t\tupdate(target.version); // $$props is coarse-grained: when $$props.x is updated, usages of $$props.y etc are also rerun\n\t\treturn true;\n\t},\n\tgetOwnPropertyDescriptor(target, key) {\n\t\tif (target.exclude.includes(key)) return;\n\t\tif (key in target.props) {\n\t\t\treturn {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: target.props[key]\n\t\t\t};\n\t\t}\n\t},\n\tdeleteProperty(target, key) {\n\t\t// Svelte 4 allowed for deletions on $$restProps\n\t\tif (target.exclude.includes(key)) return true;\n\t\ttarget.exclude.push(key);\n\t\tupdate(target.version);\n\t\treturn true;\n\t},\n\thas(target, key) {\n\t\tif (target.exclude.includes(key)) return false;\n\t\treturn key in target.props;\n\t},\n\townKeys(target) {\n\t\treturn Reflect.ownKeys(target.props).filter((key) => !target.exclude.includes(key));\n\t}\n};\n\n/**\n * @param {Record<string, unknown>} props\n * @param {string[]} exclude\n * @returns {Record<string, unknown>}\n */\nexport function legacy_rest_props(props, exclude) {\n\treturn new Proxy(\n\t\t{\n\t\t\tprops,\n\t\t\texclude,\n\t\t\tspecial: {},\n\t\t\tversion: source(0),\n\t\t\t// TODO this is only necessary because we need to track component\n\t\t\t// destruction inside `prop`, because of `bind:this`, but it\n\t\t\t// seems likely that we can simplify `bind:this` instead\n\t\t\tparent_effect: /** @type {Effect} */ (active_effect)\n\t\t},\n\t\tlegacy_rest_props_handler\n\t);\n}\n\n/**\n * The proxy handler for spread props. Handles the incoming array of props\n * that looks like `() => { dynamic: props }, { static: prop }, ..` and wraps\n * them so that the whole thing is passed to the component as the `$$props` argument.\n * @type {ProxyHandler<{ props: Array<Record<string | symbol, unknown> | (() => Record<string | symbol, unknown>)> }>}}\n */\nconst spread_props_handler = {\n\tget(target, key) {\n\t\tlet i = target.props.length;\n\t\twhile (i--) {\n\t\t\tlet p = target.props[i];\n\t\t\tif (is_function(p)) p = p();\n\t\t\tif (typeof p === 'object' && p !== null && key in p) return p[key];\n\t\t}\n\t},\n\tset(target, key, value) {\n\t\tlet i = target.props.length;\n\t\twhile (i--) {\n\t\t\tlet p = target.props[i];\n\t\t\tif (is_function(p)) p = p();\n\t\t\tconst desc = get_descriptor(p, key);\n\t\t\tif (desc && desc.set) {\n\t\t\t\tdesc.set(value);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t},\n\tgetOwnPropertyDescriptor(target, key) {\n\t\tlet i = target.props.length;\n\t\twhile (i--) {\n\t\t\tlet p = target.props[i];\n\t\t\tif (is_function(p)) p = p();\n\t\t\tif (typeof p === 'object' && p !== null && key in p) {\n\t\t\t\tconst descriptor = get_descriptor(p, key);\n\t\t\t\tif (descriptor && !descriptor.configurable) {\n\t\t\t\t\t// Prevent a \"Non-configurability Report Error\": The target is an array, it does\n\t\t\t\t\t// not actually contain this property. If it is now described as non-configurable,\n\t\t\t\t\t// the proxy throws a validation error. Setting it to true avoids that.\n\t\t\t\t\tdescriptor.configurable = true;\n\t\t\t\t}\n\t\t\t\treturn descriptor;\n\t\t\t}\n\t\t}\n\t},\n\thas(target, key) {\n\t\t// To prevent a false positive `is_entry_props` in the `prop` function\n\t\tif (key === STATE_SYMBOL || key === LEGACY_PROPS) return false;\n\n\t\tfor (let p of target.props) {\n\t\t\tif (is_function(p)) p = p();\n\t\t\tif (p != null && key in p) return true;\n\t\t}\n\n\t\treturn false;\n\t},\n\townKeys(target) {\n\t\t/** @type {Array<string | symbol>} */\n\t\tconst keys = [];\n\n\t\tfor (let p of target.props) {\n\t\t\tif (is_function(p)) p = p();\n\t\t\tif (!p) continue;\n\n\t\t\tfor (const key in p) {\n\t\t\t\tif (!keys.includes(key)) keys.push(key);\n\t\t\t}\n\n\t\t\tfor (const key of Object.getOwnPropertySymbols(p)) {\n\t\t\t\tif (!keys.includes(key)) keys.push(key);\n\t\t\t}\n\t\t}\n\n\t\treturn keys;\n\t}\n};\n\n/**\n * @param {Array<Record<string, unknown> | (() => Record<string, unknown>)>} props\n * @returns {any}\n */\nexport function spread_props(...props) {\n\treturn new Proxy({ props }, spread_props_handler);\n}\n\n/**\n * This function is responsible for synchronizing a possibly bound prop with the inner component state.\n * It is used whenever the compiler sees that the component writes to the prop, or when it has a default prop_value.\n * @template V\n * @param {Record<string, unknown>} props\n * @param {string} key\n * @param {number} flags\n * @param {V | (() => V)} [fallback]\n * @returns {(() => V | ((arg: V) => V) | ((arg: V, mutation: boolean) => V))}\n */\nexport function prop(props, key, flags, fallback) {\n\tvar runes = !legacy_mode_flag || (flags & PROPS_IS_RUNES) !== 0;\n\tvar bindable = (flags & PROPS_IS_BINDABLE) !== 0;\n\tvar lazy = (flags & PROPS_IS_LAZY_INITIAL) !== 0;\n\n\tvar fallback_value = /** @type {V} */ (fallback);\n\tvar fallback_dirty = true;\n\n\tvar get_fallback = () => {\n\t\tif (fallback_dirty) {\n\t\t\tfallback_dirty = false;\n\n\t\t\tfallback_value = lazy\n\t\t\t\t? untrack(/** @type {() => V} */ (fallback))\n\t\t\t\t: /** @type {V} */ (fallback);\n\t\t}\n\n\t\treturn fallback_value;\n\t};\n\n\t/** @type {((v: V) => void) | undefined} */\n\tvar setter;\n\n\tif (bindable) {\n\t\t// Can be the case when someone does `mount(Component, props)` with `let props = $state({...})`\n\t\t// or `createClassComponent(Component, props)`\n\t\tvar is_entry_props = STATE_SYMBOL in props || LEGACY_PROPS in props;\n\n\t\tsetter =\n\t\t\tget_descriptor(props, key)?.set ??\n\t\t\t(is_entry_props && key in props ? (v) => (props[key] = v) : undefined);\n\t}\n\n\tvar initial_value;\n\tvar is_store_sub = false;\n\n\tif (bindable) {\n\t\t[initial_value, is_store_sub] = capture_store_binding(() => /** @type {V} */ (props[key]));\n\t} else {\n\t\tinitial_value = /** @type {V} */ (props[key]);\n\t}\n\n\tif (initial_value === undefined && fallback !== undefined) {\n\t\tinitial_value = get_fallback();\n\n\t\tif (setter) {\n\t\t\tif (runes) e.props_invalid_value(key);\n\t\t\tsetter(initial_value);\n\t\t}\n\t}\n\n\t/** @type {() => V} */\n\tvar getter;\n\n\tif (runes) {\n\t\tgetter = () => {\n\t\t\tvar value = /** @type {V} */ (props[key]);\n\t\t\tif (value === undefined) return get_fallback();\n\t\t\tfallback_dirty = true;\n\t\t\treturn value;\n\t\t};\n\t} else {\n\t\tgetter = () => {\n\t\t\tvar value = /** @type {V} */ (props[key]);\n\n\t\t\tif (value !== undefined) {\n\t\t\t\t// in legacy mode, we don't revert to the fallback value\n\t\t\t\t// if the prop goes from defined to undefined. The easiest\n\t\t\t\t// way to model this is to make the fallback undefined\n\t\t\t\t// as soon as the prop has a value\n\t\t\t\tfallback_value = /** @type {V} */ (undefined);\n\t\t\t}\n\n\t\t\treturn value === undefined ? fallback_value : value;\n\t\t};\n\t}\n\n\t// prop is never written to — we only need a getter\n\tif (runes && (flags & PROPS_IS_UPDATED) === 0) {\n\t\treturn getter;\n\t}\n\n\t// prop is written to, but the parent component had `bind:foo` which\n\t// means we can just call `$$props.foo = value` directly\n\tif (setter) {\n\t\tvar legacy_parent = props.$$legacy;\n\t\treturn /** @type {() => V} */ (\n\t\t\tfunction (/** @type {V} */ value, /** @type {boolean} */ mutation) {\n\t\t\t\tif (arguments.length > 0) {\n\t\t\t\t\t// We don't want to notify if the value was mutated and the parent is in runes mode.\n\t\t\t\t\t// In that case the state proxy (if it exists) should take care of the notification.\n\t\t\t\t\t// If the parent is not in runes mode, we need to notify on mutation, too, that the prop\n\t\t\t\t\t// has changed because the parent will not be able to detect the change otherwise.\n\t\t\t\t\tif (!runes || !mutation || legacy_parent || is_store_sub) {\n\t\t\t\t\t\t/** @type {Function} */ (setter)(mutation ? getter() : value);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\n\t\t\t\treturn getter();\n\t\t\t}\n\t\t);\n\t}\n\n\t// Either prop is written to, but there's no binding, which means we\n\t// create a derived that we can write to locally.\n\t// Or we are in legacy mode where we always create a derived to replicate that\n\t// Svelte 4 did not trigger updates when a primitive value was updated to the same value.\n\tvar overridden = false;\n\n\tvar d = ((flags & PROPS_IS_IMMUTABLE) !== 0 ? derived : derived_safe_equal)(() => {\n\t\toverridden = false;\n\t\treturn getter();\n\t});\n\n\tif (DEV) {\n\t\td.label = key;\n\t}\n\n\t// Capture the initial value if it's bindable\n\tif (bindable) get(d);\n\n\tvar parent_effect = /** @type {Effect} */ (active_effect);\n\n\treturn /** @type {() => V} */ (\n\t\tfunction (/** @type {any} */ value, /** @type {boolean} */ mutation) {\n\t\t\tif (arguments.length > 0) {\n\t\t\t\tconst new_value = mutation ? get(d) : runes && bindable ? proxy(value) : value;\n\n\t\t\t\tset(d, new_value);\n\t\t\t\toverridden = true;\n\n\t\t\t\tif (fallback_value !== undefined) {\n\t\t\t\t\tfallback_value = new_value;\n\t\t\t\t}\n\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\t// special case — avoid recalculating the derived if we're in a\n\t\t\t// teardown function and the prop was overridden locally, or the\n\t\t\t// component was already destroyed (this latter part is necessary\n\t\t\t// because `bind:this` can read props after the component has\n\t\t\t// been destroyed. TODO simplify `bind:this`\n\t\t\tif ((is_destroying_effect && overridden) || (parent_effect.f & DESTROYED) !== 0) {\n\t\t\t\treturn d.v;\n\t\t\t}\n\n\t\t\treturn get(d);\n\t\t}\n\t);\n}\n","/** @import { ComponentContext, ComponentContextLegacy } from '#client' */\n/** @import { EventDispatcher } from './index.js' */\n/** @import { NotFunction } from './internal/types.js' */\nimport { active_reaction, untrack } from './internal/client/runtime.js';\nimport { is_array } from './internal/shared/utils.js';\nimport { user_effect } from './internal/client/index.js';\nimport * as e from './internal/client/errors.js';\nimport { legacy_mode_flag } from './internal/flags/index.js';\nimport { component_context } from './internal/client/context.js';\nimport { DEV } from 'esm-env';\n\nif (DEV) {\n\t/**\n\t * @param {string} rune\n\t */\n\tfunction throw_rune_error(rune) {\n\t\tif (!(rune in globalThis)) {\n\t\t\t// TODO if people start adjusting the \"this can contain runes\" config through v-p-s more, adjust this message\n\t\t\t/** @type {any} */\n\t\t\tlet value; // let's hope noone modifies this global, but belts and braces\n\t\t\tObject.defineProperty(globalThis, rune, {\n\t\t\t\tconfigurable: true,\n\t\t\t\t// eslint-disable-next-line getter-return\n\t\t\t\tget: () => {\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t}\n\n\t\t\t\t\te.rune_outside_svelte(rune);\n\t\t\t\t},\n\t\t\t\tset: (v) => {\n\t\t\t\t\tvalue = v;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tthrow_rune_error('$state');\n\tthrow_rune_error('$effect');\n\tthrow_rune_error('$derived');\n\tthrow_rune_error('$inspect');\n\tthrow_rune_error('$props');\n\tthrow_rune_error('$bindable');\n}\n\n/**\n * Returns an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that aborts when the current [derived](https://svelte.dev/docs/svelte/$derived) or [effect](https://svelte.dev/docs/svelte/$effect) re-runs or is destroyed.\n *\n * Must be called while a derived or effect is running.\n *\n * ```svelte\n * <script>\n * \timport { getAbortSignal } from 'svelte';\n *\n * \tlet { id } = $props();\n *\n * \tasync function getData(id) {\n * \t\tconst response = await fetch(`/items/${id}`, {\n * \t\t\tsignal: getAbortSignal()\n * \t\t});\n *\n * \t\treturn await response.json();\n * \t}\n *\n * \tconst data = $derived(await getData(id));\n * </script>\n * ```\n */\nexport function getAbortSignal() {\n\tif (active_reaction === null) {\n\t\te.get_abort_signal_outside_reaction();\n\t}\n\n\treturn (active_reaction.ac ??= new AbortController()).signal;\n}\n\n/**\n * `onMount`, like [`$effect`](https://svelte.dev/docs/svelte/$effect), schedules a function to run as soon as the component has been mounted to the DOM.\n * Unlike `$effect`, the provided function only runs once.\n *\n * It must be called during the component's initialisation (but doesn't need to live _inside_ the component;\n * it can be called from an external module). If a function is returned _synchronously_ from `onMount`,\n * it will be called when the component is unmounted.\n *\n * `onMount` functions do not run during [server-side rendering](https://svelte.dev/docs/svelte/svelte-server#render).\n *\n * @template T\n * @param {() => NotFunction<T> | Promise<NotFunction<T>> | (() => any)} fn\n * @returns {void}\n */\nexport function onMount(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('onMount');\n\t}\n\n\tif (legacy_mode_flag && component_context.l !== null) {\n\t\tinit_update_callbacks(component_context).m.push(fn);\n\t} else {\n\t\tuser_effect(() => {\n\t\t\tconst cleanup = untrack(fn);\n\t\t\tif (typeof cleanup === 'function') return /** @type {() => void} */ (cleanup);\n\t\t});\n\t}\n}\n\n/**\n * Schedules a callback to run immediately before the component is unmounted.\n *\n * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the\n * only one that runs inside a server-side component.\n *\n * @param {() => any} fn\n * @returns {void}\n */\nexport function onDestroy(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('onDestroy');\n\t}\n\n\tonMount(() => () => untrack(fn));\n}\n\n/**\n * @template [T=any]\n * @param {string} type\n * @param {T} [detail]\n * @param {any}params_0\n * @returns {CustomEvent<T>}\n */\nfunction create_custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n\treturn new CustomEvent(type, { detail, bubbles, cancelable });\n}\n\n/**\n * Creates an event dispatcher that can be used to dispatch [component events](https://svelte.dev/docs/svelte/legacy-on#Component-events).\n * Event dispatchers are functions that can take two arguments: `name` and `detail`.\n *\n * Component events created with `createEventDispatcher` create a\n * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).\n * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).\n * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)\n * property and can contain any type of data.\n *\n * The event dispatcher can be typed to narrow the allowed event names and the type of the `detail` argument:\n * ```ts\n * const dispatch = createEventDispatcher<{\n * loaded: null; // does not take a detail argument\n * change: string; // takes a detail argument of type string, which is required\n * optional: number | null; // takes an optional detail argument of type number\n * }>();\n * ```\n *\n * @deprecated Use callback props and/or the `$host()` rune instead — see [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Event-changes-Component-events)\n * @template {Record<string, any>} [EventMap = any]\n * @returns {EventDispatcher<EventMap>}\n */\nexport function createEventDispatcher() {\n\tconst active_component_context = component_context;\n\tif (active_component_context === null) {\n\t\te.lifecycle_outside_component('createEventDispatcher');\n\t}\n\n\t/**\n\t * @param [detail]\n\t * @param [options]\n\t */\n\treturn (type, detail, options) => {\n\t\tconst events = /** @type {Record<string, Function | Function[]>} */ (\n\t\t\tactive_component_context.s.$$events\n\t\t)?.[/** @type {string} */ (type)];\n\n\t\tif (events) {\n\t\t\tconst callbacks = is_array(events) ? events.slice() : [events];\n\t\t\t// TODO are there situations where events could be dispatched\n\t\t\t// in a server (non-DOM) environment?\n\t\t\tconst event = create_custom_event(/** @type {string} */ (type), detail, options);\n\t\t\tfor (const fn of callbacks) {\n\t\t\t\tfn.call(active_component_context.x, event);\n\t\t\t}\n\t\t\treturn !event.defaultPrevented;\n\t\t}\n\n\t\treturn true;\n\t};\n}\n\n// TODO mark beforeUpdate and afterUpdate as deprecated in Svelte 6\n\n/**\n * Schedules a callback to run immediately before the component is updated after any state change.\n *\n * The first time the callback runs will be before the initial `onMount`.\n *\n * In runes mode use `$effect.pre` instead.\n *\n * @deprecated Use [`$effect.pre`](https://svelte.dev/docs/svelte/$effect#$effect.pre) instead\n * @param {() => void} fn\n * @returns {void}\n */\nexport function beforeUpdate(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('beforeUpdate');\n\t}\n\n\tif (component_context.l === null) {\n\t\te.lifecycle_legacy_only('beforeUpdate');\n\t}\n\n\tinit_update_callbacks(component_context).b.push(fn);\n}\n\n/**\n * Schedules a callback to run immediately after the component has been updated.\n *\n * The first time the callback runs will be after the initial `onMount`.\n *\n * In runes mode use `$effect` instead.\n *\n * @deprecated Use [`$effect`](https://svelte.dev/docs/svelte/$effect) instead\n * @param {() => void} fn\n * @returns {void}\n */\nexport function afterUpdate(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('afterUpdate');\n\t}\n\n\tif (component_context.l === null) {\n\t\te.lifecycle_legacy_only('afterUpdate');\n\t}\n\n\tinit_update_callbacks(component_context).a.push(fn);\n}\n\n/**\n * Legacy-mode: Init callbacks object for onMount/beforeUpdate/afterUpdate\n * @param {ComponentContext} context\n */\nfunction init_update_callbacks(context) {\n\tvar l = /** @type {ComponentContextLegacy} */ (context).l;\n\treturn (l.u ??= { a: [], b: [], m: [] });\n}\n\nexport { flushSync } from './internal/client/reactivity/batch.js';\nexport { getContext, getAllContexts, hasContext, setContext } from './internal/client/context.js';\nexport { hydrate, mount, unmount } from './internal/client/render.js';\nexport { tick, untrack, settled } from './internal/client/runtime.js';\nexport { createRawSnippet } from './internal/client/dom/blocks/snippet.js';\n","// generated during release, do not modify\n\n/**\n * The current version, as set in package.json.\n * @type {string}\n */\nexport const VERSION = '5.38.2';\nexport const PUBLIC_VERSION = '5';\n","import { PUBLIC_VERSION } from '../version.js';\n\nif (typeof window !== 'undefined') {\n\t// @ts-expect-error\n\t((window.__svelte ??= {}).v ??= new Set()).add(PUBLIC_VERSION);\n}\n","\nexport function keyEnter(fn) {\n return function (e) {\n return e.key === 'Enter' || e.key === ' ' && !e.preventDefault() // prevent page scroll down\n ? fn.call(this, e)\n : undefined;\n };\n}\n","\nexport function setContent(node, content) {\n let actions = {\n update(content) {\n if (typeof content == 'string') {\n node.innerText = content;\n } else if (content?.domNodes) {\n node.replaceChildren(...content.domNodes);\n } else if (content?.html) {\n node.innerHTML = content.html;\n }\n }\n };\n actions.update(content);\n\n return actions;\n}\n\n/** Dispatch event occurred outside of node */\nexport function outsideEvent(node, type) {\n\n const handlePointerDown = jsEvent => {\n if (node && !node.contains(jsEvent.target)) {\n node.dispatchEvent(\n new CustomEvent(type + 'outside', {detail: {jsEvent}})\n );\n }\n };\n\n document.addEventListener(type, handlePointerDown, true);\n\n return {\n destroy() {\n document.removeEventListener(type, handlePointerDown, true);\n }\n };\n}\n\nexport function observeResize(node, callback) {\n let resizeObserver = new ResizeObserver(entries => {\n for (let entry of entries) {\n callback(entry);\n }\n });\n resizeObserver.observe(node);\n\n return {\n destroy() {\n resizeObserver.unobserve(node);\n }\n };\n}\n","export const DAY_IN_SECONDS = 86400;\n\nexport function createDate(input = undefined) {\n if (input !== undefined) {\n return input instanceof Date ? _fromLocalDate(input) : _fromISOString(input);\n }\n\n return _fromLocalDate(new Date());\n}\n\nexport function createDuration(input) {\n if (typeof input === 'number') {\n input = {seconds: input};\n } else if (typeof input === 'string') {\n // Expected format hh[:mm[:ss]]\n let seconds = 0, exp = 2;\n for (let part of input.split(':', 3)) {\n seconds += parseInt(part, 10) * Math.pow(60, exp--);\n }\n input = {seconds};\n } else if (input instanceof Date) {\n input = {hours: input.getUTCHours(), minutes: input.getUTCMinutes(), seconds: input.getUTCSeconds()};\n }\n\n let weeks = input.weeks || input.week || 0;\n\n return {\n years: input.years || input.year || 0,\n months: input.months || input.month || 0,\n days: weeks * 7 + (input.days || input.day || 0),\n seconds: (input.hours || input.hour || 0) * 60 * 60 +\n (input.minutes || input.minute || 0) * 60 +\n (input.seconds || input.second || 0),\n inWeeks: !!weeks\n };\n}\n\nexport function cloneDate(date) {\n return new Date(date.getTime());\n}\n\nexport function addDuration(date, duration, x = 1) {\n date.setUTCFullYear(date.getUTCFullYear() + x * duration.years);\n let month = date.getUTCMonth() + x * duration.months;\n date.setUTCMonth(month);\n month %= 12;\n if (month < 0) {\n month += 12;\n }\n while (date.getUTCMonth() !== month) {\n subtractDay(date);\n }\n date.setUTCDate(date.getUTCDate() + x * duration.days);\n date.setUTCSeconds(date.getUTCSeconds() + x * duration.seconds);\n\n return date;\n}\n\nexport function subtractDuration(date, duration, x = 1) {\n return addDuration(date, duration, -x);\n}\n\nexport function addDay(date, x = 1) {\n date.setUTCDate(date.getUTCDate() + x);\n\n return date;\n}\n\nexport function subtractDay(date, x = 1) {\n return addDay(date, -x);\n}\n\nexport function setMidnight(date) {\n date.setUTCHours(0, 0, 0, 0);\n\n return date;\n}\n\nexport function toLocalDate(date) {\n return new Date(\n date.getUTCFullYear(),\n date.getUTCMonth(),\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds()\n );\n}\n\nexport function toISOString(date, len = 19) {\n return date.toISOString().substring(0, len);\n}\n\nexport function datesEqual(date1, ...dates2) {\n return dates2.every(date2 => date1.getTime() === date2.getTime());\n}\n\nexport function nextClosestDay(date, day) {\n let diff = day - date.getUTCDay();\n date.setUTCDate(date.getUTCDate() + (diff >= 0 ? diff : diff + 7));\n return date;\n}\n\nexport function prevClosestDay(date, day) {\n let diff = day - date.getUTCDay();\n date.setUTCDate(date.getUTCDate() + (diff <= 0 ? diff : diff - 7));\n return date;\n}\n\n/**\n * Check whether given date is string which contains no time part\n */\nexport function noTimePart(date) {\n return typeof date === 'string' && date.length <= 10;\n}\n\n/**\n * Copy time from one date to another\n */\nexport function copyTime(toDate, fromDate) {\n toDate.setUTCHours(fromDate.getUTCHours(), fromDate.getUTCMinutes(), fromDate.getUTCSeconds(), 0);\n\n return toDate;\n}\n\n/**\n * Get duration value in seconds\n */\nexport function toSeconds(duration) {\n return duration.seconds;\n}\n\n/**\n * Move the date forward (when pressing the next button)\n */\nexport function nextDate(date, duration) {\n addDuration(date, duration);\n return date;\n}\n\n/**\n * Move the date backward (when pressing the prev button)\n */\nexport function prevDate(date, duration, hiddenDays) {\n subtractDuration(date, duration);\n if (hiddenDays.length && hiddenDays.length < 7) {\n while (hiddenDays.includes(date.getUTCDay())) {\n subtractDay(date);\n }\n }\n return date;\n}\n\n/**\n * For a given date, get its week number\n * - ISO @see https://stackoverflow.com/questions/6117814/get-week-of-year-in-javascript-like-in-php\n * - Western @see https://en.wikipedia.org/wiki/Week#Other_week_numbering_systems\n */\nexport function getWeekNumber(date, firstDay) {\n // Copy date so don't modify original\n date = cloneDate(date);\n if (firstDay == 0) { // Western\n // Set to nearest Saturday: current date + 6 - current day number\n date.setUTCDate(date.getUTCDate() + 6 - date.getUTCDay());\n } else { // ISO\n // Set to nearest Thursday: current date + 4 - current day number\n // Make Sunday's day number 7\n date.setUTCDate(date.getUTCDate() + 4 - (date.getUTCDay() || 7));\n }\n // Get first day of year\n let yearStart = new Date(Date.UTC(date.getUTCFullYear(),0,1));\n // Calculate full weeks to `date`\n return Math.ceil((((date - yearStart) / 1000 / DAY_IN_SECONDS) + 1) / 7);\n}\n\n/**\n * Private functions\n */\n\nfunction _fromLocalDate(date) {\n return new Date(Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds()\n ));\n}\n\nfunction _fromISOString(str) {\n const parts = str.match(/\\d+/g);\n return new Date(Date.UTC(\n Number(parts[0]),\n Number(parts[1]) - 1,\n Number(parts[2]),\n Number(parts[3] || 0),\n Number(parts[4] || 0),\n Number(parts[5] || 0)\n ));\n}\n","export function assign(...args) {\n return Object.assign(...args);\n}\n\nexport function keys(object) {\n return Object.keys(object);\n}\n\nexport function entries(object) {\n return Object.entries(object);\n}\n\nexport function floor(value) {\n return Math.floor(value);\n}\n\nexport function ceil(value) {\n return Math.ceil(value);\n}\n\nexport function min(...args) {\n return Math.min(...args);\n}\n\nexport function max(...args) {\n return Math.max(...args);\n}\n\nexport function symbol() {\n return Symbol('ec');\n}\n\nexport function isArray(value) {\n return Array.isArray(value);\n}\n\nexport function isFunction(value) {\n return typeof value === 'function';\n}\n\nexport function run(fn) {\n return fn();\n}\n\nexport function runAll(fns) {\n fns.forEach(run);\n}\n\nexport function noop() {}\n\nexport const identity = (x) => x;\n\nexport function stopPropagation(fn) {\n return function (event) {\n event.stopPropagation();\n if (fn) {\n fn.call(this, event);\n }\n };\n}\n","import {runAll} from './utils.js';\n\nexport function debounce(fn, handle, queueStore) {\n queueStore.update(queue => queue.set(handle, fn));\n}\n\nexport function flushDebounce(queue) {\n runAll(queue);\n queue.clear();\n}\n\nexport function task(fn, handle, tasks) {\n handle ??= fn;\n if (!tasks.has(handle)) {\n tasks.set(handle, setTimeout(() => {\n tasks.delete(handle);\n fn();\n }));\n }\n}\n","import {symbol} from './utils.js';\n\nlet payloadProp = symbol();\nexport function setPayload(obj, payload) {\n obj[payloadProp] = payload;\n}\n\nexport function hasPayload(obj) {\n return !!obj?.[payloadProp];\n}\n\nexport function getPayload(obj) {\n return obj[payloadProp];\n}\n","import {hasPayload} from './payload.js';\n\nexport function createElement(tag, className, content, attrs = []) {\n let el = document.createElement(tag);\n el.className = className;\n if (typeof content == 'string') {\n el.innerText = content;\n } else if (content.domNodes) {\n el.replaceChildren(...content.domNodes);\n } else if (content.html) {\n el.innerHTML = content.html;\n }\n for (let attr of attrs) {\n el.setAttribute(...attr);\n }\n return el;\n}\n\nexport function hasYScroll(el) {\n return el.scrollHeight > el.clientHeight;\n}\n\nexport function rect(el) {\n return el.getBoundingClientRect();\n}\n\nexport function ancestor(el, up) {\n while (up--) {\n el = el.parentElement;\n }\n return el;\n}\n\nexport function height(el) {\n return rect(el).height;\n}\n\nexport function getElementWithPayload(x, y, root = document, processed = []) {\n processed.push(root);\n for (let el of root.elementsFromPoint(x, y)) {\n if (hasPayload(el)) {\n return el;\n }\n /** @see https://github.com/vkurko/calendar/issues/142 */\n if (el.shadowRoot && !processed.includes(el.shadowRoot)) {\n let shadowEl = getElementWithPayload(x, y, el.shadowRoot, processed);\n if (shadowEl) {\n return shadowEl;\n }\n }\n }\n return null;\n}\n\nexport function listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\n","import {assign} from './utils.js';\nimport {toLocalDate} from './date.js';\n\nexport function createView(view, _viewTitle, _currentRange, _activeRange) {\n return {\n type: view,\n title: _viewTitle,\n currentStart: _currentRange.start,\n currentEnd: _currentRange.end,\n activeStart: _activeRange.start,\n activeEnd: _activeRange.end,\n calendar: undefined\n };\n}\n\nexport function toViewWithLocalDates(view) {\n view = assign({}, view);\n view.currentStart = toLocalDate(view.currentStart);\n view.currentEnd = toLocalDate(view.currentEnd);\n view.activeStart = toLocalDate(view.activeStart);\n view.activeEnd = toLocalDate(view.activeEnd);\n\n return view;\n}\n\nexport function listView(view) {\n return view.startsWith('list');\n}\n\nexport function timelineView(view) {\n return view.includes('Timeline');\n}\n","import {addDay, addDuration, datesEqual, createDate, cloneDate, setMidnight, toLocalDate, toISOString, noTimePart, copyTime} from './date.js';\nimport {createElement} from './dom.js';\nimport {assign, isArray, isFunction} from './utils.js';\nimport {toViewWithLocalDates} from './view.js';\n\nlet eventId = 1;\nexport function createEvents(input) {\n return input.map(event => {\n let result = {\n id: 'id' in event ? String(event.id) : `{generated-${eventId++}}`,\n resourceIds: toArrayProp(event, 'resourceId').map(String),\n allDay: event.allDay ?? (noTimePart(event.start) && noTimePart(event.end)),\n start: createDate(event.start),\n end: createDate(event.end),\n title: event.title ?? '',\n editable: event.editable,\n startEditable: event.startEditable,\n durationEditable: event.durationEditable,\n display: event.display ?? 'auto',\n extendedProps: event.extendedProps ?? {},\n backgroundColor: event.backgroundColor ?? event.color,\n textColor: event.textColor,\n classNames: toArrayProp(event, 'className'),\n styles: toArrayProp(event, 'style')\n };\n\n if (result.allDay) {\n // Make sure all-day events start and end at midnight\n setMidnight(result.start);\n let end = cloneDate(result.end);\n setMidnight(result.end);\n if (\n !datesEqual(result.end, end) ||\n datesEqual(result.end, result.start) /** @see https://github.com/vkurko/calendar/issues/50 */\n ) {\n addDay(result.end);\n }\n }\n\n return result;\n });\n}\n\nfunction toArrayProp(input, propName) {\n let result = input[propName + 's'] ?? input[propName] ?? [];\n return isArray(result) ? result : [result];\n}\n\nexport function createEventSources(input) {\n return input.map(source => ({\n events: source.events,\n url: (source.url && source.url.trimEnd('&')) || '',\n method: (source.method && source.method.toUpperCase()) || 'GET',\n extraParams: source.extraParams || {}\n }));\n}\n\nexport function createEventChunk(event, start, end) {\n let chunk = {\n start: event.start > start ? event.start : start,\n end: event.end < end ? event.end : end,\n event\n };\n chunk.zeroDuration = datesEqual(chunk.start, chunk.end);\n\n return chunk;\n}\n\nexport function sortEventChunks(chunks, eventOrder) {\n if (isFunction(eventOrder)) {\n chunks.sort((a, b) => eventOrder(\n _toChunkWithLocalDates(a),\n _toChunkWithLocalDates(b)\n ));\n } else {\n // Sort by start date (all-day events always on top)\n chunks.sort((a, b) => a.start - b.start || b.event.allDay - a.event.allDay);\n }\n}\n\nfunction _toChunkWithLocalDates(chunk) {\n return {\n ...chunk,\n start: toLocalDate(chunk.start),\n end: toLocalDate(chunk.end),\n event: toEventWithLocalDates(chunk.event)\n };\n}\n\nexport function createEventContent(chunk, displayEventEnd, eventContent, theme, _intlEventTime, _view) {\n let timeText = _intlEventTime.formatRange(\n chunk.start,\n displayEventEnd && chunk.event.display !== 'pointer' && !chunk.zeroDuration\n ? copyTime(cloneDate(chunk.start), chunk.end) // make Intl.formatRange output only the time part\n : chunk.start\n );\n let content;\n\n if (eventContent) {\n content = isFunction(eventContent)\n ? eventContent({\n event: toEventWithLocalDates(chunk.event),\n timeText,\n view: toViewWithLocalDates(_view)\n })\n : eventContent;\n }\n\n if (content === undefined) {\n let domNodes;\n switch (chunk.event.display) {\n case 'background':\n domNodes = [];\n break;\n case 'pointer':\n domNodes = [createTimeElement(timeText, chunk, theme)];\n break;\n default:\n domNodes = [\n ...chunk.event.allDay ? [] : [createTimeElement(timeText, chunk, theme)],\n createElement('h4', theme.eventTitle, chunk.event.title)\n ];\n }\n content = {domNodes};\n }\n\n return [timeText, content];\n}\n\nfunction createTimeElement(timeText, chunk, theme) {\n return createElement(\n 'time',\n theme.eventTime,\n timeText,\n [['datetime', toISOString(chunk.start)]]\n );\n}\n\nexport function createEventClasses(eventClassNames, event, _view) {\n let result = event.classNames;\n if (eventClassNames) {\n if (isFunction(eventClassNames)) {\n eventClassNames = eventClassNames({\n event: toEventWithLocalDates(event),\n view: toViewWithLocalDates(_view)\n });\n }\n result = [\n ...isArray(eventClassNames) ? eventClassNames : [eventClassNames],\n ...result\n ];\n }\n return result;\n}\n\nexport function toEventWithLocalDates(event) {\n return _cloneEvent(event, toLocalDate);\n}\n\nexport function cloneEvent(event) {\n return _cloneEvent(event, cloneDate);\n}\n\nfunction _cloneEvent(event, dateFn) {\n event = assign({}, event);\n event.start = dateFn(event.start);\n event.end = dateFn(event.end);\n\n return event;\n}\n\n/**\n * Prepare event chunks for month view and all-day slot in week view\n */\nexport function prepareEventChunks(chunks, hiddenDays, eventOrder) {\n let longChunks = {};\n\n if (chunks.length) {\n sortEventChunks(chunks, eventOrder);\n\n let prevChunk;\n for (let chunk of chunks) {\n let dates = [];\n let date = setMidnight(cloneDate(chunk.start));\n while (chunk.end > date) {\n if (!hiddenDays.includes(date.getUTCDay())) {\n dates.push(cloneDate(date));\n if (dates.length > 1) {\n let key = date.getTime();\n if (longChunks[key]) {\n longChunks[key].chunks.push(chunk);\n } else {\n longChunks[key] = {\n sorted: false,\n chunks: [chunk]\n };\n }\n }\n }\n addDay(date);\n }\n if (dates.length) {\n chunk.date = dates[0];\n chunk.days = dates.length;\n chunk.dates = dates;\n // Adjust the start and end dates of the chunk if hidden days affected them\n if (chunk.start < dates[0]) {\n chunk.start = dates[0];\n }\n let maxEnd = addDay(cloneDate(dates.at(-1)));\n if (chunk.end > maxEnd) {\n chunk.end = maxEnd;\n }\n } else {\n chunk.date = setMidnight(cloneDate(chunk.start));\n chunk.days = 1;\n chunk.dates = [chunk.date];\n }\n\n if (prevChunk && datesEqual(prevChunk.date, chunk.date)) {\n chunk.prev = prevChunk;\n }\n prevChunk = chunk;\n }\n }\n\n return longChunks;\n}\n\nexport function repositionEvent(chunk, longChunks, height) {\n chunk.top = 0;\n if (chunk.prev) {\n chunk.top = chunk.prev.bottom + 1;\n }\n chunk.bottom = chunk.top + height;\n let margin = 1;\n let key = chunk.date.getTime();\n if (longChunks[key]) {\n if (!longChunks[key].sorted) {\n longChunks[key].chunks.sort((a, b) => a.top - b.top);\n longChunks[key].sorted = true;\n }\n for (let longChunk of longChunks[key].chunks) {\n if (chunk.top < longChunk.bottom && chunk.bottom > longChunk.top) {\n let offset = longChunk.bottom - chunk.top + 1;\n margin += offset;\n chunk.top += offset;\n chunk.bottom += offset;\n }\n }\n }\n\n return margin;\n}\n\nexport function runReposition(refs, data) {\n refs.length = data.length;\n let result = [];\n for (let ref of refs) {\n result.push(ref?.reposition?.());\n }\n return result;\n}\n\n/**\n * Check whether the event intersects with the given date range and resources\n * @param event\n * @param start\n * @param end\n * @param resources\n * @return boolean\n */\nexport function eventIntersects(event, start, end, resources) {\n if (event.start < end && event.end > start) {\n if (resources) {\n if (!isArray(resources)) {\n resources = [resources];\n }\n return resources.some(resource => event.resourceIds.includes(resource.id));\n }\n return true;\n }\n return false;\n}\n\nexport function helperEvent(display) {\n return previewEvent(display) || ghostEvent(display) || pointerEvent(display);\n}\n\nexport function bgEvent(display) {\n return display === 'background';\n}\n\nexport function previewEvent(display) {\n return display === 'preview';\n}\n\nexport function ghostEvent(display) {\n return display === 'ghost';\n}\n\nexport function pointerEvent(display) {\n return display === 'pointer';\n}\n","\nexport function btnTextDay(text) {\n return btnText(text, 'day');\n}\n\nexport function btnTextWeek(text) {\n return btnText(text, 'week');\n}\n\nexport function btnTextMonth(text) {\n return btnText(text, 'month');\n}\n\nexport function btnTextYear(text) {\n return btnText(text, 'year');\n}\n\nfunction btnText(text, period) {\n return {\n ...text,\n next: 'Next ' + period,\n prev: 'Previous ' + period\n };\n}\n\nexport function themeView(view) {\n return theme => ({...theme, view});\n}\n","import {createDate, setMidnight} from './date.js';\n\nexport function createDateRange(input) {\n let start, end;\n if (input) {\n ({start, end} = input);\n if (start) {\n start = setMidnight(createDate(start));\n }\n if (end) {\n end = setMidnight(createDate(end));\n }\n }\n return {start, end};\n}\n\nexport function outsideRange(date, range) {\n return range.start && date < range.start || range.end && date > range.end;\n}\n\nexport function limitToRange(date, range) {\n if (range.start && date < range.start) {\n date = range.start;\n }\n if (range.end && date > range.end) {\n date = range.end;\n }\n return date;\n}\n","import {setPayload} from './payload.js';\n\nexport function createResources(input) {\n let result = [];\n _createResources(input, 0, result);\n return result;\n}\n\nfunction _createResources(input, level, flat) {\n let result = [];\n for (let item of input) {\n let resource = createResource(item);\n result.push(resource);\n flat.push(resource);\n let payload = {\n level,\n children: [],\n expanded: true,\n hidden: false\n };\n setPayload(resource, payload);\n if (item.children) {\n payload.children = _createResources(item.children, level + 1, flat);\n }\n }\n return result;\n}\n\nexport function createResource(input) {\n return {\n id: String(input.id),\n title: input.title || '',\n eventBackgroundColor: input.eventBackgroundColor,\n eventTextColor: input.eventTextColor,\n extendedProps: input.extendedProps ?? {}\n };\n}\n\nexport function resourceBackgroundColor(event, resources) {\n return findResource(event, resources)?.eventBackgroundColor;\n}\n\nexport function resourceTextColor(event, resources) {\n return findResource(event, resources)?.eventTextColor;\n}\n\nfunction findResource(event, resources) {\n return resources.find(resource => event.resourceIds.includes(resource.id));\n}\n","import {derived} from 'svelte/store';\nimport {isFunction} from './utils.js';\nimport {toLocalDate} from './date.js';\nimport {createResources} from './resources.js';\nimport {getPayload} from './payload.js';\n\nexport function intl(locale, format) {\n return derived([locale, format], ([$locale, $format]) => {\n let intl = isFunction($format)\n ? {format: $format}\n : new Intl.DateTimeFormat($locale, $format);\n return {\n format: date => intl.format(toLocalDate(date))\n };\n });\n}\n\nexport function intlRange(locale, format) {\n return derived([locale, format], ([$locale, $format]) => {\n let formatRange;\n if (isFunction($format)) {\n formatRange = $format;\n } else {\n let intl = new Intl.DateTimeFormat($locale, $format);\n formatRange = (start, end) => {\n if (start <= end) {\n return intl.formatRange(start, end);\n } else {\n // In iOS 16 and older, intl.formatRange() throws an exception if the start date is later than the end date.\n // Therefore, we first swap the parameters, and then swap the resulting parts.\n /** @see https://github.com/vkurko/calendar/issues/227 */\n let parts = intl.formatRangeToParts(end, start);\n let result = '';\n let sources = ['startRange', 'endRange'];\n let processed = [false, false];\n for (let part of parts) {\n let i = sources.indexOf(part.source);\n if (i >= 0) {\n if (!processed[i]) {\n result += _getParts(sources[1 - i], parts);\n processed[i] = true;\n }\n } else {\n result += part.value;\n }\n }\n return result;\n }\n };\n }\n return {\n formatRange: (start, end) => formatRange(toLocalDate(start), toLocalDate(end))\n };\n });\n}\n\nfunction _getParts(source, parts) {\n let result = '';\n for (let part of parts) {\n if (part.source == source) {\n result += part.value;\n }\n }\n return result;\n}\n\nexport function viewResources(state) {\n return derived(\n [state.resources, state.filterResourcesWithEvents, state._filteredEvents, state._activeRange],\n ([$resources, $filterResourcesWithEvents, $_filteredEvents, $_activeRange]) => {\n let result = $resources.filter(resource => !getPayload(resource).hidden);\n\n if ($filterResourcesWithEvents) {\n result = $resources.filter(resource => {\n for (let event of $_filteredEvents) {\n if (\n event.display !== 'background' &&\n event.resourceIds.includes(resource.id) &&\n event.start < $_activeRange.end &&\n event.end > $_activeRange.start\n ) {\n return true;\n }\n }\n return false;\n });\n }\n\n if (!result.length) {\n result = createResources([{}]);\n }\n\n return result;\n }\n );\n}\n","import {addDuration, cloneDate, createDuration, DAY_IN_SECONDS, toISOString, toSeconds} from './date.js';\nimport {max as maxFn, min as minFn, isFunction} from './utils.js';\nimport {bgEvent} from './events.js';\n\nexport function createTimes(date, $slotDuration, $slotLabelInterval, $_slotTimeLimits, $_intlSlotLabel) {\n date = cloneDate(date);\n let times = [];\n let end = cloneDate(date);\n addDuration(date, $_slotTimeLimits.min);\n addDuration(end, $_slotTimeLimits.max);\n // Labels\n if ($slotLabelInterval === undefined) {\n $slotLabelInterval = $slotDuration.seconds < 3600\n ? createDuration($slotDuration.seconds * 2)\n : $slotDuration;\n }\n let label = cloneDate(date);\n // Build times\n while (date < end) {\n times.push([\n toISOString(date),\n $_intlSlotLabel.format(date),\n date >= label\n ]);\n while ($slotLabelInterval.seconds && date >= label) {\n addDuration(label, $slotLabelInterval);\n }\n addDuration(date, $slotDuration);\n }\n\n return times;\n}\n\nexport function createSlotTimeLimits($slotMinTime, $slotMaxTime, $flexibleSlotTimeLimits, $_viewDates, $_filteredEvents) {\n let min = createDuration($slotMinTime);\n let max = createDuration($slotMaxTime);\n\n if ($flexibleSlotTimeLimits) {\n // If slotMaxTime goes past midnight, then extend it back by a maximum of 24 hours\n let minMin = createDuration(minFn(toSeconds(min), maxFn(0, toSeconds(max) - DAY_IN_SECONDS)));\n let maxMax = createDuration(maxFn(toSeconds(max), toSeconds(minMin) + DAY_IN_SECONDS));\n let filter = isFunction($flexibleSlotTimeLimits?.eventFilter)\n ? $flexibleSlotTimeLimits.eventFilter\n : event => !bgEvent(event.display);\n loop: for (let date of $_viewDates) {\n let start = addDuration(cloneDate(date), min);\n let end = addDuration(cloneDate(date), max);\n let minStart = addDuration(cloneDate(date), minMin);\n let maxEnd = addDuration(cloneDate(date), maxMax);\n for (let event of $_filteredEvents) {\n if (!event.allDay && filter(event) && event.start < maxEnd && event.end > minStart) {\n if (event.start < start) {\n let seconds = maxFn((event.start - date) / 1000, toSeconds(minMin));\n if (seconds < toSeconds(min)) {\n min.seconds = seconds;\n }\n }\n if (event.end > end) {\n let seconds = minFn((event.end - date) / 1000, toSeconds(maxMax));\n if (seconds > toSeconds(max)) {\n max.seconds = seconds;\n }\n }\n if (toSeconds(min) === toSeconds(minMin) && toSeconds(max) === toSeconds(maxMax)) {\n break loop;\n }\n }\n }\n }\n }\n\n return {min, max};\n}\n","import {\n createDate, createDuration, createEvents, createEventSources, createResources, createDateRange, keys, setMidnight\n} from '#lib';\n\nexport function createOptions(plugins) {\n let options = {\n allDayContent: undefined,\n allDaySlot: true,\n buttonText: {\n today: 'today',\n },\n customButtons: {},\n date: new Date(),\n datesSet: undefined,\n dayHeaderFormat: {\n weekday: 'short',\n month: 'numeric',\n day: 'numeric'\n },\n dayHeaderAriaLabelFormat: {\n dateStyle: 'full'\n },\n displayEventEnd: true,\n duration: {weeks: 1},\n events: [],\n eventAllUpdated: undefined,\n eventBackgroundColor: undefined,\n eventClassNames: undefined,\n eventClick: undefined,\n eventColor: undefined,\n eventContent: undefined,\n eventDidMount: undefined,\n eventFilter: undefined, // ec option\n eventMouseEnter: undefined,\n eventMouseLeave: undefined,\n eventOrder: undefined,\n eventSources: [],\n eventTextColor: undefined,\n eventTimeFormat: {\n hour: 'numeric',\n minute: '2-digit'\n },\n filterEventsWithResources: false,\n filterResourcesWithEvents: false,\n firstDay: 0,\n flexibleSlotTimeLimits: false, // ec option\n headerToolbar: {\n start: 'title',\n center: '',\n end: 'today prev,next'\n },\n height: undefined,\n hiddenDays: [],\n highlightedDates: [], // ec option\n lazyFetching: true,\n loading: undefined,\n locale: undefined,\n nowIndicator: false,\n resourceLabelContent: undefined,\n resourceLabelDidMount: undefined,\n resources: [],\n selectable: false,\n scrollTime: '06:00:00',\n slotDuration: '00:30:00',\n slotEventOverlap: true,\n slotHeight: 24, // ec option\n slotLabelInterval: undefined,\n slotLabelFormat: {\n hour: 'numeric',\n minute: '2-digit'\n },\n slotMaxTime: '24:00:00',\n slotMinTime: '00:00:00',\n slotWidth: 72,\n theme: {\n allDay: 'ec-all-day',\n active: 'ec-active',\n bgEvent: 'ec-bg-event',\n bgEvents: 'ec-bg-events',\n body: 'ec-body',\n button: 'ec-button',\n buttonGroup: 'ec-button-group',\n calendar: 'ec',\n content: 'ec-content',\n day: 'ec-day',\n dayHead: 'ec-day-head',\n days: 'ec-days',\n disabled: 'ec-disabled',\n event: 'ec-event',\n eventBody: 'ec-event-body',\n eventTime: 'ec-event-time',\n eventTitle: 'ec-event-title',\n events: 'ec-events',\n extra: 'ec-extra',\n handle: 'ec-handle',\n header: 'ec-header',\n hiddenScroll: 'ec-hidden-scroll',\n highlight: 'ec-highlight',\n icon: 'ec-icon',\n line: 'ec-line',\n lines: 'ec-lines',\n minor: 'ec-minor',\n nowIndicator: 'ec-now-indicator',\n otherMonth: 'ec-other-month',\n resource: 'ec-resource',\n sidebar: 'ec-sidebar',\n sidebarTitle: 'ec-sidebar-title',\n today: 'ec-today',\n time: 'ec-time',\n title: 'ec-title',\n toolbar: 'ec-toolbar',\n view: '',\n weekdays: ['ec-sun', 'ec-mon', 'ec-tue', 'ec-wed', 'ec-thu', 'ec-fri', 'ec-sat'],\n withScroll: 'ec-with-scroll'\n },\n titleFormat: {\n year: 'numeric',\n month: 'short',\n day: 'numeric'\n },\n validRange: undefined,\n view: undefined,\n viewDidMount: undefined,\n views: {}\n };\n\n for (let plugin of plugins) {\n plugin.createOptions?.(options);\n }\n\n return options;\n}\n\nexport function createParsers(plugins) {\n let parsers = {\n date: date => setMidnight(createDate(date)),\n duration: createDuration,\n events: createEvents,\n eventSources: createEventSources,\n hiddenDays: days => [...new Set(days)],\n highlightedDates: dates => dates.map(date => setMidnight(createDate(date))),\n resources: createResources,\n scrollTime: createDuration,\n slotDuration: createDuration,\n slotLabelInterval: input => input !== undefined ? createDuration(input) : undefined,\n slotMaxTime: createDuration,\n slotMinTime: createDuration,\n validRange: createDateRange\n };\n\n for (let plugin of plugins) {\n plugin.createParsers?.(parsers);\n }\n\n return parsers;\n}\n\nexport function diff(options, prevOptions) {\n let diff = [];\n for (let key of keys(options)) {\n if (options[key] !== prevOptions[key]) {\n diff.push([key, options[key]]);\n }\n }\n return diff;\n}\n","import {derived, get, readable, writable} from 'svelte/store';\nimport {\n addDay, addDuration, assign, cloneDate, createDate, createEvents, createView, DAY_IN_SECONDS, debounce,\n isFunction, nextClosestDay, prevClosestDay, setMidnight, subtractDay, toISOString, toLocalDate\n} from '#lib';\n\nexport function dayGrid(state) {\n return derived(state.view, $view => $view?.startsWith('dayGrid'));\n}\n\nexport function activeRange(state) {\n return derived(\n [state._currentRange, state.firstDay, state.slotMaxTime, state._dayGrid],\n ([$_currentRange, $firstDay, $slotMaxTime, $_dayGrid]) => {\n let start = cloneDate($_currentRange.start);\n let end = cloneDate($_currentRange.end);\n\n if ($_dayGrid) {\n // First day of week\n prevClosestDay(start, $firstDay);\n nextClosestDay(end, $firstDay);\n } else if ($slotMaxTime.days || $slotMaxTime.seconds > DAY_IN_SECONDS) {\n addDuration(subtractDay(end), $slotMaxTime);\n let start2 = subtractDay(cloneDate(end));\n if (start2 < start) {\n start = start2;\n }\n }\n\n return {start, end};\n }\n );\n}\n\nexport function currentRange(state) {\n return derived(\n [state.date, state.duration, state.firstDay],\n ([$date, $duration, $firstDay]) => {\n let start = cloneDate($date), end;\n if ($duration.months) {\n start.setUTCDate(1);\n } else if ($duration.inWeeks) {\n // First day of week\n prevClosestDay(start, $firstDay);\n }\n end = addDuration(cloneDate(start), $duration);\n\n return {start, end};\n }\n );\n}\n\nexport function viewDates(state) {\n return derived([state._activeRange, state.hiddenDays], ([$_activeRange, $hiddenDays]) => {\n let dates = [];\n let date = setMidnight(cloneDate($_activeRange.start));\n let end = setMidnight(cloneDate($_activeRange.end));\n while (date < end) {\n if (!$hiddenDays.includes(date.getUTCDay())) {\n dates.push(cloneDate(date));\n }\n addDay(date);\n }\n if (!dates.length && $hiddenDays.length && $hiddenDays.length < 7) {\n // Try to move the date\n state.date.update(date => {\n while ($hiddenDays.includes(date.getUTCDay())) {\n addDay(date);\n }\n return date;\n });\n dates = get(state._viewDates);\n }\n\n return dates;\n });\n}\n\nexport function viewTitle(state) {\n return derived(\n [state.date, state._activeRange, state._intlTitle, state._dayGrid],\n ([$date, $_activeRange, $_intlTitle, $_dayGrid]) => {\n return $_dayGrid\n ? $_intlTitle.formatRange($date, $date)\n : $_intlTitle.formatRange($_activeRange.start, subtractDay(cloneDate($_activeRange.end)));\n }\n );\n}\n\nexport function view(state) {\n return derived([state.view, state._viewTitle, state._currentRange, state._activeRange], args => createView(...args));\n}\n\nexport function events(state) {\n let _events = writable([]);\n let abortController;\n let fetching = 0;\n let debounceHandle = {};\n derived(\n [state.events, state.eventSources, state._activeRange, state._fetchedRange, state.lazyFetching, state.loading],\n (values, set) => debounce(() => {\n let [$events, $eventSources, $_activeRange, $_fetchedRange, $lazyFetching, $loading] = values;\n if (!$eventSources.length) {\n set($events);\n return;\n }\n // Do not fetch if new range is within the previous one\n if (!$_fetchedRange.start || $_fetchedRange.start > $_activeRange.start || $_fetchedRange.end < $_activeRange.end || !$lazyFetching) {\n if (abortController) {\n // Abort previous request\n abortController.abort();\n }\n // Create new abort controller\n abortController = new AbortController();\n // Call loading hook\n if (isFunction($loading) && !fetching) {\n $loading(true);\n }\n let stopLoading = () => {\n if (--fetching === 0 && isFunction($loading)) {\n $loading(false);\n }\n };\n let events = [];\n // Prepare handlers\n let failure = e => stopLoading();\n let success = data => {\n events = events.concat(createEvents(data));\n set(events);\n stopLoading();\n };\n // Prepare other stuff\n let startStr = toISOString($_activeRange.start)\n let endStr = toISOString($_activeRange.end);\n // Loop over event sources\n for (let source of $eventSources) {\n if (isFunction(source.events)) {\n // Events as a function\n let result = source.events({\n start: toLocalDate($_activeRange.start),\n end: toLocalDate($_activeRange.end),\n startStr,\n endStr\n }, success, failure);\n if (result !== undefined) {\n Promise.resolve(result).then(success, failure);\n }\n } else {\n // Events as a JSON feed\n // Prepare params\n let params = isFunction(source.extraParams) ? source.extraParams() : assign({}, source.extraParams);\n params.start = startStr;\n params.end = endStr;\n params = new URLSearchParams(params);\n // Prepare fetch\n let url = source.url, headers = {}, body;\n if (['GET', 'HEAD'].includes(source.method)) {\n url += (url.includes('?') ? '&' : '?') + params;\n } else {\n headers['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';\n body = String(params); // Safari 10.1 doesn't convert to string automatically\n }\n // Do the fetch\n fetch(url, {method: source.method, headers, body, signal: abortController.signal, credentials: 'same-origin'})\n .then(response => response.json())\n .then(success)\n .catch(failure);\n }\n ++fetching;\n }\n // Save current range for future requests\n $_fetchedRange.start = $_activeRange.start;\n $_fetchedRange.end = $_activeRange.end;\n }\n }, debounceHandle, state._queue),\n []\n ).subscribe(_events.set);\n\n return _events;\n}\n\nexport function filteredEvents(state){\n let view;\n state._view.subscribe($_view => view = $_view);\n let debounceHandle = {};\n return derived(\n [state._events, state.eventFilter],\n (values, set) => debounce(() => {\n let [$_events, $eventFilter] = values;\n set(\n isFunction($eventFilter)\n ? $_events.filter((event, index, events) => $eventFilter({\n event,\n index,\n events,\n view\n }))\n : $_events\n );\n }, debounceHandle, state._queue),\n []\n );\n}\n\nexport function now() {\n return readable(createDate(), set => {\n let interval = setInterval(() => {\n set(createDate());\n }, 1000);\n\n return () => clearInterval(interval);\n });\n}\n\nexport function today(state) {\n return derived(state._now, $_now => setMidnight(cloneDate($_now)));\n}\n","import {get, writable} from 'svelte/store';\nimport {tick} from 'svelte';\nimport {createOptions, createParsers} from './options.js';\nimport {activeRange, currentRange, dayGrid, events, now, today, view as view2, viewDates, viewTitle, filteredEvents} from './stores.js';\nimport {identity, intl, intlRange, isFunction, keys, toViewWithLocalDates} from '#lib';\n\nexport default class {\n constructor(plugins, input) {\n plugins = plugins || [];\n\n // Create options\n let options = createOptions(plugins);\n let parsers = createParsers(plugins);\n\n // Parse options\n options = parseOpts(options, parsers);\n input = parseOpts(input, parsers);\n\n // Create stores for options\n for (let [option, value] of Object.entries(options)) {\n this[option] = writable(value);\n }\n\n // Private stores\n this._queue = writable(new Map()); // debounce queue (beforeUpdate)\n this._tasks = new Map(); // timeout IDs for tasks\n this._auxiliary = writable([]); // auxiliary components\n this._dayGrid = dayGrid(this);\n this._currentRange = currentRange(this);\n this._activeRange = activeRange(this);\n this._fetchedRange = writable({start: undefined, end: undefined});\n this._events = events(this);\n this._now = now();\n this._today = today(this);\n this._intlEventTime = intlRange(this.locale, this.eventTimeFormat);\n this._intlSlotLabel = intl(this.locale, this.slotLabelFormat);\n this._intlDayHeader = intl(this.locale, this.dayHeaderFormat);\n this._intlDayHeaderAL = intl(this.locale, this.dayHeaderAriaLabelFormat);\n this._intlTitle = intlRange(this.locale, this.titleFormat);\n this._bodyEl = writable(undefined);\n this._scrollable = writable(false);\n this._recheckScrollable = writable(false);\n this._viewTitle = viewTitle(this);\n this._viewDates = viewDates(this);\n this._view = view2(this);\n this._viewComponent = writable(undefined);\n this._filteredEvents = filteredEvents(this);\n // Interaction\n this._interaction = writable({});\n this._iEvents = writable([null, null]); // interaction events: [drag/resize, pointer]\n this._iClasses = writable(identity); // interaction event css classes\n this._iClass = writable(undefined); // interaction css class for entire calendar\n\n // Set & Get\n this._set = (key, value) => {\n if (validKey(key, this)) {\n if (parsers[key]) {\n value = parsers[key](value);\n }\n this[key].set(value);\n }\n };\n this._get = key => validKey(key, this) ? get(this[key]) : undefined;\n\n // Let plugins create their private stores\n for (let plugin of plugins) {\n plugin.createStores?.(this);\n }\n\n if (input.view) {\n // Set initial view based on input\n this.view.set(input.view);\n }\n\n // Set options for each view\n let views = new Set([...keys(options.views), ...keys(input.views ?? {})]);\n for (let view of views) {\n let defOpts = mergeOpts(options, options.views[view] ?? {});\n let opts = mergeOpts(defOpts, input, input.views?.[view] ?? {});\n let component = opts.component;\n // Make sure we deal with valid opts from now on\n filterOpts(opts, this);\n // Process options\n for (let key of keys(opts)) {\n let {set, _set = set, ...rest} = this[key];\n\n this[key] = {\n // Set value in all views\n set: ['buttonText', 'theme'].includes(key)\n ? value => {\n if (isFunction(value)) {\n let result = value(defOpts[key]);\n opts[key] = result;\n set(set === _set ? result : value);\n } else {\n opts[key] = value;\n set(value);\n }\n }\n : value => {\n opts[key] = value;\n set(value);\n },\n _set,\n ...rest\n };\n }\n // When view changes...\n this.view.subscribe(newView => {\n if (newView === view) {\n // switch view component\n this._viewComponent.set(component);\n if (isFunction(opts.viewDidMount)) {\n tick().then(() => opts.viewDidMount({\n view: toViewWithLocalDates(get(this._view))\n }));\n }\n // update store values\n for (let key of keys(opts)) {\n this[key]._set(opts[key]);\n }\n }\n });\n }\n }\n}\n\nfunction parseOpts(opts, parsers) {\n let result = {...opts};\n for (let key of keys(parsers)) {\n if (key in result) {\n result[key] = parsers[key](result[key]);\n }\n }\n if (opts.views) {\n result.views = {};\n for (let view of keys(opts.views)) {\n result.views[view] = parseOpts(opts.views[view], parsers);\n }\n }\n return result;\n}\n\nfunction mergeOpts(...args) {\n let result = {};\n for (let opts of args) {\n let override = {};\n for (let key of ['buttonText', 'theme']) {\n if (isFunction(opts[key])) {\n override[key] = opts[key](result[key]);\n }\n }\n result = {\n ...result,\n ...opts,\n ...override\n };\n }\n return result;\n}\n\nfunction filterOpts(opts, state) {\n keys(opts)\n .filter(key => !validKey(key, state) || key === 'view')\n .forEach(key => delete opts[key]);\n}\n\nfunction validKey(key, state) {\n return state.hasOwnProperty(key) && key[0] !== '_';\n}\n","import { enable_legacy_mode_flag } from './index.js';\n\nenable_legacy_mode_flag();\n","<script>\n import {getContext, tick} from 'svelte';\n import {createDate, cloneDate, setContent, setMidnight, nextDate, prevDate, outsideRange} from '#lib';\n\n export let buttons;\n\n let {\n _currentRange, _viewTitle, _viewDates, buttonText, customButtons, date, duration, hiddenDays, theme, validRange,\n view\n } = getContext('state');\n\n let today = setMidnight(createDate());\n let prevDisabled, nextDisabled, todayDisabled;\n\n let running = false;\n function isRunning() {\n return running;\n }\n $: if (!isRunning()) {\n running = true;\n prevDisabled = false;\n nextDisabled = false;\n if ($validRange.start) {\n let currentDate = cloneDate($date);\n $date = prevDate($date, $duration, $hiddenDays);\n prevDisabled = test();\n $date = currentDate;\n }\n if ($validRange.end) {\n let currentDate = cloneDate($date);\n $date = nextDate($date, $duration);\n nextDisabled = test();\n $date = currentDate;\n }\n todayDisabled = today >= $_currentRange.start && today < $_currentRange.end;\n if (!todayDisabled && ($validRange.start || $validRange.end)) {\n let currentDate = cloneDate($date);\n $date = cloneDate(today);\n todayDisabled = test();\n $date = currentDate;\n }\n tick().then(() => running = false);\n }\n\n function test() {\n return $_viewDates.every(date => outsideRange(date, $validRange));\n }\n\n function prev() {\n $date = prevDate($date, $duration, $hiddenDays);\n }\n\n function next() {\n $date = nextDate($date, $duration);\n }\n</script>\n\n{#each buttons as button}\n {#if button == 'title'}\n <!-- svelte-ignore a11y-missing-content -->\n <h2 class=\"{$theme.title}\" use:setContent={$_viewTitle}></h2>\n {:else if button == 'prev'}\n <button\n class=\"{$theme.button} ec-{button}\"\n aria-label={$buttonText.prev}\n title={$buttonText.prev}\n on:click={prev}\n disabled={prevDisabled}\n ><i class=\"{$theme.icon} ec-{button}\"></i></button>\n {:else if button == 'next'}\n <button\n class=\"{$theme.button} ec-{button}\"\n aria-label={$buttonText.next}\n title={$buttonText.next}\n on:click={next}\n disabled={nextDisabled}\n ><i class=\"{$theme.icon} ec-{button}\"></i></button>\n {:else if button == 'today'}\n <button\n class=\"{$theme.button} ec-{button}\"\n on:click={() => $date = cloneDate(today)}\n disabled={todayDisabled}\n >{$buttonText[button]}</button>\n {:else if $customButtons[button]}\n <!-- svelte-ignore a11y_consider_explicit_label -->\n <button\n class=\"{$theme.button} ec-{button}{$customButtons[button].active ? ' ' + $theme.active : ''}\"\n on:click={$customButtons[button].click}\n use:setContent={$customButtons[button].text}\n ></button>\n {:else if button != ''}\n <button\n class=\"{$theme.button}{$view === button ? ' ' + $theme.active : ''} ec-{button}\"\n on:click={() => $view = button}\n >{$buttonText[button]}</button>\n {/if}\n{/each}\n","<script>\n import {getContext} from 'svelte';\n import {keys} from '#lib';\n import Buttons from './Buttons.svelte';\n\n let {headerToolbar, theme} = getContext('state');\n\n let sections = $derived.by(() => {\n let sections = {};\n for (let key of ['start', 'center', 'end']) {\n sections[key] = $headerToolbar[key]?.split(' ').map(group => group.split(',')) ?? [];\n }\n return sections;\n });\n</script>\n\n<nav class=\"{$theme.toolbar}\">\n {#each keys(sections) as key}\n <div class=\"ec-{key}\">\n {#each sections[key] as buttons}\n {#if buttons.length > 1}\n <div class=\"{$theme.buttonGroup}\">\n <Buttons {buttons}/>\n </div>\n {:else}\n <Buttons {buttons}/>\n {/if}\n {/each}\n </div>\n {/each}\n</nav>\n","<script>\n import {getContext, untrack} from 'svelte';\n import {\n toISOString, toLocalDate, toViewWithLocalDates, isFunction, task, flushDebounce, hasYScroll\n } from '#lib';\n\n let {\n datesSet, eventAllUpdated, _auxiliary, _activeRange, _filteredEvents, _scrollable, _bodyEl, _tasks, _recheckScrollable,\n _queue, _view\n } = getContext('state');\n\n // datesSet callback\n $effect(() => {\n $_activeRange;\n untrack(() => {\n if (isFunction($datesSet)) {\n $datesSet({\n start: toLocalDate($_activeRange.start),\n end: toLocalDate($_activeRange.end),\n startStr: toISOString($_activeRange.start),\n endStr: toISOString($_activeRange.end),\n view: toViewWithLocalDates($_view)\n });\n }\n });\n });\n\n // eventAllUpdated callback\n $effect(() => {\n $_filteredEvents;\n untrack(() => {\n if (isFunction($eventAllUpdated)) {\n task(() => $eventAllUpdated({view: toViewWithLocalDates($_view)}), 'eau', _tasks);\n }\n });\n });\n\n $effect(() => {\n $_queue;\n untrack(() => {\n flushDebounce($_queue);\n });\n });\n\n $effect(() => {\n $_recheckScrollable;\n untrack(() => {\n if ($_bodyEl) {\n $_scrollable = hasYScroll($_bodyEl);\n }\n $_recheckScrollable = false;\n });\n });\n</script>\n\n{#each $_auxiliary as Component}\n <Component/>\n{/each}\n","<script>\n import './styles/index.scss';\n import {setContext, untrack} from 'svelte';\n import {get} from 'svelte/store';\n import {diff} from './storage/options.js';\n import State from './storage/state.js';\n import Toolbar from './Toolbar.svelte';\n import Auxiliary from './Auxiliary.svelte';\n import {\n assign, createEvents, getElementWithPayload, getPayload, listView, nextDate,\n prevDate, toEventWithLocalDates, toLocalDate, toViewWithLocalDates\n } from '#lib';\n\n let {plugins = [], options = {}} = $props();\n\n let state = new State(plugins, options);\n setContext('state', state);\n\n let {\n _viewComponent, _interaction, _iClass, _events, _scrollable,\n date, duration, hiddenDays, height, theme, view\n } = state;\n\n // Reactively update options that did change\n let prevOptions = {...options};\n $effect(() => {\n for (let [name, value] of diff(options, prevOptions)) {\n untrack(() => {\n setOption(name, value);\n });\n }\n assign(prevOptions, options);\n });\n\n export function setOption(name, value) {\n state._set(name, value);\n return this;\n }\n\n export function getOption(name) {\n let value = state._get(name);\n return value instanceof Date ? toLocalDate(value) : value;\n }\n\n export function refetchEvents() {\n state._fetchedRange.set({start: undefined, end: undefined});\n return this;\n }\n\n export function getEvents() {\n return $_events.map(toEventWithLocalDates);\n }\n\n export function getEventById(id) {\n for (let event of $_events) {\n if (event.id == id) {\n return toEventWithLocalDates(event);\n }\n }\n return null;\n }\n\n export function addEvent(event) {\n event = createEvents([event])[0];\n $_events.push(event);\n $_events = $_events;\n return toEventWithLocalDates(event);\n }\n\n export function updateEvent(event) {\n let id = String(event.id);\n let idx = $_events.findIndex(event => event.id === id);\n if (idx >= 0) {\n event = createEvents([event])[0];\n $_events[idx] = event;\n return toEventWithLocalDates(event);\n }\n return null;\n }\n\n export function removeEventById(id) {\n id = String(id);\n let idx = $_events.findIndex(event => event.id === id);\n if (idx >= 0) {\n $_events.splice(idx, 1);\n $_events = $_events;\n }\n return this;\n }\n\n export function getView() {\n return toViewWithLocalDates(get(state._view));\n }\n\n export function unselect() {\n $_interaction.action?.unselect();\n return this;\n }\n\n export function dateFromPoint(x, y) {\n let dayEl = getElementWithPayload(x, y);\n if (dayEl) {\n let info = getPayload(dayEl)(x, y);\n info.date = toLocalDate(info.date);\n\n return info;\n }\n return null;\n }\n\n export function next() {\n $date = nextDate($date, $duration);\n return this;\n }\n\n export function prev() {\n $date = prevDate($date, $duration, $hiddenDays);\n return this;\n }\n\n let View = $derived($_viewComponent);\n</script>\n\n<div\n class=\"{$theme.calendar} {$theme.view}{$_scrollable ? ' ' + $theme.withScroll : ''}{$_iClass ? ' ' + $theme[$_iClass] : ''}\"\n style:height={$height}\n role=\"{listView($view) ? 'list' : 'table'}\"\n>\n <Toolbar/>\n <View/>\n</div>\n<Auxiliary/>\n","import {derived} from 'svelte/store';\nimport {cloneDate, addDay, subtractDay} from '#lib';\n\nexport function days(state) {\n return derived([state.date, state.firstDay, state.hiddenDays], ([$date, $firstDay, $hiddenDays]) => {\n let days = [];\n let day = cloneDate($date);\n let max = 7;\n // First day of week\n while (day.getUTCDay() !== $firstDay && max) {\n subtractDay(day);\n --max;\n }\n for (let i = 0; i < 7; ++i) {\n if (!$hiddenDays.includes(day.getUTCDay())) {\n days.push(cloneDate(day));\n }\n addDay(day);\n }\n\n return days;\n });\n}\n","<script>\n import {getContext} from 'svelte';\n import {setContent} from '#lib';\n\n let {theme, _intlDayHeader, _intlDayHeaderAL, _days} = getContext('state');\n</script>\n\n<div class=\"{$theme.header}\">\n <div class=\"{$theme.days}\" role=\"row\">\n {#each $_days as day}\n <div class=\"{$theme.day} {$theme.weekdays?.[day.getUTCDay()]}\" role=\"columnheader\">\n <span\n aria-label=\"{$_intlDayHeaderAL.format(day)}\"\n use:setContent={$_intlDayHeader.format(day)}\n ></span>\n </div>\n {/each}\n </div>\n <div class=\"{$theme.hiddenScroll}\"></div>\n</div>\n","/** @import { Source } from '#client' */\nimport { DEV } from 'esm-env';\nimport { source, set, state, increment } from '../internal/client/reactivity/sources.js';\nimport { label, tag } from '../internal/client/dev/tracing.js';\nimport { get, update_version } from '../internal/client/runtime.js';\n\nvar read_methods = ['forEach', 'isDisjointFrom', 'isSubsetOf', 'isSupersetOf'];\nvar set_like_methods = ['difference', 'intersection', 'symmetricDifference', 'union'];\n\nvar inited = false;\n\n/**\n * A reactive version of the built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) object.\n * Reading contents of the set (by iterating, or by reading `set.size` or calling `set.has(...)` as in the [example](https://svelte.dev/playground/53438b51194b4882bcc18cddf9f96f15) below) in an [effect](https://svelte.dev/docs/svelte/$effect) or [derived](https://svelte.dev/docs/svelte/$derived)\n * will cause it to be re-evaluated as necessary when the set is updated.\n *\n * Note that values in a reactive set are _not_ made [deeply reactive](https://svelte.dev/docs/svelte/$state#Deep-state).\n *\n * ```svelte\n * <script>\n * \timport { SvelteSet } from 'svelte/reactivity';\n * \tlet monkeys = new SvelteSet();\n *\n * \tfunction toggle(monkey) {\n * \t\tif (monkeys.has(monkey)) {\n * \t\t\tmonkeys.delete(monkey);\n * \t\t} else {\n * \t\t\tmonkeys.add(monkey);\n * \t\t}\n * \t}\n * </script>\n *\n * {#each ['🙈', '🙉', '🙊'] as monkey}\n * \t<button onclick={() => toggle(monkey)}>{monkey}</button>\n * {/each}\n *\n * <button onclick={() => monkeys.clear()}>clear</button>\n *\n * {#if monkeys.has('🙈')}<p>see no evil</p>{/if}\n * {#if monkeys.has('🙉')}<p>hear no evil</p>{/if}\n * {#if monkeys.has('🙊')}<p>speak no evil</p>{/if}\n * ```\n *\n * @template T\n * @extends {Set<T>}\n */\nexport class SvelteSet extends Set {\n\t/** @type {Map<T, Source<boolean>>} */\n\t#sources = new Map();\n\t#version = state(0);\n\t#size = state(0);\n\t#update_version = update_version || -1;\n\n\t/**\n\t * @param {Iterable<T> | null | undefined} [value]\n\t */\n\tconstructor(value) {\n\t\tsuper();\n\n\t\tif (DEV) {\n\t\t\t// If the value is invalid then the native exception will fire here\n\t\t\tvalue = new Set(value);\n\n\t\t\ttag(this.#version, 'SvelteSet version');\n\t\t\ttag(this.#size, 'SvelteSet.size');\n\t\t}\n\n\t\tif (value) {\n\t\t\tfor (var element of value) {\n\t\t\t\tsuper.add(element);\n\t\t\t}\n\t\t\tthis.#size.v = super.size;\n\t\t}\n\n\t\tif (!inited) this.#init();\n\t}\n\n\t/**\n\t * If the source is being created inside the same reaction as the SvelteSet instance,\n\t * we use `state` so that it will not be a dependency of the reaction. Otherwise we\n\t * use `source` so it will be.\n\t *\n\t * @template T\n\t * @param {T} value\n\t * @returns {Source<T>}\n\t */\n\t#source(value) {\n\t\treturn update_version === this.#update_version ? state(value) : source(value);\n\t}\n\n\t// We init as part of the first instance so that we can treeshake this class\n\t#init() {\n\t\tinited = true;\n\n\t\tvar proto = SvelteSet.prototype;\n\t\tvar set_proto = Set.prototype;\n\n\t\tfor (const method of read_methods) {\n\t\t\t// @ts-ignore\n\t\t\tproto[method] = function (...v) {\n\t\t\t\tget(this.#version);\n\t\t\t\t// @ts-ignore\n\t\t\t\treturn set_proto[method].apply(this, v);\n\t\t\t};\n\t\t}\n\n\t\tfor (const method of set_like_methods) {\n\t\t\t// @ts-ignore\n\t\t\tproto[method] = function (...v) {\n\t\t\t\tget(this.#version);\n\t\t\t\t// @ts-ignore\n\t\t\t\tvar set = /** @type {Set<T>} */ (set_proto[method].apply(this, v));\n\t\t\t\treturn new SvelteSet(set);\n\t\t\t};\n\t\t}\n\t}\n\n\t/** @param {T} value */\n\thas(value) {\n\t\tvar has = super.has(value);\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(value);\n\n\t\tif (s === undefined) {\n\t\t\tif (!has) {\n\t\t\t\t// If the value doesn't exist, track the version in case it's added later\n\t\t\t\t// but don't create sources willy-nilly to track all possible values\n\t\t\t\tget(this.#version);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\ts = this.#source(true);\n\n\t\t\tif (DEV) {\n\t\t\t\ttag(s, `SvelteSet has(${label(value)})`);\n\t\t\t}\n\n\t\t\tsources.set(value, s);\n\t\t}\n\n\t\tget(s);\n\t\treturn has;\n\t}\n\n\t/** @param {T} value */\n\tadd(value) {\n\t\tif (!super.has(value)) {\n\t\t\tsuper.add(value);\n\t\t\tset(this.#size, super.size);\n\t\t\tincrement(this.#version);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/** @param {T} value */\n\tdelete(value) {\n\t\tvar deleted = super.delete(value);\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(value);\n\n\t\tif (s !== undefined) {\n\t\t\tsources.delete(value);\n\t\t\tset(s, false);\n\t\t}\n\n\t\tif (deleted) {\n\t\t\tset(this.#size, super.size);\n\t\t\tincrement(this.#version);\n\t\t}\n\n\t\treturn deleted;\n\t}\n\n\tclear() {\n\t\tif (super.size === 0) {\n\t\t\treturn;\n\t\t}\n\t\t// Clear first, so we get nice console.log outputs with $inspect\n\t\tsuper.clear();\n\t\tvar sources = this.#sources;\n\n\t\tfor (var s of sources.values()) {\n\t\t\tset(s, false);\n\t\t}\n\n\t\tsources.clear();\n\t\tset(this.#size, 0);\n\t\tincrement(this.#version);\n\t}\n\n\tkeys() {\n\t\treturn this.values();\n\t}\n\n\tvalues() {\n\t\tget(this.#version);\n\t\treturn super.values();\n\t}\n\n\tentries() {\n\t\tget(this.#version);\n\t\treturn super.entries();\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.keys();\n\t}\n\n\tget size() {\n\t\treturn get(this.#size);\n\t}\n}\n","<script>\n import {getContext, onMount} from 'svelte';\n import {\n bgEvent, createEventClasses, createEventContent, entries, helperEvent, identity, isFunction, keyEnter,\n resourceBackgroundColor, resourceTextColor, setContent, toEventWithLocalDates, toViewWithLocalDates\n } from '#lib';\n\n let {\n el = $bindable(),\n chunk,\n classes = identity,\n styles = identity,\n onpointerdown,\n body\n } = $props();\n\n let {\n displayEventEnd, eventBackgroundColor, eventColor, eventContent, eventClick, eventDidMount, eventClassNames,\n eventMouseEnter, eventMouseLeave, eventTextColor, resources, theme, _view, _intlEventTime\n } = getContext('state');\n\n let event = $derived(chunk.event);\n let display = $derived(chunk.event.display);\n\n // Style\n let bgColor = $derived(event.backgroundColor ?? resourceBackgroundColor(event, $resources) ?? $eventBackgroundColor ?? $eventColor);\n let txtColor = $derived(event.textColor ?? resourceTextColor(event, $resources) ?? $eventTextColor);\n let style = $derived(entries(styles(\n {'background-color': bgColor, 'color': txtColor}\n )).map(entry => `${entry[0]}:${entry[1]}`).concat(event.styles).join(';'));\n\n // Class\n let classNames = $derived(classes([\n bgEvent(display) ? $theme.bgEvent : $theme.event,\n ...createEventClasses($eventClassNames, event, $_view)\n ]).join(' '));\n\n // Content\n let [timeText, content] = $derived(createEventContent(\n chunk, $displayEventEnd, $eventContent, $theme, $_intlEventTime, $_view\n ));\n\n onMount(() => {\n if (isFunction($eventDidMount)) {\n $eventDidMount({\n event: toEventWithLocalDates(event),\n timeText,\n el,\n view: toViewWithLocalDates($_view)\n });\n }\n });\n\n function createHandler(fn, display) {\n return !helperEvent(display) && isFunction(fn)\n ? jsEvent => fn({event: toEventWithLocalDates(event), el, jsEvent, view: toViewWithLocalDates($_view)})\n : undefined;\n }\n\n // Handlers\n let onclick = $derived(!bgEvent(display) && createHandler($eventClick, display) || undefined);\n let onkeydown = $derived(onclick && keyEnter(onclick));\n let onmouseenter = $derived(createHandler($eventMouseEnter, display));\n let onmouseleave = $derived(createHandler($eventMouseLeave, display));\n</script>\n\n<!-- svelte-ignore a11y_no_noninteractive_tabindex -->\n<article\n bind:this={el}\n class={classNames}\n {style}\n role={onclick ? 'button' : undefined}\n tabindex={onclick ? 0 : undefined}\n {onclick}\n {onkeydown}\n {onmouseenter}\n {onmouseleave}\n {onpointerdown}\n>\n {#snippet defaultBody()}\n <div class={$theme.eventBody} use:setContent={content}></div>\n {/snippet}\n {#if body}\n {@render body(defaultBody, bgColor, txtColor)}\n {:else}\n {@render defaultBody()}\n {/if}\n</article>\n","<script>\n import {getContext} from 'svelte';\n import BaseEvent from './BaseEvent.svelte';\n import {bgEvent, helperEvent} from \"#lib\";\n\n let {\n el = $bindable(),\n chunk,\n styles,\n axis,\n forceDate,\n forceMargin\n } = $props();\n\n let {_interaction, _iClasses} = getContext('state');\n\n let event = $derived(chunk.event);\n let display = $derived(chunk.event.display);\n\n // Class\n let classes = $derived(classNames => $_iClasses(classNames, event));\n\n function createDragHandler(event) {\n return $_interaction.action?.draggable(event)\n ? jsEvent => $_interaction.action.drag(\n event, jsEvent, forceDate?.(), forceMargin?.()\n )\n : $_interaction.action?.noAction;\n }\n let onpointerdown = $derived(!bgEvent(display) && !helperEvent(display) ? createDragHandler(event) : undefined);\n\n let Resizer = $derived($_interaction.resizer);\n</script>\n\n<BaseEvent bind:el {chunk} {classes} {styles} {onpointerdown}>\n {#snippet body(defaultBody)}\n {#if Resizer}\n <Resizer {chunk} {axis} {forceDate} {forceMargin}>\n {@render defaultBody()}\n </Resizer>\n {:else}\n {@render defaultBody()}\n {/if}\n {/snippet}\n</BaseEvent>\n","<script>\n import {getContext} from 'svelte';\n import {ancestor, bgEvent, height, max, rect, repositionEvent} from '#lib';\n import {InteractableEvent} from '#components';\n\n let {chunk, longChunks = {}, inPopup = false, dates = []} = $props();\n\n let {dayMaxEvents, _hiddenEvents, _popupDate} = getContext('state');\n\n let el = $state();\n let margin = $state(1);\n let hidden = $state(false);\n\n let event = $derived(chunk.event);\n let display = $derived(chunk.event.display);\n\n // Style\n let styles = $derived(style => {\n if (bgEvent(display)) {\n style['width'] = `calc(${chunk.days * 100}% + ${(chunk.days - 1)}px)`;\n } else {\n let marginTop = margin;\n if (event._margin) {\n // Force margin for helper events\n let [_margin, _dates] = event._margin;\n if (chunk.date >= _dates[0] && chunk.date <= _dates.at(-1)) {\n marginTop = _margin;\n }\n }\n style['width'] = `calc(${chunk.days * 100}% + ${(chunk.days - 1) * 7}px)`;\n style['margin-top'] = `${marginTop}px`;\n }\n if (hidden) {\n style['visibility'] = 'hidden';\n }\n return style;\n });\n\n export function reposition() {\n margin = repositionEvent(chunk, longChunks, height(el));\n if ($dayMaxEvents === true) {\n hide();\n } else {\n hidden = false;\n }\n }\n\n function hide() {\n let dayEl = ancestor(el, 2);\n let h = height(dayEl) - height(dayEl.firstElementChild) - footHeight(dayEl);\n hidden = chunk.bottom > h;\n let update = false;\n // Hide or show the event throughout all days\n for (let date of chunk.dates) {\n let hiddenEvents = $_hiddenEvents[date.getTime()];\n if (hiddenEvents) {\n let size = hiddenEvents.size;\n if (hidden) {\n hiddenEvents.add(chunk.event);\n } else {\n hiddenEvents.delete(chunk.event);\n }\n if (size !== hiddenEvents.size) {\n update = true;\n }\n }\n }\n if (update) {\n $_hiddenEvents = $_hiddenEvents;\n }\n }\n\n function footHeight(dayEl) {\n let h = 0;\n for (let i = 0; i < chunk.days; ++i) {\n h = max(h, height(dayEl.lastElementChild));\n dayEl = dayEl.nextElementSibling;\n if (!dayEl) {\n break;\n }\n }\n return h;\n }\n</script>\n\n<InteractableEvent\n bind:el\n {chunk}\n {styles}\n axis=\"x\"\n forceDate={() => inPopup ? $_popupDate : undefined}\n forceMargin={() => [rect(el).top - rect(ancestor(el, 1)).top, dates]}\n/>\n","<script>\n import {getContext, tick, untrack} from 'svelte';\n import {ancestor, rect, setContent, outsideEvent, keyEnter, toISOString, stopPropagation} from '#lib';\n import Event from './Event.svelte';\n\n let {buttonText, theme, _interaction, _intlDayPopover, _popupDate, _popupChunks} = getContext('state');\n\n let el = $state();\n let style = $state('');\n\n function position() {\n let dayEl = ancestor(el, 1);\n let bodyEl = ancestor(dayEl, 3);\n let popupRect = rect(el);\n let dayRect = rect(dayEl);\n let bodyRect = rect(bodyEl);\n style = '';\n\n let left;\n if (popupRect.width >= bodyRect.width) {\n left = bodyRect.left - dayRect.left;\n let right = dayRect.right - bodyRect.right;\n style += `right:${right}px;`;\n } else {\n left = (dayRect.width - popupRect.width) / 2;\n if (dayRect.left + left < bodyRect.left) {\n left = bodyRect.left - dayRect.left;\n } else if (dayRect.left + left + popupRect.width > bodyRect.right) {\n left = bodyRect.right - dayRect.left - popupRect.width;\n }\n }\n style += `left:${left}px;`;\n\n let top;\n if (popupRect.height >= bodyRect.height) {\n top = bodyRect.top - dayRect.top;\n let bottom = dayRect.bottom - bodyRect.bottom;\n style += `bottom:${bottom}px;`;\n } else {\n top = (dayRect.height - popupRect.height) / 2;\n if (dayRect.top + top < bodyRect.top) {\n top = bodyRect.top - dayRect.top;\n } else if (dayRect.top + top + popupRect.height > bodyRect.bottom) {\n top = bodyRect.bottom - dayRect.top - popupRect.height;\n }\n }\n style += `top:${top}px;`;\n }\n\n $effect(() => {\n // Fire reposition only on popup chunks change\n $_popupChunks;\n // Let chunks to update/mount then position the popup\n tick().then(reposition);\n });\n function reposition() {\n if ($_popupChunks.length) {\n position();\n } else {\n close();\n }\n }\n\n function close() {\n $_popupDate = null;\n $_popupChunks = [];\n }\n\n function handlePointerDownOutside() {\n close();\n $_interaction.action?.noClick();\n }\n</script>\n\n<div\n bind:this={el}\n class=\"{$theme.popup}\"\n {style}\n use:outsideEvent={'pointerdown'}\n onpointerdown={stopPropagation()}\n onpointerdownoutside={handlePointerDownOutside}\n>\n <div class=\"{$theme.dayHead}\">\n <time datetime=\"{toISOString($_popupDate, 10)}\" use:setContent={$_intlDayPopover.format($_popupDate)}></time>\n <!-- svelte-ignore a11y_missing_attribute -->\n <a\n role=\"button\"\n tabindex=\"0\"\n aria-label={$buttonText.close}\n onclick={stopPropagation(close)}\n onkeydown={keyEnter(close)}\n >&times;</a>\n </div>\n <div class=\"{$theme.events}\">\n {#each $_popupChunks as chunk (chunk.event)}\n <Event {chunk} inPopup />\n {/each}\n </div>\n</div>\n","<script>\n import {getContext, onMount, tick, untrack} from 'svelte';\n import {SvelteSet} from 'svelte/reactivity';\n import {\n addDay, assign, cloneDate, createEventChunk, datesEqual, getWeekNumber, isFunction, keyEnter, outsideRange,\n runReposition, setContent, setPayload, toISOString, toLocalDate, stopPropagation\n } from '#lib';\n import Event from './Event.svelte';\n import Popup from './Popup.svelte';\n\n let {date, chunks, bgChunks, longChunks, iChunks = [], dates} = $props();\n\n let {\n date: currentDate, dayMaxEvents, highlightedDates, firstDay, moreLinkContent, theme, validRange, weekNumbers,\n weekNumberContent, _hiddenEvents, _intlDayCell, _popupDate, _popupChunks, _today, _interaction\n } = getContext('state');\n\n let el = $state();\n let hiddenEvents = new SvelteSet(); // hidden events of this day\n $effect.pre(() => {\n $_hiddenEvents[date.getTime()] = untrack(() => hiddenEvents);\n });\n let refs = [];\n let isToday = $derived(datesEqual(date, $_today));\n let otherMonth = $derived(date.getUTCMonth() !== $currentDate.getUTCMonth());\n let highlight = $derived($highlightedDates.some(d => datesEqual(d, date)));\n let disabled = $derived(outsideRange(date, $validRange));\n\n let dayBgChunks = $derived(!disabled ? bgChunks.filter(bgChunk => datesEqual(bgChunk.date, date)) : []);\n let dayChunks = $derived.by(() => {\n let dayChunks = [];\n if (!disabled) {\n for (let chunk of chunks) {\n if (datesEqual(chunk.date, date)) {\n dayChunks.push(chunk);\n // if ($dayMaxEvents !== false && dayChunks.length > $dayMaxEvents) {\n // \tchunk.hidden = true;\n // }\n }\n }\n }\n return dayChunks;\n });\n $effect.pre(() => {\n dayChunks;\n hiddenEvents.clear();\n });\n\n let moreLink = $derived.by(() => {\n let moreLink = '';\n if (!disabled && hiddenEvents.size) {\n let text = '+' + hiddenEvents.size + ' more';\n if ($moreLinkContent) {\n moreLink = isFunction($moreLinkContent)\n ? $moreLinkContent({num: hiddenEvents.size, text})\n : $moreLinkContent;\n } else {\n moreLink = text;\n }\n }\n return moreLink;\n });\n\n // dateFromPoint\n onMount(() => {\n setPayload(el, () => ({allDay: true, date, resource: undefined, dayEl: el, disabled}));\n });\n\n // Popup\n function showMore() {\n $_popupDate = date;\n }\n let showPopup = $derived($_popupDate && datesEqual(date, $_popupDate));\n // Use `pre` to tick before popup positioning tick\n $effect.pre(() => {\n dayChunks;\n longChunks;\n if (showPopup) {\n // Let chunks to reposition then set popup chunks\n tick().then(setPopupChunks);\n }\n });\n function setPopupChunks() {\n let nextDay = addDay(cloneDate(date));\n let chunks = dayChunks.concat(longChunks[date.getTime()]?.chunks || []);\n $_popupChunks = chunks\n .map(chunk => assign({}, chunk, createEventChunk(chunk.event, date, nextDay), {days: 1, dates: [date]}))\n .sort((a, b) => a.top - b.top);\n }\n\n // Week numbers\n let showWeekNumber = $derived($weekNumbers && date.getUTCDay() == ($firstDay ? 1 : 0));\n let weekNumber = $derived.by(() => {\n let weekNumber;\n if (showWeekNumber) {\n let week = getWeekNumber(date, $firstDay);\n if ($weekNumberContent) {\n weekNumber = isFunction($weekNumberContent)\n ? $weekNumberContent({date: toLocalDate(date), week})\n : $weekNumberContent;\n } else {\n weekNumber = 'W' + String(week).padStart(2, '0');\n }\n }\n return weekNumber;\n });\n\n export function reposition() {\n if (!disabled) {\n runReposition(refs, dayChunks);\n }\n }\n</script>\n\n<div\n bind:this={el}\n class=\"{$theme.day} {$theme.weekdays?.[date.getUTCDay()]}{isToday ? ' ' + $theme.today : ''}{otherMonth ? ' ' + $theme.otherMonth : ''}{highlight ? ' ' + $theme.highlight : ''}{disabled ? ' ' + $theme.disabled : ''}\"\n role=\"cell\"\n onpointerdown={$_interaction.action?.select}\n>\n <div class=\"{$theme.dayHead}\">\n <time\n datetime=\"{toISOString(date, 10)}\"\n use:setContent={$_intlDayCell.format(date)}\n ></time>\n {#if showWeekNumber}\n <span\n class=\"{$theme.weekNumber}\"\n use:setContent={weekNumber}\n ></span>\n {/if}\n </div>\n <div class=\"{$theme.bgEvents}\">\n {#if !disabled}\n {#each dayBgChunks as chunk (chunk.event)}\n <Event {chunk}/>\n {/each}\n {/if}\n </div>\n {#if !disabled}\n <!-- Pointer -->\n {#if iChunks[2] && datesEqual(iChunks[2].date, date)}\n <div class=\"{$theme.events}\">\n <Event chunk={iChunks[2]}/>\n </div>\n {/if}\n <!-- Drag & Resize -->\n {#if iChunks[0] && datesEqual(iChunks[0].date, date)}\n <div class=\"{$theme.events} {$theme.preview}\">\n <Event chunk={iChunks[0]}/>\n </div>\n {/if}\n {/if}\n <div class=\"{$theme.events}\">\n {#if !disabled}\n {#each dayChunks as chunk, i (chunk.event)}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Event {chunk} {longChunks} {dates} bind:this={refs[i]}/>\n {/each}\n {/if}\n </div>\n {#if showPopup}\n <Popup/>\n {/if}\n <div class=\"{$theme.dayFoot}\">\n {#if !disabled && hiddenEvents.size}\n <!-- svelte-ignore a11y_missing_attribute -->\n <!-- svelte-ignore a11y_missing_content -->\n <!-- svelte-ignore a11y_consider_explicit_label -->\n <a\n role=\"button\"\n tabindex=\"0\"\n aria-haspopup=\"true\"\n onclick={stopPropagation(showMore)}\n onkeydown={keyEnter(showMore)}\n onpointerdown={stopPropagation()}\n use:setContent={moreLink}\n ></a>\n {/if}\n </div>\n</div>\n","<script>\n import {getContext} from 'svelte';\n import {\n addDay, bgEvent, cloneDate, createEventChunk, eventIntersects, limitToRange, prepareEventChunks,\n runReposition\n } from '#lib';\n import Day from './Day.svelte';\n\n let {dates} = $props();\n\n let {_filteredEvents, _iEvents, resources, eventOrder, filterEventsWithResources, hiddenDays, theme,\n validRange} = getContext('state');\n\n let refs = [];\n\n let start = $derived(limitToRange(dates[0], $validRange));\n let end = $derived(addDay(cloneDate(limitToRange(dates.at(-1), $validRange))));\n\n let [chunks, bgChunks, longChunks] = $derived.by(() => {\n let chunks = [];\n let bgChunks = [];\n for (let event of $_filteredEvents) {\n if (eventIntersects(event, start, end, $filterEventsWithResources ? $resources : undefined)) {\n let chunk = createEventChunk(event, start, end);\n if (bgEvent(event.display)) {\n if (event.allDay) {\n bgChunks.push(chunk);\n }\n } else {\n chunks.push(chunk);\n }\n }\n }\n prepareEventChunks(bgChunks, $hiddenDays, $eventOrder);\n let longChunks = prepareEventChunks(chunks, $hiddenDays, $eventOrder);\n return [chunks, bgChunks, longChunks];\n });\n\n let iChunks = $derived($_iEvents.map(event => {\n let chunk;\n if (event && eventIntersects(event, start, end)) {\n chunk = createEventChunk(event, start, end);\n prepareEventChunks([chunk], $hiddenDays, $eventOrder);\n } else {\n chunk = null;\n }\n return chunk;\n }));\n\n export function reposition() {\n runReposition(refs, dates);\n }\n</script>\n\n<div class=\"{$theme.days}\" role=\"row\">\n {#each dates as date, i}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Day {date} {chunks} {bgChunks} {longChunks} {iChunks} {dates} bind:this={refs[i]} />\n {/each}\n</div>\n","<script>\n import {getContext, untrack} from 'svelte';\n import {runReposition, observeResize} from '#lib';\n import Week from './Week.svelte';\n\n let {\n _bodyEl, _viewDates, _filteredEvents, _hiddenEvents, _recheckScrollable, dayMaxEvents, hiddenDays, theme\n } = getContext('state');\n\n let refs = [];\n\n let days = $derived(7 - $hiddenDays.length);\n let weeks = $derived.by(() => {\n let weeks = [];\n for (let i = 0; i < $_viewDates.length / days; ++i) {\n let dates = [];\n for (let j = 0; j < days; ++j) {\n dates.push($_viewDates[i * days + j]);\n }\n weeks.push(dates);\n }\n return weeks;\n });\n $effect.pre(() => {\n weeks;\n $dayMaxEvents;\n $_hiddenEvents = {};\n });\n\n function reposition() {\n runReposition(refs, weeks);\n }\n $effect(() => {\n $_filteredEvents;\n $_hiddenEvents;\n $dayMaxEvents;\n untrack(reposition);\n });\n</script>\n\n<div\n bind:this={$_bodyEl}\n class=\"{$theme.body}{$dayMaxEvents === true ? ' ' + $theme.uniform : ''}\"\n use:observeResize={() => $_recheckScrollable = true}\n>\n <div class=\"{$theme.content}\">\n {#each weeks as dates, i}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Week {dates} bind:this={refs[i]}/>\n {/each}\n </div>\n</div>\n\n<svelte:window on:resize={reposition}/>\n","<script>\n import Header from './Header.svelte';\n import Body from './Body.svelte';\n</script>\n\n<Header/>\n<Body/>\n","import {writable} from 'svelte/store';\nimport {btnTextMonth, intl, themeView} from '#lib';\nimport {days} from './stores.js';\nimport View from './View.svelte';\n\nexport default {\n createOptions(options) {\n options.dayMaxEvents = false;\n options.dayCellFormat = {day: 'numeric'};\n options.dayPopoverFormat = {month: 'long', day: 'numeric', year: 'numeric'};\n options.moreLinkContent = undefined;\n options.weekNumbers = false;\n options.weekNumberContent = undefined;\n // Common options\n options.buttonText.dayGridMonth = 'month';\n options.buttonText.close = 'Close';\n options.theme.uniform = 'ec-uniform';\n options.theme.dayFoot = 'ec-day-foot';\n options.theme.popup = 'ec-popup';\n options.theme.weekNumber = 'ec-week-number';\n options.view = 'dayGridMonth';\n options.views.dayGridMonth = {\n buttonText: btnTextMonth,\n component: View,\n dayHeaderFormat: {weekday: 'short'},\n dayHeaderAriaLabelFormat: {weekday: 'long'},\n displayEventEnd: false,\n duration: {months: 1},\n theme: themeView('ec-day-grid ec-month-view'),\n titleFormat: {year: 'numeric', month: 'long'}\n };\n },\n\n createStores(state) {\n state._days = days(state);\n state._intlDayCell = intl(state.locale, state.dayCellFormat);\n state._intlDayPopover = intl(state.locale, state.dayPopoverFormat);\n state._hiddenEvents = writable({});\n state._popupDate = writable(null);\n state._popupChunks = writable([]);\n }\n}\n","import {bgEvent, helperEvent} from '#lib';\n\nexport function eventDraggable(event, $eventStartEditable, $editable) {\n return (event.startEditable ?? $eventStartEditable ?? event.editable ?? $editable);\n}\n\nexport function eventResizable(event, $eventDurationEditable, $editable) {\n return (event.durationEditable ?? $eventDurationEditable ?? event.editable ?? $editable);\n}\n","import {min, max} from '#lib';\n\nlet busy = false;\nexport function animate(fn) {\n if (!busy) {\n busy = true;\n window.requestAnimationFrame(() => {\n fn();\n busy = false;\n });\n }\n}\n\nexport function limit(value, minLimit, maxLimit) {\n return max(minLimit, min(maxLimit, value));\n}\n\nexport function draggable(event) {\n\n}\n","<script>\n import {getContext} from 'svelte';\n import {\n addDay, addDuration, ancestor, assign, cloneDate, cloneEvent, copyTime, createDuration, getElementWithPayload,\n getPayload, isFunction, listen, listView, max, min, noop, rect, runAll, subtractDay, subtractDuration,\n timelineView, toEventWithLocalDates, toISOString, toLocalDate, toViewWithLocalDates\n } from '#lib';\n import {animate, limit, eventDraggable} from './lib';\n\n let {_iEvents, _iClass, _events, _view, _dayGrid, _bodyEl, datesAboveResources, dateClick, dragConstraint,\n dragScroll, editable, eventStartEditable, eventDragMinDistance, eventDragStart, eventDragStop, eventDrop,\n eventLongPressDelay, eventResizeStart, eventResizeStop, eventResize, longPressDelay, resizeConstraint,\n selectable, select: selectFn, selectBackgroundColor, selectConstraint, selectLongPressDelay, selectMinDistance,\n slotDuration, slotHeight, slotWidth, unselect: unselectFn, unselectAuto, unselectCancel, validRange,\n view} = getContext('state');\n\n const ACTION_DRAG = 1;\n const ACTION_RESIZE_END = 2;\n const ACTION_RESIZE_START = 3;\n const ACTION_SELECT = 4;\n const ACTION_CLICK = 5;\n const ACTION_NO_ACTION = 6;\n let action;\n let interacting;\n let event;\n let display;\n let date, newDate;\n let resource, newResource;\n let fromX, fromY;\n let toX, toY;\n let bodyEl, bodyRect, clipEl, clipRect;\n let delta;\n let allDay;\n let iClass;\n let minResize; // minimum end time when resizing\n let selectStep; // minimum selection step\n let selected; // whether selection has been made\n let noDateClick; // do not perform date click\n let timer; // timer for long press delays\n let viewport;\n let margin;\n let extraDuration; // extra duration for zero duration events\n\n export function draggable(event) {\n return eventDraggable(event, $eventStartEditable, $editable);\n }\n\n export function drag(eventToDrag, jsEvent, forceDate, forceMargin) {\n if (!action) {\n action = validJsEvent(jsEvent) ? ACTION_DRAG : ACTION_NO_ACTION;\n\n if (complexAction()) {\n event = eventToDrag;\n\n common(jsEvent);\n\n if (forceDate) {\n // Force date in popup\n date = forceDate;\n }\n\n if (forceMargin) {\n margin = forceMargin;\n }\n\n iClass = 'dragging';\n\n move(jsEvent);\n }\n }\n }\n\n export function resize(eventToResize, jsEvent, start, axis, forceDate, forceMargin, zeroDuration) {\n if (!action) {\n action = validJsEvent(jsEvent) ? (\n start ? ACTION_RESIZE_START : ACTION_RESIZE_END\n ) : ACTION_NO_ACTION;\n\n if (complexAction()) {\n event = eventToResize;\n\n common(jsEvent);\n\n if (forceDate) {\n // Force date in popup\n date = forceDate;\n }\n\n if (forceMargin) {\n margin = forceMargin;\n }\n\n iClass = axis === 'x' ? 'resizingX' : 'resizingY';\n\n // Calculate the limits for resize\n if (resizingStart()) {\n minResize = cloneDate(event.end);\n if (allDay) {\n copyTime(minResize, event.start);\n if (minResize >= event.end) {\n subtractDay(minResize);\n }\n } else {\n subtractDuration(minResize, $slotDuration);\n if (minResize < event.start) {\n minResize = event.start;\n }\n // Overwrite the date due to possible discrepancy between calculated date\n // and resizer coordinates in browser\n date = event.start;\n }\n } else {\n minResize = cloneDate(event.start);\n if (allDay) {\n copyTime(minResize, event.end);\n if (minResize <= event.start && !zeroDuration) {\n addDay(minResize);\n }\n } else {\n addDuration(minResize, $slotDuration);\n if (minResize > event.end) {\n minResize = event.end;\n }\n // Overwrite the date due to possible discrepancy between calculated date\n // and resizer coordinates in browser\n date = event.end;\n if (!zeroDuration) {\n date = subtractDuration(cloneDate(date), $slotDuration);\n }\n }\n\n // Handle zero duration events\n if (zeroDuration && !allDay) {\n extraDuration = $slotDuration;\n }\n }\n\n move(jsEvent);\n }\n }\n }\n\n export function select(jsEvent) {\n if (!action) {\n action = validJsEvent(jsEvent) ? (\n $selectable && !listView($view) ? ACTION_SELECT : ACTION_CLICK\n ) : ACTION_NO_ACTION;\n\n if (complexAction()) {\n common(jsEvent);\n\n iClass = 'selecting';\n\n selectStep = allDay ? createDuration({day: 1}) : $slotDuration;\n\n // Create dummy source event\n event = {\n allDay,\n start: date,\n end: addDuration(cloneDate(date), selectStep),\n resourceIds: resource ? [resource.id] : []\n };\n\n move(jsEvent);\n }\n }\n }\n\n export function noAction() {\n if (!action) {\n action = ACTION_NO_ACTION;\n }\n }\n\n\tfunction common(jsEvent) {\n window.getSelection().removeAllRanges();\n\n fromX = toX = jsEvent.clientX;\n fromY = toY = jsEvent.clientY;\n\n let dayEl = getElementWithPayload(toX, toY);\n ({allDay, date, resource} = getPayload(dayEl)(toX, toY));\n\n if (timelineView($view)) {\n bodyEl = clipEl = $_bodyEl;\n } else {\n bodyEl = ancestor(dayEl, resource ? 4 : 3);\n clipEl = ancestor(dayEl, resource && (dragging() || $datesAboveResources) ? 2 : 1);\n }\n calcViewport();\n\n if (jsEvent.pointerType !== 'mouse') {\n // For touch devices init long press delay\n timer = setTimeout(() => {\n if (action) {\n interacting = true;\n move(jsEvent);\n }\n }, (selecting() ? $selectLongPressDelay : $eventLongPressDelay) ?? $longPressDelay);\n }\n }\n\n function move(jsEvent) {\n if (\n interacting ||\n jsEvent && jsEvent.pointerType === 'mouse' && distance() >= (selecting() ? $selectMinDistance : $eventDragMinDistance)\n ) {\n interacting = true;\n unselect(jsEvent);\n $_iClass = iClass;\n\n if (!$_iEvents[0]) {\n if (selecting()) {\n createIEventSelect();\n } else {\n createIEvent(jsEvent, resizing() ? $eventResizeStart : $eventDragStart);\n }\n }\n\n let payload = findPayload(findDayEl());\n if (payload) {\n let newAllDay;\n ({allDay: newAllDay, date: newDate, resource: newResource} = payload);\n\n if (newAllDay === allDay) {\n let candidate = copyIEventData({}, $_iEvents[0]);\n let constraintFn = $resizeConstraint;\n delta = createDuration((newDate - date) / 1000);\n if (resizingStart()) {\n // Resizing start\n candidate.start = addDuration(cloneDate(event.start), delta);\n if (candidate.start > minResize) {\n candidate.start = minResize;\n delta = createDuration((minResize - event.start) / 1000);\n }\n } else {\n candidate.end = addDuration(cloneDate(event.end), delta);\n if (extraDuration) {\n addDuration(candidate.end, extraDuration);\n }\n if (resizing()) {\n // Resizing end\n if (candidate.end < minResize) {\n candidate.end = minResize;\n delta = createDuration((minResize - event.end) / 1000);\n }\n } else if (selecting()) {\n // Selecting\n if (candidate.end < event.end) {\n candidate.start = subtractDuration(candidate.end, selectStep);\n candidate.end = event.end;\n } else {\n candidate.start = event.start;\n }\n constraintFn = $selectConstraint;\n } else {\n // Dragging\n candidate.start = addDuration(cloneDate(event.start), delta);\n if (resource) {\n candidate.resourceIds = event.resourceIds.filter(id => id !== resource.id);\n candidate.resourceIds.push(newResource.id);\n }\n constraintFn = $dragConstraint;\n }\n }\n // Check constraint\n do {\n if (constraintFn !== undefined) {\n candidate = copyIEventData(cloneEvent(event), candidate);\n let result = constraintFn(\n selecting()\n ? createSelectCallbackInfo(candidate, jsEvent)\n : createCallbackInfo(candidate, event, jsEvent)\n );\n if (result === false) {\n // Revert preview event\n $_iEvents[0] = copyIEventData($_iEvents[0], event);\n break;\n }\n }\n // Update preview event\n $_iEvents[0] = copyIEventData($_iEvents[0], candidate);\n } while (0);\n }\n }\n }\n\n if ($dragScroll) {\n let thresholdY = $slotHeight * 2;\n let thresholdX = $slotWidth;\n animate(() => {\n if (bodyEl) {\n if (toY < thresholdY) {\n window.scrollBy(0, max(-10, (toY - thresholdY) / 3));\n }\n if (toY < bodyRect.top + thresholdY) {\n bodyEl.scrollTop += max(-10, (toY - bodyRect.top - thresholdY) / 3);\n }\n if (toY > window.innerHeight - thresholdY) {\n window.scrollBy(0, min(10, (toY - window.innerHeight + thresholdY) / 3));\n }\n if (toY > bodyRect.bottom - thresholdY) {\n bodyEl.scrollTop += min(10, (toY - bodyRect.bottom + thresholdY) / 3);\n }\n\n if (timelineView($view)) {\n if (toX < bodyRect.left + thresholdX) {\n bodyEl.scrollLeft += max(-10, (toX - bodyRect.left - thresholdX) / 3);\n }\n if (toX > bodyRect.right - thresholdX) {\n bodyEl.scrollLeft += min(10, (toX - bodyRect.right + thresholdX) / 3);\n }\n }\n }\n });\n }\n }\n\n export function handleScroll() {\n if (complexAction()) {\n calcViewport();\n move();\n }\n }\n\n function handlePointerMove(jsEvent) {\n if (complexAction() && jsEvent.isPrimary) {\n toX = jsEvent.clientX;\n toY = jsEvent.clientY;\n move(jsEvent);\n }\n }\n\n function handlePointerUp(jsEvent) {\n if (selected && $unselectAuto && !($unselectCancel && jsEvent.target.closest($unselectCancel))) {\n unselect(jsEvent);\n }\n if (action && jsEvent.isPrimary) {\n if (interacting) {\n if (selecting()) {\n selected = true;\n if (isFunction($selectFn)) {\n let info = createSelectCallbackInfo($_iEvents[0], jsEvent);\n $selectFn(info);\n }\n } else {\n event.display = display;\n\n let callback = resizing() ? $eventResizeStop : $eventDragStop;\n if (isFunction(callback)) {\n callback({event: toEventWithLocalDates(event), jsEvent, view: toViewWithLocalDates($_view)});\n }\n\n let oldEvent = cloneEvent(event);\n updateEvent(event, $_iEvents[0]);\n\n destroyIEvent();\n\n callback = resizing() ? $eventResize : $eventDrop;\n if (isFunction(callback)) {\n let eventRef = event;\n let info = createCallbackInfo(event, oldEvent, jsEvent);\n callback(assign(info, {\n revert() {\n updateEvent(eventRef, oldEvent);\n }\n }));\n }\n }\n } else {\n if (clicking() || selecting()) {\n // Perform date click\n if (isFunction($dateClick) && !noDateClick) {\n toX = jsEvent.clientX;\n toY = jsEvent.clientY;\n let dayEl = getElementWithPayload(toX, toY);\n if (dayEl) {\n let {allDay, date, resource} = getPayload(dayEl)(toX, toY);\n $dateClick({\n allDay,\n date: toLocalDate(date),\n dateStr: toISOString(date),\n dayEl,\n jsEvent,\n view: toViewWithLocalDates($_view),\n resource\n });\n }\n }\n }\n }\n\n interacting = false;\n action = fromX = fromY = toX = toY = event = display = date = newDate = resource = newResource = delta =\n extraDuration = allDay = $_iClass = minResize = selectStep = margin = undefined;\n bodyEl = clipEl = bodyRect = clipRect = undefined;\n\n if (timer) {\n clearTimeout(timer);\n timer = undefined;\n }\n }\n\n noDateClick = false;\n }\n\n function findDayEl() {\n // Limit coordinates to viewport\n return getElementWithPayload(\n limit(toX, viewport[0], viewport[1]),\n limit(toY, viewport[2], viewport[3])\n );\n }\n\n function findPayload(dayEl) {\n if (dayEl) {\n let payload = getPayload(dayEl)(toX, toY);\n if (payload.disabled) {\n if (!$validRange.end || payload.date < $validRange.end) {\n return findPayload(dayEl.nextElementSibling);\n }\n if (!$validRange.start || payload.date > $validRange.start) {\n return findPayload(dayEl.previousElementSibling);\n }\n } else {\n return payload;\n }\n }\n return null;\n }\n\n function calcViewport() {\n bodyRect = rect(bodyEl);\n clipRect = rect(clipEl);\n viewport = [\n max(0, clipRect.left + (timelineView($view) ? 1 : ($_dayGrid ? 0 : 8))), // left\n min(document.documentElement.clientWidth, clipRect.left + clipEl.clientWidth) - 2, // right\n max(0, bodyRect.top), // top\n min(document.documentElement.clientHeight, bodyRect.top + bodyEl.clientHeight) - 2 // bottom\n ];\n }\n\n function createIEvent(jsEvent, callback) {\n if (isFunction(callback)) {\n callback({event: toEventWithLocalDates(event), jsEvent, view: toViewWithLocalDates($_view)});\n }\n display = event.display;\n event.display = 'preview';\n $_iEvents[0] = cloneEvent(event);\n if (margin !== undefined) {\n $_iEvents[0]._margin = margin;\n }\n if (extraDuration) {\n addDuration($_iEvents[0].end, extraDuration);\n }\n event.display = 'ghost';\n $_events = $_events;\n }\n\n function createIEventSelect() {\n $_iEvents[0] = {\n id: '{select}',\n allDay: event.allDay,\n start: event.start,\n title: '',\n display: 'preview',\n extendedProps: {},\n backgroundColor: $selectBackgroundColor,\n resourceIds: event.resourceIds,\n classNames: [],\n styles: []\n };\n }\n\n function destroyIEvent() {\n $_iEvents[0] = null;\n }\n\n function copyIEventData(target, source) {\n target.start = source.start;\n target.end = source.end;\n target.resourceIds = source.resourceIds;\n return target;\n }\n\n function updateEvent(target, source) {\n copyIEventData(target, source);\n $_events = $_events;\n }\n\n function createSelectCallbackInfo(event, jsEvent) {\n let {start, end} = toEventWithLocalDates(event);\n return {\n start,\n end,\n startStr: toISOString(event.start),\n endStr: toISOString(event.end),\n allDay,\n view: toViewWithLocalDates($_view),\n resource,\n jsEvent\n };\n }\n\n function createCallbackInfo(event, oldEvent, jsEvent) {\n let info;\n if (resizing()) {\n info = resizingStart()\n ? {startDelta: delta, endDelta: createDuration(0)}\n : {startDelta: createDuration(0), endDelta: delta};\n } else {\n info = {\n delta,\n oldResource: resource !== newResource ? resource : undefined,\n newResource: resource !== newResource ? newResource : undefined\n };\n }\n assign(info, {\n event: toEventWithLocalDates(event),\n oldEvent: toEventWithLocalDates(oldEvent),\n view: toViewWithLocalDates($_view),\n jsEvent\n });\n\n return info;\n }\n\n function distance() {\n return Math.sqrt(Math.pow(toX - fromX, 2) + Math.pow(toY - fromY, 2));\n }\n\n function dragging() {\n return action === ACTION_DRAG;\n }\n\n function resizing() {\n return action === ACTION_RESIZE_END || resizingStart();\n }\n\n function resizingStart() {\n return action === ACTION_RESIZE_START;\n }\n\n function clicking() {\n return action === ACTION_CLICK;\n }\n\n function selecting() {\n return action === ACTION_SELECT;\n }\n\n function complexAction() {\n return action && action < ACTION_CLICK;\n }\n\n function validJsEvent(jsEvent) {\n return jsEvent.isPrimary && (jsEvent.pointerType !== 'mouse' || jsEvent.buttons & 1);\n }\n\n export function unselect(jsEvent) {\n if (selected) {\n selected = false;\n destroyIEvent();\n if (isFunction($unselectFn)) {\n $unselectFn({\n jsEvent,\n view: toViewWithLocalDates($_view)\n });\n }\n }\n }\n\n export function noClick() {\n noDateClick = true;\n }\n\n // Clear selection on view params change\n _view.subscribe(unselect);\n\n function handleTouchStart(jsEvent) {\n if (complexAction()) {\n let target = jsEvent.target;\n let stops = [];\n let stop = () => runAll(stops);\n stops.push(listen(window, 'touchmove', noop, {passive: false}))\n stops.push(listen(target, 'touchmove', createPreventDefaultHandler(() => interacting)));\n stops.push(listen(target, 'touchend', stop));\n stops.push(listen(target, 'touchcancel', stop));\n }\n }\n\n function createPreventDefaultHandler(condition) {\n return jsEvent => {\n if (condition()) {\n jsEvent.preventDefault();\n }\n };\n }\n</script>\n\n<svelte:window\n onpointermove={handlePointerMove}\n onpointerup={handlePointerUp}\n onpointercancel={handlePointerUp}\n onscroll={handleScroll}\n onselectstart={createPreventDefaultHandler(complexAction)}\n oncontextmenu={createPreventDefaultHandler(() => timer)}\n ontouchstart={handleTouchStart}\n/>\n","<script>\n import {getContext} from 'svelte';\n import {addDuration, cloneDate, getElementWithPayload, getPayload} from '#lib';\n\n let {_iEvents, slotDuration} = getContext('state');\n\n let x = 0, y = 0;\n\n $effect(() => {\n if ($_iEvents[0]) {\n removePointerEvent();\n }\n });\n\n function move() {\n let dayEl = getElementWithPayload(x, y);\n\n if (dayEl) {\n let {allDay, date, resource, disabled} = getPayload(dayEl)(x, y);\n if (!disabled) {\n let idx = allDay ? 2 : 1;\n\n if (!$_iEvents[idx]) {\n createPointerEvent(idx);\n }\n $_iEvents[idx].start = date;\n $_iEvents[idx].end = addDuration(cloneDate(date), $slotDuration);\n $_iEvents[idx].resourceIds = resource ? [resource.id] : [];\n\n return;\n }\n }\n\n removePointerEvent();\n }\n\n export function handleScroll() {\n move();\n }\n\n function handlePointerMove(jsEvent) {\n if (validEvent(jsEvent)) {\n x = jsEvent.clientX;\n y = jsEvent.clientY;\n move();\n }\n }\n\n function createPointerEvent(idx) {\n $_iEvents[idx] = {\n id: '{pointer}',\n title: '',\n display: 'pointer',\n extendedProps: {},\n backgroundColor: 'transparent',\n classNames: [],\n styles: []\n };\n }\n\n function removePointerEvent() {\n if ($_iEvents[1]) {\n $_iEvents[1] = null;\n }\n if ($_iEvents[2]) {\n $_iEvents[2] = null;\n }\n }\n\n function validEvent(jsEvent) {\n return jsEvent.isPrimary && jsEvent.pointerType === 'mouse';\n }\n</script>\n\n<svelte:window\n onpointermove={handlePointerMove}\n onscroll={handleScroll}\n/>\n","<script>\n import {getContext} from 'svelte';\n import {bgEvent, helperEvent} from '#lib';\n import {eventResizable} from './lib';\n\n let {chunk, axis, forceDate = undefined, forceMargin = undefined, children} = $props();\n\n let {theme, eventDurationEditable, eventResizableFromStart, editable, _interaction} = getContext('state');\n\n let event = $derived(chunk.event);\n let display = $derived(chunk.event.display);\n\n let resizable = $derived(\n !bgEvent(display) && !helperEvent(display) && eventResizable(event, $eventDurationEditable, $editable)\n );\n\n function createResizeHandler(start) {\n return jsEvent => $_interaction.action.resize(\n event,\n jsEvent,\n start,\n axis,\n forceDate?.(),\n forceMargin?.(),\n chunk.zeroDuration\n );\n }\n</script>\n\n{#if resizable && $eventResizableFromStart}\n <div class=\"{$theme.resizer} {$theme.start}\" onpointerdown={createResizeHandler(true)}></div>\n{/if}\n{@render children()}\n{#if resizable}\n <div class=\"{$theme.resizer}\" onpointerdown={createResizeHandler(false)}></div>\n{/if}\n","<script>\n import {getContext} from 'svelte';\n import {bgEvent, helperEvent, listen} from '#lib';\n import {eventDraggable} from './lib';\n import Action from './Action.svelte';\n import Pointer from './Pointer.svelte';\n import Resizer from './Resizer.svelte';\n\n let {theme, editable, eventStartEditable, pointer, _bodyEl,\n _interaction, _iClasses} = getContext('state');\n\n $_interaction.resizer = Resizer;\n\n $effect(() => {\n $theme;\n $eventStartEditable;\n $editable;\n $_iClasses = (classNames, event) => {\n let {display} = event;\n return [\n ...classNames,\n helperEvent(display)\n ? [$theme[display]]\n : (\n !bgEvent(display) && eventDraggable(event, $eventStartEditable, $editable)\n ? [$theme.draggable]\n : []\n )\n ];\n };\n });\n\n $effect(() => {\n if ($_bodyEl) {\n return listen($_bodyEl, 'scroll', bodyScrollHandler);\n }\n });\n\n function bodyScrollHandler() {\n for (let component of Object.values($_interaction)) {\n component?.handleScroll?.();\n }\n }\n</script>\n\n<Action bind:this={$_interaction.action}/>\n{#if $pointer}\n <Pointer bind:this={$_interaction.pointer}/>\n{/if}\n","import Auxiliary from './Auxiliary.svelte';\n\nexport default {\n createOptions(options) {\n options.dateClick = undefined;\n options.dragConstraint = undefined;\n options.dragScroll = true;\n options.editable = false;\n options.eventDragMinDistance = 5;\n options.eventDragStart = undefined;\n options.eventDragStop = undefined;\n options.eventDrop = undefined;\n options.eventDurationEditable = true;\n options.eventLongPressDelay = undefined;\n options.eventResizableFromStart = false;\n options.eventResizeStart = undefined;\n options.eventResizeStop = undefined;\n options.eventResize = undefined;\n options.eventStartEditable = true;\n options.longPressDelay = 1000;\n options.pointer = false;\n options.resizeConstraint = undefined;\n options.select = undefined;\n options.selectBackgroundColor = undefined; // ec option\n options.selectConstraint = undefined;\n options.selectLongPressDelay = undefined;\n options.selectMinDistance = 5;\n options.unselect = undefined;\n options.unselectAuto = true;\n options.unselectCancel = '';\n options.theme.draggable = 'ec-draggable';\n options.theme.ghost = 'ec-ghost';\n options.theme.preview = 'ec-preview';\n options.theme.pointer = 'ec-pointer';\n options.theme.resizer = 'ec-resizer';\n options.theme.start = 'ec-start';\n options.theme.dragging = 'ec-dragging';\n options.theme.resizingY = 'ec-resizing-y';\n options.theme.resizingX = 'ec-resizing-x';\n options.theme.selecting = 'ec-selecting';\n },\n\n createStores(state) {\n state._auxiliary.update($_auxiliary => [...$_auxiliary, Auxiliary]);\n }\n}\n","<script>\n import {getContext} from 'svelte';\n import {BaseEvent} from '#components';\n\n let {chunk} = $props();\n\n let {theme, _interaction} = getContext('state');\n\n // Style\n let styles = $derived(style => {\n delete style['background-color'];\n delete style['color'];\n return style;\n });\n</script>\n\n<BaseEvent {chunk} {styles} onpointerdown={$_interaction.action?.noAction}>\n {#snippet body(defaultBody, bgColor, txtColor)}\n <div class=\"{$theme.eventTag}\" style:background-color={bgColor}></div>\n {@render defaultBody()}\n {/snippet}\n</BaseEvent>\n","<script>\n import {getContext} from 'svelte';\n import {\n addDay, bgEvent, cloneDate, createEventChunk, datesEqual, eventIntersects, outsideRange, setContent, setPayload,\n sortEventChunks, toISOString\n } from '#lib';\n import Event from './Event.svelte';\n\n let {date} = $props();\n\n let {_filteredEvents, _interaction, _intlListDay, _intlListDaySide, _today,\n resources, eventOrder, filterEventsWithResources, highlightedDates, theme, validRange} = getContext('state');\n\n let el = $state();\n let isToday = $derived(datesEqual(date, $_today));\n let highlight = $derived($highlightedDates.some(d => datesEqual(d, date)));\n let disabled = $derived(outsideRange(date, $validRange));\n let datetime = $derived(toISOString(date, 10));\n\n let chunks = $derived.by(() => {\n let chunks = [];\n if (!disabled) {\n let start = date;\n let end = addDay(cloneDate(date));\n for (let event of $_filteredEvents) {\n if (!bgEvent(event.display) && eventIntersects(event, start, end, $filterEventsWithResources ? $resources : undefined)) {\n let chunk = createEventChunk(event, start, end);\n chunks.push(chunk);\n }\n }\n sortEventChunks(chunks, $eventOrder);\n }\n return chunks;\n });\n\n // dateFromPoint\n $effect(() => {\n if (el) {\n setPayload(el, () => ({allDay: true, date, resource: undefined, dayEl: el, disabled}));\n }\n });\n</script>\n\n{#if chunks.length}\n <div\n bind:this={el}\n class=\"{$theme.day} {$theme.weekdays?.[date.getUTCDay()]}{isToday ? ' ' + $theme.today : ''}{highlight ? ' ' + $theme.highlight : ''}\"\n role=\"listitem\"\n onpointerdown={$_interaction.action?.select}\n >\n <!-- svelte-ignore a11y_missing_content -->\n <h4 class=\"{$theme.dayHead}\">\n <time {datetime} use:setContent={$_intlListDay.format(date)}></time>\n <time class=\"{$theme.daySide}\" {datetime} use:setContent={$_intlListDaySide.format(date)}></time>\n </h4>\n {#each chunks as chunk (chunk.event)}\n <Event {chunk}/>\n {/each}\n </div>\n{/if}\n","<script>\n import {getContext} from 'svelte';\n import {addDay, cloneDate, toViewWithLocalDates, setContent, bgEvent, isFunction} from '#lib';\n import Day from './Day.svelte';\n\n let {_bodyEl, _filteredEvents, _view, _viewDates, noEventsClick, noEventsContent, theme} = getContext('state');\n\n let noEvents = $derived.by(() => {\n let noEvents = true;\n if ($_viewDates.length) {\n let start = $_viewDates[0];\n let end = addDay(cloneDate($_viewDates.at(-1)));\n for (let event of $_filteredEvents) {\n if (!bgEvent(event.display) && event.start < end && event.end > start) {\n noEvents = false;\n break;\n }\n }\n }\n return noEvents;\n });\n\n let content = $derived(isFunction($noEventsContent) ? $noEventsContent() : $noEventsContent);\n\n function onclick(jsEvent) {\n if (isFunction($noEventsClick)) {\n $noEventsClick({jsEvent, view: toViewWithLocalDates($_view)});\n }\n }\n</script>\n\n<div bind:this={$_bodyEl} class=\"{$theme.body}\">\n <div class=\"{$theme.content}\">\n {#if noEvents}\n <!-- svelte-ignore a11y_click_events_have_key_events -->\n <!-- svelte-ignore a11y_no_static_element_interactions -->\n <div use:setContent={content} class=\"{$theme.noEvents}\" {onclick}></div>\n {:else}\n {#each $_viewDates as date}\n <Day {date}/>\n {/each}\n {/if}\n </div>\n</div>\n","<script>\n import Body from './Body.svelte';\n</script>\n\n<Body/>\n","import {btnTextDay, btnTextWeek, btnTextMonth, btnTextYear, intl, themeView} from '#lib';\nimport View from './View.svelte';\n\nexport default {\n createOptions(options) {\n // Common options\n options.buttonText.listDay = 'list';\n options.buttonText.listWeek = 'list';\n options.buttonText.listMonth = 'list';\n options.buttonText.listYear = 'list';\n options.listDayFormat = {weekday: 'long'};\n options.listDaySideFormat = {year: 'numeric', month: 'long', day: 'numeric'};\n options.noEventsClick = undefined; // ec option\n options.noEventsContent = 'No events';\n options.theme.daySide = 'ec-day-side';\n options.theme.eventTag = 'ec-event-tag';\n options.theme.noEvents = 'ec-no-events';\n options.view = 'listWeek';\n options.views.listDay = {\n buttonText: btnTextDay,\n component: View,\n duration: {days: 1},\n theme: themeView('ec-list ec-day-view')\n };\n options.views.listWeek = {\n buttonText: btnTextWeek,\n component: View,\n duration: {weeks: 1},\n theme: themeView('ec-list ec-week-view')\n };\n options.views.listMonth = {\n buttonText: btnTextMonth,\n component: View,\n duration: {months: 1},\n theme: themeView('ec-list ec-month-view')\n };\n options.views.listYear = {\n buttonText: btnTextYear,\n component: View,\n duration: {years: 1},\n theme: themeView('ec-list ec-year-view')\n };\n },\n\n createStores(state) {\n state._intlListDay = intl(state.locale, state.listDayFormat);\n state._intlListDaySide = intl(state.locale, state.listDaySideFormat);\n }\n}\n","import {derived} from 'svelte/store';\nimport {createDate, createSlotTimeLimits, createTimes, setMidnight} from '#lib';\n\nexport function times(state) {\n return derived(\n [state.slotDuration, state.slotLabelInterval, state._slotTimeLimits, state._intlSlotLabel],\n args => createTimes(setMidnight(createDate()), ...args)\n );\n}\n\nexport function slotTimeLimits(state) {\n return derived(\n [state.slotMinTime, state.slotMaxTime, state.flexibleSlotTimeLimits, state._viewDates, state._filteredEvents],\n args => createSlotTimeLimits(...args)\n );\n}\n","import {isFunction, sortEventChunks} from '#lib';\n\nexport function groupEventChunks(chunks, $eventOrder) {\n if (!chunks.length) {\n return;\n }\n\n sortEventChunks(chunks, $eventOrder);\n\n // Group\n let group = {\n columns: [],\n end: chunks[0].end\n };\n for (let chunk of chunks) {\n let c = 0;\n if (chunk.start < group.end) {\n for (; c < group.columns.length; ++c) {\n if (group.columns[c].at(-1).end <= chunk.start) {\n break;\n }\n }\n if (chunk.end > group.end) {\n group.end = chunk.end;\n }\n } else {\n group = {\n columns: [],\n end: chunk.end\n };\n }\n\n if (group.columns.length < c + 1) {\n group.columns.push([]);\n }\n group.columns[c].push(chunk);\n\n chunk.group = group;\n chunk.column = c;\n }\n}\n\nexport function createAllDayContent(allDayContent) {\n let text = 'all-day';\n let content;\n if (allDayContent) {\n content = isFunction(allDayContent) ? allDayContent({text}) : allDayContent;\n if (typeof content === 'string') {\n content = {html: content};\n }\n } else {\n content = {\n html: text\n };\n }\n\n return content;\n}\n","<script>\n import {getContext} from 'svelte';\n import {setContent} from '#lib';\n import {createAllDayContent} from './utils.js';\n\n let {children, lines} = $props();\n\n let {allDayContent, slotLabelInterval, theme, _times} = getContext('state');\n\n let allDayText = $derived(createAllDayContent($allDayContent));\n let showAllTimes = $derived($slotLabelInterval && $slotLabelInterval.seconds <= 0);\n</script>\n\n<div class=\"{$theme.sidebar}\">\n <div class=\"{$theme.sidebarTitle}\" use:setContent={allDayText}></div>\n {#each $_times as time, i}\n <time\n class=\"{$theme.time}{(i || showAllTimes) && time[2] ? '' : ' ' + $theme.minor}\"\n datetime=\"{time[0]}\"\n use:setContent={time[1]}\n ></time>\n {/each}\n</div>\n<div class=\"{$theme.days}\" role=\"row\">\n <div class=\"{$theme.lines}\">{#if lines}{@render lines()}{/if}</div>\n {#if children}\n {@render children()}\n {/if}\n</div>\n","<script>\n import {getContext, untrack} from 'svelte';\n import {observeResize} from '#lib';\n import Section from './Section.svelte';\n\n let {children} = $props();\n\n let {\n _bodyEl, _viewDates, _slotTimeLimits, _times, _recheckScrollable, scrollTime, slotDuration, slotHeight, theme\n } = getContext('state');\n\n let el = $state();\n\n $effect(() => {\n $_bodyEl = el;\n });\n\n $effect(() => {\n $_viewDates;\n $scrollTime;\n untrack(scrollToTime);\n });\n\n function scrollToTime() {\n el.scrollTop = (($scrollTime.seconds - $_slotTimeLimits.min.seconds) / $slotDuration.seconds - 0.5) * $slotHeight;\n }\n</script>\n\n<div\n bind:this={el}\n class=\"{$theme.body}\"\n use:observeResize={() => $_recheckScrollable = true}\n>\n <div class=\"{$theme.content}\">\n <Section {children}>\n {#snippet lines()}\n {#each $_times as time}\n <div class=\"{$theme.line}{time[2] ? '' : ' ' + $theme.minor}\"></div>\n {/each}\n {/snippet}\n </Section>\n </div>\n</div>\n","<script>\n import {getContext} from 'svelte';\n import {bgEvent, ghostEvent, helperEvent} from '#lib';\n import {InteractableEvent} from '#components';\n\n let {date, chunk} = $props();\n\n let {slotEventOverlap, slotDuration, slotHeight, _slotTimeLimits} = getContext('state');\n\n let display = $derived(chunk.event.display);\n\n // Style\n let styles = $derived(style => {\n let step = $slotDuration.seconds;\n let offset = $_slotTimeLimits.min.seconds;\n let start = (chunk.start - date) / 1000;\n let end = (chunk.end - date) / 1000;\n let top = (start - offset) / step * $slotHeight;\n let height = (end - start) / step * $slotHeight || $slotHeight;\n let maxHeight = ($_slotTimeLimits.max.seconds - start) / step * $slotHeight;\n style['top'] = `${top}px`;\n style['min-height'] = `${height}px`;\n style['height'] = `${height}px`;\n style['max-height'] = `${maxHeight}px`;\n if (!bgEvent(display) && !helperEvent(display) || ghostEvent(display)) {\n style['z-index'] = `${chunk.column + 1}`;\n style['left'] = `${100 / chunk.group.columns.length * chunk.column}%`;\n style['width'] = `${100 / chunk.group.columns.length * ($slotEventOverlap ? 0.5 * (1 + chunk.group.columns.length - chunk.column) : 1)}%`;\n }\n return style;\n });\n</script>\n\n<InteractableEvent {chunk} {styles} axis=\"y\" />\n","<script>\n import {getContext} from 'svelte';\n\n let {slotDuration, slotHeight, theme, _now, _today, _slotTimeLimits} = getContext('state');\n\n let start = $derived(($_now - $_today) / 1000);\n // Style\n let top = $derived.by(() => {\n let step = $slotDuration.seconds;\n let offset = $_slotTimeLimits.min.seconds;\n return (start - offset) / step * $slotHeight;\n });\n</script>\n\n<div\n class=\"{$theme.nowIndicator}\"\n style=\"top:{top}px\"\n></div>\n","<script>\n import {getContext, onMount} from 'svelte';\n import {\n addDuration, bgEvent, cloneDate, createEventChunk, datesEqual, eventIntersects, floor, outsideRange, rect,\n setPayload\n } from '#lib';\n import {groupEventChunks} from './utils.js';\n import Event from './Event.svelte';\n import NowIndicator from './NowIndicator.svelte';\n\n let {date, resource = undefined} = $props();\n\n let {_filteredEvents, _iEvents, highlightedDates, nowIndicator, slotDuration, slotHeight, filterEventsWithResources,\n eventOrder, theme, resources, validRange, _interaction, _today, _slotTimeLimits} = getContext('state');\n\n let el = $state();\n\n let isToday = $derived(datesEqual(date, $_today));\n let highlight = $derived($highlightedDates.some(d => datesEqual(d, date)));\n let disabled = $derived(outsideRange(date, $validRange));\n\n let start = $derived(addDuration(cloneDate(date), $_slotTimeLimits.min));\n let end = $derived(addDuration(cloneDate(date), $_slotTimeLimits.max));\n\n let resourceFilter = $derived(resource ?? ($filterEventsWithResources ? $resources : undefined));\n\n let [chunks, bgChunks] = $derived.by(() => {\n if (disabled) {\n return [[], []];\n }\n let chunks = [];\n let bgChunks = [];\n for (let event of $_filteredEvents) {\n if ((!event.allDay || bgEvent(event.display)) && eventIntersects(event, start, end, resourceFilter)) {\n let chunk = createEventChunk(event, start, end);\n switch (event.display) {\n case 'background': bgChunks.push(chunk); break;\n default: chunks.push(chunk);\n }\n }\n }\n groupEventChunks(chunks, $eventOrder);\n return [chunks, bgChunks];\n });\n\n let iChunks = $derived.by(() => {\n if (disabled) {\n return [];\n }\n return $_iEvents.map(\n event => event && eventIntersects(event, start, end, resource) ? createEventChunk(event, start, end) : null\n );\n });\n\n function dateFromPoint(x, y) {\n y -= rect(el).top;\n return {\n allDay: false,\n date: addDuration(\n addDuration(cloneDate(date), $_slotTimeLimits.min),\n $slotDuration,\n floor(y / $slotHeight)\n ),\n resource,\n dayEl: el,\n disabled\n };\n }\n\n onMount(() => {\n setPayload(el, dateFromPoint);\n });\n</script>\n\n<div\n bind:this={el}\n class=\"{$theme.day} {$theme.weekdays?.[date.getUTCDay()]}{isToday ? ' ' + $theme.today : ''}{highlight ? ' ' + $theme.highlight : ''}{disabled ? ' ' + $theme.disabled : ''}\"\n role=\"cell\"\n onpointerdown={!disabled ? $_interaction.action?.select : undefined}\n>\n <div class=\"{$theme.bgEvents}\">\n {#if !disabled}\n {#each bgChunks as chunk (chunk.event)}\n <Event {date} {chunk}/>\n {/each}\n {/if}\n </div>\n <div class=\"{$theme.events}\">\n {#if !disabled}\n <!-- Pointer -->\n {#if iChunks[1]}\n <Event {date} chunk={iChunks[1]}/>\n {/if}\n {#each chunks as chunk (chunk.event)}\n <Event {date} {chunk}/>\n {/each}\n <!-- Drag, Resize & Select -->\n {#if iChunks[0] && !iChunks[0].event.allDay}\n <Event {date} chunk={iChunks[0]}/>\n {/if}\n {/if}\n </div>\n <div class=\"{$theme.extra}\">\n <!-- Now indicator -->\n {#if $nowIndicator && isToday && !disabled}\n <NowIndicator />\n {/if}\n </div>\n</div>\n","<script>\n import {ancestor, bgEvent, height, rect, repositionEvent} from '#lib';\n import {InteractableEvent} from '#components';\n\n let {chunk, longChunks = {}} = $props();\n\n let el = $state();\n let margin = $state(1);\n let event = $derived(chunk.event);\n let display = $derived(chunk.event.display);\n\n // Style\n let styles = $derived(style => {\n if (bgEvent(display)) {\n style['width'] = `calc(${chunk.days * 100}% + ${(chunk.days - 1)}px)`;\n } else {\n style['width'] = `calc(${chunk.days * 100}% + ${(chunk.days - 1) * 7}px)`;\n style['margin-top'] = `${event._margin ?? margin}px`;\n }\n return style;\n });\n\n export function reposition() {\n if (!el) {\n return;\n }\n margin = repositionEvent(chunk, longChunks, height(el));\n }\n</script>\n\n<InteractableEvent\n bind:el\n {chunk}\n {styles}\n axis=\"x\"\n forceMargin={() => rect(el).top - rect(ancestor(el, 1)).top}\n/>\n","<script>\n import {getContext, onMount} from 'svelte';\n import {datesEqual, outsideRange, runReposition, setPayload} from '#lib';\n import Event from './Event.svelte';\n\n let {date, chunks, bgChunks, longChunks, iChunks = [], resource = undefined} = $props();\n\n let {highlightedDates, theme, validRange, _interaction, _today} = getContext('state');\n\n let el = $state();\n let refs = [];\n\n let dayChunks = $derived(chunks.filter(chunk => datesEqual(chunk.date, date)));\n let dayBgChunks = $derived(bgChunks.filter(bgChunk => datesEqual(bgChunk.date, date)));\n\n let isToday = $derived(datesEqual(date, $_today));\n let highlight = $derived($highlightedDates.some(d => datesEqual(d, date)));\n let disabled = $derived(outsideRange(date, $validRange));\n\n // dateFromPoint\n onMount(() => {\n setPayload(el, () => ({\n allDay: true,\n date,\n resource,\n dayEl: el,\n disabled\n }));\n });\n\n export function reposition() {\n if (!disabled) {\n runReposition(refs, dayChunks);\n }\n }\n</script>\n\n<div\n bind:this={el}\n class=\"{$theme.day} {$theme.weekdays?.[date.getUTCDay()]}{isToday ? ' ' + $theme.today : ''}{highlight ? ' ' + $theme.highlight : ''}{disabled ? ' ' + $theme.disabled : ''}\"\n role=\"cell\"\n onpointerdown={!disabled ? $_interaction.action?.select : undefined}\n>\n <div class=\"{$theme.bgEvents}\">\n {#if !disabled}\n {#each dayBgChunks as chunk (chunk.event)}\n <Event {chunk}/>\n {/each}\n {/if}\n </div>\n <!-- Drag, Resize & Select -->\n {#if iChunks[0] && datesEqual(iChunks[0].date, date) && !disabled}\n <div class=\"{$theme.events} {$theme.preview}\">\n <Event chunk={iChunks[0]}/>\n </div>\n {/if}\n <div class=\"{$theme.events}\">\n {#if !disabled}\n {#each dayChunks as chunk, i (chunk.event)}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Event {chunk} {longChunks} bind:this={refs[i]}/>\n {/each}\n {/if}\n </div>\n</div>\n","<script>\n import {getContext, untrack} from 'svelte';\n import {\n addDay, bgEvent, cloneDate, createEventChunk, eventIntersects, limitToRange, prepareEventChunks, runReposition\n } from '#lib';\n import Day from './Day.svelte';\n\n let {dates, resource = undefined} = $props();\n\n let {_filteredEvents, _iEvents, eventOrder, hiddenDays, resources, filterEventsWithResources,\n validRange} = getContext('state');\n\n let refs = [];\n\n let start = $derived(limitToRange(dates[0], $validRange));\n let end = $derived(addDay(cloneDate(limitToRange(dates.at(-1), $validRange))));\n\n let resourceFilter = $derived(resource ?? (\n $filterEventsWithResources ? $resources : undefined\n ));\n\n let [chunks, bgChunks, longChunks] = $derived.by(() => {\n let chunks = [];\n let bgChunks = [];\n for (let event of $_filteredEvents) {\n if (event.allDay && eventIntersects(event, start, end, resourceFilter)) {\n let chunk = createEventChunk(event, start, end);\n if (bgEvent(event.display)) {\n bgChunks.push(chunk);\n } else {\n chunks.push(chunk);\n }\n }\n }\n prepareEventChunks(bgChunks, $hiddenDays, $eventOrder);\n let longChunks = prepareEventChunks(chunks, $hiddenDays, $eventOrder);\n return [chunks, bgChunks, longChunks];\n });\n\n function reposition() {\n runReposition(refs, dates);\n }\n $effect(() => {\n chunks;\n untrack(reposition);\n });\n\n let iChunks = $derived($_iEvents.map(event => {\n let chunk;\n if (event && event.allDay && eventIntersects(event, start, end, resource)) {\n chunk = createEventChunk(event, start, end);\n prepareEventChunks([chunk], $hiddenDays, $eventOrder);\n } else {\n chunk = null;\n }\n return chunk;\n }));\n</script>\n\n{#each dates as date, i}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Day {date} {chunks} {bgChunks} {longChunks} {iChunks} {resource} bind:this={refs[i]} />\n{/each}\n\n<svelte:window on:resize={reposition}/>\n","<script>\n import {getContext} from 'svelte';\n import {datesEqual, setContent, toISOString} from '#lib';\n import Section from './Section.svelte';\n import Body from './Body.svelte';\n import Day from './Day.svelte';\n import Week from './all-day/Week.svelte';\n\n let {_viewDates, _intlDayHeader, _intlDayHeaderAL, _today, allDaySlot, theme} = getContext('state');\n</script>\n\n<div class=\"{$theme.header}\">\n <Section>\n {#each $_viewDates as date}\n <div\n class=\"{$theme.day} {$theme.weekdays?.[date.getUTCDay()]}{datesEqual(date, $_today) ? ' ' + $theme.today : ''}\"\n role=\"columnheader\"\n >\n <time\n datetime=\"{toISOString(date, 10)}\"\n aria-label=\"{$_intlDayHeaderAL.format(date)}\"\n use:setContent={$_intlDayHeader.format(date)}\n ></time>\n </div>\n {/each}\n </Section>\n <div class=\"{$theme.hiddenScroll}\"></div>\n</div>\n{#if $allDaySlot}\n <div class=\"{$theme.allDay}\">\n <div class=\"{$theme.content}\">\n <Section>\n <Week dates={$_viewDates}/>\n </Section>\n <div class=\"{$theme.hiddenScroll}\"></div>\n </div>\n </div>\n{/if}\n<Body>\n{#each $_viewDates as date}\n <Day {date}/>\n{/each}\n</Body>\n","import {btnTextDay, btnTextWeek, themeView} from '#lib';\nimport {slotTimeLimits, times} from './stores.js';\nimport View from './View.svelte';\n\nexport {default as Section} from './Section.svelte';\nexport {default as Body} from './Body.svelte';\nexport {default as Day} from './Day.svelte';\nexport {default as Week} from './all-day/Week.svelte';\n\nexport default {\n createOptions(options) {\n // Common options\n options.buttonText.timeGridDay = 'day';\n options.buttonText.timeGridWeek = 'week';\n options.view = 'timeGridWeek';\n options.views.timeGridDay = {\n buttonText: btnTextDay,\n component: View,\n dayHeaderFormat: {weekday: 'long'},\n duration: {days: 1},\n theme: themeView('ec-time-grid ec-day-view'),\n titleFormat: {year: 'numeric', month: 'long', day: 'numeric'}\n };\n options.views.timeGridWeek = {\n buttonText: btnTextWeek,\n component: View,\n duration: {weeks: 1},\n theme: themeView('ec-time-grid ec-week-view')\n };\n },\n\n createStores(state) {\n state._slotTimeLimits = slotTimeLimits(state); // flexible limits\n state._times = times(state);\n }\n}\n","<script>\n import {getContext, onMount, untrack} from 'svelte';\n import {setContent, toLocalDate, isFunction} from '#lib';\n\n let {resource, date = undefined, setLabel = undefined} = $props();\n\n let {resourceLabelContent, resourceLabelDidMount, _intlDayHeaderAL} = getContext('state');\n\n let el = $state();\n // Content\n let content = $derived.by(() => {\n if ($resourceLabelContent) {\n return isFunction($resourceLabelContent)\n ? $resourceLabelContent({\n resource,\n date: date ? toLocalDate(date) : undefined,\n })\n : $resourceLabelContent;\n } else {\n return resource.title;\n }\n });\n // Aria-label\n let ariaLabel = $state();\n $effect(() => {\n content;\n untrack(() => {\n if (date) {\n ariaLabel = $_intlDayHeaderAL.format(date) + ', ' + el.innerText;\n } else if (setLabel) {\n ariaLabel = undefined;\n setLabel(el.innerText);\n }\n });\n });\n\n onMount(() => {\n if (isFunction($resourceLabelDidMount)) {\n $resourceLabelDidMount({\n resource,\n date: date ? toLocalDate(date) : undefined,\n el\n });\n }\n });\n</script>\n\n<span\n bind:this={el}\n aria-label=\"{ariaLabel}\"\n use:setContent={content}\n></span>\n","<script>\n import {getContext} from 'svelte';\n import {datesEqual, setContent, toISOString} from '#lib';\n import {Section, Body, Day, Week} from '../time-grid/index.js';\n import Label from './Label.svelte';\n\n let {\n datesAboveResources, _today, _viewDates, _viewResources, _intlDayHeader, _intlDayHeaderAL, allDaySlot, theme\n } = getContext('state');\n\n let loops = $derived($datesAboveResources ? [$_viewDates, $_viewResources] : [$_viewResources, $_viewDates]);\n\n let resourceLabels = $state([]);\n</script>\n\n<div class=\"{$theme.header}\">\n <Section>\n {#each loops[0] as item0, i}\n <div class=\"{$theme.resource}\">\n {#if $datesAboveResources}\n <div class=\"{$theme.day} {$theme.weekdays?.[item0.getUTCDay()]}{datesEqual(item0, $_today) ? ' ' + $theme.today : ''}\">\n <time\n datetime=\"{toISOString(item0, 10)}\"\n aria-label=\"{$_intlDayHeaderAL.format(item0)}\"\n use:setContent={$_intlDayHeader.format(item0)}\n ></time>\n </div>\n {:else}\n <div class=\"{$theme.day}\">\n <Label resource={item0} setLabel={e => resourceLabels[i] = e.detail + ', '} />\n </div>\n {/if}\n {#if loops[1].length > 1}\n <div class=\"{$theme.days}\">\n {#each loops[1] as item1}\n {#if $datesAboveResources}\n <div class=\"{$theme.day}\" role=\"columnheader\">\n <Label resource={item1} date={item0} />\n </div>\n {:else}\n <div\n class=\"{$theme.day} {$theme.weekdays?.[item1.getUTCDay()]}{datesEqual(item1, $_today) ? ' ' + $theme.today : ''}\"\n role=\"columnheader\"\n >\n <time\n datetime=\"{toISOString(item1, 10)}\"\n aria-label=\"{resourceLabels[i]}{$_intlDayHeaderAL.format(item1)}\"\n use:setContent={$_intlDayHeader.format(item1)}\n ></time>\n </div>\n {/if}\n {/each}\n </div>\n {/if}\n </div>\n {/each}\n </Section>\n <div class=\"{$theme.hiddenScroll}\"></div>\n</div>\n{#if $allDaySlot}\n <div class=\"{$theme.allDay}\">\n <div class=\"{$theme.content}\">\n <Section>\n {#if $datesAboveResources}\n {#each $_viewDates as date}\n <div class=\"{$theme.resource}\">\n {#each $_viewResources as resource}\n <Week dates={[date]} {resource}/>\n {/each}\n </div>\n {/each}\n {:else}\n {#each $_viewResources as resource}\n <div class=\"{$theme.resource}\">\n <Week dates={$_viewDates} {resource}/>\n </div>\n {/each}\n {/if}\n </Section>\n <div class=\"{$theme.hiddenScroll}\"></div>\n </div>\n </div>\n{/if}\n<Body>\n{#each loops[0] as item0}\n <div class=\"{$theme.resource}\">\n {#each loops[1] as item1}\n <Day\n date={$datesAboveResources ? item0 : item1}\n resource={$datesAboveResources ? item1 : item0}\n />\n {/each}\n </div>\n{/each}\n</Body>\n","import {btnTextDay, btnTextWeek, themeView, viewResources} from '#lib';\nimport TimeGrid from '../time-grid/index.js';\nimport View from './View.svelte';\n\nexport default {\n createOptions(options) {\n options.datesAboveResources = false;\n // Common options\n options.buttonText.resourceTimeGridDay = 'resources';\n options.buttonText.resourceTimeGridWeek = 'resources';\n options.view = 'resourceTimeGridWeek';\n options.views.resourceTimeGridDay = {\n buttonText: btnTextDay,\n component: View,\n duration: {days: 1},\n theme: themeView('ec-time-grid ec-resource-day-view')\n };\n options.views.resourceTimeGridWeek = {\n buttonText: btnTextWeek,\n component: View,\n duration: {weeks: 1},\n theme: themeView('ec-time-grid ec-resource-week-view')\n };\n },\n\n createStores(state) {\n if (!('_times' in state)) {\n TimeGrid.createStores(state);\n }\n if (!('_viewResources' in state)) {\n state._viewResources = viewResources(state);\n }\n }\n}\n","import {derived} from 'svelte/store';\nimport {createSlotTimeLimits, createTimes, getPayload} from '#lib';\n\n// slotTimeLimits per day\nexport function dayTimeLimits(state) {\n return derived(\n [state.slotMinTime, state.slotMaxTime, state.flexibleSlotTimeLimits, state._viewDates, state._filteredEvents],\n ([$slotMinTime, $slotMaxTime, $flexibleSlotTimeLimits, $_viewDates, $_filteredEvents]) => {\n let dayTimeLimits = {};\n for (let date of $_viewDates) {\n dayTimeLimits[date.getTime()] = createSlotTimeLimits(\n $slotMinTime,\n $slotMaxTime,\n $flexibleSlotTimeLimits,\n [date],\n $_filteredEvents\n );\n }\n\n return dayTimeLimits;\n }\n );\n}\n\nexport function dayTimes(state) {\n return derived(\n [state._viewDates, state.slotDuration, state.slotLabelInterval, state._dayTimeLimits, state._intlSlotLabel],\n ([$_viewDates, $slotDuration, $slotLabelInterval, $_dayTimeLimits, $_intlSlotLabel]) => {\n let dayTimes = {};\n for (let date of $_viewDates) {\n let time = date.getTime();\n dayTimes[time] = time in $_dayTimeLimits\n ? createTimes(date, $slotDuration, $slotLabelInterval, $_dayTimeLimits[time], $_intlSlotLabel)\n : [];\n }\n\n return dayTimes;\n }\n );\n}\n\nexport function nestedResources(state) {\n return derived(state.resources, $resources => $resources.some(resource => getPayload(resource).children.length));\n}\n","<script>\n import {getContext, onMount, untrack} from 'svelte';\n import {ceil, height, setContent, toLocalDate, isFunction} from '#lib';\n\n let {resource, date = undefined} = $props();\n\n let {resourceLabelContent, resourceLabelDidMount, _resHs} = getContext('state');\n\n let el = $state();\n // Content\n let content = $derived.by(() => {\n if ($resourceLabelContent) {\n return isFunction($resourceLabelContent)\n ? $resourceLabelContent({\n resource,\n date: date ? toLocalDate(date) : undefined,\n })\n : $resourceLabelContent;\n } else {\n return resource.title;\n }\n });\n\n $effect(() => {\n content;\n untrack(() => {\n $_resHs.set(resource, ceil(height(el) + 10));\n $_resHs = $_resHs;\n });\n });\n\n onMount(() => {\n if (isFunction($resourceLabelDidMount)) {\n $resourceLabelDidMount({\n resource,\n date: date ? toLocalDate(date) : undefined,\n el\n });\n }\n });\n</script>\n\n<span\n bind:this={el}\n use:setContent={content}\n></span>\n","<script>\n import {getContext} from 'svelte';\n import {getPayload, identity} from '#lib';\n\n let {resource} = $props();\n\n let {resources, theme} = getContext('state');\n\n let payload = $state.raw({});\n let expanded = $state(true);\n\n $effect.pre(() => {\n payload = getPayload(resource);\n expanded = payload.expanded;\n });\n\n function onclick() {\n expanded = !expanded;\n payload.expanded = expanded;\n toggle(payload.children, expanded);\n resources.update(identity);\n }\n\n function toggle(children, expand) {\n for (let child of children) {\n let payload = getPayload(child);\n payload.hidden = !expand;\n if (payload.expanded) {\n toggle(payload.children, expand);\n }\n }\n }\n</script>\n\n{#each Array(payload.level) as level}\n <span class=\"{$theme.expander}\"></span>\n{/each}\n\n<span class=\"{$theme.expander}\">\n {#if payload.children?.length}\n <button class=\"{$theme.button}\" {onclick}>\n {#if expanded}&minus;{:else}&plus;{/if}\n </button>\n {/if}\n</span>\n","<script>\n import {getContext, untrack} from 'svelte';\n import {max} from '#lib';\n import Label from './Label.svelte';\n import Expander from './Expander.svelte';\n\n let {_viewResources, _headerHeight, _bodyEl, _daysHs, _resHs, _sidebarEl, _nestedResources, theme} = getContext('state');\n\n $effect.pre(() => {\n $_viewResources;\n untrack(() => {\n $_resHs.clear();\n });\n });\n\n function onwheel(jsEvent) {\n $_bodyEl.scrollBy({\n top: jsEvent.deltaY < 0 ? -30 : 30\n });\n }\n</script>\n\n<div class=\"{$theme.sidebar}\">\n <div class=\"{$theme.sidebarTitle}\" style=\"flex-basis: {$_headerHeight}px\"></div>\n <div class=\"{$theme.content}\" bind:this={$_sidebarEl} {onwheel}>\n {#each $_viewResources as resource}\n <div class=\"{$theme.resource}\" style=\"flex-basis: {max($_daysHs.get(resource) ?? 0, $_resHs.get(resource) ?? 0, 34)}px\" role=\"rowheader\">\n {#if $_nestedResources}\n <Expander {resource} />\n {/if}\n <Label {resource}/>\n </div>\n {/each}\n </div>\n</div>\n","<script>\n import {getContext} from 'svelte';\n import {datesEqual, setContent, toISOString, toSeconds, observeResize} from '#lib';\n\n let {_headerEl, _headerHeight, _intlDayHeader, _intlDayHeaderAL, _dayTimes, _today, _viewDates,\n slotDuration, theme} = getContext('state');\n</script>\n\n<div class=\"{$theme.header}\" bind:this={$_headerEl} use:observeResize={() => $_headerHeight = $_headerEl.clientHeight}>\n <div class=\"{$theme.days}\" role=\"row\">\n {#each $_viewDates as date}\n <div class=\"{$theme.day} {$theme.weekdays?.[date.getUTCDay()]}{datesEqual(date, $_today) ? ' ' + $theme.today : ''}\">\n {#if toSeconds($slotDuration)}\n <div class=\"{$theme.dayHead}\">\n <time\n datetime=\"{toISOString(date, 10)}\"\n aria-label=\"{$_intlDayHeaderAL.format(date)}\"\n use:setContent={$_intlDayHeader.format(date)}\n ></time>\n </div>\n <div class=\"{$theme.times}\">\n {#each $_dayTimes[date.getTime()] as time}\n <div class=\"{$theme.time}{time[2] ? '' : ' ' + $theme.minor}\" role=\"columnheader\">\n <time\n datetime=\"{time[0]}\"\n use:setContent={time[1]}\n ></time>\n </div>\n {/each}\n </div>\n {:else}\n <div class=\"{$theme.time}\" role=\"columnheader\">\n <time\n datetime=\"{toISOString(date, 10)}\"\n aria-label=\"{$_intlDayHeaderAL.format(date)}\"\n use:setContent={$_intlDayHeader.format(date)}\n ></time>\n </div>\n {/if}\n </div>\n {/each}\n </div>\n <div class=\"{$theme.hiddenScroll}\"></div>\n</div>\n","import {addDay, addDuration, cloneDate, createDuration, datesEqual, sortEventChunks, toSeconds} from '#lib';\n\nexport function prepareEventChunks(chunks, $_viewDates, $_dayTimeLimits, $slotDuration, $eventOrder) {\n let longChunks = {};\n let filteredChunks = [];\n\n if (chunks.length) {\n sortEventChunks(chunks, $eventOrder);\n\n let step = toSeconds($slotDuration);\n let prevChunk;\n for (let chunk of chunks) {\n let prevDayEnd;\n if (step) {\n let slots = 0;\n for (let i = 0; i < $_viewDates.length; ++i) {\n let slotTimeLimits = getSlotTimeLimits($_dayTimeLimits, $_viewDates[i]);\n let dayStart = addDuration(cloneDate($_viewDates[i]), slotTimeLimits.min);\n let dayEnd = addDuration(cloneDate($_viewDates[i]), slotTimeLimits.max);\n if (!chunk.date) {\n if (chunk.start < dayEnd && chunk.end > dayStart) {\n // The first day is found\n chunk.date = $_viewDates[i];\n if (chunk.start < dayStart) {\n // Adjust chunk start\n chunk.start = dayStart;\n }\n // Calculate offset\n chunk.offset = (chunk.start - dayStart) / 1000 / step;\n // Calculate slots\n if (chunk.end > dayEnd) {\n slots += dayEnd - chunk.start;\n } else {\n slots += chunk.end - chunk.start || step * 1000;\n break;\n }\n }\n } else {\n if (chunk.end <= dayStart) {\n // Adjust chunk end\n chunk.end = prevDayEnd;\n break;\n }\n // The chunk is long one\n let key = $_viewDates[i].getTime();\n if (longChunks[key]) {\n longChunks[key].push(chunk);\n } else {\n longChunks[key] = [chunk];\n }\n // Calculate slots\n if (chunk.end > dayEnd) {\n slots += dayEnd - dayStart;\n } else {\n slots += chunk.end - dayStart;\n break;\n }\n }\n prevDayEnd = dayEnd;\n }\n chunk.slots = slots / 1000 / step;\n } else {\n // Month view\n let days = 0;\n for (let i = 0; i < $_viewDates.length; ++i) {\n let dayStart = $_viewDates[i];\n let dayEnd = addDay(cloneDate(dayStart));\n if (!chunk.date) {\n if (chunk.start < dayEnd) {\n // The first day is found\n chunk.date = dayStart;\n if (chunk.start < dayStart) {\n // Adjust chunk start\n chunk.start = dayStart;\n }\n ++days;\n }\n } else {\n if (chunk.end <= dayStart) {\n // Adjust chunk end\n chunk.end = prevDayEnd;\n break;\n }\n // The chunk is long one\n let key = dayStart.getTime();\n if (longChunks[key]) {\n longChunks[key].push(chunk);\n } else {\n longChunks[key] = [chunk];\n }\n ++days;\n }\n prevDayEnd = dayEnd;\n }\n chunk.days = days;\n }\n\n if (!chunk.date) {\n // Chunk is outside the slot time limits, so skip it\n continue;\n }\n\n if (prevChunk && datesEqual(prevChunk.date, chunk.date)) {\n chunk.prev = prevChunk;\n }\n prevChunk = chunk;\n filteredChunks.push(chunk);\n }\n }\n\n return [filteredChunks, longChunks];\n}\n\nexport function repositionEvent(chunk, dayChunks, longChunks, height, allDay) {\n chunk.top = 0;\n chunk.bottom = height;\n let margin = 1;\n let key = chunk.date.getTime();\n longChunks = longChunks?.[key] ?? [];\n let chunks = [...dayChunks, ...longChunks];\n chunks.sort((a, b) => (a.top ?? 0) - (b.top ?? 0) || a.start - b.start || b.event.allDay - a.event.allDay);\n for (let dayChunk of chunks) {\n if (dayChunk === chunk) {\n continue;\n }\n if ((allDay || chunk.start < dayChunk.end && chunk.end > dayChunk.start) && chunk.top < dayChunk.bottom && chunk.bottom > dayChunk.top) {\n let offset = dayChunk.bottom - chunk.top + 1;\n margin += offset;\n chunk.top += offset;\n chunk.bottom += offset;\n }\n }\n\n return margin;\n}\n\nexport function getSlotTimeLimits($_dayTimeLimits, date) {\n return $_dayTimeLimits[date.getTime()] ?? {min: createDuration(0), max: createDuration(0)};\n}\n","<script>\n import {getContext} from 'svelte';\n import {height, helperEvent, toSeconds} from '#lib';\n import {repositionEvent} from './lib.js';\n import {InteractableEvent} from '#components';\n\n let {chunk, dayChunks = [], longChunks = {}, resource = undefined} = $props();\n\n let {slotDuration, slotWidth} = getContext('state');\n\n let el = $state();\n let margin = $state(helperEvent(chunk.event.display) ? 1 : 0);\n let event = $derived(chunk.event);\n // Style\n let width = $derived('slots' in chunk ? chunk.slots * $slotWidth : chunk.days * 100);\n let styles = $derived(style => {\n if ('slots' in chunk) {\n let left = chunk.offset * $slotWidth;\n style['left'] = `${left}px`;\n style['width'] = `${width}px`;\n } else {\n // Month view\n style['width'] = `${width}%`;\n }\n let marginTop = margin;\n if (event._margin) {\n // Force margin for helper events\n let [_margin, _resource] = event._margin;\n if (resource === _resource) {\n marginTop = _margin;\n }\n }\n style['margin-top'] = `${marginTop}px`;\n return style;\n });\n\n export function reposition() {\n if (!el) {\n return 0;\n }\n let h = height(el);\n margin = repositionEvent(chunk, dayChunks, longChunks, h, !toSeconds($slotDuration));\n return margin + h;\n }\n</script>\n\n{#if width > 0}\n <InteractableEvent bind:el {chunk} {styles} axis=\"x\" forceMargin={() => [margin, resource]} />\n{/if}\n","<script>\n import {getContext} from 'svelte';\n import {\n addDuration, ceil, cloneDate, datesEqual, floor, max, outsideRange, rect, runReposition, setPayload, toSeconds\n } from '#lib';\n import {getSlotTimeLimits} from './lib.js';\n import Event from './Event.svelte';\n\n let {date, resource, chunks, bgChunks, longChunks, iChunks = []} = $props();\n\n let {\n highlightedDates, slotDuration, slotWidth, theme, validRange, _interaction, _today, _dayTimeLimits\n } = getContext('state');\n\n let el = $state();\n let refs = [];\n\n let isToday = $derived(datesEqual(date, $_today));\n let highlight = $derived($highlightedDates.some(d => datesEqual(d, date)));\n let disabled = $derived(outsideRange(date, $validRange));\n\n let slotTimeLimits = $derived(getSlotTimeLimits($_dayTimeLimits, date));\n let allDay = $derived(!toSeconds($slotDuration));\n let pointerIdx = $derived(allDay ? 2 : 1);\n\n let dayChunks = $derived(chunks.filter(chunkIntersects));\n let dayBgChunks = $derived(bgChunks.filter(bgChunk => (!allDay || bgChunk.event.allDay) && chunkIntersects(bgChunk)));\n\n function chunkIntersects(chunk) {\n return datesEqual(chunk.date, date);\n }\n\n function dateFromPoint(x, y) {\n x -= rect(el).left;\n return {\n allDay,\n date: allDay\n ? cloneDate(date)\n : addDuration(\n addDuration(cloneDate(date), slotTimeLimits.min),\n $slotDuration,\n floor(x / $slotWidth)\n ),\n resource,\n dayEl: el,\n disabled\n };\n }\n $effect(() => {\n setPayload(el, dateFromPoint);\n });\n\n export function reposition() {\n return max(...runReposition(refs, dayChunks));\n }\n</script>\n\n<div\n bind:this={el}\n class=\"{$theme.day} {$theme.weekdays?.[date.getUTCDay()]}{isToday ? ' ' + $theme.today : ''}{highlight ? ' ' + $theme.highlight : ''}{disabled ? ' ' + $theme.disabled : ''}\"\n style=\"flex-grow: {allDay ? null : ceil((toSeconds(slotTimeLimits.max) - toSeconds(slotTimeLimits.min)) / toSeconds($slotDuration))}\"\n role=\"cell\"\n onpointerdown={$_interaction.action?.select}\n>\n <div class=\"{$theme.events}\">\n {#if !disabled}\n {#each dayBgChunks as chunk (chunk.event)}\n <Event {chunk}/>\n {/each}\n <!-- Pointer -->\n {#if iChunks[pointerIdx] && chunkIntersects(iChunks[pointerIdx])}\n <Event chunk={iChunks[pointerIdx]}/>\n {/if}\n {#each dayChunks as chunk, i (chunk.event)}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Event {chunk} {dayChunks} {longChunks} {resource} bind:this={refs[i]}/>\n {/each}\n <!-- Drag, Resize & Select -->\n {#if iChunks[0] && chunkIntersects(iChunks[0])}\n <Event chunk={iChunks[0]} {resource}/>\n {/if}\n {/if}\n </div>\n</div>\n","<script>\n import {getContext} from 'svelte';\n import {\n addDay, addDuration, bgEvent, ceil, cloneDate, createEventChunk, DAY_IN_SECONDS, eventIntersects,\n limitToRange, max, runReposition\n } from '#lib';\n import {getSlotTimeLimits, prepareEventChunks} from './lib.js';\n import Day from './Day.svelte';\n\n let {resource} = $props();\n\n let {_viewDates, _filteredEvents, _iEvents, _dayTimeLimits, _daysHs, _resHs,\n eventOrder, slotDuration, theme, validRange} = getContext('state');\n\n let refs = [];\n\n let [start, end] = $derived.by(() => {\n let start = cloneDate(limitToRange($_viewDates[0], $validRange));\n let end = cloneDate(limitToRange($_viewDates.at(-1), $validRange));\n let slotTimeLimits = getSlotTimeLimits($_dayTimeLimits, start);\n addDuration(start, slotTimeLimits.min);\n slotTimeLimits = getSlotTimeLimits($_dayTimeLimits, end);\n if (slotTimeLimits.max.seconds > DAY_IN_SECONDS) {\n addDuration(end, slotTimeLimits.max) /** @see https://github.com/vkurko/calendar/issues/333 */\n } else {\n addDay(end);\n }\n return [start, end];\n });\n\n let [chunks, bgChunks, longChunks] = $derived.by(() => {\n let chunks = [];\n let bgChunks = [];\n let longChunks;\n for (let event of $_filteredEvents) {\n if (eventIntersects(event, start, end, resource)) {\n let chunk = createEventChunk(event, start, end);\n if (bgEvent(event.display)) {\n bgChunks.push(chunk);\n } else {\n chunks.push(chunk);\n }\n }\n }\n [bgChunks] = prepareEventChunks(bgChunks, $_viewDates, $_dayTimeLimits, $slotDuration, $eventOrder);\n [chunks, longChunks] = prepareEventChunks(chunks, $_viewDates, $_dayTimeLimits, $slotDuration, $eventOrder);\n return [chunks, bgChunks, longChunks];\n });\n\n let iChunks = $derived($_iEvents.map(event => {\n let chunk;\n if (event && eventIntersects(event, start, end, resource)) {\n chunk = createEventChunk(event, start, end);\n [[chunk]] = prepareEventChunks([chunk], $_viewDates, $_dayTimeLimits, $slotDuration, $eventOrder);\n } else {\n chunk = null;\n }\n return chunk;\n }));\n\n export function reposition() {\n $_daysHs.set(resource, ceil(max(...runReposition(refs, $_viewDates))) + 10);\n $_daysHs = $_daysHs;\n }\n</script>\n\n<div class=\"{$theme.days}\" style=\"flex-basis: {max($_daysHs.get(resource) ?? 0, $_resHs.get(resource) ?? 0, 34)}px\" role=\"row\">\n {#each $_viewDates as date, i}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Day {date} {resource} {chunks} {bgChunks} {longChunks} {iChunks} bind:this={refs[i]}/>\n {/each}\n</div>\n","<script>\n import {getContext, untrack} from 'svelte';\n import {observeResize, runReposition, toSeconds} from '#lib';\n import {getSlotTimeLimits} from './lib.js';\n import Days from './Days.svelte';\n\n let {_bodyEl, _bodyHeight, _bodyWidth, _bodyScrollLeft, _headerEl, _filteredEvents, _sidebarEl, _dayTimes, _dayTimeLimits,\n _recheckScrollable, _daysHs, _viewResources, _viewDates, scrollTime, slotDuration, slotWidth, theme} = getContext('state');\n\n let refs = [];\n\n function scrollToTime() {\n let slotTimeLimits = getSlotTimeLimits($_dayTimeLimits, $_viewDates[0]);\n $_bodyEl.scrollLeft = (toSeconds($scrollTime) - toSeconds(slotTimeLimits.min)) / toSeconds($slotDuration) * $slotWidth;\n $_bodyScrollLeft = $_bodyEl.scrollLeft;\n }\n $effect(() => {\n $_viewDates;\n $scrollTime;\n untrack(scrollToTime);\n });\n\n function reposition() {\n $_daysHs.clear();\n runReposition(refs, $_viewResources);\n }\n $effect(() => {\n $_filteredEvents;\n $_viewResources;\n untrack(reposition);\n });\n\n function onscroll() {\n $_headerEl.scrollLeft = $_bodyEl.scrollLeft;\n $_sidebarEl.scrollTop = $_bodyEl.scrollTop;\n $_bodyScrollLeft = $_bodyEl.scrollLeft;\n }\n\n function onresize() {\n $_bodyHeight = $_bodyEl.clientHeight;\n $_bodyWidth = $_bodyEl.clientWidth;\n $_recheckScrollable = true;\n }\n</script>\n\n<div\n bind:this={$_bodyEl}\n class=\"{$theme.body}\"\n {onscroll}\n use:observeResize={onresize}\n>\n <div class=\"{$theme.content}\">\n <div class=\"{$theme.lines}\">\n {#each $_viewDates as date}\n {#each $_dayTimes[date.getTime()] as time}\n <div class=\"{$theme.line}{time[2] ? '' : ' ' + $theme.minor}\"></div>\n {/each}\n {/each}\n </div>\n {#each $_viewResources as resource, i}\n <!-- svelte-ignore binding_property_non_reactive -->\n <Days {resource} bind:this={refs[i]}/>\n {/each}\n </div>\n</div>\n\n<svelte:window on:resize={reposition}/>\n","<script>\n import {getContext} from 'svelte';\n import {addDuration, cloneDate, datesEqual} from '#lib';\n import {getSlotTimeLimits} from './lib.js';\n\n let {slotDuration, slotWidth, theme, _bodyHeight, _bodyWidth, _bodyScrollLeft,\n _headerHeight, _dayTimeLimits, _now, _today, _viewDates} = getContext('state');\n\n // Style\n let left = $derived.by(() => {\n let offset = 0;\n for (let i = 0; i < $_viewDates.length; ++i) {\n let slotTimeLimits = getSlotTimeLimits($_dayTimeLimits, $_viewDates[i]);\n if (datesEqual($_viewDates[i], $_today)) {\n let dayStart = addDuration(cloneDate($_viewDates[i]), slotTimeLimits.min);\n let dayEnd = addDuration(cloneDate($_viewDates[i]), slotTimeLimits.max);\n if ($_now >= dayStart && $_now <= dayEnd) {\n offset += ($_now - dayStart) / 1000;\n break;\n } else {\n return null;\n }\n } else {\n offset += slotTimeLimits.max.seconds - slotTimeLimits.min.seconds;\n }\n }\n let step = $slotDuration.seconds;\n return offset / step * $slotWidth - $_bodyScrollLeft;\n });\n</script>\n\n{#if left !== null && left >= 3 && left <= $_bodyWidth - 3}\n <div\n class=\"{$theme.nowIndicator}\"\n style:top=\"{$_headerHeight+2}px\"\n style:left=\"{left}px\"\n style:height=\"{$_bodyHeight-1}px\"\n ></div>\n{/if}\n","<script>\n import {getContext} from 'svelte';\n import Sidebar from './Sidebar.svelte';\n import Header from './Header.svelte';\n import Body from './Body.svelte';\n import NowIndicator from './NowIndicator.svelte';\n\n let {nowIndicator, theme} = getContext('state');\n</script>\n\n<div class=\"{$theme.container}\">\n <Sidebar/>\n <div class=\"{$theme.main}\">\n <Header/>\n <Body/>\n {#if $nowIndicator}\n <NowIndicator/>\n {/if}\n </div>\n</div>\n","import {writable} from 'svelte/store';\nimport {btnTextDay, btnTextMonth, btnTextWeek, themeView, viewResources} from '#lib';\nimport {dayTimeLimits, dayTimes, nestedResources} from './stores.js';\nimport View from './View.svelte';\n\nexport default {\n\tcreateOptions(options) {\n\t\t// Common options\n\t\toptions.buttonText.resourceTimelineDay = 'timeline';\n\t\toptions.buttonText.resourceTimelineWeek = 'timeline';\n\t\toptions.buttonText.resourceTimelineMonth = 'timeline';\n\t\toptions.theme.expander = 'ec-expander';\n\t\toptions.theme.main = 'ec-main';\n\t\toptions.theme.times = 'ec-times';\n\t\toptions.theme.container = 'ec-container';\n\t\toptions.view = 'resourceTimelineWeek';\n\t\toptions.views.resourceTimelineDay = {\n\t\t\tbuttonText: btnTextDay,\n\t\t\tcomponent: View,\n\t\t\tdisplayEventEnd: false,\n\t\t\tdayHeaderFormat: {weekday: 'long'},\n\t\t\tduration: {days: 1},\n\t\t\tslotDuration: '01:00',\n\t\t\ttheme: themeView('ec-timeline ec-resource-day-view'),\n\t\t\ttitleFormat: {year: 'numeric', month: 'long', day: 'numeric'}\n\t\t};\n\t\toptions.views.resourceTimelineWeek = {\n\t\t\tbuttonText: btnTextWeek,\n\t\t\tcomponent: View,\n\t\t\tdisplayEventEnd: false,\n\t\t\tduration: {weeks: 1},\n\t\t\tslotDuration: '01:00',\n\t\t\ttheme: themeView('ec-timeline ec-resource-week-view')\n\t\t};\n\t\toptions.views.resourceTimelineMonth = {\n\t\t\tbuttonText: btnTextMonth,\n\t\t\tcomponent: View,\n\t\t\tdisplayEventEnd: false,\n\t\t\tdayHeaderFormat: {\n\t\t\t\tweekday: 'short',\n\t\t\t\tday: 'numeric'\n\t\t\t},\n\t\t\tduration: {months: 1},\n\t\t\tslotDuration: {days: 1},\n\t\t\ttheme: themeView('ec-timeline ec-resource-month-view'),\n\t\t\ttitleFormat: {year: 'numeric', month: 'long'}\n\t\t};\n\t},\n\n\tcreateStores(state) {\n\t\tif (!('_viewResources' in state)) {\n\t\t\tstate._viewResources = viewResources(state);\n\t\t}\n\t\tstate._bodyHeight = writable(0);\n\t\tstate._bodyWidth = writable(0);\n\t\tstate._bodyScrollLeft = writable(0);\n\t\tstate._headerEl = writable(undefined);\n\t\tstate._headerHeight = writable(0);\n\t\tstate._dayTimeLimits = dayTimeLimits(state); // flexible time limits per day\n\t\tstate._dayTimes = dayTimes(state);\n\t\tstate._daysHs = writable(new Map()); // days row heights\n\t\tstate._nestedResources = nestedResources(state);\n\t\tstate._resHs = writable(new Map()); // resource row heights\n\t\tstate._sidebarEl = writable(undefined);\n\t}\n}\n","import {mount, unmount} from 'svelte';\nimport {Calendar} from './index.svelte.js';\n\nexport function createCalendar(target, plugins, options) {\n return mount(Calendar, {\n target,\n props: {\n plugins,\n options\n }\n });\n}\n\nexport function destroyCalendar(calendar) {\n return unmount(calendar);\n}\n\nexport {\n DayGrid,\n Interaction,\n List,\n ResourceTimeGrid,\n ResourceTimeline,\n TimeGrid\n} from './index.svelte.js';\n","import {createCalendar, DayGrid, Interaction, List, ResourceTimeGrid, ResourceTimeline, TimeGrid} from './index.es.js';\n\nexport function create(target, options) {\n return createCalendar(target, [\n DayGrid,\n Interaction,\n List,\n ResourceTimeGrid,\n ResourceTimeline,\n TimeGrid\n ], options);\n}\n\nexport {destroyCalendar as destroy} from './index.es.js';\n"],"names":["is_array","index_of","array_from","define_property","get_descriptor","get_descriptors","object_prototype","array_prototype","get_prototype_of","is_extensible","noop","run","fn","run_all","arr","i","deferred","resolve","reject","promise","res","rej","to_array","value","n","array","element","DERIVED","EFFECT","RENDER_EFFECT","BLOCK_EFFECT","BRANCH_EFFECT","ROOT_EFFECT","BOUNDARY_EFFECT","UNOWNED","DISCONNECTED","CLEAN","DIRTY","MAYBE_DIRTY","INERT","DESTROYED","EFFECT_RAN","EFFECT_TRANSPARENT","INSPECT_EFFECT","HEAD_EFFECT","EFFECT_PRESERVED","USER_EFFECT","REACTION_IS_UPDATING","ASYNC","ERROR_VALUE","STATE_SYMBOL","LEGACY_PROPS","LOADING_ATTR_SYMBOL","STALE_REACTION","__publicField","await_outside_boundary","lifecycle_outside_component","name","async_derived_orphan","effect_in_teardown","rune","effect_in_unowned_derived","effect_orphan","effect_update_depth_exceeded","props_invalid_value","key","state_descriptors_fixed","state_prototype_fixed","state_unsafe_mutation","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","TEMPLATE_FRAGMENT","TEMPLATE_USE_IMPORT_NODE","UNINITIALIZED","NAMESPACE_HTML","hydrating","equals","safe_not_equal","a","b","safe_equals","legacy_mode_flag","tracing_mode_flag","enable_legacy_mode_flag","component_context","set_component_context","context","getContext","get_or_init_context_map","setContext","push","props","runes","pop","component","effects","create_user_effect","is_runes","e.lifecycle_outside_component","get_parent_context","parent","context_map","adjustments","handle_error","error","effect","active_effect","active_reaction","apply_adjustments","invoke_error_boundary","e","adjusted","micro_tasks","idle_tasks","run_micro_tasks","tasks","run_idle_tasks","queue_micro_task","flush_tasks","get_pending_boundary","boundary","e.await_outside_boundary","derived","flags","parent_derived","async_derived","location","e.async_derived_orphan","signal","source","prev","should_suspend","async_effect","p","r","batch","current_batch","pending","handler","internal_set","unset_context","fulfil","next","go","user_derived","d","push_reaction_value","derived_safe_equal","destroy_derived_effects","destroy_effect","get_derived_parent_effect","execute_derived","prev_active_effect","set_active_effect","update_reaction","update_derived","increment_write_version","is_destroying_effect","batch_deriveds","status","skip_reaction","set_signal_status","flatten","sync","async","restore","capture","expression","result","previous_effect","previous_reaction","previous_component_context","set_active_reaction","batches","effect_pending_updates","dequeue","task","queued_root_effects","last_scheduled_effect","is_flushing","is_flushing_sync","_Batch","__privateAdd","_Batch_instances","_previous","_callbacks","_pending","_deferred","_neutered","_async_effects","_boundary_async_effects","_render_effects","_effects","_block_effects","_dirty_effects","_maybe_dirty_effects","root_effects","current_values","current","previous","__privateGet","root","__privateMethod","traverse_effect_tree_fn","commit_fn","render_effects","__privateSet","flush_queued_effects","_a","defer_effects_fn","v","wv","update_effect","update","flush_effects","schedule_effect","is_branch","is_skippable_branch","skip","is_dirty","child","Batch","flushSync","was_flushing_sync","was_updating_effect","is_updating_effect","flush_count","set_is_updating_effect","updates","entry","infinite_loop_guard","old_values","e.effect_update_depth_exceeded","eager_block_effects","length","unlink_effect","stack","state","s","mutable_source","initial_value","immutable","trackable","set","should_proxy","untracking","current_sources","e.state_unsafe_mutation","new_value","proxy","old_value","mark_reactions","untracked_writes","set_untracked_writes","increment","reactions","reaction","not_dirty","prototype","sources","is_proxied_array","version","parent_version","update_version","with_parent","set_update_version","_","prop","descriptor","e.state_descriptors_fixed","target","receiver","exists","get","has","other_s","ls","own_keys","e.state_prototype_fixed","$window","is_firefox","first_child_getter","next_sibling_getter","init_operations","element_prototype","node_prototype","text_prototype","create_text","get_first_child","node","get_next_sibling","is_text","first_child","fragment","first","sibling","count","next_sibling","clear_text_content","should_defer_append","without_reactive_context","validate_effect","e.effect_orphan","e.effect_in_unowned_derived","e.effect_in_teardown","push_effect","parent_effect","parent_last","create_effect","type","inert","teardown","user_effect","defer","user_pre_effect","component_root","options","pause_effect","legacy_pre_effect","deps","token","render_effect","untrack","legacy_pre_effect_reset","template_effect","values","block","branch","execute_effect_teardown","previously_destroying_effect","set_is_destroying_effect","destroy_effect_children","remove_dom","controller","destroy_block_effect_children","removed","remove_effect_dom","remove_reactions","transitions","transition","end","callback","pause_children","run_out_transitions","remaining","check","local","transparent","resume_effect","resume_children","new_deps","skipped_deps","write_version","read_version","dependencies","is_unowned","dependency","is_disconnected","is_unowned_connected","schedule_possible_effect_self_invalidation","previous_deps","previous_skipped_deps","previous_untracked_writes","previous_skip_reaction","previous_sources","previous_untracking","previous_update_version","remove_reaction","index","new_length","start_index","dep","tick","is_derived","destroyed","depends_on_old_values","STATUS_MASK","deep_read_state","deep_read","visited","proto","descriptors","PASSIVE_EVENTS","is_passive_event","all_registered_events","root_event_handles","create_event","event_name","dom","target_handler","event","handle_event_propagation","passive","delegate","events","last_propagated_event","handler_element","owner_document","path","current_target","path_idx","handled_at","at_idx","handler_idx","throw_error","other_errors","parent_element","delegated","data","create_fragment_from_html","html","elem","assign_nodes","start","from_html","content","is_fragment","use_import_node","has_start","clone","text","comment","frag","anchor","append","set_text","str","mount","_mount","document_listeners","Component","intro","registered_events","event_handle","unmount","anchor_node","ctx","mounted_components","if_block","elseif","consequent_effect","alternate_effect","condition","has_branch","set_branch","flag","update_branch","offscreen_fragment","commit","active","inactive","new_condition","pause_effects","items","controlled_anchor","items_map","is_controlled","parent_node","link","item","each","get_collection","get_key","render_fn","fallback_fn","fallback","was_empty","offscreen_items","each_array","collection","each_effect","reconcile","keys","existing","update_item","create_item","is_animated","should_update","seen","to_animate","matched","stashed","move","child_anchor","_b","j","to_destroy","destroy_length","_c","_d","unused","reactive","mutable","dest","next_node","snippet","get_snippet","args","snippet_effect","get_component","pending_effect","action","get_value","payload","inited","f","o","clsx","_clsx","to_class","hash","directives","classname","append_styles","styles","important","separator","css","to_css_name","to_style","new_style","normal_styles","important_styles","in_str","in_apo","in_comment","reserved_names","name_index","len","c","property","set_class","is_html","prev_classes","next_classes","next_class_name","update_styles","priority","set_style","prev_styles","next_styles","next_style_attr","IS_CUSTOM_ELEMENT","IS_HTML","set_attribute","attribute","skip_warning","attributes","get_attributes","get_setters","setters_cache","setters","element_proto","bind_prop","desc","is_bound_this","bound_value","element_or_component","bind_this","get_parts","old_parts","parts","init","callbacks","changed","observe_all","fns","subscribe_to_store","store","invalidate","unsub","subscriber_queue","readable","writable","stop","subscribers","run_queue","subscriber","subscribe","stores","single","stores_array","auto","started","cleanup","unsubscribers","is_store_binding","IS_UNMOUNTED","store_get","store_name","is_synchronous_callback","get_store","store_set","setup_stores","store_mutate","capture_store_binding","previous_is_store_binding","bindable","lazy","fallback_value","fallback_dirty","get_fallback","setter","is_entry_props","is_store_sub","e.props_invalid_value","getter","legacy_parent","mutation","overridden","onMount","init_update_callbacks","l","PUBLIC_VERSION","keyEnter","setContent","actions","outsideEvent","handlePointerDown","jsEvent","observeResize","resizeObserver","entries","DAY_IN_SECONDS","createDate","input","_fromLocalDate","_fromISOString","createDuration","seconds","exp","part","weeks","cloneDate","date","addDuration","duration","x","month","subtractDay","subtractDuration","addDay","setMidnight","toLocalDate","toISOString","datesEqual","date1","dates2","date2","nextClosestDay","day","diff","prevClosestDay","noTimePart","copyTime","toDate","fromDate","toSeconds","nextDate","prevDate","hiddenDays","getWeekNumber","firstDay","yearStart","assign","object","floor","ceil","min","max","symbol","isArray","isFunction","runAll","identity","stopPropagation","debounce","handle","queueStore","queue","flushDebounce","payloadProp","setPayload","obj","hasPayload","getPayload","createElement","tag","className","attrs","el","attr","hasYScroll","rect","ancestor","up","height","getElementWithPayload","y","processed","shadowEl","listen","createView","view","_viewTitle","_currentRange","_activeRange","toViewWithLocalDates","listView","timelineView","eventId","createEvents","toArrayProp","propName","createEventSources","createEventChunk","chunk","sortEventChunks","chunks","eventOrder","_toChunkWithLocalDates","toEventWithLocalDates","createEventContent","displayEventEnd","eventContent","theme","_intlEventTime","_view","timeText","domNodes","createTimeElement","createEventClasses","eventClassNames","_cloneEvent","cloneEvent","dateFn","prepareEventChunks","longChunks","prevChunk","dates","maxEnd","repositionEvent","margin","longChunk","offset","runReposition","refs","ref","eventIntersects","resources","resource","helperEvent","display","previewEvent","ghostEvent","pointerEvent","bgEvent","btnTextDay","btnText","btnTextWeek","btnTextMonth","btnTextYear","period","themeView","createDateRange","outsideRange","range","limitToRange","createResources","_createResources","level","flat","createResource","resourceBackgroundColor","findResource","resourceTextColor","intl","locale","format","$locale","$format","intlRange","formatRange","_getParts","viewResources","$resources","$filterResourcesWithEvents","$_filteredEvents","$_activeRange","createTimes","$slotDuration","$slotLabelInterval","$_slotTimeLimits","$_intlSlotLabel","times","label","createSlotTimeLimits","$slotMinTime","$slotMaxTime","$flexibleSlotTimeLimits","$_viewDates","minMin","minFn","maxFn","maxMax","filter","loop","minStart","createOptions","plugins","plugin","createParsers","parsers","days","prevOptions","dayGrid","$view","activeRange","$_currentRange","$firstDay","$_dayGrid","start2","currentRange","$date","$duration","viewDates","$hiddenDays","viewTitle","$_intlTitle","_events","abortController","fetching","debounceHandle","$events","$eventSources","$_fetchedRange","$lazyFetching","$loading","stopLoading","failure","success","startStr","endStr","params","url","headers","body","response","filteredEvents","$_view","$_events","$eventFilter","now","interval","today","$_now","State","parseOpts","option","view2","validKey","views","defOpts","mergeOpts","opts","filterOpts","_set","rest","newView","override","buttons","$.prop","$$props","_viewDates","buttonText","customButtons","validRange","prevDisabled","$.mutable_source","nextDisabled","todayDisabled","running","isRunning","test","$validRange","$.store_set","$.set","currentDate","$.each","button","$_viewTitle","$.template_effect","$.set_class","h2","$theme","$.untrack","$.get","$.set_attribute","button_1","$buttonText","button_2","$.event","button_3","$customButtons","$$args","button_5","$$render","consequent_5","consequent_3","alternate_1","consequent_2","alternate_2","consequent_1","alternate_3","consequent","alternate_4","headerToolbar","sections","$.derived","$headerToolbar","group","$.index","$$anchor","div_1","alternate","nav","datesSet","eventAllUpdated","_auxiliary","_filteredEvents","_scrollable","_bodyEl","_tasks","_recheckScrollable","_queue","$.user_effect","$datesSet","$eventAllUpdated","$_queue","$_recheckScrollable","$_bodyEl","$_auxiliary","_viewComponent","_interaction","_iClass","setOption","getOption","refetchEvents","getEvents","getEventById","id","addEvent","updateEvent","idx","$.store_mutate","removeEventById","getView","unselect","$_interaction","dateFromPoint","dayEl","info","View","$_viewComponent","$_scrollable","$_iClass","$height","_intlDayHeader","_intlDayHeaderAL","_days","$_days","$_intlDayHeader","div_2","$0","$_intlDayHeaderAL","div","div_3","read_methods","set_like_methods","_SvelteSet","_SvelteSet_instances","_sources","_version","_size","_update_version","init_fn","source_fn","deleted","set_proto","method","SvelteSet","classes","eventBackgroundColor","eventColor","eventClick","eventDidMount","eventMouseEnter","eventMouseLeave","eventTextColor","bgColor","$eventBackgroundColor","$eventColor","txtColor","$eventTextColor","style","classNames","$eventClassNames","$displayEventEnd","$eventContent","$_intlEventTime","$$array","$eventDidMount","createHandler","onclick","$eventClick","onkeydown","onmouseenter","$eventMouseEnter","onmouseleave","$eventMouseLeave","$.clsx","defaultBody","$.bind_this","article","$$value","_iClasses","$_iClasses","createDragHandler","onpointerdown","Resizer","$.noop","inPopup","dayMaxEvents","_hiddenEvents","_popupDate","$.state","hidden","marginTop","_margin","_dates","reposition","$dayMaxEvents","hide","h","footHeight","hiddenEvents","$_hiddenEvents","size","$_popupDate","_intlDayPopover","_popupChunks","position","bodyEl","popupRect","dayRect","bodyRect","left","right","top","bottom","$_popupChunks","close","handlePointerDownOutside","$_intlDayPopover","event_handler_1","event_handler_2","iChunks","highlightedDates","moreLinkContent","weekNumbers","weekNumberContent","_intlDayCell","_today","$.user_pre_effect","isToday","$_today","otherMonth","$currentDate","highlight","$highlightedDates","disabled","dayBgChunks","bgChunk","dayChunks","moreLink","$moreLinkContent","showMore","showPopup","setPopupChunks","nextDay","showWeekNumber","$weekNumbers","weekNumber","week","$weekNumberContent","$.action","time","$$node","$$action_arg","$_intlDayCell","span","node_2","div_4","consequent_4","node_9","consequent_6","event_handler","consequent_7","div_5","div_6","_iEvents","filterEventsWithResources","$$d","bgChunks","$filterEventsWithResources","$eventOrder","$_iEvents","DayGrid","eventDraggable","$eventStartEditable","$editable","eventResizable","$eventDurationEditable","busy","animate","limit","minLimit","maxLimit","_dayGrid","datesAboveResources","dateClick","dragConstraint","dragScroll","editable","eventStartEditable","eventDragMinDistance","eventDragStart","eventDragStop","eventDrop","eventLongPressDelay","eventResizeStart","eventResizeStop","eventResize","longPressDelay","resizeConstraint","selectable","selectFn","selectBackgroundColor","selectConstraint","selectLongPressDelay","selectMinDistance","slotDuration","slotHeight","slotWidth","unselectFn","unselectAuto","unselectCancel","ACTION_DRAG","ACTION_RESIZE_END","ACTION_RESIZE_START","ACTION_SELECT","ACTION_CLICK","ACTION_NO_ACTION","interacting","newDate","newResource","fromX","fromY","toX","toY","clipEl","clipRect","delta","allDay","iClass","minResize","selectStep","selected","noDateClick","timer","viewport","extraDuration","draggable","drag","eventToDrag","forceDate","forceMargin","validJsEvent","complexAction","common","resize","eventToResize","axis","zeroDuration","resizingStart","select","$selectable","noAction","dragging","$datesAboveResources","calcViewport","selecting","$selectLongPressDelay","$eventLongPressDelay","$longPressDelay","distance","$selectMinDistance","$eventDragMinDistance","createIEventSelect","createIEvent","resizing","$eventResizeStart","$eventDragStart","findPayload","findDayEl","newAllDay","candidate","copyIEventData","constraintFn","$resizeConstraint","$selectConstraint","$dragConstraint","createSelectCallbackInfo","createCallbackInfo","$dragScroll","thresholdY","$slotHeight","thresholdX","$slotWidth","handleScroll","handlePointerMove","handlePointerUp","$unselectAuto","$unselectCancel","$selectFn","$eventResizeStop","$eventDragStop","oldEvent","destroyIEvent","$eventResize","$eventDrop","eventRef","clicking","$dateClick","$selectBackgroundColor","$unselectFn","noClick","handleTouchStart","stops","createPreventDefaultHandler","removePointerEvent","createPointerEvent","validEvent","eventDurationEditable","eventResizableFromStart","resizable","createResizeHandler","$eventResizableFromStart","pointer","bodyScrollHandler","Action","Pointer","$pointer","Interaction","Auxiliary","_intlListDay","_intlListDaySide","datetime","$_intlListDay","time_1","$_intlListDaySide","node_1","h4","$noEventsClick","noEventsClick","noEventsContent","noEvents","$noEventsContent","List","slotTimeLimits","groupEventChunks","createAllDayContent","allDayContent","slotLabelInterval","_times","allDayText","$allDayContent","showAllTimes","$_times","_slotTimeLimits","scrollTime","$scrollTime","scrollToTime","slotEventOverlap","step","maxHeight","$slotEventOverlap","_now","nowIndicator","resourceFilter","node_4","$nowIndicator","node_5","allDaySlot","$1","$allDaySlot","TimeGrid","setLabel","resourceLabelContent","resourceLabelDidMount","$resourceLabelContent","ariaLabel","$resourceLabelDidMount","_viewResources","loops","$_viewResources","resourceLabels","$.proxy","item0","item1","$3","node_10","div_10","node_11","div_11","div_8","div_9","div_12","div_13","div_7","ResourceTimeGrid","dayTimeLimits","dayTimes","$_dayTimeLimits","nestedResources","_resHs","$_resHs","expanded","toggle","children","expand","span_1","_headerHeight","_daysHs","_sidebarEl","_nestedResources","onwheel","$_nestedResources","$_daysHs","$_sidebarEl","$_headerHeight","_headerEl","_dayTimes","$_dayTimes","time_2","$_headerEl","filteredChunks","prevDayEnd","slots","getSlotTimeLimits","dayStart","dayEnd","dayChunk","width","_resource","_dayTimeLimits","pointerIdx","chunkIntersects","node_3","$$d_1","$$array_3","_bodyHeight","_bodyWidth","_bodyScrollLeft","onscroll","onresize","$_bodyScrollLeft","$_bodyHeight","$_bodyWidth","ResourceTimeline","createCalendar","Calendar","destroyCalendar","calendar","create"],"mappings":"quBAEO,IAAIA,GAAW,MAAM,QACjBC,GAAW,MAAM,UAAU,QAC3BC,GAAa,MAAM,KAEnBC,GAAkB,OAAO,eACzBC,GAAiB,OAAO,yBACxBC,GAAkB,OAAO,0BACzBC,GAAmB,OAAO,UAC1BC,GAAkB,MAAM,UACxBC,GAAmB,OAAO,eAC1BC,GAAgB,OAAO,aAU3B,MAAMC,GAAO,IAAM,CAAE,EAerB,SAASC,GAAIC,EAAI,CACvB,OAAOA,EAAI,CACZ,CAGO,SAASC,GAAQC,EAAK,CAC5B,QAASC,EAAI,EAAGA,EAAID,EAAI,OAAQC,IAC/BD,EAAIC,CAAC,EAAG,CAEV,CAMO,SAASC,IAAW,CAE1B,IAAIC,EAGAC,EAGAC,EAAU,IAAI,QAAQ,CAACC,EAAKC,IAAQ,CACvCJ,EAAUG,EACVF,EAASG,CACX,CAAE,EAGD,MAAO,CAAE,QAAAF,EAAS,QAAAF,EAAS,OAAAC,CAAQ,CACpC,CA0BO,SAASI,GAASC,EAAOC,EAAG,CAElC,GAAI,MAAM,QAAQD,CAA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,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,63,70]}