@budibase/server
Version:
Budibase Web Server
1,732 lines • 3.07 MB
JavaScript
var dn = Object.defineProperty;
var fn = (u, l, m) => l in u ? dn(u, l, { enumerable: !0, configurable: !0, writable: !0, value: m }) : u[l] = m;
var we = (u, l, m) => (fn(u, typeof l != "symbol" ? l + "" : l, m), m), Ft = (u, l, m) => {
if (!l.has(u))
throw TypeError("Cannot " + m);
};
var $e = (u, l, m) => (Ft(u, l, "read from private field"), m ? m.call(u) : l.get(u)), Ne = (u, l, m) => {
if (l.has(u))
throw TypeError("Cannot add the same private member more than once");
l instanceof WeakSet ? l.add(u) : l.set(u, m);
}, je = (u, l, m, f) => (Ft(u, l, "write to private field"), f ? f.call(u, m) : l.set(u, m), m);
var Ge = (u, l, m) => (Ft(u, l, "access private method"), m);
function noop$4() {
}
const identity$5 = (u) => u;
function assign(u, l) {
for (const m in l)
u[m] = l[m];
return (
/** @type {T & S} */
u
);
}
function is_promise(u) {
return !!u && (typeof u == "object" || typeof u == "function") && typeof /** @type {any} */
u.then == "function";
}
function add_location(u, l, m, f, p) {
u.__svelte_meta = {
loc: { file: l, line: m, column: f, char: p }
};
}
function run(u) {
return u();
}
function blank_object() {
return /* @__PURE__ */ Object.create(null);
}
function run_all(u) {
u.forEach(run);
}
function is_function(u) {
return typeof u == "function";
}
function safe_not_equal(u, l) {
return u != u ? l == l : u !== l || u && typeof u == "object" || typeof u == "function";
}
let src_url_equal_anchor;
function src_url_equal(u, l) {
return u === l ? !0 : (src_url_equal_anchor || (src_url_equal_anchor = document.createElement("a")), src_url_equal_anchor.href = l, u === src_url_equal_anchor.href);
}
function split_srcset(u) {
return u.split(",").map((l) => l.trim().split(" ").filter(Boolean));
}
function srcset_url_equal(u, l) {
const m = split_srcset(u.srcset), f = split_srcset(l || "");
return f.length === m.length && f.every(
([p, b], y) => b === m[y][1] && // We need to test both ways because Vite will create an a full URL with
// `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the
// relative URLs inside srcset are not automatically resolved to absolute URLs by
// browsers (in contrast to img.src). This means both SSR and DOM code could
// contain relative or absolute URLs.
(src_url_equal(m[y][0], p) || src_url_equal(p, m[y][0]))
);
}
function not_equal(u, l) {
return u != u ? l == l : u !== l;
}
function is_empty(u) {
return Object.keys(u).length === 0;
}
function validate_store(u, l) {
if (u != null && typeof u.subscribe != "function")
throw new Error(`'${l}' is not a store with a 'subscribe' method`);
}
function subscribe(u, ...l) {
if (u == null) {
for (const f of l)
f(void 0);
return noop$4;
}
const m = u.subscribe(...l);
return m.unsubscribe ? () => m.unsubscribe() : m;
}
function get_store_value(u) {
let l;
return subscribe(u, (m) => l = m)(), l;
}
function component_subscribe(u, l, m) {
u.$$.on_destroy.push(subscribe(l, m));
}
function create_slot(u, l, m, f) {
if (u) {
const p = get_slot_context(u, l, m, f);
return u[0](p);
}
}
function get_slot_context(u, l, m, f) {
return u[1] && f ? assign(m.ctx.slice(), u[1](f(l))) : m.ctx;
}
function get_slot_changes(u, l, m, f) {
if (u[2] && f) {
const p = u[2](f(m));
if (l.dirty === void 0)
return p;
if (typeof p == "object") {
const b = [], y = Math.max(l.dirty.length, p.length);
for (let v = 0; v < y; v += 1)
b[v] = l.dirty[v] | p[v];
return b;
}
return l.dirty | p;
}
return l.dirty;
}
function update_slot_base(u, l, m, f, p, b) {
if (p) {
const y = get_slot_context(l, m, f, b);
u.p(y, p);
}
}
function update_slot(u, l, m, f, p, b, y) {
const v = get_slot_changes(l, f, p, b);
update_slot_base(u, l, m, f, v, y);
}
function get_all_dirty_from_scope(u) {
if (u.ctx.length > 32) {
const l = [], m = u.ctx.length / 32;
for (let f = 0; f < m; f++)
l[f] = -1;
return l;
}
return -1;
}
function exclude_internal_props(u) {
const l = {};
for (const m in u)
m[0] !== "$" && (l[m] = u[m]);
return l;
}
function compute_rest_props(u, l) {
const m = {};
l = new Set(l);
for (const f in u)
!l.has(f) && f[0] !== "$" && (m[f] = u[f]);
return m;
}
function compute_slots(u) {
const l = {};
for (const m in u)
l[m] = !0;
return l;
}
function once$1(u) {
let l = !1;
return function(...m) {
l || (l = !0, u.call(this, ...m));
};
}
function null_to_empty(u) {
return u ?? "";
}
function set_store_value(u, l, m) {
return u.set(m), l;
}
const has_prop = (u, l) => Object.prototype.hasOwnProperty.call(u, l);
function action_destroyer(u) {
return u && is_function(u.destroy) ? u.destroy : noop$4;
}
function split_css_unit(u) {
const l = typeof u == "string" && u.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);
return l ? [parseFloat(l[1]), l[2] || "px"] : [
/** @type {number} */
u,
"px"
];
}
const contenteditable_truthy_values = ["", !0, 1, "true", "contenteditable"], is_client = typeof window < "u";
let now = is_client ? () => window.performance.now() : () => Date.now(), raf = is_client ? (u) => requestAnimationFrame(u) : noop$4;
function set_now(u) {
now = u;
}
function set_raf(u) {
raf = u;
}
const tasks = /* @__PURE__ */ new Set();
function run_tasks(u) {
tasks.forEach((l) => {
l.c(u) || (tasks.delete(l), l.f());
}), tasks.size !== 0 && raf(run_tasks);
}
function clear_loops() {
tasks.clear();
}
function loop(u) {
let l;
return tasks.size === 0 && raf(run_tasks), {
promise: new Promise((m) => {
tasks.add(l = { c: u, f: m });
}),
abort() {
tasks.delete(l);
}
};
}
const globals$1 = typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : (
// @ts-ignore Node typings have this
global
);
class ResizeObserverSingleton {
/** @param {ResizeObserverOptions} options */
constructor(l) {
/**
* @private
* @readonly
* @type {WeakMap<Element, import('./private.js').Listener>}
*/
we(this, "_listeners", "WeakMap" in globals$1 ? /* @__PURE__ */ new WeakMap() : void 0);
/**
* @private
* @type {ResizeObserver}
*/
we(this, "_observer");
/** @type {ResizeObserverOptions} */
we(this, "options");
this.options = l;
}
/**
* @param {Element} element
* @param {import('./private.js').Listener} listener
* @returns {() => void}
*/
observe(l, m) {
return this._listeners.set(l, m), this._getObserver().observe(l, this.options), () => {
this._listeners.delete(l), this._observer.unobserve(l);
};
}
/**
* @private
*/
_getObserver() {
return this._observer ?? (this._observer = new ResizeObserver((l) => {
var m;
for (const f of l)
ResizeObserverSingleton.entries.set(f.target, f), (m = this._listeners.get(f.target)) == null || m(f);
}));
}
}
ResizeObserverSingleton.entries = "WeakMap" in globals$1 ? /* @__PURE__ */ new WeakMap() : void 0;
let is_hydrating = !1;
function start_hydrating() {
is_hydrating = !0;
}
function end_hydrating() {
is_hydrating = !1;
}
function upper_bound(u, l, m, f) {
for (; u < l; ) {
const p = u + (l - u >> 1);
m(p) <= f ? u = p + 1 : l = p;
}
return u;
}
function init_hydrate(u) {
if (u.hydrate_init)
return;
u.hydrate_init = !0;
let l = (
/** @type {ArrayLike<NodeEx2>} */
u.childNodes
);
if (u.nodeName === "HEAD") {
const $ = [];
for (let w = 0; w < l.length; w++) {
const k = l[w];
k.claim_order !== void 0 && $.push(k);
}
l = $;
}
const m = new Int32Array(l.length + 1), f = new Int32Array(l.length);
m[0] = -1;
let p = 0;
for (let $ = 0; $ < l.length; $++) {
const w = l[$].claim_order, k = (p > 0 && l[m[p]].claim_order <= w ? p + 1 : upper_bound(1, p, (S) => l[m[S]].claim_order, w)) - 1;
f[$] = m[k] + 1;
const P = k + 1;
m[P] = $, p = Math.max(P, p);
}
const b = [], y = [];
let v = l.length - 1;
for (let $ = m[p] + 1; $ != 0; $ = f[$ - 1]) {
for (b.push(l[$ - 1]); v >= $; v--)
y.push(l[v]);
v--;
}
for (; v >= 0; v--)
y.push(l[v]);
b.reverse(), y.sort(($, w) => $.claim_order - w.claim_order);
for (let $ = 0, w = 0; $ < y.length; $++) {
for (; w < b.length && y[$].claim_order >= b[w].claim_order; )
w++;
const k = w < b.length ? b[w] : null;
u.insertBefore(y[$], k);
}
}
function append$1(u, l) {
u.appendChild(l);
}
function append_styles(u, l, m) {
const f = get_root_for_style(u);
if (!f.getElementById(l)) {
const p = element("style");
p.id = l, p.textContent = m, append_stylesheet(f, p);
}
}
function get_root_for_style(u) {
if (!u)
return document;
const l = u.getRootNode ? u.getRootNode() : u.ownerDocument;
return l && /** @type {ShadowRoot} */
l.host ? (
/** @type {ShadowRoot} */
l
) : u.ownerDocument;
}
function append_empty_stylesheet(u) {
const l = element("style");
return l.textContent = "/* empty */", append_stylesheet(get_root_for_style(u), l), l.sheet;
}
function append_stylesheet(u, l) {
return append$1(
/** @type {Document} */
u.head || u,
l
), l.sheet;
}
function append_hydration(u, l) {
if (is_hydrating) {
for (init_hydrate(u), (u.actual_end_child === void 0 || u.actual_end_child !== null && u.actual_end_child.parentNode !== u) && (u.actual_end_child = u.firstChild); u.actual_end_child !== null && u.actual_end_child.claim_order === void 0; )
u.actual_end_child = u.actual_end_child.nextSibling;
l !== u.actual_end_child ? (l.claim_order !== void 0 || l.parentNode !== u) && u.insertBefore(l, u.actual_end_child) : u.actual_end_child = l.nextSibling;
} else
(l.parentNode !== u || l.nextSibling !== null) && u.appendChild(l);
}
function insert(u, l, m) {
u.insertBefore(l, m || null);
}
function insert_hydration(u, l, m) {
is_hydrating && !m ? append_hydration(u, l) : (l.parentNode !== u || l.nextSibling != m) && u.insertBefore(l, m || null);
}
function detach(u) {
u.parentNode && u.parentNode.removeChild(u);
}
function destroy_each(u, l) {
for (let m = 0; m < u.length; m += 1)
u[m] && u[m].d(l);
}
function element(u) {
return document.createElement(u);
}
function element_is(u, l) {
return document.createElement(u, { is: l });
}
function object_without_properties(u, l) {
const m = (
/** @type {Pick<T, Exclude<keyof T, K>>} */
{}
);
for (const f in u)
has_prop(u, f) && // @ts-ignore
l.indexOf(f) === -1 && (m[f] = u[f]);
return m;
}
function svg_element(u) {
return document.createElementNS("http://www.w3.org/2000/svg", u);
}
function text$3(u) {
return document.createTextNode(u);
}
function space() {
return text$3(" ");
}
function empty$1() {
return text$3("");
}
function comment(u) {
return document.createComment(u);
}
function listen(u, l, m, f) {
return u.addEventListener(l, m, f), () => u.removeEventListener(l, m, f);
}
function prevent_default(u) {
return function(l) {
return l.preventDefault(), u.call(this, l);
};
}
function stop_propagation(u) {
return function(l) {
return l.stopPropagation(), u.call(this, l);
};
}
function stop_immediate_propagation(u) {
return function(l) {
return l.stopImmediatePropagation(), u.call(this, l);
};
}
function self$1(u) {
return function(l) {
l.target === this && u.call(this, l);
};
}
function trusted(u) {
return function(l) {
l.isTrusted && u.call(this, l);
};
}
function attr(u, l, m) {
m == null ? u.removeAttribute(l) : u.getAttribute(l) !== m && u.setAttribute(l, m);
}
const always_set_through_set_attribute = ["width", "height"];
function set_attributes(u, l) {
const m = Object.getOwnPropertyDescriptors(u.__proto__);
for (const f in l)
l[f] == null ? u.removeAttribute(f) : f === "style" ? u.style.cssText = l[f] : f === "__value" ? u.value = u[f] = l[f] : m[f] && m[f].set && always_set_through_set_attribute.indexOf(f) === -1 ? u[f] = l[f] : attr(u, f, l[f]);
}
function set_svg_attributes(u, l) {
for (const m in l)
attr(u, m, l[m]);
}
function set_custom_element_data_map(u, l) {
Object.keys(l).forEach((m) => {
set_custom_element_data(u, m, l[m]);
});
}
function set_custom_element_data(u, l, m) {
const f = l.toLowerCase();
f in u ? u[f] = typeof u[f] == "boolean" && m === "" ? !0 : m : l in u ? u[l] = typeof u[l] == "boolean" && m === "" ? !0 : m : attr(u, l, m);
}
function set_dynamic_element_data(u) {
return /-/.test(u) ? set_custom_element_data_map : set_attributes;
}
function xlink_attr(u, l, m) {
u.setAttributeNS("http://www.w3.org/1999/xlink", l, m);
}
function get_svelte_dataset(u) {
return u.dataset.svelteH;
}
function get_binding_group_value(u, l, m) {
const f = /* @__PURE__ */ new Set();
for (let p = 0; p < u.length; p += 1)
u[p].checked && f.add(u[p].__value);
return m || f.delete(l), Array.from(f);
}
function init_binding_group(u) {
let l;
return {
/* push */
p(...m) {
l = m, l.forEach((f) => u.push(f));
},
/* remove */
r() {
l.forEach((m) => u.splice(u.indexOf(m), 1));
}
};
}
function init_binding_group_dynamic(u, l) {
let m = p(u), f;
function p(v) {
for (let $ = 0; $ < l.length; $++)
v = v[l[$]] = v[l[$]] || [];
return v;
}
function b() {
f.forEach((v) => m.push(v));
}
function y() {
f.forEach((v) => m.splice(m.indexOf(v), 1));
}
return {
/* update */
u(v) {
l = v;
const $ = p(u);
$ !== m && (y(), m = $, b());
},
/* push */
p(...v) {
f = v, b();
},
/* remove */
r: y
};
}
function to_number(u) {
return u === "" ? null : +u;
}
function time_ranges_to_array(u) {
const l = [];
for (let m = 0; m < u.length; m += 1)
l.push({ start: u.start(m), end: u.end(m) });
return l;
}
function children(u) {
return Array.from(u.childNodes);
}
function init_claim_info(u) {
u.claim_info === void 0 && (u.claim_info = { last_index: 0, total_claimed: 0 });
}
function claim_node(u, l, m, f, p = !1) {
init_claim_info(u);
const b = (() => {
for (let y = u.claim_info.last_index; y < u.length; y++) {
const v = u[y];
if (l(v)) {
const $ = m(v);
return $ === void 0 ? u.splice(y, 1) : u[y] = $, p || (u.claim_info.last_index = y), v;
}
}
for (let y = u.claim_info.last_index - 1; y >= 0; y--) {
const v = u[y];
if (l(v)) {
const $ = m(v);
return $ === void 0 ? u.splice(y, 1) : u[y] = $, p ? $ === void 0 && u.claim_info.last_index-- : u.claim_info.last_index = y, v;
}
}
return f();
})();
return b.claim_order = u.claim_info.total_claimed, u.claim_info.total_claimed += 1, b;
}
function claim_element_base(u, l, m, f) {
return claim_node(
u,
/** @returns {node is Element | SVGElement} */
(p) => p.nodeName === l,
/** @param {Element} node */
(p) => {
const b = [];
for (let y = 0; y < p.attributes.length; y++) {
const v = p.attributes[y];
m[v.name] || b.push(v.name);
}
b.forEach((y) => p.removeAttribute(y));
},
() => f(l)
);
}
function claim_element(u, l, m) {
return claim_element_base(u, l, m, element);
}
function claim_svg_element(u, l, m) {
return claim_element_base(u, l, m, svg_element);
}
function claim_text(u, l) {
return claim_node(
u,
/** @returns {node is Text} */
(m) => m.nodeType === 3,
/** @param {Text} node */
(m) => {
const f = "" + l;
if (m.data.startsWith(f)) {
if (m.data.length !== f.length)
return m.splitText(f.length);
} else
m.data = f;
},
() => text$3(l),
!0
// Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements
);
}
function claim_space(u) {
return claim_text(u, " ");
}
function claim_comment(u, l) {
return claim_node(
u,
/** @returns {node is Comment} */
(m) => m.nodeType === 8,
/** @param {Comment} node */
(m) => {
m.data = "" + l;
},
() => comment(l),
!0
);
}
function get_comment_idx(u, l, m) {
for (let f = m; f < u.length; f += 1) {
const p = u[f];
if (p.nodeType === 8 && p.textContent.trim() === l)
return f;
}
return -1;
}
function claim_html_tag(u, l) {
const m = get_comment_idx(u, "HTML_TAG_START", 0), f = get_comment_idx(u, "HTML_TAG_END", m + 1);
if (m === -1 || f === -1)
return new HtmlTagHydration(l);
init_claim_info(u);
const p = u.splice(m, f - m + 1);
detach(p[0]), detach(p[p.length - 1]);
const b = p.slice(1, p.length - 1);
if (b.length === 0)
return new HtmlTagHydration(l);
for (const y of b)
y.claim_order = u.claim_info.total_claimed, u.claim_info.total_claimed += 1;
return new HtmlTagHydration(l, b);
}
function set_data(u, l) {
l = "" + l, u.data !== l && (u.data = /** @type {string} */
l);
}
function set_data_contenteditable(u, l) {
l = "" + l, u.wholeText !== l && (u.data = /** @type {string} */
l);
}
function set_data_maybe_contenteditable(u, l, m) {
~contenteditable_truthy_values.indexOf(m) ? set_data_contenteditable(u, l) : set_data(u, l);
}
function set_input_value(u, l) {
u.value = l ?? "";
}
function set_input_type(u, l) {
try {
u.type = l;
} catch {
}
}
function set_style(u, l, m, f) {
m == null ? u.style.removeProperty(l) : u.style.setProperty(l, m, f ? "important" : "");
}
function select_option(u, l, m) {
for (let f = 0; f < u.options.length; f += 1) {
const p = u.options[f];
if (p.__value === l) {
p.selected = !0;
return;
}
}
(!m || l !== void 0) && (u.selectedIndex = -1);
}
function select_options(u, l) {
for (let m = 0; m < u.options.length; m += 1) {
const f = u.options[m];
f.selected = ~l.indexOf(f.__value);
}
}
function select_value(u) {
const l = u.querySelector(":checked");
return l && l.__value;
}
function select_multiple_value(u) {
return [].map.call(u.querySelectorAll(":checked"), (l) => l.__value);
}
let crossorigin;
function is_crossorigin() {
if (crossorigin === void 0) {
crossorigin = !1;
try {
typeof window < "u" && window.parent && window.parent.document;
} catch {
crossorigin = !0;
}
}
return crossorigin;
}
function add_iframe_resize_listener(u, l) {
getComputedStyle(u).position === "static" && (u.style.position = "relative");
const f = element("iframe");
f.setAttribute(
"style",
"display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"
), f.setAttribute("aria-hidden", "true"), f.tabIndex = -1;
const p = is_crossorigin();
let b;
return p ? (f.src = "data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>", b = listen(
window,
"message",
/** @param {MessageEvent} event */
(y) => {
y.source === f.contentWindow && l();
}
)) : (f.src = "about:blank", f.onload = () => {
b = listen(f.contentWindow, "resize", l), l();
}), append$1(u, f), () => {
(p || b && f.contentWindow) && b(), detach(f);
};
}
const resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({
box: "content-box"
}), resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({
box: "border-box"
}), resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton(
{ box: "device-pixel-content-box" }
);
function toggle_class(u, l, m) {
u.classList.toggle(l, !!m);
}
function custom_event(u, l, { bubbles: m = !1, cancelable: f = !1 } = {}) {
return new CustomEvent(u, { detail: l, bubbles: m, cancelable: f });
}
function query_selector_all(u, l = document.body) {
return Array.from(l.querySelectorAll(u));
}
function head_selector(u, l) {
const m = [];
let f = 0;
for (const p of l.childNodes)
if (p.nodeType === 8) {
const b = p.textContent.trim();
b === `HEAD_${u}_END` ? (f -= 1, m.push(p)) : b === `HEAD_${u}_START` && (f += 1, m.push(p));
} else
f > 0 && m.push(p);
return m;
}
class HtmlTag {
constructor(l = !1) {
/**
* @private
* @default false
*/
we(this, "is_svg", !1);
/** parent for creating node */
we(this, "e");
/** html tag nodes */
we(this, "n");
/** target */
we(this, "t");
/** anchor */
we(this, "a");
this.is_svg = l, this.e = this.n = null;
}
/**
* @param {string} html
* @returns {void}
*/
c(l) {
this.h(l);
}
/**
* @param {string} html
* @param {HTMLElement | SVGElement} target
* @param {HTMLElement | SVGElement} anchor
* @returns {void}
*/
m(l, m, f = null) {
this.e || (this.is_svg ? this.e = svg_element(
/** @type {keyof SVGElementTagNameMap} */
m.nodeName
) : this.e = element(
/** @type {keyof HTMLElementTagNameMap} */
m.nodeType === 11 ? "TEMPLATE" : m.nodeName
), this.t = m.tagName !== "TEMPLATE" ? m : (
/** @type {HTMLTemplateElement} */
m.content
), this.c(l)), this.i(f);
}
/**
* @param {string} html
* @returns {void}
*/
h(l) {
this.e.innerHTML = l, this.n = Array.from(
this.e.nodeName === "TEMPLATE" ? this.e.content.childNodes : this.e.childNodes
);
}
/**
* @returns {void} */
i(l) {
for (let m = 0; m < this.n.length; m += 1)
insert(this.t, this.n[m], l);
}
/**
* @param {string} html
* @returns {void}
*/
p(l) {
this.d(), this.h(l), this.i(this.a);
}
/**
* @returns {void} */
d() {
this.n.forEach(detach);
}
}
class HtmlTagHydration extends HtmlTag {
constructor(m = !1, f) {
super(m);
/** @type {Element[]} hydration claimed nodes */
we(this, "l");
this.e = this.n = null, this.l = f;
}
/**
* @param {string} html
* @returns {void}
*/
c(m) {
this.l ? this.n = this.l : super.c(m);
}
/**
* @returns {void} */
i(m) {
for (let f = 0; f < this.n.length; f += 1)
insert_hydration(this.t, this.n[f], m);
}
}
function attribute_to_object(u) {
const l = {};
for (const m of u)
l[m.name] = m.value;
return l;
}
const escaped = {
'"': """,
"&": "&",
"<": "<"
}, regex_attribute_characters_to_escape = /["&<]/g;
function escape_attribute(u) {
return String(u).replace(regex_attribute_characters_to_escape, (l) => escaped[l]);
}
function stringify_spread(u) {
let l = " ";
for (const m in u)
u[m] != null && (l += `${m}="${escape_attribute(u[m])}" `);
return l;
}
function get_custom_elements_slots(u) {
const l = {};
return u.childNodes.forEach(
/** @param {Element} node */
(m) => {
l[m.slot || "default"] = !0;
}
), l;
}
function construct_svelte_component(u, l) {
return new u(l);
}
const managed_styles = /* @__PURE__ */ new Map();
let active = 0;
function hash(u) {
let l = 5381, m = u.length;
for (; m--; )
l = (l << 5) - l ^ u.charCodeAt(m);
return l >>> 0;
}
function create_style_information(u, l) {
const m = { stylesheet: append_empty_stylesheet(l), rules: {} };
return managed_styles.set(u, m), m;
}
function create_rule(u, l, m, f, p, b, y, v = 0) {
const $ = 16.666 / f;
let w = `{
`;
for (let F = 0; F <= 1; F += $) {
const L = l + (m - l) * b(F);
w += F * 100 + `%{${y(L, 1 - L)}}
`;
}
const k = w + `100% {${y(m, 1 - m)}}
}`, P = `__svelte_${hash(k)}_${v}`, S = get_root_for_style(u), { stylesheet: M, rules: T } = managed_styles.get(S) || create_style_information(S, u);
T[P] || (T[P] = !0, M.insertRule(`@keyframes ${P} ${k}`, M.cssRules.length));
const E = u.style.animation || "";
return u.style.animation = `${E ? `${E}, ` : ""}${P} ${f}ms linear ${p}ms 1 both`, active += 1, P;
}
function delete_rule(u, l) {
const m = (u.style.animation || "").split(", "), f = m.filter(
l ? (b) => b.indexOf(l) < 0 : (b) => b.indexOf("__svelte") === -1
// remove all Svelte animations
), p = m.length - f.length;
p && (u.style.animation = f.join(", "), active -= p, active || clear_rules());
}
function clear_rules() {
raf(() => {
active || (managed_styles.forEach((u) => {
const { ownerNode: l } = u.stylesheet;
l && detach(l);
}), managed_styles.clear());
});
}
function create_animation(u, l, m, f) {
if (!l)
return noop$4;
const p = u.getBoundingClientRect();
if (l.left === p.left && l.right === p.right && l.top === p.top && l.bottom === p.bottom)
return noop$4;
const {
delay: b = 0,
duration: y = 300,
easing: v = identity$5,
// @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?
start: $ = now() + b,
// @ts-ignore todo:
end: w = $ + y,
tick: k = noop$4,
css: P
} = m(u, { from: l, to: p }, f);
let S = !0, M = !1, T;
function E() {
P && (T = create_rule(u, 0, 1, y, b, v, P)), b || (M = !0);
}
function F() {
P && delete_rule(u, T), S = !1;
}
return loop((L) => {
if (!M && L >= $ && (M = !0), M && L >= w && (k(1, 0), F()), !S)
return !1;
if (M) {
const D = L - $, O = 0 + 1 * v(D / y);
k(O, 1 - O);
}
return !0;
}), E(), k(0, 1), F;
}
function fix_position(u) {
const l = getComputedStyle(u);
if (l.position !== "absolute" && l.position !== "fixed") {
const { width: m, height: f } = l, p = u.getBoundingClientRect();
u.style.position = "absolute", u.style.width = m, u.style.height = f, add_transform(u, p);
}
}
function add_transform(u, l) {
const m = u.getBoundingClientRect();
if (l.left !== m.left || l.top !== m.top) {
const f = getComputedStyle(u), p = f.transform === "none" ? "" : f.transform;
u.style.transform = `${p} translate(${l.left - m.left}px, ${l.top - m.top}px)`;
}
}
let current_component;
function set_current_component(u) {
current_component = u;
}
function get_current_component() {
if (!current_component)
throw new Error("Function called outside component initialization");
return current_component;
}
function beforeUpdate(u) {
get_current_component().$$.before_update.push(u);
}
function onMount(u) {
get_current_component().$$.on_mount.push(u);
}
function afterUpdate(u) {
get_current_component().$$.after_update.push(u);
}
function onDestroy(u) {
get_current_component().$$.on_destroy.push(u);
}
function createEventDispatcher() {
const u = get_current_component();
return (l, m, { cancelable: f = !1 } = {}) => {
const p = u.$$.callbacks[l];
if (p) {
const b = custom_event(
/** @type {string} */
l,
m,
{ cancelable: f }
);
return p.slice().forEach((y) => {
y.call(u, b);
}), !b.defaultPrevented;
}
return !0;
};
}
function setContext(u, l) {
return get_current_component().$$.context.set(u, l), l;
}
function getContext$1(u) {
return get_current_component().$$.context.get(u);
}
function getAllContexts() {
return get_current_component().$$.context;
}
function hasContext(u) {
return get_current_component().$$.context.has(u);
}
function bubble(u, l) {
const m = u.$$.callbacks[l.type];
m && m.slice().forEach((f) => f.call(this, l));
}
const dirty_components = [], intros = { enabled: !1 }, binding_callbacks = [];
let render_callbacks = [];
const flush_callbacks = [], resolved_promise = /* @__PURE__ */ Promise.resolve();
let update_scheduled = !1;
function schedule_update() {
update_scheduled || (update_scheduled = !0, resolved_promise.then(flush));
}
function tick() {
return schedule_update(), resolved_promise;
}
function add_render_callback(u) {
render_callbacks.push(u);
}
function add_flush_callback(u) {
flush_callbacks.push(u);
}
const seen_callbacks = /* @__PURE__ */ new Set();
let flushidx = 0;
function flush() {
if (flushidx !== 0)
return;
const u = current_component;
do {
try {
for (; flushidx < dirty_components.length; ) {
const l = dirty_components[flushidx];
flushidx++, set_current_component(l), update(l.$$);
}
} catch (l) {
throw dirty_components.length = 0, flushidx = 0, l;
}
for (set_current_component(null), dirty_components.length = 0, flushidx = 0; binding_callbacks.length; )
binding_callbacks.pop()();
for (let l = 0; l < render_callbacks.length; l += 1) {
const m = render_callbacks[l];
seen_callbacks.has(m) || (seen_callbacks.add(m), m());
}
render_callbacks.length = 0;
} while (dirty_components.length);
for (; flush_callbacks.length; )
flush_callbacks.pop()();
update_scheduled = !1, seen_callbacks.clear(), set_current_component(u);
}
function update(u) {
if (u.fragment !== null) {
u.update(), run_all(u.before_update);
const l = u.dirty;
u.dirty = [-1], u.fragment && u.fragment.p(u.ctx, l), u.after_update.forEach(add_render_callback);
}
}
function flush_render_callbacks(u) {
const l = [], m = [];
render_callbacks.forEach((f) => u.indexOf(f) === -1 ? l.push(f) : m.push(f)), m.forEach((f) => f()), render_callbacks = l;
}
let promise;
function wait() {
return promise || (promise = Promise.resolve(), promise.then(() => {
promise = null;
})), promise;
}
function dispatch(u, l, m) {
u.dispatchEvent(custom_event(`${l ? "intro" : "outro"}${m}`));
}
const outroing = /* @__PURE__ */ new Set();
let outros;
function group_outros() {
outros = {
r: 0,
c: [],
p: outros
// parent group
};
}
function check_outros() {
outros.r || run_all(outros.c), outros = outros.p;
}
function transition_in(u, l) {
u && u.i && (outroing.delete(u), u.i(l));
}
function transition_out(u, l, m, f) {
if (u && u.o) {
if (outroing.has(u))
return;
outroing.add(u), outros.c.push(() => {
outroing.delete(u), f && (m && u.d(1), f());
}), u.o(l);
} else
f && f();
}
const null_transition = { duration: 0 };
function create_in_transition(u, l, m) {
const f = { direction: "in" };
let p = l(u, m, f), b = !1, y, v, $ = 0;
function w() {
y && delete_rule(u, y);
}
function k() {
const {
delay: S = 0,
duration: M = 300,
easing: T = identity$5,
tick: E = noop$4,
css: F
} = p || null_transition;
F && (y = create_rule(u, 0, 1, M, S, T, F, $++)), E(0, 1);
const L = now() + S, D = L + M;
v && v.abort(), b = !0, add_render_callback(() => dispatch(u, !0, "start")), v = loop((O) => {
if (b) {
if (O >= D)
return E(1, 0), dispatch(u, !0, "end"), w(), b = !1;
if (O >= L) {
const R = T((O - L) / M);
E(R, 1 - R);
}
}
return b;
});
}
let P = !1;
return {
start() {
P || (P = !0, delete_rule(u), is_function(p) ? (p = p(f), wait().then(k)) : k());
},
invalidate() {
P = !1;
},
end() {
b && (w(), b = !1);
}
};
}
function create_out_transition(u, l, m) {
const f = { direction: "out" };
let p = l(u, m, f), b = !0, y;
const v = outros;
v.r += 1;
let $;
function w() {
const {
delay: k = 0,
duration: P = 300,
easing: S = identity$5,
tick: M = noop$4,
css: T
} = p || null_transition;
T && (y = create_rule(u, 1, 0, P, k, S, T));
const E = now() + k, F = E + P;
add_render_callback(() => dispatch(u, !1, "start")), "inert" in u && ($ = /** @type {HTMLElement} */
u.inert, u.inert = !0), loop((L) => {
if (b) {
if (L >= F)
return M(0, 1), dispatch(u, !1, "end"), --v.r || run_all(v.c), !1;
if (L >= E) {
const D = S((L - E) / P);
M(1 - D, D);
}
}
return b;
});
}
return is_function(p) ? wait().then(() => {
p = p(f), w();
}) : w(), {
end(k) {
k && "inert" in u && (u.inert = $), k && p.tick && p.tick(1, 0), b && (y && delete_rule(u, y), b = !1);
}
};
}
function create_bidirectional_transition(u, l, m, f) {
let b = l(u, m, { direction: "both" }), y = f ? 0 : 1, v = null, $ = null, w = null, k;
function P() {
w && delete_rule(u, w);
}
function S(T, E) {
const F = (
/** @type {Program['d']} */
T.b - y
);
return E *= Math.abs(F), {
a: y,
b: T.b,
d: F,
duration: E,
start: T.start,
end: T.start + E,
group: T.group
};
}
function M(T) {
const {
delay: E = 0,
duration: F = 300,
easing: L = identity$5,
tick: D = noop$4,
css: O
} = b || null_transition, R = {
start: now() + E,
b: T
};
T || (R.group = outros, outros.r += 1), "inert" in u && (T ? k !== void 0 && (u.inert = k) : (k = /** @type {HTMLElement} */
u.inert, u.inert = !0)), v || $ ? $ = R : (O && (P(), w = create_rule(u, y, T, F, E, L, O)), T && D(0, 1), v = S(R, F), add_render_callback(() => dispatch(u, T, "start")), loop((z) => {
if ($ && z > $.start && (v = S($, F), $ = null, dispatch(u, v.b, "start"), O && (P(), w = create_rule(
u,
y,
v.b,
v.duration,
0,
L,
b.css
))), v) {
if (z >= v.end)
D(y = v.b, 1 - y), dispatch(u, v.b, "end"), $ || (v.b ? P() : --v.group.r || run_all(v.group.c)), v = null;
else if (z >= v.start) {
const j = z - v.start;
y = v.a + v.d * L(j / v.duration), D(y, 1 - y);
}
}
return !!(v || $);
}));
}
return {
run(T) {
is_function(b) ? wait().then(() => {
b = b({ direction: T ? "in" : "out" }), M(T);
}) : M(T);
},
end() {
P(), v = $ = null;
}
};
}
function handle_promise(u, l) {
const m = l.token = {};
function f(p, b, y, v) {
if (l.token !== m)
return;
l.resolved = v;
let $ = l.ctx;
y !== void 0 && ($ = $.slice(), $[y] = v);
const w = p && (l.current = p)($);
let k = !1;
l.block && (l.blocks ? l.blocks.forEach((P, S) => {
S !== b && P && (group_outros(), transition_out(P, 1, 1, () => {
l.blocks[S] === P && (l.blocks[S] = null);
}), check_outros());
}) : l.block.d(1), w.c(), transition_in(w, 1), w.m(l.mount(), l.anchor), k = !0), l.block = w, l.blocks && (l.blocks[b] = w), k && flush();
}
if (is_promise(u)) {
const p = get_current_component();
if (u.then(
(b) => {
set_current_component(p), f(l.then, 1, l.value, b), set_current_component(null);
},
(b) => {
if (set_current_component(p), f(l.catch, 2, l.error, b), set_current_component(null), !l.hasCatch)
throw b;
}
), l.current !== l.pending)
return f(l.pending, 0), !0;
} else {
if (l.current !== l.then)
return f(l.then, 1, l.value, u), !0;
l.resolved = /** @type {T} */
u;
}
}
function update_await_block_branch(u, l, m) {
const f = l.slice(), { resolved: p } = u;
u.current === u.then && (f[u.value] = p), u.current === u.catch && (f[u.error] = p), u.block.p(f, m);
}
function ensure_array_like(u) {
return (u == null ? void 0 : u.length) !== void 0 ? u : Array.from(u);
}
function destroy_block(u, l) {
u.d(1), l.delete(u.key);
}
function outro_and_destroy_block(u, l) {
transition_out(u, 1, 1, () => {
l.delete(u.key);
});
}
function fix_and_destroy_block(u, l) {
u.f(), destroy_block(u, l);
}
function fix_and_outro_and_destroy_block(u, l) {
u.f(), outro_and_destroy_block(u, l);
}
function update_keyed_each(u, l, m, f, p, b, y, v, $, w, k, P) {
let S = u.length, M = b.length, T = S;
const E = {};
for (; T--; )
E[u[T].key] = T;
const F = [], L = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), O = [];
for (T = M; T--; ) {
const N = P(p, b, T), V = m(N);
let H = y.get(V);
H ? f && O.push(() => H.p(N, l)) : (H = w(V, N), H.c()), L.set(V, F[T] = H), V in E && D.set(V, Math.abs(T - E[V]));
}
const R = /* @__PURE__ */ new Set(), z = /* @__PURE__ */ new Set();
function j(N) {
transition_in(N, 1), N.m(v, k), y.set(N.key, N), k = N.first, M--;
}
for (; S && M; ) {
const N = F[M - 1], V = u[S - 1], H = N.key, W = V.key;
N === V ? (k = N.first, S--, M--) : L.has(W) ? !y.has(H) || R.has(H) ? j(N) : z.has(W) ? S-- : D.get(H) > D.get(W) ? (z.add(H), j(N)) : (R.add(W), S--) : ($(V, y), S--);
}
for (; S--; ) {
const N = u[S];
L.has(N.key) || $(N, y);
}
for (; M; )
j(F[M - 1]);
return run_all(O), F;
}
function validate_each_keys(u, l, m, f) {
const p = /* @__PURE__ */ new Map();
for (let b = 0; b < l.length; b++) {
const y = f(m(u, l, b));
if (p.has(y)) {
let v = "";
try {
v = `with value '${String(y)}' `;
} catch {
}
throw new Error(
`Cannot have duplicate keys in a keyed each: Keys at index ${p.get(
y
)} and ${b} ${v}are duplicates`
);
}
p.set(y, b);
}
}
function get_spread_update(u, l) {
const m = {}, f = {}, p = { $$scope: 1 };
let b = u.length;
for (; b--; ) {
const y = u[b], v = l[b];
if (v) {
for (const $ in y)
$ in v || (f[$] = 1);
for (const $ in v)
p[$] || (m[$] = v[$], p[$] = 1);
u[b] = v;
} else
for (const $ in y)
p[$] = 1;
}
for (const y in f)
y in m || (m[y] = void 0);
return m;
}
function get_spread_object(u) {
return typeof u == "object" && u !== null ? u : {};
}
const _boolean_attributes = (
/** @type {const} */
[
"allowfullscreen",
"allowpaymentrequest",
"async",
"autofocus",
"autoplay",
"checked",
"controls",
"default",
"defer",
"disabled",
"formnovalidate",
"hidden",
"inert",
"ismap",
"loop",
"multiple",
"muted",
"nomodule",
"novalidate",
"open",
"playsinline",
"readonly",
"required",
"reversed",
"selected"
]
), boolean_attributes = /* @__PURE__ */ new Set([..._boolean_attributes]), ATTR_REGEX = /[&"<]/g, CONTENT_REGEX = /[&<]/g;
function escape$2(u, l = !1) {
const m = String(u), f = l ? ATTR_REGEX : CONTENT_REGEX;
f.lastIndex = 0;
let p = "", b = 0;
for (; f.test(m); ) {
const y = f.lastIndex - 1, v = m[y];
p += m.substring(b, y) + (v === "&" ? "&" : v === '"' ? """ : "<"), b = y + 1;
}
return p + m.substring(b);
}
const void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;
function is_void(u) {
return void_element_names.test(u) || u.toLowerCase() === "!doctype";
}
const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
function spread(u, l) {
const m = Object.assign({}, ...u);
if (l) {
const p = l.classes, b = l.styles;
p && (m.class == null ? m.class = p : m.class += " " + p), b && (m.style == null ? m.style = style_object_to_string(b) : m.style = style_object_to_string(
merge_ssr_styles(m.style, b)
));
}
let f = "";
return Object.keys(m).forEach((p) => {
if (invalid_attribute_name_character.test(p))
return;
const b = m[p];
b === !0 ? f += " " + p : boolean_attributes.has(p.toLowerCase()) ? b && (f += " " + p) : b != null && (f += ` ${p}="${b}"`);
}), f;
}
function merge_ssr_styles(u, l) {
const m = {};
for (const f of u.split(";")) {
const p = f.indexOf(":"), b = f.slice(0, p).trim(), y = f.slice(p + 1).trim();
b && (m[b] = y);
}
for (const f in l) {
const p = l[f];
p ? m[f] = p : delete m[f];
}
return m;
}
function escape_attribute_value(u) {
return typeof u == "string" || u && typeof u == "object" ? escape$2(u, !0) : u;
}
function escape_object(u) {
const l = {};
for (const m in u)
l[m] = escape_attribute_value(u[m]);
return l;
}
function each$1(u, l) {
u = ensure_array_like(u);
let m = "";
for (let f = 0; f < u.length; f += 1)
m += l(u[f], f);
return m;
}
const missing_component = {
$$render: () => ""
};
function validate_component(u, l) {
if (!u || !u.$$render)
throw l === "svelte:component" && (l += " this={...}"), new Error(
`<${l}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${l}>.`
);
return u;
}
function debug(u, l, m, f) {
return console.log(`{@debug} ${u ? u + " " : ""}(${l}:${m})`), console.log(f), "";
}
let on_destroy;
function create_ssr_component(u) {
function l(m, f, p, b, y) {
const v = current_component, $ = {
on_destroy,
context: new Map(y || (v ? v.$$.context : [])),
// these will be immediately discarded
on_mount: [],
before_update: [],
after_update: [],
callbacks: blank_object()
};
set_current_component({ $$: $ });
const w = u(m, f, p, b);
return set_current_component(v), w;
}
return {
render: (m = {}, { $$slots: f = {}, context: p = /* @__PURE__ */ new Map() } = {}) => {
on_destroy = [];
const b = { title: "", head: "", css: /* @__PURE__ */ new Set() }, y = l(b, m, {}, f, p);
return run_all(on_destroy), {
html: y,
css: {
code: Array.from(b.css).map((v) => v.code).join(`
`),
map: null
// TODO
},
head: b.title + b.head
};
},
$$render: l
};
}
function add_attribute(u, l, m) {
if (l == null || m && !l)
return "";
const f = m && l === !0 ? "" : `="${escape$2(l, !0)}"`;
return ` ${u}${f}`;
}
function add_classes(u) {
return u ? ` class="${u}"` : "";
}
function style_object_to_string(u) {
return Object.keys(u).filter((l) => u[l] != null && u[l] !== "").map((l) => `${l}: ${escape_attribute_value(u[l])};`).join(" ");
}
function add_styles(u) {
const l = style_object_to_string(u);
return l ? ` style="${l}"` : "";
}
function bind(u, l, m) {
const f = u.$$.props[l];
f !== void 0 && (u.$$.bound[f] = m, m(u.$$.ctx[f]));
}
function create_component(u) {
u && u.c();
}
function claim_component(u, l) {
u && u.l(l);
}
function mount_component(u, l, m) {
const { fragment: f, after_update: p } = u.$$;
f && f.m(l, m), add_render_callback(() => {
const b = u.$$.on_mount.map(run).filter(is_function);
u.$$.on_destroy ? u.$$.on_destroy.push(...b) : run_all(b), u.$$.on_mount = [];
}), p.forEach(add_render_callback);
}
function destroy_component(u, l) {
const m = u.$$;
m.fragment !== null && (flush_render_callbacks(m.after_update), run_all(m.on_destroy), m.fragment && m.fragment.d(l), m.on_destroy = m.fragment = null, m.ctx = []);
}
function make_dirty(u, l) {
u.$$.dirty[0] === -1 && (dirty_components.push(u), schedule_update(), u.$$.dirty.fill(0)), u.$$.dirty[l / 31 | 0] |= 1 << l % 31;
}
function init$1(u, l, m, f, p, b, y = null, v = [-1]) {
const $ = current_component;
set_current_component(u);
const w = u.$$ = {
fragment: null,
ctx: [],
// state
props: b,
update: noop$4,
not_equal: p,
bound: blank_object(),
// lifecycle
on_mount: [],
on_destroy: [],
on_disconnect: [],
before_update: [],
after_update: [],
context: new Map(l.context || ($ ? $.$$.context : [])),
// everything else
callbacks: blank_object(),
dirty: v,
skip_bound: !1,
root: l.target || $.$$.root
};
y && y(w.root);
let k = !1;
if (w.ctx = m ? m(u, l.props || {}, (P, S, ...M) => {
const T = M.length ? M[0] : S;
return w.ctx && p(w.ctx[P], w.ctx[P] = T) && (!w.skip_bound && w.bound[P] && w.bound[P](T), k && make_dirty(u, P)), S;
}) : [], w.update(), k = !0, run_all(w.before_update), w.fragment = f ? f(w.ctx) : !1, l.target) {
if (l.hydrate) {
start_hydrating();
const P = children(l.target);
w.fragment && w.fragment.l(P), P.forEach(detach);
} else
w.fragment && w.fragment.c();
l.intro && transition_in(u.$$.fragment), mount_component(u, l.target, l.anchor), end_hydrating(), flush();
}
set_current_component($);
}
let SvelteElement;
typeof HTMLElement == "function" && (SvelteElement = class extends HTMLElement {
constructor(l, m, f) {
super();
/** The Svelte component constructor */
we(this, "$$ctor");
/** Slots */
we(this, "$$s");
/** The Svelte component instance */
we(this, "$$c");
/** Whether or not the custom element is connected */
we(this, "$$cn", !1);
/** Component props data */
we(this, "$$d", {});
/** `true` if currently in the process of reflecting component props back to attributes */
we(this, "$$r", !1);
/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
we(this, "$$p_d", {});
/** @type {Record<string, Function[]>} Event listeners */
we(this, "$$l", {});
/** @type {Map<Function, Function>} Event listener unsubscribe functions */
we(this, "$$l_u", /* @__PURE__ */ new Map());
this.$$ctor = l, this.$$s = m, f && this.attachShadow({ mode: "open" });
}
addEventListener(l, m, f) {
if (this.$$l[l] = this.$$l[l] || [], this.$$l[l].push(m), this.$$c) {
const p = this.$$c.$on(l, m);
this.$$l_u.set(m, p);
}
super.addEventListener(l, m, f);
}
removeEventListener(l, m, f) {
if (super.removeEventListener(l, m, f), this.$$c) {
const p = this.$$l_u.get(m);
p && (p(), this.$$l_u.delete(m));
}
}
async connectedCallback() {
if (this.$$cn = !0, !this.$$c) {
let l = function(b) {
return () => {
let y;
return {
c: function() {
y = element("slot"), b !== "default" && attr(y, "name", b);
},
/**
* @param {HTMLElement} target
* @param {HTMLElement} [anchor]
*/
m: function(w, k) {
insert(w, y, k);
},
d: function(w) {
w && detach(y);
}
};
};
};
if (await Promise.resolve(), !this.$$cn || this.$$c)
return;
const m = {}, f = get_custom_elements_slots(this);
for (const b of this.$$s)
b in f && (m[b] = [l(b)]);
for (const b of this.attributes) {
const y = this.$$g_p(b.name);
y in this.$$d || (this.$$d[y] = get_custom_element_value(y, b.value, this.$$p_d, "toProp"));
}
for (const b in this.$$p_d)
!(b in this.$$d) && this[b] !== void 0 && (this.$$d[b] = this[b], delete this[b]);
this.$$c = new this.$$ctor({
target: this.shadowRoot || this,
props: {
...this.$$d,
$$slots: m,
$$scope: {
ctx: []
}
}
});
const p = () => {
this.$$r = !0;
for (const b in this.$$p_d)
if (this.$$d[b] = this.$$c.$$.ctx[this.$$c.$$.props[b]], this.$$p_d[b].reflect) {
const y = get_custom_element_value(
b,
this.$$d[b],
this.$$p_d,
"toAttribute"
);
y == null ? this.removeAttribute(this.$$p_d[b].attribute || b) : this.setAttribute(this.$$p_d[b].attribute || b, y);
}
this.$$r = !1;
};
this.$$c.$$.after_update.push(p), p();
for (const b in this.$$l)
for (const y of this.$$l[b]) {
const v = this.$$c.$on(b, y);
this.$$l_u.set(y, v);
}
this.$$l = {};
}
}
// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
// and setting attributes through setAttribute etc, this is helpful
attributeChangedCallback(l, m, f) {
var p;
this.$$r || (l = this.$$g_p(l), this.$$d[l] = get_custom_element_value(l, f, this.$$p_d, "toProp"), (p = this.$$c) == null || p.$set({ [l]: this.$$d[l] }));
}
disconnectedCallback() {
this.$$cn = !1, Promise.resolve().then(() => {
!this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$c = void 0);
});
}
$$g_p(l) {
return Object.keys(this.$$p_d).find(
(m) => this.$$p_d[m].attribute === l || !this.$$p_d[m].attribute && m.toLowerCase() === l
) || l;
}
});
function get_custom_element_value(u, l, m, f) {
var b;
const p = (b = m[u]) == null ? void 0 : b.type;
if (l = p === "Boolean" && typeof l != "boolean" ? l != null : l, !f || !m[u])
return l;
if (f === "toAttribute")
switch (p) {
case "Object":
case "Array":
return l == null ? null : JSON.stringify(l);
case "Boolean":
return l ? "" : null;
case "Number":
return l ?? null;
default:
return l;
}
else
switch (p) {
case "Object":
case "Array":
return l && JSON.parse(l);
case "Boolean":
return l;
case "Number":
return l != null ? +l : l;
default:
return l;
}
}
function create_custom_element(u, l, m, f, p, b) {
let y = class extends SvelteElement {
constructor() {
super(u, m, p), this.$$p_d = l;
}
static get observedAttributes() {
return Object.keys(l).map(
(v) => (l[v].attribute || v).toLowerCase()
);
}
};
return Object.keys(l).forEach((v) => {
Object.defineProperty(y.prototype, v, {
get() {
return this.$$c && v in this.$$c ? this.$$c[v] : this.$$d[v];
},
set($) {
var w;
$ = get_custom_element_value(v, $, l), this.$$d[v] = $, (w = this.$$c) == null || w.$set({ [v]: $ });
}
});
}), f.forEach((v) => {
Object.defineProperty(y.prototype, v, {
get() {
var $;
return ($ = this.$$c) == null ?