UNPKG

mirador

Version:

An open-source, web-based 'multi-up' viewer that supports zoom-pan-rotate functionality, ability to display/compare simple images, and images with annotations.

22,290 lines 684 kB
import { B as e, M as t, U as n, V as r, W as i, Z as a, _ as o, a as s, at as c, ct as l, d as u, dt as d, f, ft as p, g as m, h, i as g, l as _, lt as v, m as y, n as b, o as x, ot as S, s as C, st as w, t as T, u as E, ut as D } from "./getters-B4oepJRC.js";
import { $ as ee, A as te, Bt as ne, C as re, D as ie, Dt as ae, E as oe, Et as se, F as ce, Ft as O, G as le, H as ue, I as de, It as fe, J as pe, K as me, Kt as he, M as ge, Mt as _e, N as ve, Nt as ye, Ot as k, P as be, Pt as xe, Q as Se, R as Ce, S as we, St as Te, T as Ee, Tt as De, U as Oe, Ut as ke, V as Ae, Vt as je, W as Me, Wt as Ne, Y as Pe, Z as Fe, _ as Ie, _t as Le, a as Re, at as ze, b as Be, c as Ve, ct as He, d as Ue, dn as We, et as Ge, g as Ke, gt as qe, h as Je, i as Ye, it as Xe, j as Ze, jt as Qe, k as $e, l as et, lt as tt, mt as nt, n as rt, nt as it, o as at, ot, p as st, q as ct, rt as lt, s as ut, sn as dt, tt as ft, u as pt, w as mt, x as ht, xt as gt, y as _t, yt as vt, zt as yt } from "./canvases-CeUwRIFA.js";
import { t as A } from "./action-types-DjIbTE-A.js";
import { E as bt, S as xt, _ as St, b as Ct, c as wt, d as Tt, f as Et, k as Dt, l as Ot, n as kt, p as At, r as jt, v as Mt, w as Nt, x as Pt, y as Ft } from "./FailedImageContext-CwSMbPf_.js";
import { a as It, c as Lt, d as Rt, f as zt, l as Bt, n as Vt, t as Ht, u as Ut } from "./index.module-DGZAy1M6.js";
import { a as Wt, c as Gt, d as Kt, f as qt, i as Jt, l as Yt, n as Xt, o as Zt, r as Qt, s as $t, t as en, u as tn } from "./window-COQOIAli.js";
import { n as nn, r as rn, t as an } from "./canvas-DYtXsw9j.js";
import { i as on, n as sn, r as j, t as cn } from "./PluginHook-CsLe05K9.js";
import { a as ln, n as un, o as dn, r as fn, t as pn } from "./CommentSharp-D3pMyMsr.js";
import { t as M } from "./createSvgIcon-Cwt8YPfm.js";
import { i as mn, n as hn, o as gn, r as _n, t as vn } from "./visuallyHidden-D8sxji69.js";
import { t as yn } from "./react-error-boundary.esm-ByHqCaxk.js";
import * as N from "react";
import P, { Children as bn, PureComponent as xn, Suspense as Sn, cloneElement as Cn, createContext as wn, createElement as Tn, createRef as En, forwardRef as Dn, isValidElement as On, lazy as kn, memo as An, useCallback as jn, useContext as Mn, useEffect as F, useId as Nn, useImperativeHandle as Pn, useLayoutEffect as Fn, useMemo as In, useRef as I, useState as L } from "react";
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
import Ln from "@mui/material/Paper";
import { useTranslation as V } from "react-i18next";
import { alpha as Rn, darken as zn, lighten as Bn, styled as H, styled as Vn, useTheme as Hn, useThemeProps as Un } from "@mui/material/styles";
import U from "@mui/material/Typography";
import { createSvgIcon as Wn } from "@mui/material/utils";
import Gn from "@mui/material/Badge";
import Kn from "@mui/material/IconButton";
import qn from "@mui/material/Tooltip";
import Jn from "@mui/material/Chip";
import Yn from "@mui/material/MenuList";
import Xn from "@mui/material/MenuItem";
import Zn from "@mui/material/ListItemText";
import Qn from "@mui/material/Toolbar";
import $n, { flushSync as er } from "react-dom";
import tr from "@mui/material/Accordion";
import nr from "@mui/material/AccordionDetails";
import rr from "@mui/material/AccordionSummary";
import ir from "@mui/material/InputLabel";
import ar from "@mui/material/FormControl";
import or from "@mui/material/Select";
import sr from "@mui/material/Button";
import cr from "@mui/material/Link";
import lr from "@mui/material/Tabs";
import ur from "@mui/material/Tab";
import { useRtl as dr } from "@mui/system/RtlProvider";
import fr from "@mui/material/Collapse";
import { shouldForwardProp as pr } from "@mui/system/createStyled";
import mr from "@mui/material/Checkbox";
import { shouldForwardProp as hr } from "@mui/system";
import gr from "@mui/material/Skeleton";
import _r from "@mui/material/Autocomplete";
import vr from "@mui/material/CircularProgress";
import yr from "@mui/material/TextField";
import br from "@mui/material/InputAdornment";
import xr from "@mui/material/List";
import Sr from "@mui/material/ListItem";
import Cr from "@mui/material/ListItemButton";
import wr from "@mui/material/Input";
import Tr from "@mui/material/Slider";
import Er from "@mui/material/ListItemIcon";
import Dr from "@mui/material/AppBar";
import Or from "@mui/material/ListSubheader";
import kr from "@mui/material/Popover";
import Ar from "@mui/material/FormControlLabel";
import jr from "@mui/material/SvgIcon";
import Mr from "@mui/material/Menu";
import Nr from "@mui/material/Drawer";
import Pr from "@mui/material/Slide";
import Fr from "@mui/material/Stack";
import Ir from "@mui/material/Alert";
import { Button as Lr, Card as Rr, CardContent as zr, Chip as Br, Dialog as Vr, DialogActions as Hr, DialogContent as Ur, DialogContentText as Wr, DialogTitle as Gr, Link as Kr, ListItemIcon as qr, ListItemText as Jr, MenuItem as Yr, MenuList as Xr, TextField as Zr, Typography as Qr } from "@mui/material";
import $r from "@mui/material/DialogContent";
import ei from "@mui/material/DialogActions";
import ti from "@mui/material/Dialog";
import ni from "@mui/material/DialogTitle";
import ri from "@mui/material/Backdrop";
import { grey as ii } from "@mui/material/colors";
import ai from "@mui/material/Grid";
import oi from "@mui/material/ButtonBase";
import si from "@mui/material/GlobalStyles";
import ci from "@mui/material/Fab";
import li from "@mui/material/useMediaQuery";
import ui from "@mui/material/Snackbar";
//#region node_modules/lodash/union.js
var di = /* @__PURE__ */ D(((e, t) => {
	var n = Ne(), r = zt(), i = Rt(), a = Ut();
	t.exports = r(function(e) {
		return i(n(e, 1, a, !0));
	});
})), fi = /* @__PURE__ */ D(((e, t) => {
	var n = Bt(), r = zt(), i = Ut();
	t.exports = r(function(e, t) {
		return i(e) ? n(e, t) : [];
	});
})), pi = /* @__PURE__ */ p(di(), 1), mi = /* @__PURE__ */ p(fi(), 1), hi = je();
function gi(e, t) {
	let n = e.getCanvasIds();
	for (let e = 0; e < n.length; e += 1) if (hi.Utils.normalisedUrlsMatch(n[e], t)) return !0;
	return !1;
}
function _i(e) {
	return e.parentNode === void 0 ? [] : e.parentNode.parentNode === void 0 ? [e.parentNode.id] : [..._i(e.parentNode), e.parentNode.id];
}
function vi(e, t) {
	return e.reduce((e, n) => {
		let r = [];
		r.push(...e);
		let i = t.reduce((e, t) => e || gi(n.data, t), !1), a = n.nodes.length > 0 ? vi(n.nodes, t) : [];
		return r.push(...a), (i || a.length > 0) && r.push({
			containsVisibleCanvas: i,
			descendantsContainVisibleCanvas: a.length > 0,
			id: n.id,
			leaf: n.nodes.length === 0,
			parentIds: _i(n)
		}), r;
	}, []);
}
var yi = y([ce, st], (e, t) => t.length === 0 || !e ? [] : vi(e.nodes, t)), bi = y([yi], (e) => e.map((e) => e.id)), xi = y([yi], (e) => e.reduce((e, t) => t.leaf || !t.descendantsContainVisibleCanvas ? e : [...e, t.id], [])), Si = y([yi], (e) => e.reduce((e, t) => t.containsVisibleCanvas ? [...e, t] : e, []));
function Ci(e, { companionWindowId: t }, n) {
	let r = se(e, { companionWindowId: t });
	return r.tocNodes ? Object.keys(r.tocNodes).reduce((e, t) => r.tocNodes[t].expanded === n ? [...e, t] : e, []) : [];
}
function wi(e, { companionWindowId: t, windowId: n }) {
	let r = xi(e, {
		companionWindowId: t,
		windowId: n
	}), i = Ci(e, { companionWindowId: t }, !0), a = Ci(e, { companionWindowId: t }, !1);
	return (0, mi.default)((0, pi.default)(i, r), ...a);
}
function Ti(e, { ...t }) {
	let n = Si(e, { ...t }), r = Ci(e, t, !1);
	if (n && n.length > 0) {
		for (let e = 0; e < n[0].parentIds.length; e += 1) if (r.indexOf(n[0].parentIds[e]) !== -1) return n[0].parentIds[e];
		return n[0].id;
	}
	return null;
}
var Ei = y([ce], (e) => e && e.nodes && e.nodes.length > 0 ? "tableOfContents" : "item"), Di = /* @__PURE__ */ p(ke(), 1), Oi = y([nt], ({ auth: { serviceProfiles: e = [] } = {} }) => e), ki = (e) => f(e).accessTokens || u, Ai = (e) => f(e).auth || u, ji = y([
	Ie,
	_t,
	Oi,
	Ai,
	fe,
	(e, { iiifResources: t }) => t
], (e, t = {}, n, r, i, a) => {
	let o = a;
	if (!o && e && (o = (0, Di.default)(e.map((e) => i(e).iiifImageResources.map((e) => {
		let n = ne(e), r = t[n.id];
		return r && r.json ? {
			...r.json,
			options: {}
		} : n;
	})))), !o || o.length === 0) return E;
	let s = o.map((e) => {
		let t, i = hi.Utils.getServices(e);
		for (let e of n) {
			let n = i.filter((t) => e.profile === t.getProfile());
			for (let e of n) if (t = e, !r[e.id] || r[e.id].isFetching || r[e.id].ok) return e;
		}
		return t;
	});
	return Object.values(s.reduce((e, t) => (t && !e[t.id] && (e[t.id] = t), e), {}));
}), Mi = {
	content: null,
	position: null
};
function Ni(e, t, n = Mi) {
	let r = `cw-${h()}`;
	return {
		id: r,
		payload: {
			...n,
			...t,
			id: r,
			windowId: e
		},
		type: A.ADD_COMPANION_WINDOW,
		windowId: e
	};
}
function Pi(e, t, n = Mi) {
	return (r, i) => {
		let a = i(), { position: o } = t, s = o === "left" && ae(a, {
			position: o,
			windowId: e
		})[0];
		r(s ? Fi(e, s, t) : Ni(e, t, n));
	};
}
function Fi(e, t, n) {
	return {
		id: t,
		payload: n,
		type: A.UPDATE_COMPANION_WINDOW,
		windowId: e
	};
}
function Ii(e, t) {
	return {
		id: t,
		type: A.REMOVE_COMPANION_WINDOW,
		windowId: e
	};
}
function Li(e, t, n) {
	return (r, i) => {
		let a = i(), o = Ci(a, { companionWindowId: t }, !1), s = Ci(a, { companionWindowId: t }, !0), c = bi(a, {
			id: t,
			windowId: e
		}), l = o.indexOf(n) !== -1 || s.indexOf(n) === -1 && c.indexOf(n) === -1;
		return r({
			id: t,
			payload: { [n]: { expanded: l } },
			type: A.TOGGLE_TOC_NODE,
			windowId: e
		});
	};
}
function Ri(e, t, n) {
	return (r, i) => {
		let a = Ci(i(), { companionWindowId: t }, !0), o = {};
		return a.forEach((e) => {
			o[e] = { expanded: !1 };
		}), n.forEach((e) => {
			o[e] = { expanded: !0 };
		}), r({
			id: t,
			payload: o,
			type: A.TOGGLE_TOC_NODE,
			windowId: e
		});
	};
}
//#endregion
//#region src/state/actions/config.js
function zi(e) {
	return {
		config: e,
		type: A.IMPORT_CONFIG
	};
}
function Bi(e) {
	return {
		config: e,
		type: A.SET_CONFIG
	};
}
function Vi(e) {
	return {
		config: e,
		type: A.UPDATE_CONFIG
	};
}
function Hi(e) {
	return {
		state: {
			...e,
			workspace: {
				...e.workspace,
				id: h()
			}
		},
		type: A.IMPORT_MIRADOR_STATE
	};
}
//#endregion
//#region src/state/actions/errors.js
function Ui(e) {
	return {
		id: `error-${h()}`,
		message: e,
		type: A.ADD_ERROR
	};
}
function Wi(e) {
	return {
		id: e,
		type: A.REMOVE_ERROR
	};
}
//#endregion
//#region src/state/actions/manifest.js
function Gi(e, t) {
	return {
		manifestId: e,
		properties: t,
		type: A.REQUEST_MANIFEST
	};
}
function Ki(e, t) {
	return {
		manifestId: e,
		manifestJson: t,
		type: A.RECEIVE_MANIFEST
	};
}
function qi(e, t) {
	return {
		error: t,
		manifestId: e,
		type: A.RECEIVE_MANIFEST_FAILURE
	};
}
function Ji(e, t) {
	return Gi(e, {
		...t,
		isFetching: !0
	});
}
function Yi(e) {
	return {
		manifestId: e,
		type: A.REMOVE_MANIFEST
	};
}
//#endregion
//#region src/state/actions/workspace.js
function Xi(e) {
	return {
		config: e,
		type: A.UPDATE_WORKSPACE
	};
}
function Zi(e) {
	return {
		showZoomControls: e,
		type: A.TOGGLE_ZOOM_CONTROLS
	};
}
function Qi(e) {
	return {
		layout: e,
		type: A.UPDATE_WORKSPACE_MOSAIC_LAYOUT
	};
}
function $i(e) {
	return {
		isWorkspaceAddVisible: e,
		type: A.SET_WORKSPACE_ADD_VISIBILITY
	};
}
function ea({ x: e, y: t }) {
	return {
		payload: { position: {
			x: e,
			y: t
		} },
		type: A.SET_WORKSPACE_VIEWPORT_POSITION
	};
}
function ta({ width: e, height: t }) {
	return {
		payload: { position: {
			height: t,
			width: e
		} },
		type: A.SET_WORKSPACE_VIEWPORT_POSITION
	};
}
function na() {
	return { type: A.TOGGLE_DRAGGING };
}
//#endregion
//#region src/state/actions/auth.js
function ra(e, t, n = void 0) {
	return {
		id: t,
		profile: n,
		type: A.ADD_AUTHENTICATION_REQUEST,
		windowId: e
	};
}
function ia(e, t, n) {
	return {
		id: e,
		tokenServiceId: t,
		type: A.RESOLVE_AUTHENTICATION_REQUEST,
		...n
	};
}
function aa(e, t) {
	return {
		authId: t,
		serviceId: e,
		type: A.REQUEST_ACCESS_TOKEN
	};
}
function oa(e, t, n) {
	return {
		authId: e,
		json: n,
		serviceId: t,
		type: A.RECEIVE_ACCESS_TOKEN
	};
}
function sa(e, t, n) {
	return {
		authId: e,
		error: n,
		serviceId: t,
		type: A.RECEIVE_ACCESS_TOKEN_FAILURE
	};
}
function ca(e, t, n) {
	return n.accessToken ? oa(e, t, n) : sa(e, t, n);
}
function la({ authServiceId: e, tokenServiceId: t }) {
	return {
		id: e,
		tokenServiceId: t,
		type: A.RESET_AUTHENTICATION_STATE
	};
}
//#endregion
//#region src/state/actions/elasticLayout.js
function ua(e, t) {
	return {
		payload: t,
		type: A.UPDATE_ELASTIC_WINDOW_LAYOUT,
		windowId: e
	};
}
//#endregion
//#region src/state/actions/search.js
function da(e, t, n, r) {
	return {
		companionWindowId: t,
		query: r,
		searchId: n,
		type: A.REQUEST_SEARCH,
		windowId: e
	};
}
function fa(e, t, n, r) {
	return {
		companionWindowId: t,
		searchId: n,
		searchJson: r,
		type: A.RECEIVE_SEARCH,
		windowId: e
	};
}
function pa(e, t, n, r) {
	return {
		companionWindowId: t,
		error: r,
		searchId: n,
		type: A.RECEIVE_SEARCH_FAILURE,
		windowId: e
	};
}
function ma(e, t) {
	return {
		companionWindowId: t,
		type: A.REMOVE_SEARCH,
		windowId: e
	};
}
function ha(e, t, n, r) {
	return da(e, t, n, r);
}
function ga(e, t, n) {
	return {
		annotationIds: n,
		companionWindowId: t,
		type: A.SET_CONTENT_SEARCH_CURRENT_ANNOTATIONS,
		windowId: e
	};
}
//#endregion
//#region src/state/actions/layers.js
function _a(e, t, n) {
	return {
		canvasId: t,
		payload: n,
		type: A.UPDATE_LAYERS,
		windowId: e
	};
}
//#endregion
//#region src/state/actions/catalog.js
function va(e, t = void 0, n) {
	return {
		manifestId: e,
		manifestJson: t,
		payload: n,
		type: A.ADD_RESOURCE
	};
}
function ya(e) {
	return {
		manifestId: e,
		type: A.REMOVE_RESOURCE
	};
}
//#endregion
//#region node_modules/react-window/dist/react-window.js
var W = /* @__PURE__ */ p(c(), 1);
function ba(e) {
	let t = e;
	for (; t;) {
		if (t.dir) return t.dir === "rtl";
		t = t.parentElement;
	}
	return !1;
}
function xa(e, t) {
	let [n, r] = L(t === "rtl");
	return Fn(() => {
		e && (t || r(ba(e)));
	}, [t, e]), n;
}
var Sa = typeof window < "u" ? Fn : F;
function Ca(e) {
	if (e !== void 0) switch (typeof e) {
		case "number": return e;
		case "string":
			if (e.endsWith("px")) return parseFloat(e);
			break;
	}
}
function wa({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
	let { styleHeight: s, styleWidth: c } = In(() => ({
		styleHeight: Ca(o?.height),
		styleWidth: Ca(o?.width)
	}), [o?.height, o?.width]), [l, u] = L({
		height: t,
		width: n
	}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
	return Sa(() => {
		if (i === null || d) return;
		let t = new ResizeObserver((e) => {
			for (let t of e) {
				let { contentRect: e, target: n } = t;
				i === n && u((t) => t.height === e.height && t.width === e.width ? t : {
					height: e.height,
					width: e.width
				});
			}
		});
		return t.observe(i, { box: e }), () => {
			t?.unobserve(i);
		};
	}, [
		e,
		d,
		i,
		s,
		c
	]), In(() => ({
		height: s ?? l.height,
		width: c ?? l.width
	}), [
		l,
		s,
		c
	]);
}
function Ta(e) {
	let t = I(() => {
		throw Error("Cannot call during render.");
	});
	return Sa(() => {
		t.current = e;
	}, [e]), jn((e) => t.current?.(e), [t]);
}
var Ea = null;
function Da(e = !1) {
	if (Ea === null || e) {
		let e = document.createElement("div"), t = e.style;
		t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
		let n = document.createElement("div"), r = n.style;
		return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? Ea = "positive-descending" : (e.scrollLeft = 1, Ea = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), Ea;
	}
	return Ea;
}
function Oa({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
	if (t === "horizontal" && n) switch (Da()) {
		case "negative": return -r;
		case "positive-descending":
			if (e) {
				let { clientWidth: t, scrollLeft: n, scrollWidth: r } = e;
				return r - t - n;
			}
			break;
	}
	return r;
}
function ka(e, t = "Assertion error") {
	if (!e) throw console.error(t), Error(t);
}
function Aa(e, t) {
	if (e === t) return !0;
	if (!!e != !!t || (ka(e !== void 0), ka(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
	for (let n in e) if (!Object.is(t[n], e[n])) return !1;
	return !0;
}
function ja({ cachedBounds: e, itemCount: t, itemSize: n }) {
	if (t === 0) return 0;
	if (typeof n == "number") return t * n;
	{
		let n = e.get(e.size === 0 ? 0 : e.size - 1);
		return ka(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
	}
}
function Ma({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
	if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
	let s = ja({
		cachedBounds: t,
		itemCount: r,
		itemSize: i
	}), c = t.get(n), l = Math.max(0, Math.min(s - o, c.scrollOffset)), u = Math.max(0, c.scrollOffset - o + c.size);
	switch (e === "smart" && (e = a >= u && a <= l ? "auto" : "center"), e) {
		case "start": return l;
		case "end": return u;
		case "center": return c.scrollOffset <= o / 2 ? 0 : c.scrollOffset + c.size / 2 >= s - o / 2 ? s - o : c.scrollOffset + c.size / 2 - o / 2;
		default: return a >= u && a <= l ? a : a < u ? u : l;
	}
}
function Na({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
	let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
	for (; u < a;) {
		let n = e.get(u);
		if (n.scrollOffset + n.size > t) break;
		u++;
	}
	for (o = u, c = Math.max(0, o - i); u < a;) {
		let r = e.get(u);
		if (r.scrollOffset + r.size >= t + n) break;
		u++;
	}
	return s = Math.min(a, u), l = Math.min(r - 1, s + i), o < 0 && (o = 0, s = -1, c = 0, l = -1), {
		startIndexVisible: o,
		stopIndexVisible: s,
		startIndexOverscan: c,
		stopIndexOverscan: l
	};
}
function Pa({ itemCount: e, itemProps: t, itemSize: n }) {
	let r = /* @__PURE__ */ new Map();
	return {
		get(i) {
			for (ka(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
				let e = r.size, a;
				switch (typeof n) {
					case "function":
						a = n(e, t);
						break;
					case "number": a = n;
				}
				if (e === 0) r.set(e, {
					size: a,
					scrollOffset: 0
				});
				else {
					let t = r.get(e - 1);
					ka(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
						scrollOffset: t.scrollOffset + t.size,
						size: a
					});
				}
			}
			let a = r.get(i);
			return ka(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
		},
		set(e, t) {
			r.set(e, t);
		},
		get size() {
			return r.size;
		}
	};
}
function Fa({ itemCount: e, itemProps: t, itemSize: n }) {
	return In(() => Pa({
		itemCount: e,
		itemProps: t,
		itemSize: n
	}), [
		e,
		t,
		n
	]);
}
function Ia({ containerSize: e, itemSize: t }) {
	let n;
	switch (typeof t) {
		case "string":
			ka(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), ka(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
			break;
		default: n = t;
	}
	return n;
}
function La({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
	let { height: u = n, width: d = n } = wa({
		defaultHeight: r === "vertical" ? n : void 0,
		defaultWidth: r === "horizontal" ? n : void 0,
		element: e,
		mode: r === "vertical" ? "only-height" : "only-width",
		style: t
	}), f = I({
		height: 0,
		width: 0
	}), p = r === "vertical" ? u : d, m = Ia({
		containerSize: p,
		itemSize: s
	});
	Fn(() => {
		if (typeof c == "function") {
			let e = f.current;
			(e.height !== u || e.width !== d) && (c({
				height: u,
				width: d
			}, { ...e }), e.height = u, e.width = d);
		}
	}, [
		u,
		c,
		d
	]);
	let h = Fa({
		itemCount: a,
		itemProps: o,
		itemSize: m
	}), g = jn((e) => h.get(e), [h]), [_, v] = L(() => Na({
		cachedBounds: h,
		containerScrollOffset: 0,
		containerSize: p,
		itemCount: a,
		overscanCount: l
	})), { startIndexVisible: y, startIndexOverscan: b, stopIndexVisible: x, stopIndexOverscan: S } = {
		startIndexVisible: Math.min(a - 1, _.startIndexVisible),
		startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
		stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
		stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
	}, C = jn(() => ja({
		cachedBounds: h,
		itemCount: a,
		itemSize: m
	}), [
		h,
		a,
		m
	]), w = jn((t) => {
		let n = Oa({
			containerElement: e,
			direction: r,
			isRtl: i,
			scrollOffset: t
		});
		return Na({
			cachedBounds: h,
			containerScrollOffset: n,
			containerSize: p,
			itemCount: a,
			overscanCount: l
		});
	}, [
		h,
		e,
		p,
		r,
		i,
		a,
		l
	]);
	return Sa(() => {
		let t = (r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
		v(w(t));
	}, [
		e,
		r,
		w
	]), Sa(() => {
		if (!e) return;
		let t = () => {
			v((t) => {
				let { scrollLeft: n, scrollTop: o } = e, s = Oa({
					containerElement: e,
					direction: r,
					isRtl: i,
					scrollOffset: r === "vertical" ? o : n
				}), c = Na({
					cachedBounds: h,
					containerScrollOffset: s,
					containerSize: p,
					itemCount: a,
					overscanCount: l
				});
				return Aa(c, t) ? t : c;
			});
		};
		return e.addEventListener("scroll", t), () => {
			e.removeEventListener("scroll", t);
		};
	}, [
		h,
		e,
		p,
		r,
		a,
		l
	]), {
		getCellBounds: g,
		getEstimatedSize: C,
		scrollToIndex: Ta(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
			let s = Ma({
				align: t,
				cachedBounds: h,
				containerScrollOffset: n,
				containerSize: p,
				index: o,
				itemCount: a,
				itemSize: m
			});
			if (e) {
				if (s = Oa({
					containerElement: e,
					direction: r,
					isRtl: i,
					scrollOffset: s
				}), typeof e.scrollTo != "function") {
					let e = w(s);
					Aa(_, e) || v(e);
				}
				return s;
			}
		}),
		startIndexOverscan: b,
		startIndexVisible: y,
		stopIndexOverscan: S,
		stopIndexVisible: x
	};
}
function Ra(e) {
	return In(() => e, Object.values(e));
}
function za(e, t) {
	let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
	return Aa(n, a) && Aa(r, o) && Aa(i, s);
}
function Ba({ cellComponent: e, cellProps: t, children: n, className: r, columnCount: i, columnWidth: a, defaultHeight: o = 0, defaultWidth: s = 0, dir: c, gridRef: l, onCellsRendered: u, onResize: d, overscanCount: f = 3, rowCount: p, rowHeight: m, style: h, tagName: g = "div", ..._ }) {
	let v = Ra(t), y = In(() => An(e, za), [e]), [b, x] = L(null), S = xa(b, c), { getCellBounds: C, getEstimatedSize: w, startIndexOverscan: T, startIndexVisible: E, scrollToIndex: D, stopIndexOverscan: ee, stopIndexVisible: te } = La({
		containerElement: b,
		containerStyle: h,
		defaultContainerSize: s,
		direction: "horizontal",
		isRtl: S,
		itemCount: i,
		itemProps: v,
		itemSize: a,
		onResize: d,
		overscanCount: f
	}), { getCellBounds: ne, getEstimatedSize: re, startIndexOverscan: ie, startIndexVisible: ae, scrollToIndex: oe, stopIndexOverscan: se, stopIndexVisible: ce } = La({
		containerElement: b,
		containerStyle: h,
		defaultContainerSize: o,
		direction: "vertical",
		itemCount: p,
		itemProps: v,
		itemSize: m,
		onResize: d,
		overscanCount: f
	});
	Pn(l, () => ({
		get element() {
			return b;
		},
		scrollToCell({ behavior: e = "auto", columnAlign: t = "auto", columnIndex: n, rowAlign: r = "auto", rowIndex: i }) {
			let a = D({
				align: t,
				containerScrollOffset: b?.scrollLeft ?? 0,
				index: n
			}), o = oe({
				align: r,
				containerScrollOffset: b?.scrollTop ?? 0,
				index: i
			});
			typeof b?.scrollTo == "function" && b.scrollTo({
				behavior: e,
				left: a,
				top: o
			});
		},
		scrollToColumn({ align: e = "auto", behavior: t = "auto", index: n }) {
			let r = D({
				align: e,
				containerScrollOffset: b?.scrollLeft ?? 0,
				index: n
			});
			typeof b?.scrollTo == "function" && b.scrollTo({
				behavior: t,
				left: r
			});
		},
		scrollToRow({ align: e = "auto", behavior: t = "auto", index: n }) {
			let r = oe({
				align: e,
				containerScrollOffset: b?.scrollTop ?? 0,
				index: n
			});
			typeof b?.scrollTo == "function" && b.scrollTo({
				behavior: t,
				top: r
			});
		}
	}), [
		b,
		D,
		oe
	]), F(() => {
		T >= 0 && ee >= 0 && ie >= 0 && se >= 0 && u && u({
			columnStartIndex: E,
			columnStopIndex: te,
			rowStartIndex: ae,
			rowStopIndex: ce
		}, {
			columnStartIndex: T,
			columnStopIndex: ee,
			rowStartIndex: ie,
			rowStopIndex: se
		});
	}, [
		u,
		T,
		E,
		ee,
		te,
		ie,
		ae,
		se,
		ce
	]);
	let O = In(() => {
		let e = [];
		if (i > 0 && p > 0) for (let t = ie; t <= se; t++) {
			let n = ne(t), r = [];
			for (let e = T; e <= ee; e++) {
				let i = C(e);
				r.push(/* @__PURE__ */ Tn(y, {
					...v,
					ariaAttributes: {
						"aria-colindex": e + 1,
						role: "gridcell"
					},
					columnIndex: e,
					key: e,
					rowIndex: t,
					style: {
						position: "absolute",
						left: S ? void 0 : 0,
						right: S ? 0 : void 0,
						transform: `translate(${S ? -i.scrollOffset : i.scrollOffset}px, ${n.scrollOffset}px)`,
						height: n.size,
						width: i.size
					}
				}));
			}
			e.push(/* @__PURE__ */ z("div", {
				role: "row",
				"aria-rowindex": t + 1,
				children: r
			}, t));
		}
		return e;
	}, [
		y,
		v,
		i,
		T,
		ee,
		C,
		ne,
		S,
		p,
		ie,
		se
	]), le = /* @__PURE__ */ z("div", {
		"aria-hidden": !0,
		style: {
			height: re(),
			width: w(),
			zIndex: -1
		}
	});
	return Tn(g, {
		"aria-colcount": i,
		"aria-rowcount": p,
		role: "grid",
		..._,
		className: r,
		dir: c,
		ref: x,
		style: {
			position: "relative",
			maxHeight: "100%",
			maxWidth: "100%",
			flexGrow: 1,
			overflow: "auto",
			...h
		}
	}, O, n, le);
}
function Va(e) {
	return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
}
var Ha = "data-react-window-index";
function Ua({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
	let m = Ra(u), h = In(() => An(s, za), [s]), [g, _] = L(null), v = Va(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = La({
		containerElement: g,
		containerStyle: f,
		defaultContainerSize: n,
		direction: "vertical",
		itemCount: c,
		itemProps: m,
		itemSize: In(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
		onResize: i,
		overscanCount: o
	});
	Pn(r, () => ({
		get element() {
			return g;
		},
		scrollToRow({ align: e = "auto", behavior: t = "auto", index: n }) {
			let r = x({
				align: e,
				containerScrollOffset: g?.scrollTop ?? 0,
				index: n
			});
			typeof g?.scrollTo == "function" && g.scrollTo({
				behavior: t,
				top: r
			});
		}
	}), [g, x]), Sa(() => {
		if (!g) return;
		let e = Array.from(g.children).filter((e, t) => {
			if (e.hasAttribute("aria-hidden")) return !1;
			let n = `${S + t}`;
			return e.setAttribute(Ha, n), !0;
		});
		if (v) return l.observeRowElements(e);
	}, [
		g,
		v,
		l,
		S,
		w
	]), F(() => {
		S >= 0 && w >= 0 && a && a({
			startIndex: C,
			stopIndex: T
		}, {
			startIndex: S,
			stopIndex: w
		});
	}, [
		a,
		S,
		C,
		w,
		T
	]);
	let E = In(() => {
		let e = [];
		if (c > 0) for (let t = S; t <= w; t++) {
			let n = y(t);
			e.push(/* @__PURE__ */ Tn(h, {
				...m,
				ariaAttributes: {
					"aria-posinset": t + 1,
					"aria-setsize": c,
					role: "listitem"
				},
				key: t,
				index: t,
				style: {
					position: "absolute",
					left: 0,
					transform: `translateY(${n.scrollOffset}px)`,
					height: v ? void 0 : n.size,
					width: "100%"
				}
			}));
		}
		return e;
	}, [
		h,
		y,
		v,
		c,
		m,
		S,
		w
	]), D = /* @__PURE__ */ z("div", {
		"aria-hidden": !0,
		style: {
			height: b(),
			width: "100%",
			zIndex: -1
		}
	});
	return Tn(d, {
		role: "list",
		...p,
		className: t,
		ref: _,
		style: {
			position: "relative",
			maxHeight: "100%",
			flexGrow: 1,
			overflowY: "auto",
			...f
		}
	}, E, e, D);
}
//#endregion
//#region src/hooks/useCanvasWorldService.js
function Wa() {
	let e = l(fe);
	return { get: (t) => t && new Vt(t.map(e)) };
}
//#endregion
//#region src/components/ThumbnailCanvasGrouping.jsx
var G = /* @__PURE__ */ p(on(), 1), Ga = H("div")(({ theme: e }) => ({
	boxSizing: "border-box",
	color: e.palette.common.white,
	cursor: "pointer",
	display: "inline-block",
	whiteSpace: "nowrap"
})), Ka = class extends xn {
	constructor(e) {
		super(e), this.setCanvas = this.setCanvas.bind(this);
	}
	setCanvas(e) {
		let { setCanvas: t } = this.props;
		t(e.currentTarget.dataset.canvasId);
	}
	currentCanvasClass(e) {
		let { index: t } = this.props;
		return e.includes(t) ? "current-canvas-grouping" : "";
	}
	render() {
		let { index: e, columnIndex: t, style: n, canvasGroupings: r, position: i, currentCanvasId: a, showThumbnailLabels: o } = this.props, s = t === void 0 ? e : t, c = r[s], l = c.map((e) => e.id).includes(a);
		return /* @__PURE__ */ z("div", {
			style: {
				...n,
				boxSizing: "border-box",
				height: Number.isInteger(n.height) ? n.height - 12 : null,
				left: Number.isInteger(n.left) ? n.left + 6 : null,
				padding: 6,
				top: Number.isInteger(n.top) ? n.top + 6 : null,
				width: Number.isInteger(n.width) ? n.width - 12 : null
			},
			className: j("thumbnail-nav-container"),
			role: "gridcell",
			"aria-selected": l,
			"aria-colindex": s + 1,
			children: /* @__PURE__ */ z(Ga, {
				role: "button",
				"data-canvas-id": c[0].id,
				"data-canvas-index": c[0].index,
				onClick: this.setCanvas,
				tabIndex: -1,
				sx: (e) => ({
					"&:not(:hover)": {
						outline: l ? `2px solid ${e.palette.primary.main}` : 0,
						...l && { outlineOffset: "3px" }
					},
					"&:hover": {
						outline: l ? `2px solid ${e.palette.primary.main}` : `2px solid ${e.palette.action.hover}`,
						outlineOffset: l ? "3px" : "-2px"
					},
					height: i === "far-right" ? "auto" : `${n.height}px`,
					width: i === "far-bottom" ? "auto" : `${n.width}px`
				}),
				className: (0, G.default)(j([
					"thumbnail-nav-canvas",
					`thumbnail-nav-canvas-${s}`,
					this.currentCanvasClass(c.map((e) => e.index))
				])),
				children: c.map((e, t) => /* @__PURE__ */ z(fn, {
					resource: e,
					labelled: o,
					maxHeight: i === "far-right" ? n.height - 12 : n.height,
					variant: "inside"
				}, e.id))
			})
		});
	}
};
Ka.propTypes = {
	canvasGroupings: W.default.array.isRequired,
	columnIndex: W.default.number,
	currentCanvasId: W.default.string.isRequired,
	index: W.default.number,
	position: W.default.string.isRequired,
	setCanvas: W.default.func.isRequired,
	showThumbnailLabels: W.default.bool.isRequired,
	style: W.default.object.isRequired
}, Ka.defaultProps = {
	columnIndex: void 0,
	index: void 0
};
var qa = n(w((e, { windowId: t }) => ({
	currentCanvasId: (Ve(e, { windowId: t }) || {}).id,
	showThumbnailLabels: nt(e).thumbnailNavigation.showThumbnailLabels
}), (e, { windowId: t }) => ({ setCanvas: (...n) => e(an(t, ...n)) })), m("ThumbnailCanvasGrouping"))(Ka);
//#endregion
//#region src/components/ThumbnailNavigation.jsx
function Ja({ canvasGroupings: e, canvasIndex: t, hasNextCanvas: n = !1, hasPreviousCanvas: r = !1, position: i, setNextCanvas: a = () => {}, setPreviousCanvas: o = () => {}, thumbnailNavigation: s, view: c = void 0, viewingDirection: l = "", windowId: u }) {
	let { t: d } = V(), f = I(), p = I(c), m = Wa();
	F(() => {
		p.current !== c && i !== "off" && (p.current = c);
	}, [c, i]), F(() => {
		let n = t;
		c === "book" && (n = Math.ceil(n / 2)), f.current && n >= 0 && n < e.length && (i === "far-bottom" ? f.current.scrollToCell({
			columnIndex: n,
			rowIndex: 0,
			columnAlign: "center",
			rowAlign: "center"
		}) : f.current.scrollToRow({
			index: n,
			align: "center"
		}));
	}, [
		t,
		c,
		e.length,
		i
	]);
	let h = I(null);
	F(() => {
		h.current && document.activeElement !== h.current && h.current.focus();
	}, [t]);
	let g = (e) => {
		let t = "ArrowRight", n = "ArrowLeft";
		switch (i === "far-right" && (t = "ArrowDown", n = "ArrowUp"), e.key) {
			case t:
				b();
				break;
			case n: x();
		}
	}, _ = (t) => {
		let n = e[t];
		if (!n) return s.width + 12;
		let r = m.get(n).worldBounds(), i = s.height - 12 - 6, a = Math.ceil(i * r[2] / r[3]);
		return Number.isInteger(a) ? a + 12 : s.width + 12;
	}, v = (t) => {
		let n = e[t];
		if (!n) return s.height + 12;
		let r = m.get(n).worldBounds(), i = s.width - 12 - 6, a = Math.ceil(i * n.length * r[3] / r[2]);
		return Number.isInteger(a) ? a + 12 : s.height + 12;
	}, y = jn(() => {
		let e = c === "book" ? s.width * 2 : s.width;
		switch (i) {
			case "far-right": return { width: `${e}px` };
			default: return { width: "100%" };
		}
	}, [
		i,
		s,
		c
	]), b = () => {
		n && a();
	}, x = () => {
		r && o();
	};
	if (i === "off") return null;
	let S = l === "right-to-left" ? "rtl" : "ltr", C = {
		canvasGroupings: e,
		position: i,
		windowId: u
	};
	return /* @__PURE__ */ B(Ln, {
		className: (0, G.default)(j("thumb-navigation")),
		sx: {
			"&:focus": {
				boxShadow: 0,
				outline: 0
			},
			scrollbarGutter: "stable"
		},
		"aria-label": d("thumbnailNavigation"),
		square: !0,
		elevation: 0,
		style: y(),
		tabIndex: 0,
		onKeyDown: g,
		ref: h,
		children: [e.length > 0 && i === "far-bottom" && /* @__PURE__ */ z(Ba, {
			columnCount: e.length,
			columnWidth: _,
			rowCount: 1,
			rowHeight: s.height - 12 - 6,
			style: {
				direction: S === "rtl" ? "rtl" : "ltr",
				height: s.height
			},
			cellProps: C,
			gridRef: f,
			cellComponent: qa
		}), e.length > 0 && i === "far-right" && /* @__PURE__ */ z(Ua, {
			defaultHeight: 100,
			rowCount: e.length,
			rowHeight: v,
			style: {
				paddingBottom: 12,
				direction: S === "rtl" ? "rtl" : "ltr"
			},
			rowProps: C,
			listRef: f,
			rowComponent: qa
		})]
	});
}
Ja.propTypes = {
	canvasGroupings: W.default.array.isRequired,
	canvasIndex: W.default.number.isRequired,
	hasNextCanvas: W.default.bool,
	hasPreviousCanvas: W.default.bool,
	position: W.default.string.isRequired,
	setNextCanvas: W.default.func,
	setPreviousCanvas: W.default.func,
	thumbnailNavigation: W.default.object.isRequired,
	view: W.default.string,
	viewingDirection: W.default.string,
	windowId: W.default.string.isRequired
};
var Ya = n(w((e, { windowId: t }) => ({
	canvasGroupings: Ye(e, { windowId: t }),
	canvasIndex: ge(e, { windowId: t }),
	hasNextCanvas: !!et(e, { windowId: t }),
	hasPreviousCanvas: !!pt(e, { windowId: t }),
	position: se(e, { companionWindowId: s(e, { windowId: t }).thumbnailNavigationId }).position,
	thumbnailNavigation: nt(e).thumbnailNavigation,
	view: Ee(e, { windowId: t }),
	viewingDirection: de(e, { windowId: t })
}), (e, { windowId: t }) => ({
	setNextCanvas: (...n) => e(nn(t)),
	setPreviousCanvas: (...n) => e(rn(t))
})), m("ThumbnailNavigation"))(Ja), Xa = M(/*#__PURE__*/ z("path", { d: "M12 4C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 12.5c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3" }), "VisibilitySharp"), Za = M(/*#__PURE__*/ z("path", { d: "M12 6.5c2.76 0 5 2.24 5 5 0 .51-.1 1-.24 1.46l3.06 3.06c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l2.17 2.17c.47-.14.96-.24 1.47-.24M3.42 2.45 2.01 3.87l2.68 2.68C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.97-.3 4.31-.82l3.43 3.43 1.41-1.41zM12 16.5c-2.76 0-5-2.24-5-5 0-.77.18-1.5.49-2.14l1.57 1.57c-.03.18-.06.37-.06.57 0 1.66 1.34 3 3 3 .2 0 .38-.03.57-.07L14.14 16c-.65.32-1.37.5-2.14.5m2.97-5.33c-.15-1.4-1.25-2.49-2.64-2.64z" }), "VisibilityOffSharp");
//#endregion
//#region src/components/AnnotationSettings.jsx
function Qa({ displayAll: e, displayAllDisabled: t, toggleAnnotationDisplay: n }) {
	let { t: r } = V();
	return /* @__PURE__ */ z(mn, {
		"aria-label": r(e ? "displayNoAnnotations" : "highlightAllAnnotations"),
		onClick: n,
		disabled: t,
		size: "small",
		children: z(e ? Xa : Za, {})
	});
}
Qa.propTypes = {
	displayAll: W.default.bool.isRequired,
	displayAllDisabled: W.default.bool.isRequired,
	toggleAnnotationDisplay: W.default.func.isRequired,
	windowId: W.default.string.isRequired
};
var $a = n(w((e, { windowId: t }) => ({
	displayAll: s(e, { windowId: t }).highlightAllAnnotations,
	displayAllDisabled: Nt(e, { windowId: t }).length < 1
}), (e, { windowId: t }) => ({ toggleAnnotationDisplay: () => {
	e(Ot(t));
} })), m("AnnotationSettings"))(Qa);
//#endregion
//#region node_modules/dompurify/dist/purify.es.mjs
function eo(e, t) {
	(t == null || t > e.length) && (t = e.length);
	for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
	return r;
}
function to(e) {
	if (Array.isArray(e)) return e;
}
function no(e, t) {
	var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
	if (n != null) {
		var r, i, a, o, s = [], c = !0, l = !1;
		try {
			if (a = (n = n.call(e)).next, t !== 0) for (; !(c = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); c = !0);
		} catch (e) {
			l = !0, i = e;
		} finally {
			try {
				if (!c && n.return != null && (o = n.return(), Object(o) !== o)) return;
			} finally {
				if (l) throw i;
			}
		}
		return s;
	}
}
function ro() {
	throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function io(e, t) {
	return to(e) || no(e, t) || ao(e, t) || ro();
}
function ao(e, t) {
	if (e) {
		if (typeof e == "string") return eo(e, t);
		var n = {}.toString.call(e).slice(8, -1);
		return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? eo(e, t) : void 0;
	}
}
var oo = Object.entries, so = Object.setPrototypeOf, co = Object.isFrozen, lo = Object.getPrototypeOf, uo = Object.getOwnPropertyDescriptor, fo = Object.freeze, po = Object.seal, mo = Object.create, ho = typeof Reflect < "u" && Reflect, go = ho.apply, _o = ho.construct;
fo ||= function(e) {
	return e;
}, po ||= function(e) {
	return e;
}, go ||= function(e, t) {
	var n = [...arguments].slice(2);
	return e.apply(t, n);
}, _o ||= function(e) {
	return new e(...[...arguments].slice(1));
};
var vo = Ro(Array.prototype.forEach), yo = Ro(Array.prototype.lastIndexOf), bo = Ro(Array.prototype.pop), xo = Ro(Array.prototype.push), So = Ro(Array.prototype.splice), Co = Array.isArray, wo = Ro(String.prototype.toLowerCase), To = Ro(String.prototype.toString), Eo = Ro(String.prototype.match), Do = Ro(String.prototype.replace), Oo = Ro(String.prototype.indexOf), ko = Ro(String.prototype.trim), Ao = Ro(Number.prototype.toString), jo = Ro(Boolean.prototype.toString), Mo = typeof BigInt > "u" ? null : Ro(BigInt.prototype.toString), No = typeof Symbol > "u" ? null : Ro(Symbol.prototype.toString), Po = Ro(Object.prototype.hasOwnProperty), Fo = Ro(Object.prototype.toString), Io = Ro(RegExp.prototype.test), Lo = zo(TypeError);
function Ro(e) {
	return function(t) {
		t instanceof RegExp && (t.lastIndex = 0);
		var n = [...arguments].slice(1);
		return go(e, t, n);
	};
}
function zo(e) {
	return function() {
		return _o(e, [...arguments]);
	};
}
function K(e, t) {
	let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : wo;
	if (so && so(e, null), !Co(t)) return e;
	let r = t.length;
	for (; r--;) {
		let i = t[r];
		if (typeof i == "string") {
			let e = n(i);
			e !== i && (co(t) || (t[r] = e), i = e);
		}
		e[i] = !0;
	}
	return e;
}
function Bo(e) {
	for (let t = 0; t < e.length; t++) Po(e, t) || (e[t] = null);
	return e;
}
function Vo(e) {
	let t = mo(null);
	for (let r of oo(e)) {
		var n = io(r, 2);
		let i = n[0], a = n[1];
		Po(e, i) && (t[i] = Co(a) ? Bo(a) : a && typeof a == "object" && a.constructor === Object ? Vo(a) : a);
	}
	return t;
}
function Ho(e) {
	switch (typeof e) {
		case "string": return e;
		case "number": return Ao(e);
		case "boolean": return jo(e);
		case "bigint": return Mo ? Mo(e) : "0";
		case "symbol": return No ? No(e) : "Symbol()";
		case "undefined": return Fo(e);
		case "function":
		case "object": {
			if (e === null) return Fo(e);
			let t = e, n = Uo(t, "toString");
			if (typeof n == "function") {
				let e = n(t);
				return typeof e == "string" ? e : Fo(e);
			}
			return Fo(e);
		}
		default: return Fo(e);
	}
}
function Uo(e, t) {
	for (; e !== null;) {
		let n = uo(e, t);
		if (n) {
			if (n.get) return Ro(n.get);
			if (typeof n.value == "function") return Ro(n.value);
		}
		e = lo(e);
	}
	function n() {
		return null;
	}
	return n;
}
function Wo(e) {
	try {
		return Io(e, ""), !0;
	} catch {
		return !1;
	}
}
var Go = fo(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), Ko = fo(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), qo = fo([
	"feBlend",
	"feColorMatrix",
	"feComponentTransfer",
	"feComposite",
	"feConvolveMatrix",
	"feDiffuseLighting",
	"feDisplacementMap",
	"feDistantLight",
	"feDropShadow",
	"feFlood",
	"feFuncA",
	"feFuncB",
	"feFuncG",
	"feFuncR",
	"feGaussianBlur",
	"feImage",
	"feMerge",
	"feMergeNode",
	"feMorphology",
	"feOffset",
	"fePointLight",
	"feSpecularLighting",
	"feSpotLight",
	"feTile",
	"feTurbulence"
]), Jo = fo([
	"animate",
	"color-profile",
	"cursor",
	"discard",
	"font-face",
	"font-face-format",
	"font-face-name",
	"font-face-src",
	"font-face-uri",
	"foreignobject",
	"hatch",
	"hatchpath",
	"mesh",
	"meshgradient",
	"meshpatch",
	"meshrow",
	"missing-glyph",
	"script",
	"set",
	"solidcolor",
	"unknown",
	"use"
]), Yo = fo(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Xo = fo([
	"maction",
	"maligngroup",
	"malignmark",
	"mlongdiv",
	"mscarries",
	"mscarry",
	"msgroup",
	"mstack",
	"msline",
	"msrow",
	"semantics",
	"annotation",
	"annotation-xml",
	"mprescripts",
	"none"
]), Zo = fo(["#text"]), Qo = fo(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), $o = fo(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), es = fo(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), ts = fo([
	"xlink:href",
	"xml:id",
	"xlink:title",
	"xml:space",
	"xmlns:xlink"
]), ns = po(/{{[\w\W]*|^[\w\W]*}}/g), rs = po(/<%[\w\W]*|^[\w\W]*%>/g), is = po(/\${[\w\W]*/g), as = po(/^data-[\-\w.\u00B7-\uFFFF]+$/), os = po(/^aria-[\-\w]+$/), ss = po(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), cs = po(/^(?:\w+script|data):/i), ls = po(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), us = po(/^html$/i), ds = po(/^[a-z][.\w]*(-[.\w]+)+$/i), fs = po(/<[/\w!]/g), ps = po(/<[/\w]/g), ms = po(/<\/no(script|embed|frames)/i), hs = po(/\/>/i), gs = {
	element: 1,
	attribute: 2,
	text: 3,
	cdataSection: 4,
	entityReference: 5,
	entityNode: 6,
	processingInstruction: 7,
	comment: 8,
	document: 9,
	documentType: 10,
	documentFragment: 11,
	notation: 12
}, _s = function() {
	return typeof window > "u" ? null : window;
}, vs = function(e, t) {
	if (typeof e != "object" || typeof e.createPolicy != "function") return null;
	let n = null, r = "data-tt-policy-suffix";
	t && t.hasAttribute(r) && (n = t.getAttribute(r));
	let i = "dompurify" + (n ? "#" + n : "");
	try {
		return e.createPolicy(i, {
			createHTML(e) {
				return e;
			},
			createScriptURL(e) {
				return e;
			}
		});
	} catch {
		return console.warn("TrustedTypes policy " + i + " could not be created."), null;
	}
}, ys = function() {
	return {
		afterSanitizeAttributes: [],
		afterSanitizeElements: [],
		afterSanitizeShadowDOM: [],
		beforeSanitizeAttributes: [],
		beforeSanitizeElements: [],
		beforeSanitizeShadowDOM: [],
		uponSanitizeAttribute: [],
		uponSanitizeElement: [],
		uponSanitizeShadowNode: []
	};
}, bs = function(e, t, n, r) {
	return Po(e, t) && Co(e[t]) ? K(r.base ? Vo(r.base) : {}, e[t], r.transform) : n;
};
function xs() {
	let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _s(), t = (e) => xs(e);
	if (t.version = "3.4.13", t.removed = [], !e || !e.document || e.document.nodeType !== gs.document || !e.Element) return t.isSupported = !1, t;
	let n = e.document, r = n, i = r.currentScript;
	e.DocumentFragment;
	let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
	e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
	let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Uo(d, "cloneNode"), p = Uo(d, "remove"), m = Uo(d, "nextSibling"), h = Uo(d, "childNodes"), g = Uo(d, "parentNode"), _ = Uo(d, "shadowRoot"), v = Uo(d, "attributes"), y = o && o.prototype ? Uo(o.prototype, "nodeType") : null, b = o && o.prototype ? Uo(o.prototype, "nodeName") : null, x = o && o.prototype ? Uo(o.prototype, "ownerDocument") : null;
	if (typeof a == "function") {
		let e = n.createElement("template");
		e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
	}
	let S, C = "", w, T = !1, E = 0, D = function() {
		if (E > 0) throw Lo("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
	}, ee = function(e) {
		D(), E++;
		try {
			return S.createHTML(e);
		} finally {
			E--;
		}
	}, te = function(e) {
		D(), E++;
		try {
			return S.createScriptURL(e);
		} finally {
			E--;
		}
	}, ne = function() {
		return T ||= (w = vs(u, i), !0), w;
	}, re = n, ie = re.implementation, ae = re.createNodeIterator, oe = re.createDocumentFragment, se = re.getElementsByTagName, ce = r.importNode, O = ys();
	t.isSupported = typeof oo == "function" && typeof g == "function" && ie && ie.createHTMLDocument !== void 0;
	let le = ns, ue = rs, de = is, fe = as, pe = os, me = cs, he = ls, ge = ds, _e = ss, ve = null, ye = K({}, [
		...Go,
		...Ko,
		...qo,
		...Yo,
		...Zo
	]), k = null, be = K({}, [
		...Qo,
		...$o,
		...es,
		...ts
	]), xe = Object.seal(mo(null, {
		tagNameCheck: {
			writable: !0,
			configurable: !1,
			enumerable: !0,
			value: null
		},
		attributeNameCheck: {
			writable: !0,
			configurable: !1,
			enumerable: !0,
			value: null
		},
		allowCustomizedBuiltInElements: {
			writable: !0,
			configurable: !1,
			enumerable: !0,
			value: !1
		}
	})), Se = null, Ce = null, we = Object.seal(mo(null, {
		tagCheck: {
			writable: !0,
			configurable: !1,
			enumerable: !0,
			value: null
		},
		attributeCheck: {
			writable: !0,
			configurable: !1,
			enumerable: !0,
			value: null
		}
	})), Te = !0, Ee = !0, De = !1, Oe = !0, ke = !1, Ae = !0, je = !1, Me = !1, Ne = null, Pe = null, Fe = !1, Ie = !1, Le = !1, Re = !1, ze = !0, Be = !1, Ve = "user-content-", He = !0, Ue = !1, We = {}, Ge = null, Ke = K({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), qe = null, Je = K({}, [
		"audio",
		"video",
		"img",
		"source",
		"image",
		"track"
	]), Ye = null, Xe = K({}, [
		"alt",
		"class",
		"for",
		"id",
		"label",
		"name",
		"pattern",
		"placeholder",
		"role",
		"summary",
		"title",
		"value",
		"style",
		"xmlns"
	]), Ze = "http://www.w3.org/1998/Math/MathML", Qe = "http://www.w3.org/2000/svg", $e = "http://www.w3.org/1999/xhtml", et = $e, tt = !1, nt = null, rt = K({}, [
		Ze,
		Qe,
		$e
	], To), it = fo([
		"mi",
		"mo",
		"mn",
		"ms",
		"mtext"
	]), at = K({}, it), ot = fo(["annotation-xml"]), st = K({}, ot), ct = K({}, [
		"title",
		"style",
		"font",
		"a",
		"script"
	]), lt = null, ut = ["application/xhtml+xml", "text/html"], dt = null, ft = null, pt = n.createElement("form"), mt = function(e) {
		return e instanceof RegExp || e instanceof Function;
	}, ht = function() {
		let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
		if (ft && ft === e) return;
		(!e || typeof e != "object") && (e = {}), e = Vo(e), lt = ut.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, dt = lt === "application/xhtml+xml" ? To : wo, ve = bs(e, "ALLOWED_TAGS", ye, { transform: dt }), k = bs(e, "ALLOWED_ATTR", be, { transform: dt }), nt = bs(e, "ALLOWED_NAMESPACES", rt, { transform: To }), Ye = bs(e, "ADD_URI_SAFE_ATTR", Xe, {
			transform: dt,
			base: Xe
		}), qe = bs(e, "ADD_DATA_URI_TAGS", Je, {
			transform: dt,
			base: Je
		}), Ge = bs(e, "FORBID_CONTENTS", Ke, { transform: dt }), Se = bs(e, "FORBID_TAGS", Vo({}), { transform: dt }), Ce = bs(e, "FORBID_ATTR", Vo({}), { transform: dt }), We = Po(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Vo(e.USE_PROFILES) : e.USE_PROFILES : !1, Te = e.ALLOW_ARIA_ATTR !== !1, Ee = e.ALLOW_DATA_ATTR !== !1, De = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Oe = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ke = e.SAFE_FOR_TEMPLATES || !1, Ae = e.SAFE_FOR_XML !== !1, je = e.WHOLE_DOCUMENT || !1, Ie = e.RETURN_DOM || !1, Le = e.RETURN_DOM_FRAGMENT || !1, Re = e.RETURN_TRUSTED_TYPE || !1, Fe = e.FORCE_BODY || !1, ze = e.SANITIZE_DOM !== !1, Be = e.SANITIZE_NAMED_PROPS || !1, He = e.KEEP_CONTENT !== !1, Ue = e.IN_PLACE || !1, _e = Wo(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : ss, et = typeof e.NAMESPACE == "string" ? e.NAMESPACE : $e, at = Po(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Vo(e.MATHML_TEXT_INTEGRATION_POINTS) : K({}, it), st = Po(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? Vo(e.HTML_INTEGRATION_POINTS) : K({}, ot);
		let t = Po(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? Vo(e.CUSTOM_ELEMENT_HANDLING) : mo(null);
		if (xe = mo(null), Po(t, "tagNameCheck") && mt(t.tagNameCheck) && (xe.tagNameCheck = t.tagNameCheck), Po(t, "attributeNameCheck") && mt(t.attributeNameCheck) && (xe.attributeNameCheck = t.attributeNameCheck), Po(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (xe.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), po(xe), ke && (Ee = !1), Le && (Ie = !0), We && (ve = K({}, Zo), k = mo(null), We.html === !0 && (K(ve, Go), K(k, Qo)), We.svg === !0 && (K(ve, Ko), K(k, $o), K(k, ts)), We.svgFilters === !0 && (K(ve, qo), K(k, $o), K(k, ts)), We.mathMl === !0 && (K(ve, Yo), K(k, es), K(k, ts))), we.tagCheck = null, we.attributeCheck = null, Po(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? we.tagCheck = e.ADD_TAGS : Co(e.ADD_TAGS) && (ve === ye && (ve = Vo(ve)), K(ve, e.ADD_TAGS, dt))), Po(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? we.attributeCheck = e.ADD_ATTR : Co(e.ADD_ATTR) && (k === be && (k = Vo(k)), K(k, e.ADD_ATTR, dt))), Po(e, "ADD_URI_SAFE_ATTR") && Co(e.ADD_URI_SAFE_ATTR) && K(Ye, e.ADD_URI_SAFE_ATTR, dt), Po(e, "FORBID_CONTENTS") && Co(e.FORBID_CONTENTS) && (Ge === Ke && (Ge = Vo(Ge)), K(Ge, e.FORBID_CONTENTS, dt)), Po(e, "ADD_FORBID_CONTENTS") && Co(e.ADD_FORBID_CONTENTS) && (Ge === Ke && (Ge = Vo(Ge)), K(Ge, e.ADD_FORBID_CONTENTS, dt)), He && (ve["#text"] = !0), je && K(ve, [
			"html",
			"head",
			"body"
		]), ve.table && (K(ve, ["tbody"]), delete Se.tbody), e.TRUSTED_TYPES_POLICY) {
			if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Lo("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
			if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Lo("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
			let t = S;
			S = e.TRUSTED_TYPES_POLICY;
			try {
				C = ee("");
			} catch (e) {
				throw S = t, e;
			}
		} else e.TRUSTED_TYPES_POLICY === null ? (S = void 0, C = "") : (S === void 0 && (S = ne()), S && typeof C == "string" && (C = ee("")));
		fo && fo(e), ft = e;
	}, gt = K({}, [
		...Ko,
		...qo,
		...Jo
	]), _t = K({}, [...Yo, ...Xo]), vt = function(e, t, n) {
		return t.namespaceURI === $e ? e === "svg" : t.namespaceURI === Ze ? e === "svg" && (n === "annotation-xml" || at[n]) : !!gt[e];
	}, yt = function(e, t, n) {
		return t.namespaceURI === $e ? e === "math" : t.namespaceURI === Qe ? e === "math" && st[n] : !!_t[e];
	}, A = function(e, t, n) {
		return t.namespaceURI === Qe && !st[n] || t.namespaceURI === Ze && !at[n] ? !1 : !_t[e] && (ct[e] || !gt[e]);
	}, bt = function(e) {
		let t = g(e);
		(!t || !t.tagName) && (t = {
			namespaceURI: et,
			tagName: "template"
		});
		let n = wo(e.tagName), r = wo(t.tagName);
		return nt[e.namespaceURI] ? e.namespaceURI === Qe ? vt(n, t, r) : e.namespaceURI === Ze ? yt(n, t, r) : e.namespaceURI === $e ? A(n, t, r) : !!(lt === "application/xhtml+xml" && nt[e.namespaceURI]) : !1;
	}, xt = function(e) {
		xo(t.removed, { element: e });
		try {
			g(e).removeChild(e);
		} catch {
			if (p(e), !g(e)) throw Lo("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
		}
	}, St = function(e) {
		Tt(e);
		let t = h(e);
		if (t) {
			let e = [];
			vo(t, (t) => {
				xo(e, t);
			}), vo(e, (e) => {
				try {
					p(e);
				} catch {}
			});
		}
		let n = v(e);
		if (n) for (let t = n.length - 1; t >= 0; --t) {
			let r = n[t], i = r && r.name;
			if (typeof i == "string") try {
				e.removeAttribute(i);
			} catch {}
		}
	}, Ct = function(e, n) {
		try {
			xo(t.removed, {
				attribute: n.getAttributeNode(e),
				from: n
			});
		} catch {
			xo(t.removed, {
				attribute: null,
				from: n
			});
		}
		if (n.removeAttribute(e), e === "is") {
			if (Ie || Le) try {
				xt(n);
			} catch {}
			else try {
				n.setAttribute(e, "");
			} catch {}
		}
	}, wt = function(e) {
		let t = v(e);
		if (t) for (let n = t.length - 1; n >= 0; --n) {
			let r = t[n], i = r && r.name;
			if (!(typeof i != "string" || k[dt(i)])) try {
				e.removeAttribute(i);
			} catch {}
		}
	}, Tt = function(e) {
		let t = [e];
		for (; t.length > 0;) {
			let e = t.pop();
			(y ? y(e) : e.nodeType) === gs.element && wt(e);
			let n = h(e);
			if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
		}
	}, Et = function(e) {
		if (!Ae) return;
		let t = [e];
		for (; t.length > 0;) {
			let e = t.pop(), n = y ? y(e) : e.nodeType;
			if (n === gs.processingInstruction || n === gs.comment && Io(ps, e.data)) {
				try {
					p(e);
				} catch {}
				continue;
			}
			if (n === gs.element) {
				let t = e, n = dt(b ? b(e) : e.nodeName);
				try {
					t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && n !== "label" && n !== "output" && t.removeAttribute("for");
				} catch {}
			}
			let r = h(e);
			if (r) for (let e = r.length - 1; e >= 0; --e) t.push(r[e]);
		}
	}, Dt = function(e) {
		let t = null, r = null;
		if (Fe) e = "<remove></remove>" + e;
		else {
			let t = Eo(e, /^[\r\n\t ]+/);
			r = t && t[0];
		}
		lt === "application/xhtml+xml" && et === $e && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
		let i = S ? ee(e) : e;
		if (et === $e) try {
			t = new l().parseFromString(i, lt);
		} catch {}
		if (!t || !t.documentElement) {
			t = ie.createDocument(et, "template", null);
			try {
				t.documentElement.innerHTML = tt ? C : i;
			} catch {}
		}
		let a = t.body || t.documentElement;
		return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), et === $e ? se.call(t, je ? "html" : "body")[0] : je ? t.documentElement : a;
	}, Ot = function(e) {
		let t = x ? x(e) : e.ownerDocument;
		return ae.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
	}, kt = function(e) {
		return e = Do(e, le, " "), e = Do(e, ue, " "), e = Do(e, de, " "), e;
	}, At = function(e) {
		e.normalize();
		let t = x ? x(e) : e.ownerDocument, n = ae.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
		for (; r;) r.data = kt(r.data), r = n.nextNode();
		let i = e.querySelectorAll?.call(e, "template");
		i && vo(i, (e) => {
			Mt(e.content) && At(e.content);
		});
	}, jt = function(e) {
		let t = b ? b(e) : null;
		return typeof t != "string" || dt(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== v(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== y(e) || e.childNodes !== h(e);
	}, Mt = function(e) {
		if (!y || typeof e != "object" || !e) return !1;
		try {
			return y(e) === gs.documentFragment;
		} catch {
			return !1;
		}
	}, Nt = function(e) {
		if (!y || typeof e != "object" || !e) return !1;
		try {
			return typeof y(e) == "number";
		} catch {
			return !1;
		}
	};
	function Pt(e, n, r) {
		e.length !== 0 && vo(e, (e) => {
			e.call(t, n, r, ft);
		});
	}
	let Ft = function(e, t) {
		return !!(Ae && e.hasChildNodes() && !Nt(e.firstElementChild) && Io(fs, e.textContent) && Io(fs, e.innerHTML) || Ae && e.namespaceURI === $e && t === "style" && Nt(e.firstElementChild) || e.nodeType === gs.processingInstruction || Ae && e.nodeType === gs.comment && Io(ps, e.data));
	}, It = function(e, t, n) {
		if (!Se[t] && Vt(t) && (xe.tagNameCheck instanceof RegExp && Io(xe.tagNameCheck, t) || xe.tagNameCheck instanceof Function && xe.tagNameCheck(t))) return !1;
		if (He && !Ge[t]) {
			let t = g(e), r = h(e);
			if (r && t) {
				let i = r.length;
				for (let a = i - 1; a >= 0; --a) {
					let i = e === n ? f(r[a], !0) : r[a];
					t.insertBefore(i, m(e));
				}
			}
		}
		return xt(e), !0;
	}, Lt = function(e, t, n, r) {
		return e.length === 0 ? t : t === n || t === r ? Vo(t) : t;
	}, Rt = function(e, n) {
		if (Pt(O.beforeSanitizeElements, e, null), e !== n && g(e) === null) return Ue && Tt(e), !0;
		if (jt(e)) return xt(e), !0;
		let r = dt(b ? b(e) : e.nodeName);
		if (ve = Lt(O.uponSanitizeElement, ve, ye, Ne), Pt(O.uponSanitizeElement, e, {
			tagName: r,
			allowedTags: ve
		}), e !== n && g(e) === null) return Ue && Tt(e), !0;
		if (Ft(e, r)) return xt(e), !0;
		if (Se[r] || !(we.tagCheck instanceof Function && we.tagCheck(r)) && !ve[r]) {
			let t = It(e, r, n);
			return t === !1 && Pt(O.afterSanitizeElements, e, null), t;
		}
		if ((y ? y(e) : e.nodeType) === gs.element && !bt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && Io(ms, e.innerHTML)) return xt(e), !0;
		if (ke && e.nodeType === gs.text) {
			let n = kt(e.textContent);
			e.textContent !== n && (xo(t.removed, { element: e.cloneNode() }), e.textContent = n);
		}
		return Pt(O.afterSanitizeElements, e, null), !1;
	}, zt = function(e, t, r) {
		if (Ce[t] || Ae && t === "patchsrc" || Ae && t === "for" && e !== "label" && e !== "output" || ze && (t === "id" || t === "name") && (r in n || r in pt)) return !1;
		let i = k[t] || we.attributeCheck instanceof Function && we.attributeCheck(t, e);
		if (!(Ee && Io(fe, t)) && !(Te && Io(pe, t))) {
			if (!i) {
				if (!(Vt(e) && (xe.tagNameCheck instanceof RegExp && Io(xe.tagNameCheck, e) || xe.tagNameCheck instanceof Function && xe.tagNameCheck(e)) && (xe.attributeNameCheck instanceof RegExp && Io(xe.attributeNameCheck, t) || xe.attributeNameCheck instanceof Function && xe.attributeNameCheck(t, e)) || t === "is" && xe.allowCustomizedBuiltInElements && (xe.tagNameCheck instanceof RegExp && Io(xe.tagNameCheck, r) || xe.tagNameCheck instanceof Function && xe.tagNameCheck(r)))) return !1;
			} else if (!Ye[t] && !Io(_e, Do(r, he, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Oo(r, "data:") === 0 && qe[e]) && !(De && !Io(me, Do(r, he, ""))) && r) return !1;
		}
		return !0;
	}, Bt = K({}, [
		"annotation-xml",
		"color-profile",
		"font-face",
		"font-face-format",
		"font-face-name",
		"font-face-src",
		"font-face-uri",
		"missing-glyph"
	]), Vt = function(e) {
		return !Bt[wo(e)] && Io(ge, e);
	}, Ht = function(e, t, n, r) {
		if (S && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
			case "TrustedHTML": return ee(r);
			case "TrustedScriptURL": return te(r);
		}
		return r;
	}, Ut = function(e, n, r, i) {
		try {
			r ? e.setAttributeNS(r, n, i) : e.setAttribute(n, i), jt(e) ? xt(e) : bo(t.removed);
		} catch {
			Ct(n, e);
		}
	}, Wt = function(e) {
		Pt(O.beforeSanitizeAttributes, e, null);
		let t = e.attributes;
		if (!t || jt(e)) return;
		k = Lt(O.uponSanitizeAttribute, k, be, Pe);
		let n = {
			attrName: "",
			attrValue: "",
			keepAttr: !0,
			allowedAttributes: k,
			forceKeepAttr: void 0
		}, r = t.length, i = dt(e.nodeName);
		for (; r--;) {
			let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, l = dt(o), u = c, d = o === "value" ? u : ko(u);
			if (n.attrName = l, n.attrValue = d, n.keepAttr = !0, n.forceKeepAttr = void 0, Pt(O.uponSanitizeAttribute, e, n), d = n.attrValue, Be && (l === "id" || l === "name") && Oo(d, Ve) !== 0 && (Ct(o, e), d = Ve + d), Ae && Io(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
				Ct(o, e);
				continue;
			}
			if (l === "attributename" && Eo(d, "href")) {
				Ct(o, e);
				continue;
			}
			if (!n.forceKeepAttr) {
				if (!n.keepAttr) {
					Ct(o, e);
					continue;
				}
				if (!Oe && Io(hs, d)) {
					Ct(o, e);
					continue;
				}
				if (ke && (d = kt(d)), !zt(i, l, d)) {
					Ct(o, e);
					continue;
				}
				d = Ht(i, l, s, d), d !== u && Ut(e, o, s, d);
			}
		}
		Pt(O.afterSanitizeAttributes, e, null);
	}, Gt = function(e) {
		let t = null, n = Ot(e);
		for (Pt(O.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (Pt(O.uponSanitizeShadowNode, t, null), Rt(t, e), Wt(t), Mt(t.content) && Gt(t.content), (y ? y(t) : t.nodeType) === gs.element) {
			let e = _(t);
			Mt(e) && (Kt(e), Gt(e));
		}
		Pt(O.afterSanitizeShadowDOM, e, null);
	}, Kt = function(e) {
		let t = [{
			node: e,
			shadow: null
		}];
		for (; t.length > 0;) {
			let e = t.pop();
			if (e.shadow) {
				Gt(e.shadow);
				continue;
			}
			let n = e.node, r = (y ? y(n) : n.nodeType) === gs.element, i = h(n);
			if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
				node: i[e],
				shadow: null
			});
			if (r) {
				let e = b ? b(n) : null;
				if (typeof e == "string" && dt(e) === "template") {
					let e = n.content;
					Mt(e) && t.push({
						node: e,
						shadow: null
					});
				}
			}
			if (r) {
				let e = _(n);
				Mt(e) && t.push({
					node: null,
					shadow: e
				}, {
					node: e,
					shadow: null
				});
			}
		}
	};
	return t.sanitize = function(e) {
		let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
		if (tt = !e, tt && (e = "<!-->"), typeof e != "string" && !Nt(e) && (e = Ho(e), typeof e != "string")) throw Lo("dirty is not a string, aborting");
		if (!t.isSupported) return e;
		Me ? (ve = Ne, k = Pe) : ht(n), (O.uponSanitizeElement.length > 0 || O.uponSanitizeAttribute.length > 0) && (ve = Vo(ve)), O.uponSanitizeAttribute.length > 0 && (k = Vo(k)), t.removed = [];
		let c = Ue && typeof e != "string" && Nt(e);
		if (c) {
			Et(e);
			let t = b ? b(e) : e.nodeName;
			if (typeof t == "string") {
				let n = dt(t);
				if (!ve[n] || Se[n]) throw St(e), Lo("root node is forbidden and cannot be sanitized in-place");
			}
			if (jt(e)) throw St(e), Lo("root node is clobbered and cannot be sanitized in-place");
			try {
				Kt(e);
			} catch (t) {
				throw St(e), t;
			}
		} else if (Nt(e)) i = Dt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === gs.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Kt(a);
		else {
			if (!Ie && !ke && !je && e.indexOf("<") === -1) return S && Re ? ee(e) : e;
			if (i = Dt(e), !i) return Ie ? null : Re ? C : "";
		}
		i && Fe && xt(i.firstChild);
		let l = c ? e : i;
		try {
			let e = Ot(l);
			for (; o = e.nextNode();) Rt(o, l), Wt(o), Mt(o.content) && Gt(o.content);
		} catch (n) {
			throw c && (St(e), vo(t.removed, (e) => {
				e.element && Tt(e.element);
			})), n;
		}
		if (c) return vo(t.removed, (e) => {
			e.element && Tt(e.element);
		}), ke && At(e), e;
		if (Ie) {
			if (ke && At(i), Le) for (s = oe.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
			else s = i;
			return (k.shadowroot || k.shadowrootmode) && (s = ce.call(r, s, !0)), s;
		}
		let u = je ? i.outerHTML : i.innerHTML;
		return je && ve["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && Io(us, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), ke && (u = kt(u)), S && Re ? ee(u) : u;
	}, t.setConfig = function() {
		let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
		ht(e), Me = !0, Ne = ve, Pe = k;
	}, t.clearConfig = function() {
		ft = null, Me = !1, Ne = null, Pe = null, S = w, C = "";
	}, t.isValidAttribute = function(e, t, n) {
		ft || ht({});
		let r = dt(e), i = dt(t);
		return zt(r, i, n);
	}, t.addHook = function(e, t) {
		typeof t == "function" && Po(O, e) && xo(O[e], t);
	}, t.removeHook = function(e, t) {
		if (Po(O, e)) {
			if (t !== void 0) {
				let n = yo(O[e], t);
				return n === -1 ? void 0 : So(O[e], n, 1)[0];
			}
			return bo(O[e]);
		}
	}, t.removeHooks = function(e) {
		Po(O, e) && (O[e] = []);
	}, t.removeAllHooks = function() {
		O = ys();
	}, t;
}
var Ss = xs(), Cs = {
	iiif: {
		ALLOWED_ATTR: [
			"href",
			"src",
			"alt"
		],
		ALLOWED_TAGS: [
			"a",
			"b",
			"br",
			"i",
			"img",
			"p",
			"span"
		]
	},
	liberal: {},
	mirador2: {
		ALLOWED_ATTR: [
			"href",
			"target",
			"src",
			"alt",
			"dir"
		],
		ALLOWED_TAGS: [
			"a",
			"b",
			"br",
			"i",
			"img",
			"p",
			"span",
			"strong",
			"em",
			"ul",
			"ol",
			"li"
		]
	},
	noHtml: { ALLOWED_TAGS: [] }
}, ws = H("span", {
	name: "IIIFHtmlContent",
	slot: "root"
})({});
Ss.addHook("afterSanitizeAttributes", (e) => {
	"target" in e && (e.setAttribute("target", "_blank"), e.setAttribute("rel", "noopener noreferrer"));
});
function Ts({ classes: e = {}, htmlString: t, ruleSet: n, ...r }) {
	return /* @__PURE__ */ z(ws, {
		className: [j("third-party-html"), e.root].join(" "),
		dangerouslySetInnerHTML: { __html: Ss.sanitize(t, Cs[n]) },
		...r
	});
}
Ts.propTypes = {
	classes: W.default.objectOf(W.default.string),
	htmlString: W.default.string.isRequired,
	ruleSet: W.default.string.isRequired
};
//#endregion
//#region src/containers/SanitizedHtml.js
var Es = Ts, Ds = /* @__PURE__ */ p(o(), 1);
function Os(e) {
	let t = I();
	return F(() => {
		t.current = e;
	}, [e]), t.current;
}
function ks({ children: e, containerRef: t, offsetTop: n = 0, scrollTo: r, ...i }) {
	let a = I(), o = Os(r);
	return F(() => {
		if (!r || r === o) return;
		let e = a?.current;
		if (!e) return;
		let i = t?.current?.querySelector(`.${j("scrollto-scrollable")}`);
		if (!i) return;
		let s = t?.current?.getBoundingClientRect() || {}, c = e?.getBoundingClientRect() || {};
		if (!(c.top < s.top + n || c.bottom > s.bottom)) return;
		let l = e.offsetTop - s.height / 2 + n;
		i.scrollTo(0, l);
	}, [
		t,
		a,
		r,
		o,
		n
	]), !r && (0, Ds.default)(i) ? e : Cn(e, {
		ref: a,
		...i
	});
}
ks.propTypes = {
	children: W.default.node.isRequired,
	containerRef: W.default.oneOfType([W.default.func, W.default.shape({ current: W.default.instanceOf(Element) })]).isRequired,
	offsetTop: W.default.number,
	scrollTo: W.default.bool.isRequired
};
//#endregion
//#region src/components/CanvasAnnotations.jsx
function As({ annotations: e = [], index: t, label: n, selectedAnnotationId: r = void 0, totalSize: i, listContainerComponent: a = "li", htmlSanitizationRuleSet: o = "iiif", hoveredAnnotationIds: s = [], containerRef: c = void 0, deselectAnnotation: l, selectAnnotation: u, windowId: d, hoverAnnotation: f }) {
	let { t: p } = V(), m = jn((e, t) => {
		window.getSelection()?.toString() || (r === t.id ? l(d, t.id) : u(d, t.id));
	}, [
		d,
		l,
		u,
		r
	]), h = jn((e) => {
		f(d, [e.id]);
	}, [f, d]), g = jn(() => {
		f(d, []);
	}, [f, d]);
	return e.length === 0 ? null : /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(U, {
		sx: {
			paddingLeft: 2,
			paddingRight: 1,
			paddingTop: 2
		},
		variant: "overline",
		children: p("annotationCanvasLabel", {
			context: `${t + 1}/${i}`,
			label: n
		})
	}), /* @__PURE__ */ z(Yn, {
		autoFocusItem: !0,
		variant: "selectedMenu",
		children: e.map((e) => /* @__PURE__ */ z(ks, {
			containerRef: c,
			offsetTop: 96,
			scrollTo: r === e.id,
			selected: r === e.id,
			children: /* @__PURE__ */ z(Xn, {
				component: a,
				variant: "multiline",
				divider: !0,
				sx: {
					"&:hover,&:focus": { backgroundColor: "action.hover" },
					backgroundColor: s.includes(e.id) ? "action.hover" : "",
					userSelect: "text"
				},
				annotationid: e.id,
				onClick: (t) => m(t, e),
				onFocus: () => h(e),
				onBlur: g,
				onMouseEnter: () => h(e),
				onMouseLeave: g,
				children: /* @__PURE__ */ z(Zn, {
					primaryTypographyProps: { variant: "body2" },
					primary: /* @__PURE__ */ z(Es, {
						ruleSet: o,
						htmlString: e.content
					}),
					secondary: e.tags.map((e) => /* @__PURE__ */ z(Jn, {
						component: "span",
						size: "small",
						variant: "outlined",
						label: e,
						id: e
					}, e.toString()))
				})
			}, e.id)
		}, `${e.id}-scroll`))
	})] });
}
As.propTypes = {
	annotations: W.default.arrayOf(W.default.shape({
		content: W.default.string.isRequired,
		id: W.default.string.isRequired
	})),
	containerRef: W.default.oneOfType([W.default.func, W.default.shape({ current: W.default.instanceOf(Element) })]),
	deselectAnnotation: W.default.func.isRequired,
	hoverAnnotation: W.default.func.isRequired,
	hoveredAnnotationIds: W.default.arrayOf(W.default.string),
	htmlSanitizationRuleSet: W.default.string,
	index: W.default.number.isRequired,
	label: W.default.string.isRequired,
	listContainerComponent: W.default.elementType,
	selectAnnotation: W.default.func.isRequired,
	selectedAnnotationId: W.default.string,
	totalSize: W.default.number.isRequired,
	windowId: W.default.string.isRequired
};
var js = n(w((e, { canvasId: t, windowId: n }) => ({
	annotations: bt(e, {
		canvasId: t,
		windowId: n
	}),
	htmlSanitizationRuleSet: nt(e).annotations.htmlSanitizationRuleSet,
	label: Re(e, {
		canvasId: t,
		windowId: n
	}),
	selectedAnnotationId: Dt(e, { windowId: n })
}), {
	deselectAnnotation: kt,
	hoverAnnotation: jt,
	selectAnnotation: wt
}), m("CanvasAnnotations"))(As), Ms = M(/*#__PURE__*/ z("path", { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }), "CloseSharp"), Ns = M(/*#__PURE__*/ z("path", { d: "M19 19H5V5h7V3H3v18h18v-9h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z" }), "OpenInNewSharp"), Ps = M(/*#__PURE__*/ z("path", { d: "M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }), "DragIndicatorSharp");
//#endregion
//#region node_modules/clsx/dist/clsx.mjs
function Fs(e) {
	var t, n, r = "";
	if (typeof e == "string" || typeof e == "number") r += e;
	else if (typeof e == "object") {
		if (Array.isArray(e)) {
			var i = e.length;
			for (t = 0; t < i; t++) e[t] && (n = Fs(e[t])) && (r && (r += " "), r += n);
		} else for (n in e) e[n] && (r && (r += " "), r += n);
	}
	return r;
}
function Is() {
	for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = Fs(e)) && (r && (r += " "), r += t);
	return r;
}
//#endregion
//#region node_modules/react-draggable/build/cjs/chunk-RXGSR3JC.mjs
function Ls(e, t) {
	for (let n = 0, r = e.length; n < r; n++) if (t.apply(t, [
		e[n],
		n,
		e
	])) return e[n];
}
function Rs(e) {
	return typeof e == "function" || Object.prototype.toString.call(e) === "[object Function]";
}
function zs(e) {
	return typeof e == "number" && !isNaN(e);
}
function Bs(e) {
	return parseInt(e, 10);
}
function Vs(e, t, n) {
	if (e[t]) return /* @__PURE__ */ Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`);
}
var Hs = [
	"Moz",
	"Webkit",
	"O",
	"ms"
];
function Us(e = "transform") {
	if (typeof window > "u") return "";
	let t = window.document?.documentElement?.style;
	if (!t || e in t) return "";
	for (let n = 0; n < Hs.length; n++) if (Ws(e, Hs[n]) in t) return Hs[n];
	return "";
}
function Ws(e, t) {
	return t ? `${t}${Gs(e)}` : e;
}
function Gs(e) {
	let t = "", n = !0;
	for (let r = 0; r < e.length; r++) n ? (t += e[r].toUpperCase(), n = !1) : e[r] === "-" ? n = !0 : t += e[r];
	return t;
}
var Ks = Us(), qs = "";
function Js(e, t) {
	qs ||= Ls([
		"matches",
		"webkitMatchesSelector",
		"mozMatchesSelector",
		"msMatchesSelector",
		"oMatchesSelector"
	], function(t) {
		return Rs(e[t]);
	}) ?? "";
	let n = e[qs];
	return Rs(n) ? !!n.call(e, t) : !1;
}
function Ys(e, t, n) {
	let r = e;
	do {
		if (Js(r, t)) return !0;
		if (r === n) return !1;
		r = r.parentNode;
	} while (r);
	return !1;
}
function Xs(e, t, n, r) {
	if (!e) return;
	let i = {
		capture: !0,
		...r
	}, a = n;
	e.addEventListener ? e.addEventListener(t, a, i) : e.attachEvent ? e.attachEvent("on" + t, a) : e["on" + t] = a;
}
function Zs(e, t, n, r) {
	if (!e) return;
	let i = {
		capture: !0,
		...r
	}, a = n;
	e.removeEventListener ? e.removeEventListener(t, a, i) : e.detachEvent ? e.detachEvent("on" + t, a) : e["on" + t] = null;
}
function Qs(e) {
	let t = e.clientHeight, n = e.ownerDocument.defaultView.getComputedStyle(e);
	return t += Bs(n.borderTopWidth), t += Bs(n.borderBottomWidth), t;
}
function $s(e) {
	let t = e.clientWidth, n = e.ownerDocument.defaultView.getComputedStyle(e);
	return t += Bs(n.borderLeftWidth), t += Bs(n.borderRightWidth), t;
}
function ec(e) {
	let t = e.clientHeight, n = e.ownerDocument.defaultView.getComputedStyle(e);
	return t -= Bs(n.paddingTop), t -= Bs(n.paddingBottom), t;
}
function tc(e) {
	let t = e.clientWidth, n = e.ownerDocument.defaultView.getComputedStyle(e);
	return t -= Bs(n.paddingLeft), t -= Bs(n.paddingRight), t;
}
function nc(e, t, n) {
	let r = t === t.ownerDocument.body ? {
		left: 0,
		top: 0
	} : t.getBoundingClientRect();
	return {
		x: (e.clientX + t.scrollLeft - r.left) / n,
		y: (e.clientY + t.scrollTop - r.top) / n
	};
}
function rc(e, t) {
	let n = ac(e, t, "px");
	return { [Ws("transform", Ks)]: n };
}
function ic(e, t) {
	return ac(e, t, "");
}
function ac({ x: e, y: t }, n, r) {
	let i = `translate(${e}${r},${t}${r})`;
	return n && (i = `translate(${`${typeof n.x == "string" ? n.x : n.x + r}`}, ${`${typeof n.y == "string" ? n.y : n.y + r}`})` + i), i;
}
function oc(e, t) {
	return e.targetTouches && Ls(e.targetTouches, (e) => t === e.identifier) || e.changedTouches && Ls(e.changedTouches, (e) => t === e.identifier);
}
function sc(e) {
	if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier;
	if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier;
}
function cc() {
	return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : void 0;
}
function lc(e, t) {
	if (!e) return;
	let n = e.getElementById("react-draggable-style-el");
	if (!n) {
		n = e.createElement("style"), n.type = "text/css", n.id = "react-draggable-style-el";
		let r = t ?? cc();
		r && n.setAttribute("nonce", r), n.innerHTML = ".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n", n.innerHTML += ".react-draggable-transparent-selection *::selection {all: inherit;}\n", e.getElementsByTagName("head")[0].appendChild(n);
	}
	e.body && fc(e.body, "react-draggable-transparent-selection");
}
function uc(e) {
	window.requestAnimationFrame ? window.requestAnimationFrame(() => {
		dc(e);
	}) : dc(e);
}
function dc(e) {
	if (e) try {
		e.body && pc(e.body, "react-draggable-transparent-selection");
		let t = e.selection;
		if (t) t.empty();
		else {
			let t = (e.defaultView || window).getSelection();
			t && t.type !== "Caret" && t.removeAllRanges();
		}
	} catch {}
}
function fc(e, t) {
	e.classList ? e.classList.add(t) : e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`)) || (e.className += ` ${t}`);
}
function pc(e, t) {
	e.classList ? e.classList.remove(t) : e.className = e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`, "g"), "");
}
function mc(e, t, n) {
	if (!e.props.bounds) return [t, n];
	let { bounds: r } = e.props;
	r = typeof r == "string" ? r : xc(r);
	let i = Sc(e);
	if (typeof r == "string") {
		let { ownerDocument: e } = i, t = e.defaultView;
		if (!t) throw Error("Cannot resolve the owner window of the draggable node.");
		let n;
		if (n = r === "parent" ? i.parentNode : i.getRootNode().querySelector(r), !(n instanceof t.HTMLElement)) throw Error("Bounds selector \"" + r + "\" could not find an element.");
		let a = n, o = t.getComputedStyle(i), s = t.getComputedStyle(a);
		r = {
			left: -i.offsetLeft + Bs(s.paddingLeft) + Bs(o.marginLeft),
			top: -i.offsetTop + Bs(s.paddingTop) + Bs(o.marginTop),
			right: tc(a) - $s(i) - i.offsetLeft + Bs(s.paddingRight) - Bs(o.marginRight),
			bottom: ec(a) - Qs(i) - i.offsetTop + Bs(s.paddingBottom) - Bs(o.marginBottom)
		};
	}
	return zs(r.right) && (t = Math.min(t, r.right)), zs(r.bottom) && (n = Math.min(n, r.bottom)), zs(r.left) && (t = Math.max(t, r.left)), zs(r.top) && (n = Math.max(n, r.top)), [t, n];
}
function hc(e, t, n) {
	return [Math.round(t / e[0]) * e[0], Math.round(n / e[1]) * e[1]];
}
function gc(e) {
	return e.props.axis === "both" || e.props.axis === "x";
}
function _c(e) {
	return e.props.axis === "both" || e.props.axis === "y";
}
function vc(e, t, n) {
	let r = typeof t == "number" ? oc(e, t) : null;
	if (typeof t == "number" && !r) return null;
	let i = Sc(n), a = n.props.offsetParent || i.offsetParent || i.ownerDocument.body;
	return nc(r || e, a, n.props.scale);
}
function yc(e, t, n) {
	let r = !zs(e.lastX), i = Sc(e);
	return r ? {
		node: i,
		deltaX: 0,
		deltaY: 0,
		lastX: t,
		lastY: n,
		x: t,
		y: n
	} : {
		node: i,
		deltaX: t - e.lastX,
		deltaY: n - e.lastY,
		lastX: e.lastX,
		lastY: e.lastY,
		x: t,
		y: n
	};
}
function bc(e, t) {
	let n = e.props.scale;
	return {
		node: t.node,
		x: e.state.x + t.deltaX / n,
		y: e.state.y + t.deltaY / n,
		deltaX: t.deltaX / n,
		deltaY: t.deltaY / n,
		lastX: e.state.x,
		lastY: e.state.y
	};
}
function xc(e) {
	return {
		left: e.left,
		top: e.top,
		right: e.right,
		bottom: e.bottom
	};
}
function Sc(e) {
	let t = e.findDOMNode();
	if (!t) throw Error("<DraggableCore>: Unmounted during event!");
	return t;
}
function Cc(...e) {
	({}).DRAGGABLE_DEBUG && console.log(...e);
}
var wc = {
	touch: {
		start: "touchstart",
		move: "touchmove",
		stop: "touchend"
	},
	mouse: {
		start: "mousedown",
		move: "mousemove",
		stop: "mouseup"
	}
}, Tc = wc.mouse, Ec = class extends N.Component {
	constructor() {
		super(...arguments), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, this.touchIdentifier = null, this.mounted = !1, this.handleDragStart = (e) => {
			if (this.props.onMouseDown(e), !this.props.allowAnyClick && (typeof e.button == "number" && e.button !== 0 || e.ctrlKey)) return !1;
			let t = this.findDOMNode();
			if (!t || !t.ownerDocument || !t.ownerDocument.body) throw Error("<DraggableCore> not mounted on DragStart!");
			let { ownerDocument: n } = t;
			if (this.props.disabled || !(e.target instanceof n.defaultView.Node) || this.props.handle && !Ys(e.target, this.props.handle, t) || this.props.cancel && Ys(e.target, this.props.cancel, t)) return;
			e.type === "touchstart" && !this.props.allowMobileScroll && e.preventDefault();
			let r = sc(e);
			this.touchIdentifier = r;
			let i = vc(e, r, this);
			if (i == null) return;
			let { x: a, y: o } = i, s = yc(this, a, o);
			Cc("DraggableCore: handleDragStart: %j", s), Cc("calling", this.props.onStart), this.props.onStart(e, s) !== !1 && this.mounted !== !1 && (this.props.enableUserSelectHack && lc(n, this.props.nonce), this.dragging = !0, this.lastX = a, this.lastY = o, Xs(n, Tc.move, this.handleDrag), Xs(n, Tc.stop, this.handleDragStop));
		}, this.handleDrag = (e) => {
			let t = vc(e, this.touchIdentifier, this);
			if (t == null) return;
			let { x: n, y: r } = t;
			if (Array.isArray(this.props.grid)) {
				let e = n - this.lastX, t = r - this.lastY;
				if ([e, t] = hc(this.props.grid, e, t), !e && !t) return;
				n = this.lastX + e, r = this.lastY + t;
			}
			let i = yc(this, n, r);
			if (Cc("DraggableCore: handleDrag: %j", i), this.props.onDrag(e, i) === !1 || this.mounted === !1) {
				try {
					this.handleDragStop(new MouseEvent("mouseup"));
				} catch {
					let e = document.createEvent("MouseEvents");
					e.initMouseEvent("mouseup", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), this.handleDragStop(e);
				}
				return;
			}
			this.lastX = n, this.lastY = r;
		}, this.handleDragStop = (e) => {
			if (!this.dragging) return;
			let t = vc(e, this.touchIdentifier, this);
			if (t == null) return;
			let { x: n, y: r } = t;
			if (Array.isArray(this.props.grid)) {
				let e = n - this.lastX || 0, t = r - this.lastY || 0;
				[e, t] = hc(this.props.grid, e, t), n = this.lastX + e, r = this.lastY + t;
			}
			let i = yc(this, n, r);
			if (this.props.onStop(e, i) === !1 || this.mounted === !1) return !1;
			let a = this.findDOMNode();
			a && this.props.enableUserSelectHack && uc(a.ownerDocument), Cc("DraggableCore: handleDragStop: %j", i), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, a && (Cc("DraggableCore: Removing handlers"), Zs(a.ownerDocument, Tc.move, this.handleDrag), Zs(a.ownerDocument, Tc.stop, this.handleDragStop));
		}, this.onMouseDown = (e) => (Tc = wc.mouse, this.handleDragStart(e)), this.onMouseUp = (e) => (Tc = wc.mouse, this.handleDragStop(e)), this.onTouchStart = (e) => (Tc = wc.touch, this.handleDragStart(e)), this.onTouchEnd = (e) => (Tc = wc.touch, this.handleDragStop(e));
	}
	componentDidMount() {
		this.mounted = !0;
		let e = this.findDOMNode();
		e && Xs(e, wc.touch.start, this.onTouchStart, { passive: !1 });
	}
	componentWillUnmount() {
		this.mounted = !1;
		let e = this.findDOMNode();
		if (e) {
			let { ownerDocument: t } = e;
			Zs(t, wc.mouse.move, this.handleDrag), Zs(t, wc.touch.move, this.handleDrag), Zs(t, wc.mouse.stop, this.handleDragStop), Zs(t, wc.touch.stop, this.handleDragStop), Zs(e, wc.touch.start, this.onTouchStart, { passive: !1 }), this.props.enableUserSelectHack && uc(t);
		}
	}
	findDOMNode() {
		if (this.props?.nodeRef) return this.props.nodeRef.current;
		let e = $n;
		return typeof e.findDOMNode == "function" ? e.findDOMNode(this) : (Cc("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"), null);
	}
	render() {
		return N.cloneElement(N.Children.only(this.props.children), {
			onMouseDown: this.onMouseDown,
			onMouseUp: this.onMouseUp,
			onTouchEnd: this.onTouchEnd
		});
	}
};
Ec.displayName = "DraggableCore", Ec.propTypes = {
	allowAnyClick: W.default.bool,
	allowMobileScroll: W.default.bool,
	children: W.default.node.isRequired,
	disabled: W.default.bool,
	enableUserSelectHack: W.default.bool,
	offsetParent: function(e, t) {
		if (e[t] && e[t].nodeType !== 1) throw Error("Draggable's offsetParent must be a DOM Node.");
	},
	grid: W.default.arrayOf(W.default.number),
	handle: W.default.string,
	cancel: W.default.string,
	nodeRef: W.default.object,
	nonce: W.default.string,
	onStart: W.default.func,
	onDrag: W.default.func,
	onStop: W.default.func,
	onMouseDown: W.default.func,
	scale: W.default.number,
	className: Vs,
	style: Vs,
	transform: Vs
}, Ec.defaultProps = {
	allowAnyClick: !1,
	allowMobileScroll: !1,
	disabled: !1,
	enableUserSelectHack: !0,
	onStart: function() {},
	onDrag: function() {},
	onStop: function() {},
	onMouseDown: function() {},
	scale: 1
};
var Dc = class extends N.Component {
	constructor(e) {
		super(e), this.onDragStart = (e, t) => {
			if (Cc("Draggable: onDragStart: %j", t), this.props.onStart(e, bc(this, t)) === !1) return !1;
			this.setState({
				dragging: !0,
				dragged: !0
			});
		}, this.onDrag = (e, t) => {
			if (!this.state.dragging) return !1;
			Cc("Draggable: onDrag: %j", t);
			let n = bc(this, t), r = {
				x: n.x,
				y: n.y,
				slackX: 0,
				slackY: 0
			};
			if (this.props.bounds) {
				let { x: e, y: t } = r;
				r.x += this.state.slackX, r.y += this.state.slackY;
				let [i, a] = mc(this, r.x, r.y);
				r.x = i, r.y = a, r.slackX = this.state.slackX + (e - r.x), r.slackY = this.state.slackY + (t - r.y), n.x = r.x, n.y = r.y, n.deltaX = r.x - this.state.x, n.deltaY = r.y - this.state.y;
			}
			if (this.props.onDrag(e, n) === !1) return !1;
			this.setState(r);
		}, this.onDragStop = (e, t) => {
			if (!this.state.dragging || this.props.onStop(e, bc(this, t)) === !1) return !1;
			Cc("Draggable: onDragStop: %j", t);
			let n = {
				dragging: !1,
				slackX: 0,
				slackY: 0
			};
			if (this.props.position) {
				let { x: e, y: t } = this.props.position;
				n.x = e, n.y = t;
			}
			this.setState(n);
		}, this.state = {
			dragging: !1,
			dragged: !1,
			x: e.position ? e.position.x : e.defaultPosition.x,
			y: e.position ? e.position.y : e.defaultPosition.y,
			prevPropsPosition: { ...e.position },
			slackX: 0,
			slackY: 0,
			isElementSVG: !1
		}, e.position && !(e.onDrag || e.onStop) && console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.");
	}
	static getDerivedStateFromProps({ position: e }, { prevPropsPosition: t }) {
		return e && (!t || e.x !== t.x || e.y !== t.y) ? (Cc("Draggable: getDerivedStateFromProps %j", {
			position: e,
			prevPropsPosition: t
		}), {
			x: e.x,
			y: e.y,
			prevPropsPosition: { ...e }
		}) : null;
	}
	componentDidMount() {
		window.SVGElement !== void 0 && this.findDOMNode() instanceof window.SVGElement && this.setState({ isElementSVG: !0 });
	}
	componentWillUnmount() {
		this.state.dragging && this.setState({ dragging: !1 });
	}
	findDOMNode() {
		if (this.props?.nodeRef) return this.props.nodeRef.current;
		let e = $n;
		return typeof e.findDOMNode == "function" ? e.findDOMNode(this) : null;
	}
	render() {
		let { axis: e, bounds: t, children: n, defaultPosition: r, defaultClassName: i, defaultClassNameDragging: a, defaultClassNameDragged: o, position: s, positionOffset: c, scale: l, ...u } = this.props, d = {}, f = null, p = !s || this.state.dragging, m = s || r, h = {
			x: gc(this) && p ? this.state.x : m.x,
			y: _c(this) && p ? this.state.y : m.y
		};
		this.state.isElementSVG ? f = ic(h, c) : d = rc(h, c);
		let g = N.Children.only(n), _ = Is(g.props.className || "", i, {
			[a]: this.state.dragging,
			[o]: this.state.dragged
		});
		return /* @__PURE__ */ N.createElement(Ec, {
			...u,
			onStart: this.onDragStart,
			onDrag: this.onDrag,
			onStop: this.onDragStop
		}, N.cloneElement(g, {
			className: _,
			style: {
				...g.props.style,
				...d
			},
			transform: f
		}));
	}
};
Dc.displayName = "Draggable", Dc.propTypes = {
	...Ec.propTypes,
	axis: W.default.oneOf([
		"both",
		"x",
		"y",
		"none"
	]),
	bounds: W.default.oneOfType([
		W.default.shape({
			left: W.default.number,
			right: W.default.number,
			top: W.default.number,
			bottom: W.default.number
		}),
		W.default.string,
		W.default.oneOf([!1])
	]),
	defaultClassName: W.default.string,
	defaultClassNameDragging: W.default.string,
	defaultClassNameDragged: W.default.string,
	defaultPosition: W.default.shape({
		x: W.default.number,
		y: W.default.number
	}),
	positionOffset: W.default.shape({
		x: W.default.oneOfType([W.default.number, W.default.string]),
		y: W.default.oneOfType([W.default.number, W.default.string])
	}),
	position: W.default.shape({
		x: W.default.number,
		y: W.default.number
	}),
	className: Vs,
	style: Vs,
	transform: Vs
}, Dc.defaultProps = {
	...Ec.defaultProps,
	axis: "both",
	bounds: !1,
	defaultClassName: "react-draggable",
	defaultClassNameDragging: "react-draggable-dragging",
	defaultClassNameDragged: "react-draggable-dragged",
	defaultPosition: {
		x: 0,
		y: 0
	},
	scale: 1
};
//#endregion
//#region node_modules/react-draggable/build/cjs/cjs.mjs
var Oc = Dc, kc = function() {
	return kc = Object.assign || function(e) {
		for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
		return e;
	}, kc.apply(this, arguments);
}, Ac = {
	width: "100%",
	height: "10px",
	top: "0px",
	left: "0px",
	cursor: "row-resize"
}, jc = {
	width: "10px",
	height: "100%",
	top: "0px",
	left: "0px",
	cursor: "col-resize"
}, Mc = {
	width: "20px",
	height: "20px",
	position: "absolute",
	zIndex: 1
}, Nc = {
	top: kc(kc({}, Ac), { top: "-5px" }),
	right: kc(kc({}, jc), {
		left: void 0,
		right: "-5px"
	}),
	bottom: kc(kc({}, Ac), {
		top: void 0,
		bottom: "-5px"
	}),
	left: kc(kc({}, jc), { left: "-5px" }),
	topRight: kc(kc({}, Mc), {
		right: "-10px",
		top: "-10px",
		cursor: "ne-resize"
	}),
	bottomRight: kc(kc({}, Mc), {
		right: "-10px",
		bottom: "-10px",
		cursor: "se-resize"
	}),
	bottomLeft: kc(kc({}, Mc), {
		left: "-10px",
		bottom: "-10px",
		cursor: "sw-resize"
	}),
	topLeft: kc(kc({}, Mc), {
		left: "-10px",
		top: "-10px",
		cursor: "nw-resize"
	})
}, Pc = An(function(e) {
	var t = e.onResizeStart, n = e.direction, r = e.children, i = e.replaceStyles, a = e.className, o = jn(function(e) {
		t(e, n);
	}, [t, n]), s = jn(function(e) {
		t(e, n);
	}, [t, n]), c = In(function() {
		return kc(kc({
			position: "absolute",
			userSelect: "none"
		}, Nc[n]), i ?? {});
	}, [i, n]);
	return z("div", {
		className: a || void 0,
		style: c,
		onMouseDown: o,
		onTouchStart: s,
		children: r
	});
}), Fc = (function() {
	var e = function(t, n) {
		return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
			e.__proto__ = t;
		} || function(e, t) {
			for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
		}, e(t, n);
	};
	return function(t, n) {
		if (typeof n != "function" && n !== null) throw TypeError("Class extends value " + String(n) + " is not a constructor or null");
		e(t, n);
		function r() {
			this.constructor = t;
		}
		t.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype, new r());
	};
})(), Ic = function() {
	return Ic = Object.assign || function(e) {
		for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
		return e;
	}, Ic.apply(this, arguments);
}, Lc = {
	width: "auto",
	height: "auto"
}, Rc = function(e, t, n) {
	return Math.max(Math.min(e, n), t);
}, zc = function(e, t, n) {
	var r = Math.round(e / t);
	return r * t + n * (r - 1);
}, Bc = function(e, t) {
	return new RegExp(e, "i").test(t);
}, Vc = function(e) {
	return !!(e.touches && e.touches.length);
}, Hc = function(e) {
	return !!((e.clientX || e.clientX === 0) && (e.clientY || e.clientY === 0));
}, Uc = function(e, t, n) {
	n === void 0 && (n = 0);
	var r = t.reduce(function(n, r, i) {
		return Math.abs(r - e) < Math.abs(t[n] - e) ? i : n;
	}, 0), i = Math.abs(t[r] - e);
	return n === 0 || i < n ? t[r] : e;
}, Wc = function(e) {
	return e = e.toString(), e === "auto" || e.endsWith("px") || e.endsWith("%") || e.endsWith("vh") || e.endsWith("vw") || e.endsWith("vmax") || e.endsWith("vmin") ? e : `${e}px`;
}, Gc = function(e, t, n, r) {
	if (e && typeof e == "string") {
		if (e.endsWith("px")) return Number(e.replace("px", ""));
		if (e.endsWith("%")) {
			var i = Number(e.replace("%", "")) / 100;
			return t * i;
		}
		if (e.endsWith("vw")) {
			var i = Number(e.replace("vw", "")) / 100;
			return n * i;
		}
		if (e.endsWith("vh")) {
			var i = Number(e.replace("vh", "")) / 100;
			return r * i;
		}
	}
	return e;
}, Kc = function(e, t, n, r, i, a, o) {
	return r = Gc(r, e.width, t, n), i = Gc(i, e.height, t, n), a = Gc(a, e.width, t, n), o = Gc(o, e.height, t, n), {
		maxWidth: r === void 0 ? void 0 : Number(r),
		maxHeight: i === void 0 ? void 0 : Number(i),
		minWidth: a === void 0 ? void 0 : Number(a),
		minHeight: o === void 0 ? void 0 : Number(o)
	};
}, qc = function(e) {
	return Array.isArray(e) ? e : [e, e];
}, Jc = /* @__PURE__ */ "as.ref.style.className.grid.gridGap.snap.bounds.boundsByDirection.size.defaultSize.minWidth.minHeight.maxWidth.maxHeight.lockAspectRatio.lockAspectRatioExtraWidth.lockAspectRatioExtraHeight.enable.handleStyles.handleClasses.handleWrapperStyle.handleWrapperClass.children.onResizeStart.onResize.onResizeStop.handleComponent.scale.resizeRatio.snapGap".split("."), Yc = "__resizable_base__", Xc = function(e) {
	Fc(t, e);
	function t(t) {
		var n = e.call(this, t) || this;
		return n.ratio = 1, n.resizable = null, n.parentLeft = 0, n.parentTop = 0, n.resizableLeft = 0, n.resizableRight = 0, n.resizableTop = 0, n.resizableBottom = 0, n.targetLeft = 0, n.targetTop = 0, n.delta = {
			width: 0,
			height: 0
		}, n.appendBase = function() {
			if (!n.resizable || !n.window) return null;
			var e = n.parentNode;
			if (!e) return null;
			var t = n.window.document.createElement("div");
			return t.style.width = "100%", t.style.height = "100%", t.style.position = "absolute", t.style.transform = "scale(0, 0)", t.style.left = "0", t.style.flex = "0 0 100%", t.classList ? t.classList.add(Yc) : t.className += Yc, e.appendChild(t), t;
		}, n.removeBase = function(e) {
			var t = n.parentNode;
			t && t.removeChild(e);
		}, n.state = {
			isResizing: !1,
			width: n.propsSize?.width ?? "auto",
			height: n.propsSize?.height ?? "auto",
			direction: "right",
			original: {
				x: 0,
				y: 0,
				width: 0,
				height: 0
			},
			backgroundStyle: {
				height: "100%",
				width: "100%",
				backgroundColor: "rgba(0,0,0,0)",
				cursor: "auto",
				opacity: 0,
				position: "fixed",
				zIndex: 9999,
				top: "0",
				left: "0",
				bottom: "0",
				right: "0"
			},
			flexBasis: void 0
		}, n.onResizeStart = n.onResizeStart.bind(n), n.onMouseMove = n.onMouseMove.bind(n), n.onMouseUp = n.onMouseUp.bind(n), n;
	}
	return Object.defineProperty(t.prototype, "parentNode", {
		get: function() {
			return this.resizable ? this.resizable.parentNode : null;
		},
		enumerable: !1,
		configurable: !0
	}), Object.defineProperty(t.prototype, "window", {
		get: function() {
			return !this.resizable || !this.resizable.ownerDocument ? null : this.resizable.ownerDocument.defaultView;
		},
		enumerable: !1,
		configurable: !0
	}), Object.defineProperty(t.prototype, "propsSize", {
		get: function() {
			return this.props.size || this.props.defaultSize || Lc;
		},
		enumerable: !1,
		configurable: !0
	}), Object.defineProperty(t.prototype, "size", {
		get: function() {
			var e = 0, t = 0;
			if (this.resizable && this.window) {
				var n = this.resizable.offsetWidth, r = this.resizable.offsetHeight, i = this.resizable.style.position;
				i !== "relative" && (this.resizable.style.position = "relative"), e = this.resizable.style.width === "auto" ? n : this.resizable.offsetWidth, t = this.resizable.style.height === "auto" ? r : this.resizable.offsetHeight, this.resizable.style.position = i;
			}
			return {
				width: e,
				height: t
			};
		},
		enumerable: !1,
		configurable: !0
	}), Object.defineProperty(t.prototype, "sizeStyle", {
		get: function() {
			var e = this, t = this.props.size, n = function(t) {
				if (e.state[t] === void 0 || e.state[t] === "auto") return "auto";
				if (e.propsSize && e.propsSize[t] && e.propsSize[t]?.toString().endsWith("%")) {
					if (e.state[t].toString().endsWith("%")) return e.state[t].toString();
					var n = e.getParentSize();
					return `${Number(e.state[t].toString().replace("px", "")) / n[t] * 100}%`;
				}
				return Wc(e.state[t]);
			};
			return {
				width: t && t.width !== void 0 && !this.state.isResizing ? Wc(t.width) : n("width"),
				height: t && t.height !== void 0 && !this.state.isResizing ? Wc(t.height) : n("height")
			};
		},
		enumerable: !1,
		configurable: !0
	}), t.prototype.getParentSize = function() {
		if (!this.parentNode) return this.window ? {
			width: this.window.innerWidth,
			height: this.window.innerHeight
		} : {
			width: 0,
			height: 0
		};
		var e = this.appendBase();
		if (!e) return {
			width: 0,
			height: 0
		};
		var t = !1, n = this.parentNode.style.flexWrap;
		n !== "wrap" && (t = !0, this.parentNode.style.flexWrap = "wrap"), e.style.position = "relative", e.style.minWidth = "100%", e.style.minHeight = "100%";
		var r = {
			width: e.offsetWidth,
			height: e.offsetHeight
		};
		return t && (this.parentNode.style.flexWrap = n), this.removeBase(e), r;
	}, t.prototype.bindEvents = function() {
		this.window && (this.window.addEventListener("mouseup", this.onMouseUp), this.window.addEventListener("mousemove", this.onMouseMove), this.window.addEventListener("mouseleave", this.onMouseUp), this.window.addEventListener("touchmove", this.onMouseMove, {
			capture: !0,
			passive: !1
		}), this.window.addEventListener("touchend", this.onMouseUp));
	}, t.prototype.unbindEvents = function() {
		this.window && (this.window.removeEventListener("mouseup", this.onMouseUp), this.window.removeEventListener("mousemove", this.onMouseMove), this.window.removeEventListener("mouseleave", this.onMouseUp), this.window.removeEventListener("touchmove", this.onMouseMove, !0), this.window.removeEventListener("touchend", this.onMouseUp));
	}, t.prototype.componentDidMount = function() {
		if (!(!this.resizable || !this.window)) {
			var e = this.window.getComputedStyle(this.resizable);
			this.setState({
				width: this.state.width || this.size.width,
				height: this.state.height || this.size.height,
				flexBasis: e.flexBasis === "auto" ? void 0 : e.flexBasis
			});
		}
	}, t.prototype.componentWillUnmount = function() {
		this.window && this.unbindEvents();
	}, t.prototype.createSizeForCssProperty = function(e, t) {
		var n = this.propsSize && this.propsSize[t];
		return this.state[t] === "auto" && this.state.original[t] === e && (n === void 0 || n === "auto") ? "auto" : e;
	}, t.prototype.calculateNewMaxFromBoundary = function(e, t) {
		var n = this.props.boundsByDirection, r = this.state.direction, i = n && Bc("left", r), a = n && Bc("top", r), o, s;
		if (this.props.bounds === "parent") {
			var c = this.parentNode;
			c && (o = i ? this.resizableRight - this.parentLeft : c.offsetWidth + (this.parentLeft - this.resizableLeft), s = a ? this.resizableBottom - this.parentTop : c.offsetHeight + (this.parentTop - this.resizableTop));
		} else this.props.bounds === "window" ? this.window && (o = i ? this.resizableRight : this.window.innerWidth - this.resizableLeft, s = a ? this.resizableBottom : this.window.innerHeight - this.resizableTop) : this.props.bounds && (o = i ? this.resizableRight - this.targetLeft : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft), s = a ? this.resizableBottom - this.targetTop : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop));
		return o && Number.isFinite(o) && (e = e && e < o ? e : o), s && Number.isFinite(s) && (t = t && t < s ? t : s), {
			maxWidth: e,
			maxHeight: t
		};
	}, t.prototype.calculateNewSizeFromDirection = function(e, t) {
		var n = this.props.scale || 1, r = qc(this.props.resizeRatio || 1), i = r[0], a = r[1], o = this.state, s = o.direction, c = o.original, l = this.props, u = l.lockAspectRatio, d = l.lockAspectRatioExtraHeight, f = l.lockAspectRatioExtraWidth, p = c.width, m = c.height, h = d || 0, g = f || 0;
		return Bc("right", s) && (p = c.width + (e - c.x) * i / n, u && (m = (p - g) / this.ratio + h)), Bc("left", s) && (p = c.width - (e - c.x) * i / n, u && (m = (p - g) / this.ratio + h)), Bc("bottom", s) && (m = c.height + (t - c.y) * a / n, u && (p = (m - h) * this.ratio + g)), Bc("top", s) && (m = c.height - (t - c.y) * a / n, u && (p = (m - h) * this.ratio + g)), {
			newWidth: p,
			newHeight: m
		};
	}, t.prototype.calculateNewSizeFromAspectRatio = function(e, t, n, r) {
		var i = this.props, a = i.lockAspectRatio, o = i.lockAspectRatioExtraHeight, s = i.lockAspectRatioExtraWidth, c = r.width === void 0 ? 10 : r.width, l = n.width === void 0 || n.width < 0 ? e : n.width, u = r.height === void 0 ? 10 : r.height, d = n.height === void 0 || n.height < 0 ? t : n.height, f = o || 0, p = s || 0;
		if (a) {
			var m = (u - f) * this.ratio + p, h = (d - f) * this.ratio + p, g = (c - p) / this.ratio + f, _ = (l - p) / this.ratio + f, v = Math.max(c, m), y = Math.min(l, h), b = Math.max(u, g), x = Math.min(d, _);
			e = Rc(e, v, y), t = Rc(t, b, x);
		} else e = Rc(e, c, l), t = Rc(t, u, d);
		return {
			newWidth: e,
			newHeight: t
		};
	}, t.prototype.setBoundingClientRect = function() {
		var e = 1 / (this.props.scale || 1);
		if (this.props.bounds === "parent") {
			var t = this.parentNode;
			if (t) {
				var n = t.getBoundingClientRect();
				this.parentLeft = n.left * e, this.parentTop = n.top * e;
			}
		}
		if (this.props.bounds && typeof this.props.bounds != "string") {
			var r = this.props.bounds.getBoundingClientRect();
			this.targetLeft = r.left * e, this.targetTop = r.top * e;
		}
		if (this.resizable) {
			var i = this.resizable.getBoundingClientRect(), a = i.left, o = i.top, s = i.right, c = i.bottom;
			this.resizableLeft = a * e, this.resizableRight = s * e, this.resizableTop = o * e, this.resizableBottom = c * e;
		}
	}, t.prototype.onResizeStart = function(e, t) {
		if (!(!this.resizable || !this.window)) {
			var n = 0, r = 0;
			if (e.nativeEvent && Hc(e.nativeEvent) ? (n = e.nativeEvent.clientX, r = e.nativeEvent.clientY) : e.nativeEvent && Vc(e.nativeEvent) && (n = e.nativeEvent.touches[0].clientX, r = e.nativeEvent.touches[0].clientY), !(this.props.onResizeStart && this.resizable && this.props.onResizeStart(e, t, this.resizable) === !1)) {
				this.props.size && (this.props.size.height !== void 0 && this.props.size.height !== this.state.height && this.setState({ height: this.props.size.height }), this.props.size.width !== void 0 && this.props.size.width !== this.state.width && this.setState({ width: this.props.size.width })), this.ratio = typeof this.props.lockAspectRatio == "number" ? this.props.lockAspectRatio : this.size.width / this.size.height;
				var i, a = this.window.getComputedStyle(this.resizable);
				if (a.flexBasis !== "auto") {
					var o = this.parentNode;
					if (o) {
						var s = this.window.getComputedStyle(o).flexDirection;
						this.flexDir = s.startsWith("row") ? "row" : "column", i = a.flexBasis;
					}
				}
				this.setBoundingClientRect(), this.bindEvents();
				var c = {
					original: {
						x: n,
						y: r,
						width: this.size.width,
						height: this.size.height
					},
					isResizing: !0,
					backgroundStyle: Ic(Ic({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(e.target).cursor || "auto" }),
					direction: t,
					flexBasis: i
				};
				this.setState(c);
			}
		}
	}, t.prototype.onMouseMove = function(e) {
		var t = this;
		if (!(!this.state.isResizing || !this.resizable || !this.window)) {
			if (this.window.TouchEvent && Vc(e)) try {
				e.preventDefault(), e.stopPropagation();
			} catch {}
			var n = this.props, r = n.maxWidth, i = n.maxHeight, a = n.minWidth, o = n.minHeight, s = Vc(e) ? e.touches[0].clientX : e.clientX, c = Vc(e) ? e.touches[0].clientY : e.clientY, l = this.state, u = l.direction, d = l.original, f = l.width, p = l.height, m = this.getParentSize(), h = Kc(m, this.window.innerWidth, this.window.innerHeight, r, i, a, o);
			r = h.maxWidth, i = h.maxHeight, a = h.minWidth, o = h.minHeight;
			var g = this.calculateNewSizeFromDirection(s, c), _ = g.newHeight, v = g.newWidth, y = this.calculateNewMaxFromBoundary(r, i);
			this.props.snap && this.props.snap.x && (v = Uc(v, this.props.snap.x, this.props.snapGap)), this.props.snap && this.props.snap.y && (_ = Uc(_, this.props.snap.y, this.props.snapGap));
			var b = this.calculateNewSizeFromAspectRatio(v, _, {
				width: y.maxWidth,
				height: y.maxHeight
			}, {
				width: a,
				height: o
			});
			if (v = b.newWidth, _ = b.newHeight, this.props.grid) {
				var x = zc(v, this.props.grid[0], this.props.gridGap ? this.props.gridGap[0] : 0), S = zc(_, this.props.grid[1], this.props.gridGap ? this.props.gridGap[1] : 0), C = this.props.snapGap || 0, w = C === 0 || Math.abs(x - v) <= C ? x : v, T = C === 0 || Math.abs(S - _) <= C ? S : _;
				v = w, _ = T;
			}
			var E = {
				width: v - d.width,
				height: _ - d.height
			};
			if (this.delta = E, f && typeof f == "string") {
				if (f.endsWith("%")) {
					var D = v / m.width * 100;
					v = `${D}%`;
				} else if (f.endsWith("vw")) {
					var ee = v / this.window.innerWidth * 100;
					v = `${ee}vw`;
				} else if (f.endsWith("vh")) {
					var te = v / this.window.innerHeight * 100;
					v = `${te}vh`;
				}
			}
			if (p && typeof p == "string") {
				if (p.endsWith("%")) {
					var D = _ / m.height * 100;
					_ = `${D}%`;
				} else if (p.endsWith("vw")) {
					var ee = _ / this.window.innerWidth * 100;
					_ = `${ee}vw`;
				} else if (p.endsWith("vh")) {
					var te = _ / this.window.innerHeight * 100;
					_ = `${te}vh`;
				}
			}
			var ne = {
				width: this.createSizeForCssProperty(v, "width"),
				height: this.createSizeForCssProperty(_, "height")
			};
			this.flexDir === "row" ? ne.flexBasis = ne.width : this.flexDir === "column" && (ne.flexBasis = ne.height);
			var re = this.state.width !== ne.width, ie = this.state.height !== ne.height, ae = this.state.flexBasis !== ne.flexBasis, oe = re || ie || ae;
			oe && er(function() {
				t.setState(ne);
			}), this.props.onResize && oe && this.props.onResize(e, u, this.resizable, E);
		}
	}, t.prototype.onMouseUp = function(e) {
		var t = this.state, n = t.isResizing, r = t.direction;
		t.original, !(!n || !this.resizable) && (this.props.onResizeStop && this.props.onResizeStop(e, r, this.resizable, this.delta), this.props.size && this.setState({
			width: this.props.size.width ?? "auto",
			height: this.props.size.height ?? "auto"
		}), this.unbindEvents(), this.setState({
			isResizing: !1,
			backgroundStyle: Ic(Ic({}, this.state.backgroundStyle), { cursor: "auto" })
		}));
	}, t.prototype.updateSize = function(e) {
		this.setState({
			width: e.width ?? "auto",
			height: e.height ?? "auto"
		});
	}, t.prototype.renderResizer = function() {
		var e = this, t = this.props, n = t.enable, r = t.handleStyles, i = t.handleClasses, a = t.handleWrapperStyle, o = t.handleWrapperClass, s = t.handleComponent;
		if (!n) return null;
		var c = Object.keys(n).map(function(t) {
			return n[t] === !1 ? null : z(Pc, {
				direction: t,
				onResizeStart: e.onResizeStart,
				replaceStyles: r && r[t],
				className: i && i[t],
				children: s && s[t] ? s[t] : null
			}, t);
		});
		return z("div", {
			className: o,
			style: a,
			children: c
		});
	}, t.prototype.render = function() {
		var e = this, t = Object.keys(this.props).reduce(function(t, n) {
			return Jc.indexOf(n) === -1 && (t[n] = e.props[n]), t;
		}, {}), n = Ic(Ic(Ic({
			position: "relative",
			userSelect: this.state.isResizing ? "none" : "auto"
		}, this.props.style), this.sizeStyle), {
			maxWidth: this.props.maxWidth,
			maxHeight: this.props.maxHeight,
			minWidth: this.props.minWidth,
			minHeight: this.props.minHeight,
			boxSizing: "border-box",
			flexShrink: 0
		});
		this.state.flexBasis && (n.flexBasis = this.state.flexBasis);
		var r = this.props.as || "div";
		return B(r, Ic({
			style: n,
			className: this.props.className
		}, t, {
			ref: function(t) {
				t && (e.resizable = t);
			},
			children: [
				this.state.isResizing && z("div", { style: this.state.backgroundStyle }),
				this.props.children,
				this.renderResizer()
			]
		}));
	}, t.defaultProps = {
		as: "div",
		onResizeStart: function() {},
		onResize: function() {},
		onResizeStop: function() {},
		enable: {
			top: !0,
			right: !0,
			bottom: !0,
			left: !0,
			topRight: !0,
			bottomRight: !0,
			bottomLeft: !0,
			topLeft: !0
		},
		style: {},
		grid: [1, 1],
		gridGap: [0, 0],
		lockAspectRatio: !1,
		lockAspectRatioExtraWidth: 0,
		lockAspectRatioExtraHeight: 0,
		scale: 1,
		resizeRatio: 1,
		snapGap: 0
	}, t;
}(xn), Zc = function(e, t) {
	return Zc = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
		e.__proto__ = t;
	} || function(e, t) {
		for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
	}, Zc(e, t);
};
function Qc(e, t) {
	Zc(e, t);
	function n() {
		this.constructor = e;
	}
	e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
}
var $c = function() {
	return $c = Object.assign || function(e) {
		for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
		return e;
	}, $c.apply(this, arguments);
};
function el(e, t) {
	var n = {};
	for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
	if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++) t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
	return n;
}
var tl = {
	width: "auto",
	height: "auto",
	display: "inline-block",
	position: "absolute",
	top: 0,
	left: 0
}, nl = function(e) {
	return {
		bottom: e,
		bottomLeft: e,
		bottomRight: e,
		left: e,
		right: e,
		top: e,
		topLeft: e,
		topRight: e
	};
}, rl = function(e) {
	Qc(t, e);
	function t(t) {
		var n = e.call(this, t) || this;
		return n.resizingPosition = {
			x: 0,
			y: 0
		}, n.offsetFromParent = {
			left: 0,
			top: 0
		}, n.resizableElement = { current: null }, n.originalPosition = {
			x: 0,
			y: 0
		}, n.state = {
			resizing: !1,
			bounds: {
				top: 0,
				right: 0,
				bottom: 0,
				left: 0
			},
			maxWidth: t.maxWidth,
			maxHeight: t.maxHeight
		}, n.onResizeStart = n.onResizeStart.bind(n), n.onResize = n.onResize.bind(n), n.onResizeStop = n.onResizeStop.bind(n), n.onDragStart = n.onDragStart.bind(n), n.onDrag = n.onDrag.bind(n), n.onDragStop = n.onDragStop.bind(n), n.getMaxSizesFromProps = n.getMaxSizesFromProps.bind(n), n;
	}
	return t.prototype.componentDidMount = function() {
		this.updateOffsetFromParent();
		var e = this.offsetFromParent, t = e.left, n = e.top, r = this.getDraggablePosition(), i = r.x, a = r.y;
		this.draggable.setState({
			x: i - t,
			y: a - n
		}), this.forceUpdate();
	}, t.prototype.getDraggablePosition = function() {
		var e = this.draggable.state;
		return {
			x: e.x,
			y: e.y
		};
	}, t.prototype.getParent = function() {
		return this.resizable && this.resizable.parentNode;
	}, t.prototype.getParentSize = function() {
		return this.resizable.getParentSize();
	}, t.prototype.getMaxSizesFromProps = function() {
		return {
			maxWidth: this.props.maxWidth === void 0 ? 2 ** 53 - 1 : this.props.maxWidth,
			maxHeight: this.props.maxHeight === void 0 ? 2 ** 53 - 1 : this.props.maxHeight
		};
	}, t.prototype.getSelfElement = function() {
		return this.resizable && this.resizable.resizable;
	}, t.prototype.getOffsetHeight = function(e) {
		var t = this.props.scale;
		switch (this.props.bounds) {
			case "window": return window.innerHeight / t;
			case "body": return document.body.offsetHeight / t;
			default: return e.offsetHeight;
		}
	}, t.prototype.getOffsetWidth = function(e) {
		var t = this.props.scale;
		switch (this.props.bounds) {
			case "window": return window.innerWidth / t;
			case "body": return document.body.offsetWidth / t;
			default: return e.offsetWidth;
		}
	}, t.prototype.onDragStart = function(e, t) {
		if (this.props.onDragStart && this.props.onDragStart(e, t) === !1) return !1;
		var n = this.getDraggablePosition();
		if (this.originalPosition = n, this.props.bounds) {
			var r = this.getParent(), i = this.props.scale, a;
			if (this.props.bounds === "parent") a = r;
			else if (this.props.bounds === "body") {
				var o = r.getBoundingClientRect(), s = o.left, c = o.top, l = document.body.getBoundingClientRect(), u = -(s - r.offsetLeft * i - l.left) / i, d = -(c - r.offsetTop * i - l.top) / i, f = (document.body.offsetWidth - this.resizable.size.width * i) / i + u, p = (document.body.offsetHeight - this.resizable.size.height * i) / i + d;
				return this.setState({ bounds: {
					top: d,
					right: f,
					bottom: p,
					left: u
				} });
			} else if (this.props.bounds === "window") {
				if (!this.resizable) return;
				var m = r.getBoundingClientRect(), h = m.left, g = m.top, _ = -(h - r.offsetLeft * i) / i, v = -(g - r.offsetTop * i) / i, f = (window.innerWidth - this.resizable.size.width * i) / i + _, p = (window.innerHeight - this.resizable.size.height * i) / i + v;
				return this.setState({ bounds: {
					top: v,
					right: f,
					bottom: p,
					left: _
				} });
			} else typeof this.props.bounds == "string" ? a = document.querySelector(this.props.bounds) : this.props.bounds instanceof HTMLElement && (a = this.props.bounds);
			if (!(!(a instanceof HTMLElement) || !(r instanceof HTMLElement))) {
				var y = a.getBoundingClientRect(), b = y.left, x = y.top, S = r.getBoundingClientRect(), C = S.left, w = S.top, T = (b - C) / i, E = x - w;
				if (this.resizable) {
					this.updateOffsetFromParent();
					var D = this.offsetFromParent;
					this.setState({ bounds: {
						top: E - D.top,
						right: T + (a.offsetWidth - this.resizable.size.width) - D.left / i,
						bottom: E + (a.offsetHeight - this.resizable.size.height) - D.top,
						left: T - D.left / i
					} });
				}
			}
		}
	}, t.prototype.onDrag = function(e, t) {
		if (this.props.onDrag) {
			var n = this.offsetFromParent, r = n.left, i = n.top;
			if (!this.props.dragAxis || this.props.dragAxis === "both") return this.props.onDrag(e, $c($c({}, t), {
				x: t.x + r,
				y: t.y + i
			}));
			if (this.props.dragAxis === "x") return this.props.onDrag(e, $c($c({}, t), {
				x: t.x + r,
				y: this.originalPosition.y + i,
				deltaY: 0
			}));
			if (this.props.dragAxis === "y") return this.props.onDrag(e, $c($c({}, t), {
				x: this.originalPosition.x + r,
				y: t.y + i,
				deltaX: 0
			}));
		}
	}, t.prototype.onDragStop = function(e, t) {
		if (this.props.onDragStop) {
			var n = this.offsetFromParent, r = n.left, i = n.top;
			if (!this.props.dragAxis || this.props.dragAxis === "both") return this.props.onDragStop(e, $c($c({}, t), {
				x: t.x + r,
				y: t.y + i
			}));
			if (this.props.dragAxis === "x") return this.props.onDragStop(e, $c($c({}, t), {
				x: t.x + r,
				y: this.originalPosition.y + i,
				deltaY: 0
			}));
			if (this.props.dragAxis === "y") return this.props.onDragStop(e, $c($c({}, t), {
				x: this.originalPosition.x + r,
				y: t.y + i,
				deltaX: 0
			}));
		}
	}, t.prototype.onResizeStart = function(e, t, n) {
		if (this.props.onResizeStart && this.props.onResizeStart(e, t, n) === !1) return !1;
		e.stopPropagation(), this.setState({ resizing: !0 });
		var r = this.props.scale, i = this.offsetFromParent, a = this.getDraggablePosition();
		if (this.resizingPosition = {
			x: a.x + i.left,
			y: a.y + i.top
		}, this.originalPosition = a, this.props.bounds) {
			var o = this.getParent(), s = void 0;
			this.props.bounds === "parent" ? s = o : this.props.bounds === "body" ? s = document.body : this.props.bounds === "window" ? s = window : typeof this.props.bounds == "string" ? s = document.querySelector(this.props.bounds) : this.props.bounds instanceof HTMLElement && (s = this.props.bounds);
			var c = this.getSelfElement();
			if (c instanceof Element && (s instanceof HTMLElement || s === window) && o instanceof HTMLElement) {
				var l = this.getMaxSizesFromProps(), u = l.maxWidth, d = l.maxHeight, f = this.getParentSize();
				if (u && typeof u == "string") {
					if (u.endsWith("%")) {
						var p = Number(u.replace("%", "")) / 100;
						u = f.width * p;
					} else u.endsWith("px") && (u = Number(u.replace("px", "")));
				}
				if (d && typeof d == "string") {
					if (d.endsWith("%")) {
						var p = Number(d.replace("%", "")) / 100;
						d = f.height * p;
					} else d.endsWith("px") && (d = Number(d.replace("px", "")));
				}
				var m = c.getBoundingClientRect(), h = m.left, g = m.top, _ = this.props.bounds === "window" ? {
					left: 0,
					top: 0
				} : s.getBoundingClientRect(), v = _.left, y = _.top, b = this.getOffsetWidth(s), x = this.getOffsetHeight(s), S = t.toLowerCase().endsWith("left"), C = t.toLowerCase().endsWith("right"), w = t.startsWith("top"), T = t.startsWith("bottom");
				if ((S || w) && this.resizable) {
					var E = (h - v) / r + this.resizable.size.width;
					this.setState({ maxWidth: E > Number(u) ? u : E });
				}
				if (C || this.props.lockAspectRatio && !S && !w) {
					var E = b + (v - h) / r;
					this.setState({ maxWidth: E > Number(u) ? u : E });
				}
				if ((w || S) && this.resizable) {
					var E = (g - y) / r + this.resizable.size.height;
					this.setState({ maxHeight: E > Number(d) ? d : E });
				}
				if (T || this.props.lockAspectRatio && !w && !S) {
					var E = x + (y - g) / r;
					this.setState({ maxHeight: E > Number(d) ? d : E });
				}
			}
		} else this.setState({
			maxWidth: this.props.maxWidth,
			maxHeight: this.props.maxHeight
		});
	}, t.prototype.onResize = function(e, t, n, r) {
		var i = this, a = {
			x: this.originalPosition.x,
			y: this.originalPosition.y
		}, o = -r.width, s = -r.height;
		[
			"top",
			"left",
			"topLeft",
			"bottomLeft",
			"topRight"
		].includes(t) && (t === "bottomLeft" ? a.x += o : (t === "topRight" || (a.x += o), a.y += s));
		var c = this.draggable.state;
		(a.x !== c.x || a.y !== c.y) && er(function() {
			i.draggable.setState(a);
		}), this.updateOffsetFromParent();
		var l = this.offsetFromParent, u = this.getDraggablePosition().x + l.left, d = this.getDraggablePosition().y + l.top;
		this.resizingPosition = {
			x: u,
			y: d
		}, this.props.onResize && this.props.onResize(e, t, n, r, {
			x: u,
			y: d
		});
	}, t.prototype.onResizeStop = function(e, t, n, r) {
		this.setState({ resizing: !1 });
		var i = this.getMaxSizesFromProps(), a = i.maxWidth, o = i.maxHeight;
		this.setState({
			maxWidth: a,
			maxHeight: o
		}), this.props.onResizeStop && this.props.onResizeStop(e, t, n, r, this.resizingPosition);
	}, t.prototype.updateSize = function(e) {
		this.resizable && this.resizable.updateSize({
			width: e.width,
			height: e.height
		});
	}, t.prototype.updatePosition = function(e) {
		this.draggable.setState(e);
	}, t.prototype.updateOffsetFromParent = function() {
		var e = this.props.scale, t = this.getParent(), n = this.getSelfElement();
		if (!t || n === null) return {
			top: 0,
			left: 0
		};
		var r = t.getBoundingClientRect(), i = r.left, a = r.top, o = n.getBoundingClientRect(), s = this.getDraggablePosition(), c = t.scrollLeft, l = t.scrollTop;
		this.offsetFromParent = {
			left: o.left - i + c - s.x * e,
			top: o.top - a + l - s.y * e
		};
	}, t.prototype.render = function() {
		var e = this, t = this.props, n = t.disableDragging, r = t.style, i = t.dragHandleClassName, a = t.position, o = t.onMouseDown, s = t.onMouseUp, c = t.dragAxis, l = t.dragGrid, u = t.bounds, d = t.enableUserSelectHack, f = t.cancel, p = t.children;
		t.onResizeStart, t.onResize, t.onResizeStop, t.onDragStart, t.onDrag, t.onDragStop;
		var m = t.resizeHandleStyles, h = t.resizeHandleClasses, g = t.resizeHandleComponent, _ = t.enableResizing, v = t.resizeGrid, y = t.resizeHandleWrapperClass, b = t.resizeHandleWrapperStyle, x = t.scale, S = t.allowAnyClick, C = t.dragPositionOffset, w = el(t, /* @__PURE__ */ "disableDragging.style.dragHandleClassName.position.onMouseDown.onMouseUp.dragAxis.dragGrid.bounds.enableUserSelectHack.cancel.children.onResizeStart.onResize.onResizeStop.onDragStart.onDrag.onDragStop.resizeHandleStyles.resizeHandleClasses.resizeHandleComponent.enableResizing.resizeGrid.resizeHandleWrapperClass.resizeHandleWrapperStyle.scale.allowAnyClick.dragPositionOffset".split(".")), T = this.props.default ? $c({}, this.props.default) : void 0;
		delete w.default;
		var E = n || i ? { cursor: "auto" } : { cursor: "move" }, D = $c($c($c({}, tl), E), r), ee = this.offsetFromParent, te = ee.left, ne = ee.top, re;
		a && (re = {
			x: a.x - te,
			y: a.y - ne
		});
		var ie = this.state.resizing ? void 0 : re, ae = this.state.resizing ? "both" : c;
		return Tn(Oc, {
			ref: function(t) {
				t && (e.draggable = t);
			},
			handle: i ? `.${i}` : void 0,
			defaultPosition: T,
			onMouseDown: o,
			onMouseUp: s,
			onStart: this.onDragStart,
			onDrag: this.onDrag,
			onStop: this.onDragStop,
			axis: ae,
			disabled: n,
			grid: l,
			bounds: u ? this.state.bounds : void 0,
			position: ie,
			enableUserSelectHack: d,
			cancel: f,
			scale: x,
			allowAnyClick: S,
			nodeRef: this.resizableElement,
			positionOffset: C
		}, Tn(Xc, $c({}, w, {
			ref: function(t) {
				t && (e.resizable = t, e.resizableElement.current = t.resizable);
			},
			defaultSize: T,
			size: this.props.size,
			enable: typeof _ == "boolean" ? nl(_) : _,
			onResizeStart: this.onResizeStart,
			onResize: this.onResize,
			onResizeStop: this.onResizeStop,
			style: D,
			minWidth: this.props.minWidth,
			minHeight: this.props.minHeight,
			maxWidth: this.state.resizing ? this.state.maxWidth : this.props.maxWidth,
			maxHeight: this.state.resizing ? this.state.maxHeight : this.props.maxHeight,
			grid: v,
			handleWrapperClass: y,
			handleWrapperStyle: b,
			lockAspectRatio: this.props.lockAspectRatio,
			lockAspectRatioExtraWidth: this.props.lockAspectRatioExtraWidth,
			lockAspectRatioExtraHeight: this.props.lockAspectRatioExtraHeight,
			handleStyles: m,
			handleClasses: h,
			handleComponent: g,
			scale: this.props.scale
		}), p));
	}, t.defaultProps = {
		maxWidth: 2 ** 53 - 1,
		maxHeight: 2 ** 53 - 1,
		scale: 1,
		onResizeStart: function() {},
		onResize: function() {},
		onResizeStop: function() {},
		onDragStart: function() {},
		onDrag: function() {},
		onDragStop: function() {}
	}, t;
}(xn), il = _n(), al = H(Ln, {
	name: "CompanionWindow",
	slot: "root"
})({}), ol = H(Qn, {
	name: "CompanionWindow",
	slot: "toolbar"
})({}), sl = H(U, {
	name: "CompanionWindow",
	slot: "title"
})({}), cl = H("div", {
	name: "CompanionWindow",
	slot: "controls"
})({}), ll = H(Ln, {
	name: "CompanionWindow",
	slot: "contents"
})({}), ul = H(rl, {
	name: "CompanionWindow",
	slot: "resize"
})({}), dl = H(mn, {
	name: "CompanionWindow",
	slot: "positionButton"
})({}), fl = H(mn, {
	name: "CompanionWindow",
	slot: "closeButton"
})({}), pl = Dn((e, t) => {
	let { ariaLabel: n = void 0, classes: r = {}, direction: i, id: a, paperClassName: o = "", onCloseClick: s = () => {}, updateCompanionWindow: c = void 0, isDisplayed: u = !1, position: d = null, title: f = null, children: p = void 0, titleControls: m = null, defaultSidebarPanelWidth: h = 235, defaultSidebarPanelHeight: g = 201 } = e, [_, v] = (0, il.useElementSize)(), { t: y } = V(), b = l((e) => k(e, { companionWindowId: a }), [a]), x = i === "rtl" ? { transform: "scale(-1, 1)" } : {}, S = (() => {
		let e = {
			ltr: {
				default: "left",
				opposite: "right"
			},
			rtl: {
				default: "right",
				opposite: "left"
			}
		}, t = {
			bottom: !1,
			bottomLeft: !1,
			bottomRight: !1,
			left: !1,
			right: !1,
			top: !1,
			topLeft: !1,
			topRight: !1
		};
		return d === "right" || d === "far-right" ? {
			...t,
			[e[i].default]: !0
		} : d === "left" ? {
			...t,
			[e[i].opposite]: !0
		} : d === "bottom" || d === "far-bottom" ? {
			...t,
			top: !0
		} : t;
	})(), C = d === "bottom" || d === "far-bottom", w = bn.map(p, (e) => e ? Cn(e, { parentactions: { closeCompanionWindow: s } }) : null);
	return /* @__PURE__ */ z(al, {
		ownerState: e,
		ref: hn(t, _),
		style: {
			display: u ? null : "none",
			order: d === "left" ? -1 : null
		},
		className: [
			j(`companion-window-${d}`),
			o,
			d === "bottom" ? r.horizontal : r.vertical
		].join(" "),
		square: !0,
		component: "aside",
		role: "region",
		"aria-label": n || f,
		children: /* @__PURE__ */ z(dn.Provider, {
			value: b,
			children: /* @__PURE__ */ B(ul, {
				style: {
					display: "inherit",
					position: "inherit"
				},
				ownerState: e,
				default: {
					height: C ? g : "100%",
					width: C ? "auto" : h
				},
				disableDragging: !0,
				enableResizing: S,
				minHeight: 50,
				minWidth: d === "left" ? 235 : 100,
				children: [/* @__PURE__ */ B(ol, {
					variant: "dense",
					className: [j("companion-window-header"), v.width < 370 ? "test" : null].join(" "),
					disableGutters: !0,
					children: [
						/* @__PURE__ */ z(sl, {
							variant: "h3",
							children: f
						}),
						d === "left" ? c && /* @__PURE__ */ z(mn, {
							"aria-label": y("openInCompanionWindow"),
							onClick: () => {
								c({ position: "right" });
							},
							children: /* @__PURE__ */ z(Ns, { style: x })
						}) : /* @__PURE__ */ B(R, { children: [c && /* @__PURE__ */ z(dl, {
							"aria-label": y(d === "bottom" ? "moveCompanionWindowToRight" : "moveCompanionWindowToBottom"),
							onClick: () => {
								c({ position: d === "bottom" ? "right" : "bottom" });
							},
							children: /* @__PURE__ */ z(Ps, {})
						}), /* @__PURE__ */ z(fl, {
							sx: { ...v.width < 370 && { order: "unset" } },
							"aria-label": y("closeCompanionWindow"),
							onClick: s,
							children: /* @__PURE__ */ z(Ms, {})
						})] }),
						m && /* @__PURE__ */ z(cl, {
							ownerState: { position: d },
							sx: { order: C || v.width < 370 ? "unset" : 1e3 },
							className: j("companion-window-title-controls"),
							children: m
						})
					]
				}), /* @__PURE__ */ z(ll, {
					className: j("scrollto-scrollable"),
					elevation: 0,
					children: w
				})]
			})
		})
	});
});
pl.propTypes = {
	ariaLabel: W.default.string,
	children: W.default.node,
	classes: W.default.objectOf(W.default.string),
	defaultSidebarPanelHeight: W.default.number,
	defaultSidebarPanelWidth: W.default.number,
	direction: W.default.string.isRequired,
	id: W.default.string.isRequired,
	isDisplayed: W.default.bool,
	onCloseClick: W.default.func,
	paperClassName: W.default.string,
	position: W.default.string,
	size: W.default.shape({ width: W.default.number }),
	title: W.default.oneOfType([W.default.string, W.default.node]),
	titleControls: W.default.node,
	updateCompanionWindow: W.default.func
}, pl.displayName = "CompanionWindow";
var ml = n(w((e, { id: t, windowId: n }) => {
	let r = se(e, { companionWindowId: t }), { defaultSidebarPanelHeight: i, defaultSidebarPanelWidth: a } = we(e, { windowId: n });
	return {
		...r,
		defaultSidebarPanelHeight: i,
		defaultSidebarPanelWidth: a,
		direction: gt(e),
		isDisplayed: r && r.content && r.content.length > 0
	};
}, (e, { windowId: t, id: n }) => ({
	onCloseClick: () => e(Ii(t, n)),
	updateCompanionWindow: (...r) => e(Fi(t, n, ...r))
}), null, { forwardRef: !0 }), m("CompanionWindow"))(pl), hl = H("div", {
	name: "CompanionWindowSection",
	slot: "root"
})(({ theme: e }) => ({
	paddingBlockEnd: e.spacing(1),
	paddingBlockStart: e.spacing(2),
	paddingInlineEnd: e.spacing(1),
	paddingInlineStart: e.spacing(2)
}));
//#endregion
//#region src/components/WindowSideBarAnnotationsPanel.jsx
function gl({ annotationCount: e, canvasIds: t = [], windowId: n, id: r }) {
	let { t: i } = V(), a = En();
	return /* @__PURE__ */ B(ml, {
		title: i("annotations"),
		paperClassName: j("window-sidebar-annotation-panel"),
		windowId: n,
		id: r,
		ref: a,
		titleControls: /* @__PURE__ */ z($a, { windowId: n }),
		children: [/* @__PURE__ */ z(hl, { children: /* @__PURE__ */ z(U, {
			component: "p",
			variant: "subtitle2",
			children: i("showingNumAnnotations", {
				count: e,
				number: e
			})
		}) }), t.map((e, r) => /* @__PURE__ */ z(js, {
			canvasId: e,
			containerRef: a,
			index: r,
			totalSize: t.length,
			windowId: n
		}, e))]
	});
}
gl.propTypes = {
	annotationCount: W.default.number.isRequired,
	canvasIds: W.default.arrayOf(W.default.string),
	id: W.default.string.isRequired,
	windowId: W.default.string.isRequired
};
var _l = n(w((e, { windowId: t }) => ({
	annotationCount: Nt(e, { windowId: t }).length,
	canvasIds: st(e, { windowId: t })
}), null), m("WindowSideBarAnnotationsPanel"))(gl), vl = M(/*#__PURE__*/ z("path", { d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" }), "ExpandMore");
//#endregion
//#region src/components/CollapsibleSection.jsx
function yl({ children: e, id: t, label: n }) {
	let { t: r } = V(), [i, a] = L(!0), o = jn((e, t) => {
		a(t);
	}, [a]);
	return /* @__PURE__ */ B(tr, {
		slotProps: { heading: { component: "h4" } },
		id: t,
		elevation: 0,
		expanded: i,
		onChange: o,
		disableGutters: !0,
		square: !0,
		variant: "compact",
		children: [/* @__PURE__ */ z(rr, {
			id: `${t}-header`,
			"aria-controls": `${t}-content`,
			"aria-label": r(i ? "collapseSection" : "expandSection", { section: n }),
			expandIcon: /* @__PURE__ */ z(vl, {}),
			children: /* @__PURE__ */ z(U, {
				variant: "overline",
				children: n
			})
		}), /* @__PURE__ */ z(nr, { children: e })]
	});
}
yl.propTypes = {
	children: W.default.node.isRequired,
	id: W.default.string.isRequired,
	label: W.default.string.isRequired
};
//#endregion
//#region src/containers/CollapsibleSection.js
var bl = yl;
//#endregion
//#region src/components/LabelValueMetadata.jsx
function xl({ defaultLabel: e = void 0, labelValuePairs: t, labelValueJoiner: n = ", " }) {
	return t.length === 0 ? null : /* @__PURE__ */ z("dl", {
		className: j("label-value-metadata"),
		children: t.reduce((t, r, i) => t.concat([/* @__PURE__ */ z(U, {
			component: "dt",
			variant: "subtitle2",
			children: r.label || e
		}, `label-${i}`), /* @__PURE__ */ z(U, {
			style: {
				marginBottom: ".5em",
				marginLeft: "0px"
			},
			component: "dd",
			variant: "body1",
			children: /* @__PURE__ */ z(Es, {
				htmlString: r.values.join(n),
				ruleSet: "iiif"
			})
		}, `value-${i}`)]), [])
	});
}
xl.propTypes = {
	defaultLabel: W.default.string,
	labelValueJoiner: W.default.string,
	labelValuePairs: W.default.arrayOf(W.default.shape({
		label: W.default.string,
		values: W.default.arrayOf(W.default.string)
	})).isRequired
};
var Sl = n(w((e) => ({ labelValueJoiner: nt(e).labelValueJoiner })), m("LabelValueMetadata"))(xl);
//#endregion
//#region src/components/CanvasInfo.jsx
function Cl({ canvasDescription: e = null, canvasLabel: t = null, canvasMetadata: n = [], index: r = 1, totalSize: i = 1 }) {
	let { t: a } = V(), o = Nn(), s = Nn(), c = arguments[0];
	return /* @__PURE__ */ B(bl, {
		id: o,
		label: a("currentItem", { context: `${r + 1}/${i}` }),
		children: [
			t && /* @__PURE__ */ z(U, {
				"aria-labelledby": `${o} ${s}`,
				id: s,
				variant: "h4",
				component: "h5",
				children: t
			}),
			e && /* @__PURE__ */ z(U, {
				variant: "body1",
				children: /* @__PURE__ */ z(Es, {
					htmlString: e,
					ruleSet: "iiif"
				})
			}),
			n && n.length > 0 && /* @__PURE__ */ z(Sl, { labelValuePairs: n }),
			/* @__PURE__ */ z(cn, {
				targetName: "CanvasInfo",
				...c
			})
		]
	});
}
Cl.propTypes = {
	canvasDescription: W.default.string,
	canvasLabel: W.default.string,
	canvasMetadata: W.default.array,
	index: W.default.number,
	totalSize: W.default.number
};
var wl = n(w((e, { canvasId: t, companionWindowId: n, windowId: r }) => ({
	canvasDescription: rt(e, {
		canvasId: t,
		companionWindowId: n,
		windowId: r
	}),
	canvasLabel: Re(e, {
		canvasId: t,
		companionWindowId: n,
		windowId: r
	}),
	canvasMetadata: at(e, {
		canvasId: t,
		companionWindowId: n,
		windowId: r
	})
})), m("CanvasInfo"))(Cl), Tl = /* @__PURE__ */ p((/* @__PURE__ */ D(((e, t) => {
	var n = dt();
	t.exports = xe()(function(e, t, r) {
		n(e, r, t);
	});
})))(), 1);
function El({ availableLocales: e = [], locale: t = "", setLocale: n = void 0 }) {
	let r = l((e) => Le(e)), { t: i } = V();
	if (!n || e.length < 2) return null;
	let a = e.indexOf(t) >= 0 ? t : e[0], o = (0, Tl.default)(r, (e) => e.locale);
	return /* @__PURE__ */ B(ar, {
		variant: "standard",
		children: [/* @__PURE__ */ z(ir, { children: i("language") }), /* @__PURE__ */ z(or, {
			MenuProps: { anchorOrigin: {
				horizontal: "left",
				vertical: "bottom"
			} },
			autoWidth: !0,
			displayEmpty: !0,
			value: a,
			onChange: (e) => {
				n(e.target.value);
			},
			name: "locale",
			children: e.map((e) => /* @__PURE__ */ z(Xn, {
				value: e,
				children: /* @__PURE__ */ z(U, {
					variant: "body2",
					children: o[e]?.label || e
				})
			}, e))
		})]
	});
}
El.propTypes = {
	availableLocales: W.default.arrayOf(W.default.string),
	locale: W.default.string,
	setLocale: W.default.func
};
//#endregion
//#region src/containers/LocalePicker.js
var Dl = El;
//#endregion
//#region src/components/ManifestInfo.jsx
function Ol({ manifestDescription: e = null, manifestLabel: t = null, manifestMetadata: n = [], manifestSummary: r = null, ...i }) {
	let { t: a } = V(), o = Nn(), s = {
		manifestDescription: e,
		manifestLabel: t,
		manifestMetadata: n,
		manifestSummary: r,
		...i
	};
	return /* @__PURE__ */ B(bl, {
		id: `${o}-resource`,
		label: a("resource"),
		children: [
			t && /* @__PURE__ */ z(U, {
				"aria-labelledby": `${o}-resource ${o}-resource-heading`,
				id: `${o}-resource-heading`,
				variant: "h4",
				component: "h5",
				children: t
			}),
			e && /* @__PURE__ */ z(U, {
				variant: "body1",
				children: /* @__PURE__ */ z(Es, {
					htmlString: e,
					ruleSet: "iiif"
				})
			}),
			r && /* @__PURE__ */ z(U, {
				variant: "body1",
				children: /* @__PURE__ */ z(Es, {
					htmlString: r,
					ruleSet: "iiif"
				})
			}),
			n.length > 0 && /* @__PURE__ */ z(Sl, { labelValuePairs: n }),
			/* @__PURE__ */ z(cn, {
				targetName: "ManifestInfo",
				...s
			})
		]
	});
}
Ol.propTypes = {
	manifestDescription: W.default.string,
	manifestLabel: W.default.string,
	manifestMetadata: W.default.array,
	manifestSummary: W.default.string
};
var kl = n(w((e, { companionWindowId: t, manifestId: n, windowId: r }) => ({
	manifestDescription: ue(e, {
		companionWindowId: t,
		manifestId: n,
		windowId: r
	}),
	manifestLabel: lt(e, {
		companionWindowId: t,
		manifestId: n,
		windowId: r
	}),
	manifestMetadata: ct(e, {
		companionWindowId: t,
		manifestId: n,
		windowId: r
	}),
	manifestSummary: ft(e, {
		companionWindowId: t,
		manifestId: n,
		windowId: r
	})
})), m("ManifestInfo"))(Ol), Al = M(/*#__PURE__*/ z("path", { d: "M3 14h4v-4H3zm0 5h4v-4H3zM3 9h4V5H3zm5 5h13v-4H8zm0 5h13v-4H8zM8 5v4h13V5z" }), "ViewListSharp");
//#endregion
//#region src/components/CollectionInfo.jsx
function jl({ collectionLabel: e = null, collectionPath: t = [], showCollectionDialog: n, windowId: r = null }) {
	let { t: i } = V(), a = Nn(), o = Nn();
	return t.length === 0 ? null : /* @__PURE__ */ B(bl, {
		id: a,
		label: i("collection"),
		children: [e && /* @__PURE__ */ z(U, {
			"aria-labelledby": `${a} ${o}`,
			id: o,
			variant: "h4",
			children: e
		}), /* @__PURE__ */ z(sr, {
			color: "primary",
			onClick: () => {
				let e = t[t.length - 1];
				n(e, t.slice(0, -1), r);
			},
			startIcon: /* @__PURE__ */ z(Al, {}),
			children: i("showCollection")
		})]
	});
}
jl.propTypes = {
	collectionLabel: W.default.string,
	collectionPath: W.default.arrayOf(W.default.string),
	showCollectionDialog: W.default.func.isRequired,
	windowId: W.default.string
};
var Ml = n(w((e, { windowId: t }) => {
	let { collectionPath: n } = s(e, { windowId: t }) || {}, r = n[n.length - 1];
	return {
		collectionLabel: lt(e, { manifestId: r }),
		collectionPath: n
	};
}, { showCollectionDialog: tn }), m("CollectionInfo"))(jl), Nl = H("dl")(({ theme: e }) => ({ "& dd": {
	marginBottom: ".5em",
	marginLeft: "0"
} }));
function Pl({ homepage: e = null, manifestUrl: t = null, related: n = null, renderings: r = null, seeAlso: i = null, ...a }) {
	let { t: o } = V(), s = Nn(), c = Nn(), l = {
		homepage: e,
		manifestUrl: t,
		related: n,
		renderings: r,
		seeAlso: i,
		t: o,
		...a
	};
	return /* @__PURE__ */ B(bl, {
		"aria-labelledby": c,
		id: s,
		label: o("related"),
		children: [
			/* @__PURE__ */ z(U, {
				"aria-labelledby": `${s} ${c}`,
				id: c,
				variant: "h4",
				component: "h5",
				children: o("links")
			}),
			/* @__PURE__ */ B(Nl, {
				className: (0, G.default)(j("label-value-metadata")),
				children: [
					e && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(U, {
						variant: "subtitle2",
						component: "dt",
						children: o("iiif_homepage")
					}), e.map((e) => /* @__PURE__ */ z(U, {
						variant: "body1",
						component: "dd",
						children: /* @__PURE__ */ z(cr, {
							target: "_blank",
							rel: "noopener noreferrer",
							href: e.value,
							children: e.label || e.value
						})
					}, e.value))] }),
					r && r.length > 0 && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(U, {
						variant: "subtitle2",
						component: "dt",
						children: o("iiif_renderings")
					}), r.map((e) => /* @__PURE__ */ z(U, {
						variant: "body1",
						component: "dd",
						children: /* @__PURE__ */ z(cr, {
							target: "_blank",
							rel: "noopener noreferrer",
							href: e.value,
							children: e.label || e.value
						})
					}, e.value))] }),
					n && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(U, {
						variant: "subtitle2",
						component: "dt",
						children: o("iiif_related")
					}), n.map((e) => /* @__PURE__ */ B(U, {
						variant: "body1",
						component: "dd",
						children: [/* @__PURE__ */ z(cr, {
							target: "_blank",
							rel: "noopener noreferrer",
							href: e.value,
							children: e.label || e.value
						}), e.format && /* @__PURE__ */ z(U, {
							component: "span",
							children: ` (${e.format})`
						})]
					}, e.value))] }),
					i && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(U, {
						variant: "subtitle2",
						component: "dt",
						children: o("iiif_seeAlso")
					}), i.map((e) => /* @__PURE__ */ B(U, {
						variant: "body1",
						component: "dd",
						children: [/* @__PURE__ */ z(cr, {
							target: "_blank",
							rel: "noopener noreferrer",
							href: e.value,
							children: e.label || e.value
						}), e.format && /* @__PURE__ */ z(U, {
							component: "span",
							children: ` (${e.format})`
						})]
					}, e.value))] }),
					t && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(U, {
						variant: "subtitle2",
						component: "dt",
						children: o("iiif_manifest")
					}), /* @__PURE__ */ z(U, {
						variant: "body1",
						component: "dd",
						children: /* @__PURE__ */ z(cr, {
							target: "_blank",
							rel: "noopener noreferrer",
							href: t,
							children: t
						})
					})] })
				]
			}),
			/* @__PURE__ */ z(cn, {
				targetName: "ManifestRelatedLinks",
				...l
			})
		]
	});
}
Pl.propTypes = {
	homepage: W.default.arrayOf(W.default.shape({
		label: W.default.string,
		value: W.default.string
	})),
	manifestUrl: W.default.string,
	related: W.default.arrayOf(W.default.shape({
		format: W.default.string,
		label: W.default.string,
		value: W.default.string
	})),
	renderings: W.default.arrayOf(W.default.shape({
		label: W.default.string,
		value: W.default.string
	})),
	seeAlso: W.default.arrayOf(W.default.shape({
		format: W.default.string,
		label: W.default.string,
		value: W.default.string
	}))
};
var Fl = n(w((e, { companionWindowId: t, windowId: n }) => ({
	homepage: Me(e, { windowId: n }),
	manifestUrl: Xe(e, { windowId: n }),
	related: Pe(e, { windowId: n }),
	renderings: Fe(e, { windowId: n }),
	seeAlso: ee(e, { windowId: n })
})), m("ManifestRelatedLinks"))(Pl);
//#endregion
//#region src/components/WindowSideBarInfoPanel.jsx
function Il({ windowId: e, id: t, canvasIds: n = [], collectionPath: r = [], locale: i = "", setLocale: a = void 0, availableLocales: o = [], showLocalePicker: s = !1 }) {
	let { t: c } = V();
	return /* @__PURE__ */ B(ml, {
		title: c("aboutThisItem"),
		paperClassName: j("window-sidebar-info-panel"),
		windowId: e,
		id: t,
		titleControls: s && /* @__PURE__ */ z(Dl, {
			locale: i,
			setLocale: a,
			availableLocales: o
		}),
		children: [
			n.map((r, i) => /* @__PURE__ */ z(hl, { children: /* @__PURE__ */ z(wl, {
				canvasId: r,
				companionWindowId: t,
				index: i,
				totalSize: n.length,
				windowId: e
			}) }, r)),
			r.length > 0 && /* @__PURE__ */ z(hl, { children: /* @__PURE__ */ z(Ml, {
				companionWindowId: t,
				windowId: e
			}) }),
			/* @__PURE__ */ z(hl, { children: /* @__PURE__ */ z(kl, {
				companionWindowId: t,
				windowId: e
			}) }),
			/* @__PURE__ */ z(hl, { children: /* @__PURE__ */ z(Fl, {
				companionWindowId: t,
				windowId: e
			}) })
		]
	});
}
Il.propTypes = {
	availableLocales: W.default.arrayOf(W.default.string),
	canvasIds: W.default.arrayOf(W.default.string),
	collectionPath: W.default.arrayOf(W.default.string),
	id: W.default.string.isRequired,
	locale: W.default.string,
	setLocale: W.default.func,
	showLocalePicker: W.default.bool,
	windowId: W.default.string.isRequired
};
var Ll = n(w((e, { id: t, windowId: n }) => ({
	availableLocales: ot(e, {
		companionWindowId: t,
		windowId: n
	}),
	canvasIds: st(e, { windowId: n }),
	collectionPath: (s(e, { windowId: n }) || {}).collectionPath,
	locale: se(e, { companionWindowId: t }).locale || le(e, { windowId: n }),
	showLocalePicker: we(e, { windowId: n }).showLocalePicker
}), (e, { windowId: t, id: n }) => ({ setLocale: (r) => e(Fi(t, n, { locale: r })) })), m("WindowSideBarInfoPanel"))(Il), Rl = M(/*#__PURE__*/ z("path", { d: "M3 15h18v-2H3zm0 4h18v-2H3zm0-8h18V9H3zm0-6v2h18V5z" }), "ReorderSharp"), zl = M(/*#__PURE__*/ z("path", { d: "M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z" }), "SortSharp"), Bl = M(/*#__PURE__*/ z("path", { d: "m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" }), "ArrowForwardSharp");
//#endregion
//#region src/components/SidebarIndexItem.jsx
function Vl({ label: e }) {
	return /* @__PURE__ */ z(U, {
		variant: "body1",
		children: e
	});
}
Vl.propTypes = { label: W.default.string.isRequired };
var Hl = n(w(null, null), m("SidebarIndexItem"))(Vl);
//#endregion
//#region src/components/SidebarIndexThumbnail.jsx
function Ul({ canvas: e, height: t = void 0, label: n, width: r = void 0 }) {
	return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z("div", {
		style: { minWidth: 50 },
		children: /* @__PURE__ */ z(fn, {
			label: n,
			resource: e,
			maxHeight: t,
			maxWidth: r
		})
	}), /* @__PURE__ */ z(U, { children: n })] });
}
Ul.propTypes = {
	canvas: W.default.object.isRequired,
	height: W.default.number,
	label: W.default.string.isRequired,
	width: W.default.number
};
var Wl = n(w((e, { data: t }) => ({ ...nt(e).canvasNavigation || {} }), null), m("SidebarIndexThumbnail"))(Ul), Gl = H(Xn, {
	name: "SidebarIndexList",
	slot: "item"
})(({ theme: e }) => ({
	alignItems: "flex-start",
	paddingLeft: e.spacing(2),
	paddingRight: e.spacing(1),
	position: "initial",
	whiteSpace: "normal"
}));
function Kl(e) {
	return e.map((e) => ({
		id: e.id,
		label: new yt(e).getLabel()
	}));
}
function ql({ canvases: e, containerRef: t, selectedCanvasIds: n = [], setCanvas: r, variant: i = "item", windowId: a }) {
	let o = In(() => Kl(e), [e]), s;
	switch (i) {
		case "thumbnail":
			s = Wl;
			break;
		default: s = Hl;
	}
	return /* @__PURE__ */ z(Yn, {
		variant: "selectedMenu",
		children: o.map((o, c) => /* @__PURE__ */ z(ks, {
			containerRef: t,
			offsetTop: 96,
			selected: n.includes(o.id),
			scrollTo: n.includes(o.id),
			children: /* @__PURE__ */ z(Gl, {
				divider: !0,
				onClick: () => {
					r(a, o.id);
				},
				component: "li",
				children: /* @__PURE__ */ z(s, {
					label: o.label,
					canvas: e[c]
				})
			}, o.id)
		}, `${o.id}-${i}`))
	});
}
ql.propTypes = {
	canvases: W.default.array.isRequired,
	containerRef: W.default.oneOfType([W.default.func, W.default.shape({ current: W.default.instanceOf(Element) })]).isRequired,
	selectedCanvasIds: W.default.arrayOf(W.default.string),
	setCanvas: W.default.func.isRequired,
	variant: W.default.oneOf(["item", "thumbnail"]),
	windowId: W.default.string.isRequired
};
var Jl = n(w((e, { id: t, windowId: n }) => ({
	canvases: ut(e, { windowId: n }),
	selectedCanvasIds: st(e, { windowId: n }),
	variant: se(e, {
		companionWindowId: t,
		windowId: n
	}).variant
}), (e, { id: t, windowId: n }) => ({ setCanvas: (...t) => e(an(...t)) })), m("SidebarIndexList"))(ql);
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/extends.js
function q() {
	return q = Object.assign ? Object.assign.bind() : function(e) {
		for (var t = 1; t < arguments.length; t++) {
			var n = arguments[t];
			for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
		}
		return e;
	}, q.apply(null, arguments);
}
//#endregion
//#region node_modules/@mui/x-tree-view/node_modules/@mui/utils/esm/composeClasses/composeClasses.js
function Yl(e, t, n = void 0) {
	let r = {};
	for (let i in e) {
		let a = e[i], o = "", s = !0;
		for (let e = 0; e < a.length; e += 1) {
			let r = a[e];
			r && (o += (s === !0 ? "" : " ") + t(r), s = !1, n && n[r] && (o += " " + n[r]));
		}
		r[i] = o;
	}
	return r;
}
//#endregion
//#region node_modules/@mui/x-tree-view/node_modules/@mui/utils/esm/useForkRef/useForkRef.js
function Xl(...e) {
	let t = N.useRef(void 0), n = N.useCallback((t) => {
		let n = e.map((e) => {
			if (e == null) return null;
			if (typeof e == "function") {
				let n = e, r = n(t);
				return typeof r == "function" ? r : () => {
					n(null);
				};
			}
			return e.current = t, () => {
				e.current = null;
			};
		});
		return () => {
			n.forEach((e) => e?.());
		};
	}, e);
	return N.useMemo(() => e.every((e) => e == null) ? null : (e) => {
		t.current &&= (t.current(), void 0), e != null && (t.current = n(e));
	}, e);
}
//#endregion
//#region node_modules/@mui/x-tree-view/node_modules/@mui/utils/esm/isHostComponent/isHostComponent.js
function Zl(e) {
	return typeof e == "string";
}
//#endregion
//#region node_modules/@mui/x-tree-view/node_modules/@mui/utils/esm/appendOwnerState/appendOwnerState.js
function Ql(e, t, n) {
	return e === void 0 || Zl(e) ? t : {
		...t,
		ownerState: {
			...t.ownerState,
			...n
		}
	};
}
//#endregion
//#region node_modules/@mui/x-tree-view/node_modules/@mui/utils/esm/extractEventHandlers/extractEventHandlers.js
function $l(e, t = []) {
	if (e === void 0) return {};
	let n = {};
	return Object.keys(e).filter((n) => n.match(/^on[A-Z]/) && typeof e[n] == "function" && !t.includes(n)).forEach((t) => {
		n[t] = e[t];
	}), n;
}
//#endregion
//#region node_modules/@mui/x-tree-view/node_modules/@mui/utils/esm/omitEventHandlers/omitEventHandlers.js
function eu(e) {
	if (e === void 0) return {};
	let t = {};
	return Object.keys(e).filter((t) => !(t.match(/^on[A-Z]/) && typeof e[t] == "function")).forEach((n) => {
		t[n] = e[n];
	}), t;
}
//#endregion
//#region node_modules/@mui/x-tree-view/node_modules/@mui/utils/esm/mergeSlotProps/mergeSlotProps.js
function tu(e) {
	let { getSlotProps: t, additionalProps: n, externalSlotProps: r, externalForwardedProps: i, className: a } = e;
	if (!t) {
		let e = Is(n?.className, a, i?.className, r?.className), t = {
			...n?.style,
			...i?.style,
			...r?.style
		}, o = {
			...n,
			...i,
			...r
		};
		return e.length > 0 && (o.className = e), Object.keys(t).length > 0 && (o.style = t), {
			props: o,
			internalRef: void 0
		};
	}
	let o = $l({
		...i,
		...r
	}), s = eu(r), c = eu(i), l = t(o), u = Is(l?.className, n?.className, a, i?.className, r?.className), d = {
		...l?.style,
		...n?.style,
		...i?.style,
		...r?.style
	}, f = {
		...l,
		...n,
		...c,
		...s
	};
	return u.length > 0 && (f.className = u), Object.keys(d).length > 0 && (f.style = d), {
		props: f,
		internalRef: l.ref
	};
}
//#endregion
//#region node_modules/@mui/x-tree-view/node_modules/@mui/utils/esm/resolveComponentProps/resolveComponentProps.js
function nu(e, t, n) {
	return typeof e == "function" ? e(t, n) : e;
}
//#endregion
//#region node_modules/@mui/x-tree-view/node_modules/@mui/utils/esm/useSlotProps/useSlotProps.js
function ru(e) {
	let { elementType: t, externalSlotProps: n, ownerState: r, skipResolvingSlotProps: i = !1, ...a } = e, o = i ? {} : nu(n, r), { props: s, internalRef: c } = tu({
		...a,
		externalSlotProps: o
	}), l = Xl(c, o?.ref, e.additionalProps?.ref);
	return Ql(t, {
		...s,
		ref: l
	}, r);
}
//#endregion
//#region node_modules/@mui/x-tree-view/internals/zero-styled/index.js
function iu(e) {
	return Un;
}
//#endregion
//#region node_modules/@mui/x-tree-view/node_modules/@mui/utils/esm/ClassNameGenerator/ClassNameGenerator.js
var au = (e) => e, ou = (() => {
	let e = au;
	return {
		configure(t) {
			e = t;
		},
		generate(t) {
			return e(t);
		},
		reset() {
			e = au;
		}
	};
})(), su = {
	active: "active",
	checked: "checked",
	completed: "completed",
	disabled: "disabled",
	error: "error",
	expanded: "expanded",
	focused: "focused",
	focusVisible: "focusVisible",
	open: "open",
	readOnly: "readOnly",
	required: "required",
	selected: "selected"
};
function cu(e, t, n = "Mui") {
	let r = su[t];
	return r ? `${n}-${r}` : `${ou.generate(e)}-${t}`;
}
//#endregion
//#region node_modules/@mui/x-tree-view/node_modules/@mui/utils/esm/generateUtilityClasses/generateUtilityClasses.js
function lu(e, t, n = "Mui") {
	let r = {};
	return t.forEach((t) => {
		r[t] = cu(e, t, n);
	}), r;
}
//#endregion
//#region node_modules/@mui/x-tree-view/SimpleTreeView/simpleTreeViewClasses.js
function uu(e) {
	return cu("MuiSimpleTreeView", e);
}
lu("MuiSimpleTreeView", ["root"]);
//#endregion
//#region node_modules/@mui/x-tree-view/internals/useTreeView/useTreeViewModels.js
var du = (e, t) => {
	let n = N.useRef({}), [r, i] = N.useState(() => {
		let r = {};
		return e.forEach((e) => {
			e.models && Object.entries(e.models).forEach(([e, i]) => {
				n.current[e] = {
					isControlled: t[e] !== void 0,
					getDefaultValue: i.getDefaultValue
				}, r[e] = i.getDefaultValue(t);
			});
		}), r;
	});
	return Object.fromEntries(Object.entries(n.current).map(([e, n]) => [e, {
		value: t[e] ?? r[e],
		setControlledValue: (t) => {
			n.isControlled || i((n) => q({}, n, { [e]: t }));
		}
	}]));
}, fu = class {
	constructor() {
		this.maxListeners = 20, this.warnOnce = !1, this.events = {};
	}
	on(e, t, n = {}) {
		let r = this.events[e];
		r || (r = {
			highPriority: /* @__PURE__ */ new Map(),
			regular: /* @__PURE__ */ new Map()
		}, this.events[e] = r), n.isFirst ? r.highPriority.set(t, !0) : r.regular.set(t, !0);
	}
	removeListener(e, t) {
		this.events[e] && (this.events[e].regular.delete(t), this.events[e].highPriority.delete(t));
	}
	removeAllListeners() {
		this.events = {};
	}
	emit(e, ...t) {
		let n = this.events[e];
		if (!n) return;
		let r = Array.from(n.highPriority.keys()), i = Array.from(n.regular.keys());
		for (let e = r.length - 1; e >= 0; --e) {
			let i = r[e];
			n.highPriority.has(i) && i.apply(this, t);
		}
		for (let e = 0; e < i.length; e += 1) {
			let r = i[e];
			n.regular.has(r) && r.apply(this, t);
		}
	}
	once(e, t) {
		let n = this;
		this.on(e, function r(...i) {
			n.removeListener(e, r), t.apply(n, i);
		});
	}
}, pu = (e) => e.isPropagationStopped !== void 0, mu = () => {
	let [e] = N.useState(() => new fu());
	return { instance: {
		$$publishEvent: N.useCallback((...t) => {
			let [n, r, i = {}] = t;
			i.defaultMuiPrevented = !1, !(pu(i) && i.isPropagationStopped()) && e.emit(n, r, i);
		}, [e]),
		$$subscribeEvent: N.useCallback((t, n) => (e.on(t, n), () => {
			e.removeListener(t, n);
		}), [e])
	} };
};
mu.params = {};
//#endregion
//#region node_modules/@mui/x-tree-view/internals/corePlugins/useTreeViewOptionalPlugins/useTreeViewOptionalPlugins.js
var hu = ({ plugins: e }) => {
	let t = new Set(e);
	return { instance: { getAvailablePlugins: () => t } };
};
hu.params = {};
//#endregion
//#region node_modules/@mui/x-tree-view/internals/corePlugins/useTreeViewId/useTreeViewId.utils.js
var gu = 0, _u = () => (gu += 1, `mui-tree-view-${gu}`), vu = ({ id: e, treeId: t = "", itemId: n }) => e ?? `${t}-${n}`, yu = ({ params: e, state: t, setState: n }) => {
	N.useEffect(() => {
		n((t) => t.id.treeId === e.id && t.id.treeId !== void 0 ? t : q({}, t, { id: q({}, t.id, { treeId: e.id ?? _u() }) }));
	}, [n, e.id]);
	let r = e.id ?? t.id.treeId;
	return {
		getRootProps: () => ({ id: r }),
		contextValue: { treeId: r }
	};
};
yu.params = { id: !0 }, yu.getInitialState = ({ id: e }) => ({ id: { treeId: e ?? void 0 } });
//#endregion
//#region node_modules/@mui/x-tree-view/internals/corePlugins/corePlugins.js
var bu = [
	mu,
	hu,
	yu
];
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
function xu(e, t) {
	if (e == null) return {};
	var n = {};
	for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
		if (t.indexOf(r) !== -1) continue;
		n[r] = e[r];
	}
	return n;
}
//#endregion
//#region node_modules/@mui/x-tree-view/internals/useTreeView/extractPluginParamsFromProps.js
var Su = [
	"slots",
	"slotProps",
	"apiRef",
	"experimentalFeatures"
], Cu = (e) => {
	let { props: { slots: t, slotProps: n, apiRef: r, experimentalFeatures: i }, plugins: a } = e, o = xu(e.props, Su), s = {};
	a.forEach((e) => {
		Object.assign(s, e.params);
	});
	let c = {}, l = {};
	Object.keys(o).forEach((e) => {
		let t = o[e];
		s[e] ? c[e] = t : l[e] = t;
	});
	let u = i ?? {};
	return {
		apiRef: r,
		forwardedProps: l,
		pluginParams: a.reduce((e, t) => t.getDefaultizedParams ? t.getDefaultizedParams({
			params: e,
			experimentalFeatures: u
		}) : e, c),
		slots: t ?? {},
		slotProps: n ?? {},
		experimentalFeatures: u
	};
}, wu = ({ plugins: e, instance: t, publicAPI: n, rootRef: r }) => ({
	runItemPlugins: (t) => {
		let n = null, r = null, i = [], a = {};
		e.forEach((e) => {
			if (!e.itemPlugin) return;
			let o = e.itemPlugin({
				props: t,
				rootRef: n,
				contentRef: r
			});
			o?.rootRef && (n = o.rootRef), o?.contentRef && (r = o.contentRef), o?.propsEnhancers && (i.push(o.propsEnhancers), Object.keys(o.propsEnhancers).forEach((e) => {
				a[e] = !0;
			}));
		});
		let o = (e) => (t) => {
			let n = {};
			return i.forEach((r) => {
				let i = r[e];
				i != null && Object.assign(n, i(t));
			}), n;
		}, s = Object.fromEntries(Object.keys(a).map((e) => [e, o(e)]));
		return {
			contentRef: r,
			rootRef: n,
			propsEnhancers: s
		};
	},
	wrapItem: ({ itemId: n, children: r }) => {
		let i = r;
		for (let r = e.length - 1; r >= 0; --r) {
			let a = e[r];
			a.wrapItem && (i = a.wrapItem({
				itemId: n,
				children: i,
				instance: t
			}));
		}
		return i;
	},
	wrapRoot: ({ children: n }) => {
		let r = n;
		for (let n = e.length - 1; n >= 0; --n) {
			let i = e[n];
			i.wrapRoot && (r = i.wrapRoot({
				children: r,
				instance: t
			}));
		}
		return r;
	},
	instance: t,
	rootRef: r,
	publicAPI: n
});
//#endregion
//#region node_modules/@mui/x-tree-view/internals/useTreeView/useTreeView.js
function Tu(e) {
	let t = N.useRef({});
	return e ? (e.current ??= {}, e.current) : t.current;
}
var Eu = ({ plugins: e, rootRef: t, props: n }) => {
	let r = [...bu, ...e], { pluginParams: i, forwardedProps: a, apiRef: o, experimentalFeatures: s, slots: c, slotProps: l } = Cu({
		plugins: r,
		props: n
	}), u = du(r, i), d = N.useRef({}).current, f = Tu(o), p = N.useRef(null), m = Xl(p, t), h = wu({
		plugins: r,
		instance: d,
		publicAPI: f,
		rootRef: p
	}), [g, _] = N.useState(() => {
		let e = {};
		return r.forEach((t) => {
			t.getInitialState && Object.assign(e, t.getInitialState(i));
		}), e;
	}), v = [];
	return r.forEach((e) => {
		let t = e({
			instance: d,
			params: i,
			slots: c,
			slotProps: l,
			experimentalFeatures: s,
			state: g,
			setState: _,
			rootRef: p,
			models: u,
			plugins: r
		});
		t.getRootProps && v.push(t.getRootProps), t.publicAPI && Object.assign(f, t.publicAPI), t.instance && Object.assign(d, t.instance), t.contextValue && Object.assign(h, t.contextValue);
	}), {
		getRootProps: (e = {}) => {
			let t = q({ role: "tree" }, a, e, { ref: m });
			return v.forEach((n) => {
				Object.assign(t, n(e));
			}), t;
		},
		rootRef: m,
		contextValue: h,
		instance: d
	};
}, Du = /*#__PURE__*/ N.createContext(null);
//#endregion
//#region node_modules/@mui/x-tree-view/internals/TreeViewProvider/TreeViewProvider.js
function Ou(e) {
	let { value: t, children: n } = e;
	return /*#__PURE__*/ z(Du.Provider, {
		value: t,
		children: t.wrapRoot({
			children: n,
			instance: t.instance
		})
	});
}
//#endregion
//#region node_modules/@mui/x-tree-view/internals/TreeViewProvider/useTreeViewContext.js
var ku = () => {
	let e = N.useContext(Du);
	if (e == null) throw Error([
		"MUI X: Could not find the Tree View context.",
		"It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.",
		"This can also happen if you are bundling multiple versions of the Tree View."
	].join("\n"));
	return e;
}, Au = (e, t, n) => {
	e.$$publishEvent(t, n);
}, ju = "__TREE_VIEW_ROOT_PARENT_ID__", Mu = (e) => {
	let t = {};
	return e.forEach((e, n) => {
		t[e] = n;
	}), t;
}, Nu = /*#__PURE__*/ N.createContext(() => -1), Pu = ["children"], Fu = ({ items: e, isItemDisabled: t, getItemLabel: n, getItemId: r }) => {
	let i = {}, a = {}, o = { [ju]: [] }, s = (e, c, l) => {
		let u = r ? r(e) : e.id;
		if (u == null) throw Error([
			"MUI X: The Tree View component requires all items to have a unique `id` property.",
			"Alternatively, you can use the `getItemId` prop to specify a custom id for each item.",
			"An item was provided without id in the `items` prop:",
			JSON.stringify(e)
		].join("\n"));
		if (i[u] != null) throw Error([
			"MUI X: The Tree View component requires all items to have a unique `id` property.",
			"Alternatively, you can use the `getItemId` prop to specify a custom id for each item.",
			`Two items were provided with the same id in the \`items\` prop: "${u}"`
		].join("\n"));
		let d = n ? n(e) : e.label;
		if (d == null) throw Error([
			"MUI X: The Tree View component requires all items to have a `label` property.",
			"Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.",
			"An item was provided without label in the `items` prop:",
			JSON.stringify(e)
		].join("\n"));
		i[u] = {
			id: u,
			label: d,
			parentId: l,
			idAttribute: void 0,
			expandable: !!e.children?.length,
			disabled: t ? t(e) : !1,
			depth: c
		}, a[u] = e;
		let f = l ?? "__TREE_VIEW_ROOT_PARENT_ID__";
		o[f] || (o[f] = []), o[f].push(u), e.children?.forEach((e) => s(e, c + 1, u));
	};
	e.forEach((e) => s(e, 0, null));
	let c = {};
	return Object.keys(o).forEach((e) => {
		c[e] = Mu(o[e]);
	}), {
		itemMetaMap: i,
		itemMap: a,
		itemOrderedChildrenIds: o,
		itemChildrenIndexes: c
	};
}, Iu = ({ instance: e, params: t, state: n, setState: r, experimentalFeatures: i }) => {
	let a = N.useCallback((e) => n.items.itemMetaMap[e], [n.items.itemMetaMap]), o = N.useCallback((e) => n.items.itemMap[e], [n.items.itemMap]), s = N.useCallback(() => {
		let e = (t) => {
			let r = n.items.itemMap[t], i = xu(r, Pu), a = n.items.itemOrderedChildrenIds[t];
			return a && (i.children = a.map(e)), i;
		};
		return n.items.itemOrderedChildrenIds[ju].map(e);
	}, [n.items.itemMap, n.items.itemOrderedChildrenIds]), c = N.useCallback((t) => {
		if (t == null) return !1;
		let n = e.getItemMeta(t);
		if (!n) return !1;
		if (n.disabled) return !0;
		for (; n.parentId != null;) if (n = e.getItemMeta(n.parentId), n.disabled) return !0;
		return !1;
	}, [e]), l = N.useCallback((t) => {
		let r = e.getItemMeta(t).parentId ?? "__TREE_VIEW_ROOT_PARENT_ID__";
		return n.items.itemChildrenIndexes[r][t];
	}, [e, n.items.itemChildrenIndexes]), u = N.useCallback((e) => n.items.itemOrderedChildrenIds[e ?? "__TREE_VIEW_ROOT_PARENT_ID__"] ?? [], [n.items.itemOrderedChildrenIds]), d = (t) => {
		let r = e.getItemMeta(t);
		return r == null ? null : document.getElementById(vu({
			treeId: n.id.treeId,
			itemId: t,
			id: r.idAttribute
		}));
	}, f = (n) => t.disabledItemsFocusable ? !0 : !e.isItemDisabled(n), p = N.useRef(!1), m = N.useCallback(() => {
		p.current = !0;
	}, []), h = N.useCallback(() => p.current, []);
	return N.useEffect(() => {
		e.areItemUpdatesPrevented() || r((n) => {
			let r = Fu({
				items: t.items,
				isItemDisabled: t.isItemDisabled,
				getItemId: t.getItemId,
				getItemLabel: t.getItemLabel
			});
			return Object.values(n.items.itemMetaMap).forEach((t) => {
				r.itemMetaMap[t.id] || Au(e, "removeItem", { id: t.id });
			}), q({}, n, { items: r });
		});
	}, [
		e,
		r,
		t.items,
		t.isItemDisabled,
		t.getItemId,
		t.getItemLabel
	]), {
		getRootProps: () => ({ style: { "--TreeView-itemChildrenIndentation": typeof t.itemChildrenIndentation == "number" ? `${t.itemChildrenIndentation}px` : t.itemChildrenIndentation } }),
		publicAPI: {
			getItem: o,
			getItemDOMElement: d,
			getItemTree: s,
			getItemOrderedChildrenIds: u
		},
		instance: {
			getItemMeta: a,
			getItem: o,
			getItemTree: s,
			getItemsToRender: () => {
				let e = (t) => {
					let r = n.items.itemMetaMap[t];
					return {
						label: r.label,
						itemId: r.id,
						id: r.idAttribute,
						children: n.items.itemOrderedChildrenIds[t]?.map(e)
					};
				};
				return n.items.itemOrderedChildrenIds[ju].map(e);
			},
			getItemIndex: l,
			getItemDOMElement: d,
			getItemOrderedChildrenIds: u,
			isItemDisabled: c,
			isItemNavigable: f,
			preventItemUpdates: m,
			areItemUpdatesPrevented: h
		},
		contextValue: { items: {
			onItemClick: t.onItemClick,
			disabledItemsFocusable: t.disabledItemsFocusable,
			indentationAtItemLevel: i.indentationAtItemLevel ?? !1
		} }
	};
};
Iu.getInitialState = (e) => ({ items: Fu({
	items: e.items,
	isItemDisabled: e.isItemDisabled,
	getItemId: e.getItemId,
	getItemLabel: e.getItemLabel
}) }), Iu.getDefaultizedParams = ({ params: e }) => q({}, e, {
	disabledItemsFocusable: e.disabledItemsFocusable ?? !1,
	itemChildrenIndentation: e.itemChildrenIndentation ?? "12px"
}), Iu.wrapRoot = ({ children: e, instance: t }) => /*#__PURE__*/ z(Nu.Provider, {
	value: (e) => t.getItemMeta(e)?.depth ?? 0,
	children: e
}), Iu.params = {
	disabledItemsFocusable: !0,
	items: !0,
	isItemDisabled: !0,
	getItemLabel: !0,
	getItemId: !0,
	onItemClick: !0,
	itemChildrenIndentation: !0
};
//#endregion
//#region node_modules/@mui/x-tree-view/node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js
var Lu = typeof window < "u" ? N.useLayoutEffect : N.useEffect;
//#endregion
//#region node_modules/@mui/x-tree-view/node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
function Ru(e) {
	let t = N.useRef(e);
	return Lu(() => {
		t.current = e;
	}), N.useRef((...e) => (0, t.current)(...e)).current;
}
//#endregion
//#region node_modules/@mui/x-tree-view/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js
var zu = ({ instance: e, params: t, models: n }) => {
	let r = N.useMemo(() => {
		let e = /* @__PURE__ */ new Map();
		return n.expandedItems.value.forEach((t) => {
			e.set(t, !0);
		}), e;
	}, [n.expandedItems.value]), i = (e, r) => {
		t.onExpandedItemsChange?.(e, r), n.expandedItems.setControlledValue(r);
	}, a = N.useCallback((e) => r.has(e), [r]), o = N.useCallback((t) => !!e.getItemMeta(t)?.expandable, [e]), s = Ru((t, n) => {
		let r = e.isItemExpanded(n);
		e.setItemExpansion(t, n, !r);
	}), c = Ru((r, a, o) => {
		if (e.isItemExpanded(a) === o) return;
		let s;
		s = o ? [a].concat(n.expandedItems.value) : n.expandedItems.value.filter((e) => e !== a), t.onItemExpansionToggle && t.onItemExpansionToggle(r, a, o), i(r, s);
	}), l = (r, a) => {
		let o = e.getItemMeta(a), s = e.getItemOrderedChildrenIds(o.parentId).filter((t) => e.isItemExpandable(t) && !e.isItemExpanded(t)), c = n.expandedItems.value.concat(s);
		s.length > 0 && (t.onItemExpansionToggle && s.forEach((e) => {
			t.onItemExpansionToggle(r, e, !0);
		}), i(r, c));
	}, u = N.useMemo(() => t.expansionTrigger ? t.expansionTrigger : e.isTreeViewEditable ? "iconContainer" : "content", [t.expansionTrigger, e.isTreeViewEditable]);
	return {
		publicAPI: { setItemExpansion: c },
		instance: {
			isItemExpanded: a,
			isItemExpandable: o,
			setItemExpansion: c,
			toggleItemExpansion: s,
			expandAllSiblings: l
		},
		contextValue: { expansion: { expansionTrigger: u } }
	};
};
zu.models = { expandedItems: { getDefaultValue: (e) => e.defaultExpandedItems } };
var Bu = [];
zu.getDefaultizedParams = ({ params: e }) => q({}, e, { defaultExpandedItems: e.defaultExpandedItems ?? Bu }), zu.params = {
	expandedItems: !0,
	defaultExpandedItems: !0,
	onExpandedItemsChange: !0,
	onItemExpansionToggle: !0,
	expansionTrigger: !0
};
//#endregion
//#region node_modules/@mui/x-tree-view/internals/utils/tree.js
var Vu = (e, t) => {
	let n = t.length - 1;
	for (; n >= 0 && !e.isItemNavigable(t[n]);) --n;
	if (n !== -1) return t[n];
}, Hu = (e, t) => {
	let n = e.getItemMeta(t), r = e.getItemOrderedChildrenIds(n.parentId), i = e.getItemIndex(t);
	if (i === 0) return n.parentId;
	let a = i - 1;
	for (; !e.isItemNavigable(r[a]) && a >= 0;) --a;
	if (a === -1) return n.parentId == null ? null : Hu(e, n.parentId);
	let o = r[a], s = Vu(e, e.getItemOrderedChildrenIds(o));
	for (; e.isItemExpanded(o) && s != null;) o = s, s = e.getItemOrderedChildrenIds(o).find(e.isItemNavigable);
	return o;
}, Uu = (e, t) => {
	if (e.isItemExpanded(t)) {
		let n = e.getItemOrderedChildrenIds(t).find(e.isItemNavigable);
		if (n != null) return n;
	}
	let n = e.getItemMeta(t);
	for (; n != null;) {
		let t = e.getItemOrderedChildrenIds(n.parentId), r = e.getItemIndex(n.id);
		if (r < t.length - 1) {
			let n = r + 1;
			for (; !e.isItemNavigable(t[n]) && n < t.length - 1;) n += 1;
			if (e.isItemNavigable(t[n])) return t[n];
		}
		n = e.getItemMeta(n.parentId);
	}
	return null;
}, Wu = (e) => {
	let t = null;
	for (; t == null || e.isItemExpanded(t);) {
		let n = Vu(e, e.getItemOrderedChildrenIds(t));
		if (n == null) return t;
		t = n;
	}
	return t;
}, Gu = (e) => e.getItemOrderedChildrenIds(null).find(e.isItemNavigable), Ku = (e, t, n) => {
	if (t === n) return [t, n];
	let r = e.getItemMeta(t), i = e.getItemMeta(n);
	if (r.parentId === i.id || i.parentId === r.id) return i.parentId === r.id ? [r.id, i.id] : [i.id, r.id];
	let a = [r.id], o = [i.id], s = r.parentId, c = i.parentId, l = o.indexOf(s) !== -1, u = a.indexOf(c) !== -1, d = !0, f = !0;
	for (; !u && !l;) d && (a.push(s), l = o.indexOf(s) !== -1, d = s !== null, !l && d && (s = e.getItemMeta(s).parentId)), f && !l && (o.push(c), u = a.indexOf(c) !== -1, f = c !== null, !u && f && (c = e.getItemMeta(c).parentId));
	let p = l ? s : c, m = e.getItemOrderedChildrenIds(p), h = a[a.indexOf(p) - 1], g = o[o.indexOf(p) - 1];
	return m.indexOf(h) < m.indexOf(g) ? [t, n] : [n, t];
}, qu = (e, t, n) => {
	let r = (t) => {
		if (e.isItemExpandable(t) && e.isItemExpanded(t)) return e.getItemOrderedChildrenIds(t)[0];
		let n = e.getItemMeta(t);
		for (; n != null;) {
			let t = e.getItemOrderedChildrenIds(n.parentId), r = e.getItemIndex(n.id);
			if (r < t.length - 1) return t[r + 1];
			n = e.getItemMeta(n.parentId);
		}
		throw Error("Invalid range");
	}, [i, a] = Ku(e, t, n), o = [i], s = i;
	for (; s !== a;) s = r(s), e.isItemDisabled(s) || o.push(s);
	return o;
}, Ju = (e) => {
	let t = Gu(e), n = [];
	for (; t != null;) n.push(t), t = Uu(e, t);
	return n;
}, Yu = (e, t) => t !== e.closest("*[role=\"treeitem\"]"), Xu = (e) => Array.isArray(e) ? e : e == null ? [] : [e], Zu = (e) => {
	let t = {};
	return e.forEach((e) => {
		t[e] = !0;
	}), t;
}, Qu = ({ instance: e, params: t, models: n }) => {
	let r = N.useRef(null), i = N.useRef({}), a = N.useMemo(() => {
		let e = /* @__PURE__ */ new Map();
		return Array.isArray(n.selectedItems.value) ? n.selectedItems.value.forEach((t) => {
			e.set(t, !0);
		}) : n.selectedItems.value != null && e.set(n.selectedItems.value, !0), e;
	}, [n.selectedItems.value]), o = (r, i) => {
		if (t.onItemSelectionToggle) {
			if (t.multiSelect) {
				let a = i.filter((t) => !e.isItemSelected(t)), o = n.selectedItems.value.filter((e) => !i.includes(e));
				a.forEach((e) => {
					t.onItemSelectionToggle(r, e, !0);
				}), o.forEach((e) => {
					t.onItemSelectionToggle(r, e, !1);
				});
			} else i !== n.selectedItems.value && (n.selectedItems.value != null && t.onItemSelectionToggle(r, n.selectedItems.value, !1), i != null && t.onItemSelectionToggle(r, i, !0));
		}
		t.onSelectedItemsChange && t.onSelectedItemsChange(r, i), n.selectedItems.setControlledValue(i);
	}, s = (e) => a.has(e), c = ({ event: a, itemId: s, keepExistingSelection: c = !1, shouldBeSelected: l }) => {
		if (t.disableSelection) return;
		let u;
		if (c) {
			let t = Xu(n.selectedItems.value), r = e.isItemSelected(s);
			u = r && (l === !1 || l == null) ? t.filter((e) => e !== s) : !r && (l === !0 || l == null) ? [s].concat(t) : t;
		} else u = l === !1 || l == null && e.isItemSelected(s) ? t.multiSelect ? [] : null : t.multiSelect ? [s] : s;
		o(a, u), r.current = s, i.current = {};
	}, l = (r, [a, s]) => {
		if (t.disableSelection || !t.multiSelect) return;
		let c = Xu(n.selectedItems.value).slice();
		Object.keys(i.current).length > 0 && (c = c.filter((e) => !i.current[e]));
		let l = Zu(c), u = qu(e, a, s), d = u.filter((e) => !l[e]);
		c = c.concat(d), o(r, c), i.current = Zu(u);
	};
	return {
		getRootProps: () => ({ "aria-multiselectable": t.multiSelect }),
		publicAPI: { selectItem: c },
		instance: {
			isItemSelected: s,
			selectItem: c,
			selectAllNavigableItems: (n) => {
				if (t.disableSelection || !t.multiSelect) return;
				let r = Ju(e);
				o(n, r), i.current = Zu(r);
			},
			expandSelectionRange: (t, n) => {
				if (r.current != null) {
					let [i, a] = Ku(e, n, r.current);
					l(t, [i, a]);
				}
			},
			selectRangeFromStartToItem: (t, n) => {
				l(t, [Gu(e), n]);
			},
			selectRangeFromItemToEnd: (t, n) => {
				l(t, [n, Wu(e)]);
			},
			selectItemFromArrowNavigation: (e, r, a) => {
				if (t.disableSelection || !t.multiSelect) return;
				let s = Xu(n.selectedItems.value).slice();
				Object.keys(i.current).length === 0 ? (s.push(a), i.current = {
					[r]: !0,
					[a]: !0
				}) : (i.current[r] || (i.current = {}), i.current[a] ? (s = s.filter((e) => e !== r), delete i.current[r]) : (s.push(a), i.current[a] = !0)), o(e, s);
			}
		},
		contextValue: { selection: {
			multiSelect: t.multiSelect,
			checkboxSelection: t.checkboxSelection,
			disableSelection: t.disableSelection
		} }
	};
};
Qu.models = { selectedItems: { getDefaultValue: (e) => e.defaultSelectedItems } };
var $u = [];
Qu.getDefaultizedParams = ({ params: e }) => q({}, e, {
	disableSelection: e.disableSelection ?? !1,
	multiSelect: e.multiSelect ?? !1,
	checkboxSelection: e.checkboxSelection ?? !1,
	defaultSelectedItems: e.defaultSelectedItems ?? (e.multiSelect ? $u : null)
}), Qu.params = {
	disableSelection: !0,
	multiSelect: !0,
	checkboxSelection: !0,
	defaultSelectedItems: !0,
	selectedItems: !0,
	onSelectedItemsChange: !0,
	onItemSelectionToggle: !0
};
//#endregion
//#region node_modules/@mui/x-tree-view/node_modules/@mui/utils/esm/ownerDocument/ownerDocument.js
function ed(e) {
	return e && e.ownerDocument || document;
}
//#endregion
//#region node_modules/@mui/x-tree-view/internals/utils/cleanupTracking/TimerBasedCleanupTracking.js
var td = 1e3, nd = class {
	constructor(e = td) {
		this.timeouts = /* @__PURE__ */ new Map(), this.cleanupTimeout = td, this.cleanupTimeout = e;
	}
	register(e, t, n) {
		this.timeouts ||= /* @__PURE__ */ new Map();
		let r = setTimeout(() => {
			typeof t == "function" && t(), this.timeouts.delete(n.cleanupToken);
		}, this.cleanupTimeout);
		this.timeouts.set(n.cleanupToken, r);
	}
	unregister(e) {
		let t = this.timeouts.get(e.cleanupToken);
		t && (this.timeouts.delete(e.cleanupToken), clearTimeout(t));
	}
	reset() {
		this.timeouts &&= (this.timeouts.forEach((e, t) => {
			this.unregister({ cleanupToken: t });
		}), void 0);
	}
}, rd = class {
	constructor() {
		this.registry = new FinalizationRegistry((e) => {
			typeof e == "function" && e();
		});
	}
	register(e, t, n) {
		this.registry.register(e, t, n);
	}
	unregister(e) {
		this.registry.unregister(e);
	}
	reset() {}
}, id = class {};
function ad(e) {
	let t = 0;
	return function(n, r, i) {
		e.registry === null && (e.registry = typeof FinalizationRegistry < "u" ? new rd() : new nd());
		let [a] = N.useState(new id()), o = N.useRef(null), s = N.useRef(void 0);
		s.current = i;
		let c = N.useRef(null);
		!o.current && s.current ? (o.current = n.$$subscribeEvent(r, (e, t) => {
			t.defaultMuiPrevented || s.current?.(e, t);
		}), t += 1, c.current = { cleanupToken: t }, e.registry.register(a, () => {
			o.current?.(), o.current = null, c.current = null;
		}, c.current)) : !s.current && o.current && (o.current(), o.current = null, c.current &&= (e.registry.unregister(c.current), null)), N.useEffect(() => (!o.current && s.current && (o.current = n.$$subscribeEvent(r, (e, t) => {
			t.defaultMuiPrevented || s.current?.(e, t);
		})), c.current && e.registry && (e.registry.unregister(c.current), c.current = null), () => {
			o.current?.(), o.current = null;
		}), [n, r]);
	};
}
var od = ad({ registry: null }), sd = (e = document) => {
	let t = e.activeElement;
	return t ? t.shadowRoot ? sd(t.shadowRoot) : t : null;
};
function cd(e) {
	return e.replace(/["\\]/g, "\\$&");
}
//#endregion
//#region node_modules/@mui/x-tree-view/internals/plugins/useTreeViewFocus/useTreeViewFocus.js
var ld = (e, t) => {
	let n = Xu(t).find((t) => {
		if (!e.isItemNavigable(t)) return !1;
		let n = e.getItemMeta(t);
		return n && (n.parentId == null || e.isItemExpanded(n.parentId));
	});
	return n ??= Gu(e), n;
}, ud = ({ instance: e, params: t, state: n, setState: r, models: i, rootRef: a }) => {
	let o = ld(e, i.selectedItems.value), s = Ru((e) => {
		let t = typeof e == "function" ? e(n.focusedItemId) : e;
		n.focusedItemId !== t && r((e) => q({}, e, { focusedItemId: t }));
	}), c = N.useCallback(() => !!a.current && a.current.contains(sd(ed(a.current))), [a]), l = N.useCallback((e) => n.focusedItemId === e && c(), [n.focusedItemId, c]), u = (t) => {
		let n = e.getItemMeta(t);
		return n && (n.parentId == null || e.isItemExpanded(n.parentId));
	}, d = (n, r) => {
		let i = e.getItemDOMElement(r);
		i && i.focus(), s(r), t.onItemFocus && t.onItemFocus(n, r);
	}, f = Ru((e, t) => {
		u(t) && d(e, t);
	}), p = Ru(() => {
		if (n.focusedItemId != null) {
			if (e.getItemMeta(n.focusedItemId)) {
				let t = e.getItemDOMElement(n.focusedItemId);
				t && t.blur();
			}
			s(null);
		}
	}), m = (e) => e === o;
	od(e, "removeItem", ({ id: e }) => {
		n.focusedItemId === e && d(null, o);
	});
	let h = (e) => (t) => {
		e.onFocus?.(t), !t.defaultMuiPrevented && t.target === t.currentTarget && d(t, o);
	};
	return {
		getRootProps: (e) => ({ onFocus: h(e) }),
		publicAPI: { focusItem: f },
		instance: {
			isItemFocused: l,
			canItemBeTabbed: m,
			focusItem: f,
			removeFocusedItem: p
		}
	};
};
ud.getInitialState = () => ({ focusedItemId: null }), ud.params = { onItemFocus: !0 };
//#endregion
//#region node_modules/@mui/x-tree-view/internals/utils/plugins.js
var dd = (e, t) => e.getAvailablePlugins().has(t), fd = ({ props: e }) => {
	let { instance: t } = ku(), { label: n, itemId: r } = e, [i, a] = N.useState(n), o = t.isItemBeingEdited(r);
	return N.useEffect(() => {
		o || a(n);
	}, [o, n]), { propsEnhancers: { labelInput: ({ externalEventHandlers: e, interactions: n }) => t.isItemEditable(r) ? {
		value: i ?? "",
		"data-element": "labelInput",
		onChange: (t) => {
			e.onChange?.(t), a(t.target.value);
		},
		onKeyDown: (t) => {
			if (e.onKeyDown?.(t), t.defaultMuiPrevented) return;
			let r = t.target;
			t.key === "Enter" && r.value ? n.handleSaveItemLabel(t, r.value) : t.key === "Escape" && n.handleCancelItemLabelEditing(t);
		},
		onBlur: (t) => {
			e.onBlur?.(t), !t.defaultMuiPrevented && t.target.value && n.handleSaveItemLabel(t, t.target.value);
		},
		autoFocus: !0,
		type: "text"
	} : {} } };
}, pd = ({ instance: e, state: t, setState: n, params: r }) => {
	let i = N.useRef(t.editedItemId), a = (e) => i.current === e, o = (e) => {
		n((t) => q({}, t, { editedItemId: e })), i.current = e;
	}, s = (e) => e === t.editedItemId, c = !!r.isItemEditable, l = (t) => {
		if (t == null || !c) return !1;
		let n = e.getItem(t);
		return n ? typeof r.isItemEditable == "function" ? r.isItemEditable(n) : !!r.isItemEditable : !1;
	}, u = (e, t) => {
		if (!t) throw Error([
			"MUI X: The Tree View component requires all items to have a `label` property.",
			"The label of an item cannot be empty.",
			e
		].join("\n"));
		n((n) => {
			let r = n.items.itemMetaMap[e];
			return r.label === t ? n : q({}, n, { items: q({}, n.items, { itemMetaMap: q({}, n.items.itemMetaMap, { [e]: q({}, r, { label: t }) }) }) });
		}), r.onItemLabelChange && r.onItemLabelChange(e, t);
	};
	return {
		instance: {
			setEditedItemId: o,
			isItemBeingEdited: s,
			updateItemLabel: u,
			isItemEditable: l,
			isTreeViewEditable: c,
			isItemBeingEditedRef: a
		},
		publicAPI: { updateItemLabel: u }
	};
};
pd.itemPlugin = fd, pd.getDefaultizedParams = ({ params: e, experimentalFeatures: t }) => {
	let n = t?.labelEditing;
	return q({}, e, { isItemEditable: n ? e.isItemEditable ?? !1 : !1 });
}, pd.getInitialState = () => ({ editedItemId: null }), pd.params = {
	onItemLabelChange: !0,
	isItemEditable: !0
};
//#endregion
//#region node_modules/@mui/x-tree-view/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js
function md(e) {
	return !!e && e.length === 1 && !!e.match(/\S/);
}
var hd = ({ instance: e, params: t, state: n }) => {
	let r = dr(), i = N.useRef({}), a = Ru((e) => {
		i.current = e(i.current);
	});
	N.useEffect(() => {
		if (e.areItemUpdatesPrevented()) return;
		let t = {};
		Object.values(n.items.itemMetaMap).forEach((e) => {
			t[e.id] = e.label.substring(0, 1).toLowerCase();
		}), i.current = t;
	}, [
		n.items.itemMetaMap,
		t.getItemId,
		e
	]);
	let o = (t, n) => {
		let r = n.toLowerCase(), a = (t) => {
			let n = Uu(e, t);
			return n === null ? Gu(e) : n;
		}, o = null, s = a(t), c = {};
		for (; o == null && !c[s];) i.current[s] === r ? o = s : (c[s] = !0, s = a(s));
		return o;
	}, s = (n) => !t.disableSelection && !e.isItemDisabled(n), c = (t) => !e.isItemDisabled(t) && e.isItemExpandable(t);
	return { instance: {
		updateFirstCharMap: a,
		handleItemKeyDown: (n, i) => {
			if (n.defaultMuiPrevented || n.altKey || Yu(n.target, n.currentTarget)) return;
			let a = n.ctrlKey || n.metaKey, l = n.key;
			switch (!0) {
				case l === " " && s(i):
					n.preventDefault(), t.multiSelect && n.shiftKey ? e.expandSelectionRange(n, i) : e.selectItem({
						event: n,
						itemId: i,
						keepExistingSelection: t.multiSelect,
						shouldBeSelected: !t.multiSelect || void 0
					});
					break;
				case l === "Enter":
					dd(e, pd) && e.isItemEditable(i) && !e.isItemBeingEdited(i) ? e.setEditedItemId(i) : c(i) ? (e.toggleItemExpansion(n, i), n.preventDefault()) : s(i) && (t.multiSelect ? (n.preventDefault(), e.selectItem({
						event: n,
						itemId: i,
						keepExistingSelection: !0
					})) : e.isItemSelected(i) || (e.selectItem({
						event: n,
						itemId: i
					}), n.preventDefault()));
					break;
				case l === "ArrowDown": {
					let r = Uu(e, i);
					r && (n.preventDefault(), e.focusItem(n, r), t.multiSelect && n.shiftKey && s(r) && e.selectItemFromArrowNavigation(n, i, r));
					break;
				}
				case l === "ArrowUp": {
					let r = Hu(e, i);
					r && (n.preventDefault(), e.focusItem(n, r), t.multiSelect && n.shiftKey && s(r) && e.selectItemFromArrowNavigation(n, i, r));
					break;
				}
				case l === "ArrowRight" && !r || l === "ArrowLeft" && r:
					if (a) return;
					if (e.isItemExpanded(i)) {
						let t = Uu(e, i);
						t && (e.focusItem(n, t), n.preventDefault());
					} else c(i) && (e.toggleItemExpansion(n, i), n.preventDefault());
					break;
				case l === "ArrowLeft" && !r || l === "ArrowRight" && r:
					if (a) return;
					if (c(i) && e.isItemExpanded(i)) e.toggleItemExpansion(n, i), n.preventDefault();
					else {
						let t = e.getItemMeta(i).parentId;
						t && (e.focusItem(n, t), n.preventDefault());
					}
					break;
				case l === "Home":
					s(i) && t.multiSelect && a && n.shiftKey ? e.selectRangeFromStartToItem(n, i) : e.focusItem(n, Gu(e)), n.preventDefault();
					break;
				case l === "End":
					s(i) && t.multiSelect && a && n.shiftKey ? e.selectRangeFromItemToEnd(n, i) : e.focusItem(n, Wu(e)), n.preventDefault();
					break;
				case l === "*":
					e.expandAllSiblings(n, i), n.preventDefault();
					break;
				case String.fromCharCode(n.keyCode) === "A" && a && t.multiSelect && !t.disableSelection:
					e.selectAllNavigableItems(n), n.preventDefault();
					break;
				case !a && !n.shiftKey && md(l): {
					let t = o(i, l);
					t != null && (e.focusItem(n, t), n.preventDefault());
					break;
				}
			}
		}
	} };
};
hd.params = {};
//#endregion
//#region node_modules/@mui/x-tree-view/internals/plugins/useTreeViewIcons/useTreeViewIcons.js
var gd = ({ slots: e, slotProps: t }) => ({ contextValue: { icons: {
	slots: {
		collapseIcon: e.collapseIcon,
		expandIcon: e.expandIcon,
		endIcon: e.endIcon
	},
	slotProps: {
		collapseIcon: t.collapseIcon,
		expandIcon: t.expandIcon,
		endIcon: t.endIcon
	}
} } });
gd.params = {};
//#endregion
//#region node_modules/@mui/x-tree-view/internals/TreeViewProvider/TreeViewChildrenItemProvider.js
var _d = /*#__PURE__*/ N.createContext(null);
function vd(e) {
	let { children: t, itemId: n = null } = e, { instance: r, treeId: i, rootRef: a } = ku(), o = N.useRef(/* @__PURE__ */ new Map());
	N.useEffect(() => {
		if (!a.current) return;
		let e = null;
		if (n == null) e = a.current.id;
		else {
			let t = r.getItemMeta(n);
			t !== void 0 && (e = vu({
				itemId: n,
				treeId: i,
				id: t.idAttribute
			}));
		}
		if (e == null) return;
		let t = r.getItemOrderedChildrenIds(n ?? null) ?? [], s = cd(e), c = a.current.querySelectorAll(`${n == null ? "" : `*[id="${s}"] `}[role="treeitem"]:not(*[id="${s}"] [role="treeitem"] [role="treeitem"])`), l = Array.from(c).map((e) => o.current.get(e.id));
		(l.length !== t.length || l.some((e, n) => e !== t[n])) && r.setJSXItemsOrderedChildrenIds(n ?? null, l);
	});
	let s = N.useMemo(() => ({
		registerChild: (e, t) => o.current.set(e, t),
		unregisterChild: (e) => o.current.delete(e),
		parentId: n
	}), [n]);
	return /*#__PURE__*/ z(_d.Provider, {
		value: s,
		children: t
	});
}
//#endregion
//#region node_modules/@mui/x-tree-view/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.js
var yd = ({ instance: e, setState: t }) => (e.preventItemUpdates(), { instance: {
	insertJSXItem: Ru((n) => (t((e) => {
		if (e.items.itemMetaMap[n.id] != null) throw Error([
			"MUI X: The Tree View component requires all items to have a unique `id` property.",
			"Alternatively, you can use the `getItemId` prop to specify a custom id for each item.",
			`Two items were provided with the same id in the \`items\` prop: "${n.id}"`
		].join("\n"));
		return q({}, e, { items: q({}, e.items, {
			itemMetaMap: q({}, e.items.itemMetaMap, { [n.id]: n }),
			itemMap: q({}, e.items.itemMap, { [n.id]: {
				id: n.id,
				label: n.label
			} })
		}) });
	}), () => {
		t((e) => {
			let t = q({}, e.items.itemMetaMap), r = q({}, e.items.itemMap);
			return delete t[n.id], delete r[n.id], q({}, e, { items: q({}, e.items, {
				itemMetaMap: t,
				itemMap: r
			}) });
		}), Au(e, "removeItem", { id: n.id });
	})),
	setJSXItemsOrderedChildrenIds: (e, n) => {
		let r = e ?? "__TREE_VIEW_ROOT_PARENT_ID__";
		t((e) => q({}, e, { items: q({}, e.items, {
			itemOrderedChildrenIds: q({}, e.items.itemOrderedChildrenIds, { [r]: n }),
			itemChildrenIndexes: q({}, e.items.itemChildrenIndexes, { [r]: Mu(n) })
		}) }));
	},
	mapFirstCharFromJSX: Ru((t, n) => (e.updateFirstCharMap((e) => (e[t] = n, e)), () => {
		e.updateFirstCharMap((e) => {
			let n = q({}, e);
			return delete n[t], n;
		});
	}))
} }), bd = (e) => Array.isArray(e) ? e.length > 0 && e.some(bd) : !!e;
yd.itemPlugin = ({ props: e, rootRef: t, contentRef: n }) => {
	let { instance: r, treeId: i } = ku(), { children: a, disabled: o = !1, label: s, itemId: c, id: l } = e, u = N.useContext(_d);
	if (u == null) throw Error([
		"MUI X: Could not find the Tree View Children Item context.",
		"It looks like you rendered your component outside of a SimpleTreeView parent component.",
		"This can also happen if you are bundling multiple versions of the Tree View."
	].join("\n"));
	let { registerChild: d, unregisterChild: f, parentId: p } = u, m = bd(a), h = N.useRef(null), g = Xl(h, n);
	return Lu(() => {
		let e = vu({
			itemId: c,
			treeId: i,
			id: l
		});
		return d(e, c), () => {
			f(e);
		};
	}, [
		d,
		f,
		c,
		l,
		i
	]), N.useEffect(() => r.insertJSXItem({
		id: c,
		idAttribute: l,
		parentId: p,
		expandable: m,
		disabled: o
	}), [
		r,
		p,
		c,
		m,
		o,
		l
	]), N.useEffect(() => {
		if (s) return r.mapFirstCharFromJSX(c, (h.current?.textContent ?? "").substring(0, 1).toLowerCase());
	}, [
		r,
		c,
		s
	]), {
		contentRef: g,
		rootRef: t
	};
}, yd.wrapItem = ({ children: e, itemId: t }) => {
	let n = N.useContext(Nu);
	return /*#__PURE__*/ z(vd, {
		itemId: t,
		children: /*#__PURE__*/ z(Nu.Provider, {
			value: n + 1,
			children: e
		})
	});
}, yd.wrapRoot = ({ children: e }) => /*#__PURE__*/ z(vd, { children: /*#__PURE__*/ z(Nu.Provider, {
	value: 0,
	children: e
}) }), yd.params = {};
//#endregion
//#region node_modules/@mui/x-tree-view/SimpleTreeView/SimpleTreeView.plugins.js
var xd = [
	Iu,
	zu,
	Qu,
	ud,
	hd,
	gd,
	yd
], Sd = iu("MuiSimpleTreeView"), Cd = (e) => {
	let { classes: t } = e;
	return Yl({ root: ["root"] }, uu, t);
}, wd = Vn("ul", {
	name: "MuiSimpleTreeView",
	slot: "Root",
	overridesResolver: (e, t) => t.root
})({
	padding: 0,
	margin: 0,
	listStyle: "none",
	outline: 0,
	position: "relative"
}), Td = [], Ed = /*#__PURE__*/ N.forwardRef(function(e, t) {
	let n = Sd({
		props: e,
		name: "MuiSimpleTreeView"
	}), r = n, { getRootProps: i, contextValue: a } = Eu({
		plugins: xd,
		rootRef: t,
		props: q({}, n, { items: Td })
	}), { slots: o, slotProps: s } = n, c = Cd(n), l = o?.root ?? wd, u = ru({
		elementType: l,
		externalSlotProps: s?.root,
		className: c.root,
		getSlotProps: i,
		ownerState: r
	});
	return /*#__PURE__*/ z(Ou, {
		value: a,
		children: /*#__PURE__*/ z(l, q({}, u))
	});
});
//#endregion
//#region node_modules/@mui/x-tree-view/TreeItem/useTreeItemState.js
function Dd(e) {
	let { instance: t, items: { onItemClick: n }, selection: { multiSelect: r, checkboxSelection: i, disableSelection: a }, expansion: { expansionTrigger: o } } = ku(), s = t.isItemExpandable(e), c = t.isItemExpanded(e), l = t.isItemFocused(e), u = t.isItemSelected(e), d = t.isItemDisabled(e), f = t?.isItemBeingEdited ? t?.isItemBeingEdited(e) : !1, p = t.isItemEditable ? t.isItemEditable(e) : !1, m = (n) => {
		if (!d) {
			l || t.focusItem(n, e);
			let i = r && (n.shiftKey || n.ctrlKey || n.metaKey);
			s && !(i && t.isItemExpanded(e)) && t.toggleItemExpansion(n, e);
		}
	}, h = (n) => {
		d || (!l && !f && t.focusItem(n, e), r && (n.shiftKey || n.ctrlKey || n.metaKey) ? n.shiftKey ? t.expandSelectionRange(n, e) : t.selectItem({
			event: n,
			itemId: e,
			keepExistingSelection: !0
		}) : t.selectItem({
			event: n,
			itemId: e,
			shouldBeSelected: !0
		}));
	}, g = (n) => {
		if (a || d) return;
		let i = n.nativeEvent.shiftKey;
		r && i ? t.expandSelectionRange(n, e) : t.selectItem({
			event: n,
			itemId: e,
			keepExistingSelection: r,
			shouldBeSelected: n.target.checked
		});
	}, _ = (e) => {
		(e.shiftKey || e.ctrlKey || e.metaKey || d) && e.preventDefault();
	}, v = () => {
		dd(t, pd) && t.isItemEditable(e) && (t.isItemBeingEdited(e) ? t.setEditedItemId(null) : t.setEditedItemId(e));
	};
	return {
		disabled: d,
		expanded: c,
		selected: u,
		focused: l,
		editable: p,
		editing: f,
		disableSelection: a,
		checkboxSelection: i,
		handleExpansion: m,
		handleSelection: h,
		handleCheckboxSelection: g,
		handleContentClick: n,
		preventSelection: _,
		expansionTrigger: o,
		toggleItemEditing: v,
		handleSaveItemLabel: (n, r) => {
			dd(t, pd) && t.isItemBeingEditedRef(e) && (t.updateItemLabel(e, r), v(), t.focusItem(n, e));
		},
		handleCancelItemLabelEditing: (n) => {
			dd(t, pd) && t.isItemBeingEditedRef(e) && (v(), t.focusItem(n, e));
		}
	};
}
//#endregion
//#region node_modules/@mui/x-tree-view/TreeItem2DragAndDropOverlay/TreeItem2DragAndDropOverlay.js
var Od = Vn("div", {
	name: "MuiTreeItem2DragAndDropOverlay",
	slot: "Root",
	overridesResolver: (e, t) => t.root,
	shouldForwardProp: (e) => hr(e) && e !== "action"
})(({ theme: e }) => ({
	position: "absolute",
	left: 0,
	display: "flex",
	top: 0,
	bottom: 0,
	right: 0,
	pointerEvents: "none",
	variants: [
		{
			props: { action: "make-child" },
			style: {
				marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
				borderRadius: e.shape.borderRadius,
				backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.darkChannel} / ${e.vars.palette.action.focusOpacity})` : Rn(e.palette.primary.dark, e.palette.action.focusOpacity)
			}
		},
		{
			props: { action: "reorder-above" },
			style: {
				marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
				borderTop: `1px solid ${(e.vars || e).palette.action.active}`
			}
		},
		{
			props: { action: "reorder-below" },
			style: {
				marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
				borderBottom: `1px solid ${(e.vars || e).palette.action.active}`
			}
		},
		{
			props: { action: "move-to-parent" },
			style: {
				marginLeft: "calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",
				borderBottom: `1px solid ${(e.vars || e).palette.action.active}`
			}
		}
	]
}));
function kd(e) {
	return e.action == null ? null : /*#__PURE__*/ z(Od, q({}, e));
}
//#endregion
//#region node_modules/@mui/x-tree-view/TreeItem2LabelInput/TreeItem2LabelInput.js
var Ad = Vn("input", {
	name: "MuiTreeItem2",
	slot: "LabelInput",
	overridesResolver: (e, t) => t.labelInput
})(({ theme: e }) => q({}, e.typography.body1, {
	width: "100%",
	backgroundColor: e.palette.background.paper,
	borderRadius: e.shape.borderRadius,
	border: "none",
	padding: "0 2px",
	boxSizing: "border-box",
	"&:focus": { outline: `1px solid ${e.palette.primary.main}` }
})), jd = [
	"classes",
	"className",
	"displayIcon",
	"expansionIcon",
	"icon",
	"label",
	"itemId",
	"onClick",
	"onMouseDown",
	"dragAndDropOverlayProps",
	"labelInputProps"
], Md = /*#__PURE__*/ N.forwardRef(function(e, t) {
	let { classes: n, className: r, displayIcon: i, expansionIcon: a, icon: o, label: s, itemId: c, onClick: l, onMouseDown: u, dragAndDropOverlayProps: d, labelInputProps: f } = e, p = xu(e, jd), { disabled: m, expanded: h, selected: g, focused: _, editing: v, editable: y, disableSelection: b, checkboxSelection: x, handleExpansion: S, handleSelection: C, handleCheckboxSelection: w, handleContentClick: T, preventSelection: E, expansionTrigger: D, toggleItemEditing: ee } = Dd(c), te = o || a || i, ne = N.useRef(null), re = (e) => {
		E(e), u && u(e);
	}, ie = (e) => {
		T?.(e, c), !ne.current?.contains(e.target) && (D === "content" && S(e), x || C(e), l && l(e));
	}, ae = a != null && te === a && D === "iconContainer" ? (e) => {
		a != null && te === a && D === "iconContainer" && S(e);
	} : void 0;
	return /*#__PURE__*/ B("div", q({}, p, {
		className: Is(n.root, r, h && n.expanded, g && n.selected, _ && n.focused, m && n.disabled, v && n.editing, y && n.editable),
		onClick: ie,
		onMouseDown: re,
		ref: t,
		children: [
			/*#__PURE__*/ z("div", {
				className: n.iconContainer,
				onClick: ae,
				children: te
			}),
			x && /*#__PURE__*/ z(mr, {
				className: n.checkbox,
				checked: g,
				onChange: w,
				disabled: m || b,
				ref: ne,
				tabIndex: -1
			}),
			v ? /*#__PURE__*/ z(Ad, q({}, f, { className: n.labelInput })) : /*#__PURE__*/ z("div", q({ className: n.label }, y && { onDoubleClick: (e) => {
				e.defaultMuiPrevented || ee();
			} }, { children: s })),
			d && /*#__PURE__*/ z(kd, q({}, d))
		]
	}));
});
//#endregion
//#region node_modules/@mui/x-tree-view/TreeItem/treeItemClasses.js
function Nd(e) {
	return cu("MuiTreeItem", e);
}
var Pd = lu("MuiTreeItem", [
	"root",
	"groupTransition",
	"content",
	"expanded",
	"selected",
	"focused",
	"disabled",
	"iconContainer",
	"label",
	"checkbox",
	"labelInput",
	"editable",
	"editing",
	"dragAndDropOverlay"
]), Fd = Wn(/*#__PURE__*/ z("path", { d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }), "TreeViewExpandIcon"), Id = Wn(/*#__PURE__*/ z("path", { d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" }), "TreeViewCollapseIcon");
//#endregion
//#region node_modules/@mui/x-tree-view/TreeItem2Provider/TreeItem2Provider.js
function Ld(e) {
	let { children: t, itemId: n } = e, { wrapItem: r, instance: i } = ku();
	return r({
		children: t,
		itemId: n,
		instance: i
	});
}
Ld.propTypes = {
	children: W.default.node,
	itemId: W.default.string.isRequired
};
//#endregion
//#region node_modules/@mui/x-tree-view/TreeItem/TreeItem.js
var Rd = [
	"children",
	"className",
	"slots",
	"slotProps",
	"ContentComponent",
	"ContentProps",
	"itemId",
	"id",
	"label",
	"onClick",
	"onMouseDown",
	"onFocus",
	"onBlur",
	"onKeyDown"
], zd = ["ownerState"], Bd = ["ownerState"], Vd = ["ownerState"], Hd = iu("MuiTreeItem"), Ud = (e) => {
	let { classes: t } = e;
	return Yl({
		root: ["root"],
		content: ["content"],
		expanded: ["expanded"],
		selected: ["selected"],
		focused: ["focused"],
		disabled: ["disabled"],
		iconContainer: ["iconContainer"],
		checkbox: ["checkbox"],
		label: ["label"],
		labelInput: ["labelInput"],
		editing: ["editing"],
		editable: ["editable"],
		groupTransition: ["groupTransition"]
	}, Nd, t);
}, Wd = Vn("li", {
	name: "MuiTreeItem",
	slot: "Root",
	overridesResolver: (e, t) => t.root
})({
	listStyle: "none",
	margin: 0,
	padding: 0,
	outline: 0
}), Gd = Vn(Md, {
	name: "MuiTreeItem",
	slot: "Content",
	overridesResolver: (e, t) => [
		t.content,
		t.iconContainer && { [`& .${Pd.iconContainer}`]: t.iconContainer },
		t.label && { [`& .${Pd.label}`]: t.label }
	],
	shouldForwardProp: (e) => pr(e) && e !== "indentationAtItemLevel"
})(({ theme: e }) => ({
	padding: e.spacing(.5, 1),
	borderRadius: e.shape.borderRadius,
	width: "100%",
	boxSizing: "border-box",
	position: "relative",
	display: "flex",
	alignItems: "center",
	gap: e.spacing(1),
	cursor: "pointer",
	WebkitTapHighlightColor: "transparent",
	"&:hover": {
		backgroundColor: (e.vars || e).palette.action.hover,
		"@media (hover: none)": { backgroundColor: "transparent" }
	},
	[`&.${Pd.disabled}`]: {
		opacity: (e.vars || e).palette.action.disabledOpacity,
		backgroundColor: "transparent"
	},
	[`&.${Pd.focused}`]: { backgroundColor: (e.vars || e).palette.action.focus },
	[`&.${Pd.selected}`]: {
		backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : Rn(e.palette.primary.main, e.palette.action.selectedOpacity),
		"&:hover": {
			backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : Rn(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
			"@media (hover: none)": { backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : Rn(e.palette.primary.main, e.palette.action.selectedOpacity) }
		},
		[`&.${Pd.focused}`]: { backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : Rn(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity) }
	},
	[`& .${Pd.iconContainer}`]: {
		width: 16,
		display: "flex",
		flexShrink: 0,
		justifyContent: "center",
		"& svg": { fontSize: 18 }
	},
	[`& .${Pd.label}`]: q({
		width: "100%",
		boxSizing: "border-box",
		minWidth: 0,
		position: "relative"
	}, e.typography.body1),
	[`& .${Pd.checkbox}`]: { padding: 0 },
	variants: [{
		props: { indentationAtItemLevel: !0 },
		style: { paddingLeft: `calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))` }
	}]
})), Kd = Vn(fr, {
	name: "MuiTreeItem",
	slot: "GroupTransition",
	overridesResolver: (e, t) => t.groupTransition,
	shouldForwardProp: (e) => pr(e) && e !== "indentationAtItemLevel"
})({
	margin: 0,
	padding: 0,
	paddingLeft: "var(--TreeView-itemChildrenIndentation)",
	variants: [{
		props: { indentationAtItemLevel: !0 },
		style: { paddingLeft: 0 }
	}]
}), qd = /*#__PURE__*/ N.forwardRef(function(e, t) {
	let { icons: n, runItemPlugins: r, items: { disabledItemsFocusable: i, indentationAtItemLevel: a }, selection: { disableSelection: o }, treeId: s, instance: c } = ku(), l = N.useContext(Nu), u = Hd({
		props: e,
		name: "MuiTreeItem"
	}), { children: d, className: f, slots: p, slotProps: m, ContentComponent: h = Md, ContentProps: g, itemId: _, id: v, label: y, onClick: b, onMouseDown: x, onBlur: S, onKeyDown: C } = u, w = xu(u, Rd), { expanded: T, focused: E, selected: D, disabled: ee, editing: te, handleCancelItemLabelEditing: ne, handleSaveItemLabel: re } = Dd(_), { contentRef: ie, rootRef: ae, propsEnhancers: oe } = r(u), se = N.useRef(null), ce = N.useRef(null), O = Xl(t, ae, se), le = Xl(g?.ref, ie, ce), ue = {
		expandIcon: p?.expandIcon ?? n.slots.expandIcon ?? Fd,
		collapseIcon: p?.collapseIcon ?? n.slots.collapseIcon ?? Id,
		endIcon: p?.endIcon ?? n.slots.endIcon,
		icon: p?.icon,
		groupTransition: p?.groupTransition
	}, de = (e) => Array.isArray(e) ? e.length > 0 && e.some(de) : !!e, fe = de(d), pe = q({}, u, {
		expanded: T,
		focused: E,
		selected: D,
		disabled: ee,
		indentationAtItemLevel: a
	}), me = Ud(pe), he = ue.groupTransition ?? void 0, ge = ru({
		elementType: he,
		ownerState: {},
		externalSlotProps: m?.groupTransition,
		additionalProps: q({
			unmountOnExit: !0,
			in: T,
			component: "ul",
			role: "group"
		}, a ? { indentationAtItemLevel: !0 } : {}),
		className: me.groupTransition
	}), _e = T ? ue.collapseIcon : ue.expandIcon, ve = xu(ru({
		elementType: _e,
		ownerState: {},
		externalSlotProps: (e) => T ? q({}, nu(n.slotProps.collapseIcon, e), nu(m?.collapseIcon, e)) : q({}, nu(n.slotProps.expandIcon, e), nu(m?.expandIcon, e))
	}), zd), ye = fe && _e ? /*#__PURE__*/ z(_e, q({}, ve)) : null, k = fe ? void 0 : ue.endIcon, be = xu(ru({
		elementType: k,
		ownerState: {},
		externalSlotProps: (e) => fe ? {} : q({}, nu(n.slotProps.endIcon, e), nu(m?.endIcon, e))
	}), Bd), xe = k ? /*#__PURE__*/ z(k, q({}, be)) : null, Se = ue.icon, Ce = xu(ru({
		elementType: Se,
		ownerState: {},
		externalSlotProps: m?.icon
	}), Vd), we = Se ? /*#__PURE__*/ z(Se, q({}, Ce)) : null, Te;
	Te = D ? !0 : o || ee ? void 0 : !1;
	function Ee(e) {
		!E && (!ee || i) && e.currentTarget === e.target && c.focusItem(e, _);
	}
	function De(e) {
		S?.(e), !(te || e.relatedTarget && Yu(e.relatedTarget, se.current) && (e.target && e.target?.dataset?.element === "labelInput" && Yu(e.target, se.current) || e.relatedTarget?.dataset?.element === "labelInput")) && c.removeFocusedItem();
	}
	let Oe = (e) => {
		C?.(e), e.target?.dataset?.element !== "labelInput" && c.handleItemKeyDown(e, _);
	}, ke = vu({
		itemId: _,
		treeId: s,
		id: v
	}), Ae = c.canItemBeTabbed(_) ? 0 : -1, je = {
		rootRefObject: se,
		contentRefObject: ce,
		interactions: {
			handleSaveItemLabel: re,
			handleCancelItemLabelEditing: ne
		}
	}, Me = oe.root?.(q({}, je, { externalEventHandlers: $l(w) })) ?? {}, Ne = oe.content?.(q({}, je, { externalEventHandlers: $l(g) })) ?? {}, Pe = oe.dragAndDropOverlay?.(q({}, je, { externalEventHandlers: {} })) ?? {}, Fe = oe.labelInput?.(q({}, je, { externalEventHandlers: {} })) ?? {};
	return /*#__PURE__*/ z(Ld, {
		itemId: _,
		children: /*#__PURE__*/ B(Wd, q({
			className: Is(me.root, f),
			role: "treeitem",
			"aria-expanded": fe ? T : void 0,
			"aria-selected": Te,
			"aria-disabled": ee || void 0,
			id: ke,
			tabIndex: Ae
		}, w, {
			ownerState: pe,
			onFocus: Ee,
			onBlur: De,
			onKeyDown: Oe,
			ref: O,
			style: a ? q({}, w.style, { "--TreeView-itemDepth": typeof l == "function" ? l(_) : l }) : w.style
		}, Me, { children: [/*#__PURE__*/ z(Gd, q({
			as: h,
			classes: {
				root: me.content,
				expanded: me.expanded,
				selected: me.selected,
				focused: me.focused,
				disabled: me.disabled,
				editable: me.editable,
				editing: me.editing,
				iconContainer: me.iconContainer,
				label: me.label,
				labelInput: me.labelInput,
				checkbox: me.checkbox
			},
			label: y,
			itemId: _,
			onClick: b,
			onMouseDown: x,
			icon: we,
			expansionIcon: ye,
			displayIcon: xe,
			ownerState: pe
		}, g, Ne, Pe.action == null ? {} : { dragAndDropOverlayProps: Pe }, Fe.value == null ? {} : { labelInputProps: Fe }, { ref: le })), d && /*#__PURE__*/ z(Kd, q({ as: he }, ge, { children: d }))] }))
	});
}), Jd = M(/*#__PURE__*/ z("path", { d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }), "ChevronRight"), Yd = H("div")(() => ({}));
function Xd(e) {
	let t = e.data.__jsonld;
	if (t.startCanvas && typeof t.startCanvas == "string") return t.startCanvas;
	if (t.start) {
		if (t.start.type === "Canvas" && typeof t.start.id == "string") return t.start.id;
		if (t.start.type === "SpecificResource" && typeof t.start.source == "string") return t.start.source;
	}
	return e.data.getCanvasIds()[0];
}
function Zd(e, t) {
	if (e.id === t) return e;
	let n = null;
	if (e.nodes) for (let r = 0; n == null && r < e.nodes.length; r += 1) n = Zd(e.nodes[r], t);
	return n;
}
var Qd = ({ children: e, itemId: t, ...n }) => /* @__PURE__ */ z(ks, {
	...n,
	children: e
});
Qd.propTypes = {
	children: W.default.node.isRequired,
	itemId: W.default.string.isRequired
};
var $d = (e) => /* @__PURE__ */ z(vl, {
	...e,
	color: "action"
}), ef = (e) => /* @__PURE__ */ z(Jd, {
	...e,
	color: "action"
});
function tf({ toggleNode: e, expandNodes: t, setCanvas: n, windowId: r, treeStructure: i, visibleNodeIds: a, expandedNodeIds: o, containerRef: s, nodeIdToScrollTo: c }) {
	let l = (t, n) => {
		(t.key === " " || t.key === "Spacebar") && e(n), d(n);
	}, u = (e, n) => {
		t(n);
	}, d = (e) => {
		let t = Zd(i, e);
		if (!t.data.getCanvasIds() || t.data.getCanvasIds().length === 0 || t.nodes.length > 0) return;
		let a = Xd(t);
		n(r, a.indexOf("#") === -1 ? a : a.substr(0, a.indexOf("#")));
	};
	if (!i) return null;
	let f = (e) => /* @__PURE__ */ z(Qd, {
		containerRef: s,
		itemId: e.id,
		offsetTop: 96,
		scrollTo: c === e.id,
		children: /* @__PURE__ */ z(qd, {
			itemId: e.id,
			label: /* @__PURE__ */ z(Yd, {
				sx: (t) => ({
					backgroundColor: a.indexOf(e.id) !== -1 && Rn(t.palette.highlights?.primary || t.palette.action.selected, .35),
					display: a.indexOf(e.id) !== -1 && "inline"
				}),
				children: e.label
			}),
			children: e.nodes && e.nodes.length > 0 ? e.nodes.map(f) : null
		})
	}, e.id);
	return /* @__PURE__ */ z(Ed, {
		sx: { flexGrow: 1 },
		slots: {
			collapseIcon: $d,
			endIcon: null,
			expandIcon: ef
		},
		onSelectedItemsChange: l,
		onExpandedItemsChange: u,
		expandedItems: o,
		children: Array.isArray(i.nodes) && i.nodes.length > 0 ? i.nodes.map((e) => f(e)) : /* @__PURE__ */ z("p", { children: "No items found" })
	});
}
tf.propTypes = {
	containerRef: W.default.oneOfType([W.default.func, W.default.shape({ current: W.default.instanceOf(Element) })]).isRequired,
	expandedNodeIds: W.default.arrayOf(W.default.string).isRequired,
	expandNodes: W.default.func.isRequired,
	nodeIdToScrollTo: W.default.string.isRequired,
	setCanvas: W.default.func.isRequired,
	toggleNode: W.default.func.isRequired,
	treeStructure: W.default.shape({
		id: W.default.string.isRequired,
		label: W.default.string.isRequired,
		nodes: W.default.arrayOf(W.default.shape({
			id: W.default.string.isRequired,
			label: W.default.string.isRequired,
			nodes: W.default.array
		}))
	}).isRequired,
	visibleNodeIds: W.default.arrayOf(W.default.string).isRequired,
	windowId: W.default.string.isRequired
};
var nf = n(w((e, { id: t, windowId: n }) => ({
	expandedNodeIds: wi(e, {
		companionWindowId: t,
		windowId: n
	}),
	nodeIdToScrollTo: Ti(e, {
		companionWindowId: t,
		windowId: n
	}),
	treeStructure: ce(e, { windowId: n }),
	visibleNodeIds: bi(e, {
		companionWindowId: t,
		windowId: n
	})
}), (e, { id: t, windowId: n }) => ({
	expandNodes: (r) => e(Ri(n, t, r)),
	setCanvas: (...t) => e(an(...t)),
	toggleNode: (r) => e(Li(n, t, r))
})), m("SidebarIndexTableOfContents"))(tf), rf = H("div")(() => ({
	flexBasis: "100%",
	height: 0
}));
function af({ collection: e = null, id: t, showMultipart: n, sequenceId: r = null, sequences: i = [], variant: a, showToc: o = !1, updateSequence: s, updateVariant: c, windowId: l }) {
	let { t: u } = V(), d = I(), f = Nn(), p = (e) => {
		s(e.target.value);
	}, m = (e, t) => {
		c(t);
	}, h;
	return h = z(a === "tableOfContents" ? nf : Jl, {
		id: t,
		containerRef: d,
		windowId: l
	}), /* @__PURE__ */ z(ml, {
		title: u("canvasIndex"),
		id: t,
		windowId: l,
		ref: d,
		titleControls: /* @__PURE__ */ B(R, { children: [
			i && i.length > 1 && /* @__PURE__ */ z(ar, { children: /* @__PURE__ */ z(or, {
				MenuProps: { anchorOrigin: {
					horizontal: "left",
					vertical: "bottom"
				} },
				displayEmpty: !0,
				value: r,
				onChange: p,
				name: "sequenceId",
				sx: {
					"&.MuiSelect-select": { "&:focus": { backgroundColor: "background.paper" } },
					backgroundColor: "background.paper"
				},
				"data-testid": "sequence-select",
				children: i.map((e, t) => /* @__PURE__ */ z(Xn, {
					value: e.id,
					children: /* @__PURE__ */ z(U, {
						variant: "body2",
						children: /* @__PURE__ */ z(ln, { resource: e })
					})
				}, e.id))
			}) }),
			/* @__PURE__ */ z(rf, {}),
			/* @__PURE__ */ B(lr, {
				value: a,
				onChange: m,
				variant: "fullWidth",
				indicatorColor: "primary",
				textColor: "primary",
				children: [
					o && /* @__PURE__ */ z(qn, {
						title: u("tableOfContentsList"),
						value: "tableOfContents",
						children: /* @__PURE__ */ z(ur, {
							sx: { minWidth: "auto" },
							value: "tableOfContents",
							"aria-label": u("tableOfContentsList"),
							"aria-controls": f,
							icon: /* @__PURE__ */ z(zl, { style: { transform: "scale(-1, 1)" } })
						})
					}),
					/* @__PURE__ */ z(qn, {
						title: u("itemList"),
						value: "item",
						children: /* @__PURE__ */ z(ur, {
							sx: { minWidth: "auto" },
							value: "item",
							"aria-label": u("itemList"),
							"aria-controls": f,
							icon: /* @__PURE__ */ z(Rl, {})
						})
					}),
					/* @__PURE__ */ z(qn, {
						title: u("thumbnailList"),
						value: "thumbnail",
						children: /* @__PURE__ */ z(ur, {
							sx: { minWidth: "auto" },
							value: "thumbnail",
							"aria-label": u("thumbnailList"),
							"aria-controls": f,
							icon: /* @__PURE__ */ z(Al, {})
						})
					})
				]
			})
		] }),
		children: /* @__PURE__ */ B("div", {
			id: f,
			children: [e && /* @__PURE__ */ z(sr, {
				fullWidth: !0,
				onClick: n,
				endIcon: /* @__PURE__ */ z(Bl, {}),
				children: /* @__PURE__ */ z(U, {
					sx: { textTransform: "none" },
					children: /* @__PURE__ */ z(ln, { resource: e })
				})
			}), h]
		})
	});
}
af.propTypes = {
	collection: W.default.object,
	id: W.default.string.isRequired,
	sequenceId: W.default.string,
	sequences: W.default.arrayOf(W.default.object),
	showMultipart: W.default.func.isRequired,
	showToc: W.default.bool,
	updateSequence: W.default.func.isRequired,
	updateVariant: W.default.func.isRequired,
	variant: W.default.oneOf([
		"item",
		"thumbnail",
		"tableOfContents"
	]).isRequired,
	windowId: W.default.string.isRequired
};
var of = n(w((e, { id: t, windowId: n }) => {
	let r = ce(e, { windowId: n }), i = s(e, { windowId: n }), { config: a } = e, o = se(e, { companionWindowId: t }), c = i.collectionPath || [], l = c && c[c.length - 1], u = ve(e, { windowId: n });
	return {
		collection: l && ze(e, { manifestId: l }),
		config: a,
		sequenceId: u && u.id,
		sequences: Ce(e, { windowId: n }),
		showToc: r && r.nodes && r.nodes.length > 0,
		variant: o.variant || Ei(e, { windowId: n })
	};
}, (e, { id: t, windowId: n }) => ({
	showMultipart: () => e(Pi(n, {
		content: "collection",
		position: "right"
	})),
	updateSequence: (t) => e(qt(n, { sequenceId: t })),
	updateVariant: (r) => e(Fi(n, t, { variant: r }))
})), m("WindowSideBarCanvasPanel"))(af), sf = /* @__PURE__ */ D(((e, t) => {
	function n(e) {
		"@babel/helpers - typeof";
		return t.exports = n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
			return typeof e;
		} : function(e) {
			return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
		}, t.exports.__esModule = !0, t.exports.default = t.exports, n(e);
	}
	t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
})), cf = /* @__PURE__ */ D(((e, t) => {
	var n = sf().default;
	function r(e, t) {
		if (n(e) != "object" || !e) return e;
		var r = e[Symbol.toPrimitive];
		if (r !== void 0) {
			var i = r.call(e, t || "default");
			if (n(i) != "object") return i;
			throw TypeError("@@toPrimitive must return a primitive value.");
		}
		return (t === "string" ? String : Number)(e);
	}
	t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
})), lf = /* @__PURE__ */ D(((e, t) => {
	var n = sf().default, r = cf();
	function i(e) {
		var t = r(e, "string");
		return n(t) == "symbol" ? t : t + "";
	}
	t.exports = i, t.exports.__esModule = !0, t.exports.default = t.exports;
})), uf = /* @__PURE__ */ D(((e, t) => {
	var n = lf();
	function r(e, t, r) {
		return (t = n(t)) in e ? Object.defineProperty(e, t, {
			value: r,
			enumerable: !0,
			configurable: !0,
			writable: !0
		}) : e[t] = r, e;
	}
	t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
})), df = /* @__PURE__ */ D(((e, t) => {
	function n(e, t) {
		if (e == null) return {};
		var n = {};
		for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
			if (t.indexOf(r) !== -1) continue;
			n[r] = e[r];
		}
		return n;
	}
	t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
})), ff = (/* @__PURE__ */ D(((e, t) => {
	(function(n, r) {
		typeof e == "object" && t !== void 0 ? r(e, uf(), df(), v()) : typeof define == "function" && define.amd ? define([
			"exports",
			"@babel/runtime/helpers/defineProperty",
			"@babel/runtime/helpers/objectWithoutPropertiesLoose",
			"react"
		], r) : (n = typeof globalThis > "u" ? n || self : globalThis, r(n.Img = {}, n._defineProperty, n._objectWithoutPropertiesLoose, n.React));
	})(e, function(e, t, n, r) {
		function i(e) {
			return e && typeof e == "object" && "default" in e ? e : { default: e };
		}
		function a(e, t) {
			var n = Object.keys(e);
			if (Object.getOwnPropertySymbols) {
				var r = Object.getOwnPropertySymbols(e);
				t && (r = r.filter(function(t) {
					return Object.getOwnPropertyDescriptor(e, t).enumerable;
				})), n.push.apply(n, r);
			}
			return n;
		}
		function o(e) {
			for (var t, n = 1; n < arguments.length; n++) t = arguments[n] == null ? {} : arguments[n], n % 2 ? a(Object(t), !0).forEach(function(n) {
				u.default(e, n, t[n]);
			}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : a(Object(t)).forEach(function(n) {
				Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
			});
			return e;
		}
		function s(e) {
			var t = e.srcList, n = e.imgPromise, i = n === void 0 ? p({ decode: !0 }) : n, a = e.useSuspense, s = a === void 0 || a, c = r.useState(!1)[1], l = m(h(t)), u = l.join("");
			if (g[u] || (g[u] = {
				promise: _(l, i),
				cache: "pending",
				error: null
			}), g[u].cache === "resolved") return {
				src: g[u].src,
				isLoading: !1,
				error: null
			};
			if (g[u].cache === "rejected") {
				if (s) throw g[u].error;
				return {
					isLoading: !1,
					error: g[u].error,
					src: void 0
				};
			}
			if (g[u].promise.then(function(e) {
				g[u] = o(o({}, g[u]), {}, {
					cache: "resolved",
					src: e
				}), s || c(u);
			}).catch(function(e) {
				g[u] = o(o({}, g[u]), {}, {
					cache: "rejected",
					error: e
				}), s || c(u);
			}), s) throw g[u].promise;
			return {
				isLoading: !0,
				src: void 0,
				error: null
			};
		}
		function c(e, t) {
			var n = Object.keys(e);
			if (Object.getOwnPropertySymbols) {
				var r = Object.getOwnPropertySymbols(e);
				t && (r = r.filter(function(t) {
					return Object.getOwnPropertyDescriptor(e, t).enumerable;
				})), n.push.apply(n, r);
			}
			return n;
		}
		function l(e) {
			for (var t, n = 1; n < arguments.length; n++) t = arguments[n] == null ? {} : arguments[n], n % 2 ? c(Object(t), !0).forEach(function(n) {
				u.default(e, n, t[n]);
			}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : c(Object(t)).forEach(function(n) {
				Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
			});
			return e;
		}
		var u = i(t), d = i(n), f = i(r), p = function(e) {
			var t = e.decode, n = e.crossOrigin, r = n === void 0 ? "" : n;
			return function(e) {
				return new Promise(function(n, i) {
					var a = new Image();
					r && (a.crossOrigin = r), a.onload = function() {
						(t === void 0 || t) && a.decode ? a.decode().then(n).catch(i) : n();
					}, a.onerror = i, a.src = e;
				});
			};
		}, m = function(e) {
			return e.filter(function(e) {
				return e;
			});
		}, h = function(e) {
			return Array.isArray(e) ? e : [e];
		}, g = {}, _ = function(e, t) {
			var n = !1;
			return new Promise(function(r, i) {
				var a = function(e) {
					return t(e).then(function() {
						n = !0, r(e);
					});
				};
				e.reduce(function(e, t) {
					return e.catch(function() {
						if (!n) return a(t);
					});
				}, a(e.shift())).catch(i);
			});
		}, v = [
			"decode",
			"src",
			"loader",
			"unloader",
			"container",
			"loaderContainer",
			"unloaderContainer",
			"imgPromise",
			"crossorigin",
			"useSuspense"
		], y = function(e) {
			return e;
		};
		e.Img = function(e) {
			var t = e.decode, n = e.src, r = n === void 0 ? [] : n, i = e.loader, a = i === void 0 ? null : i, o = e.unloader, c = o === void 0 ? null : o, u = e.container, m = u === void 0 ? y : u, h = e.loaderContainer, g = h === void 0 ? y : h, _ = e.unloaderContainer, b = _ === void 0 ? y : _, x = e.imgPromise, S = e.crossorigin, C = e.useSuspense, w = C !== void 0 && C, T = d.default(e, v);
			x ||= p({
				decode: t === void 0 || t,
				crossOrigin: S
			});
			var E = s({
				srcList: r,
				imgPromise: x,
				useSuspense: w
			}), D = E.src, ee = E.isLoading;
			return D ? m(f.default.createElement("img", l({ src: D }, T))) : !w && ee ? g(a) : !w && c ? b(c) : null;
		}, e.useImage = s, Object.defineProperty(e, "__esModule", { value: !0 });
	});
})))(), pf = H(ff.Img)(() => ({ maxWidth: "100%" })), mf = H(gr)(({ theme: e }) => ({ backgroundColor: e.palette.grey[300] }));
function hf({ manifestLogo: e = null, requiredStatement: t = null, rights: n = null, windowId: r, id: i }) {
	let { t: a } = V(), o = arguments[0];
	return /* @__PURE__ */ B(ml, {
		title: a("attributionTitle"),
		paperClassName: j("attribution-panel"),
		windowId: r,
		id: i,
		children: [
			/* @__PURE__ */ B(hl, { children: [t && /* @__PURE__ */ z(Sl, {
				labelValuePairs: t,
				defaultLabel: a("attribution")
			}), n && n.length > 0 && /* @__PURE__ */ B("dl", {
				className: j("label-value-metadata"),
				children: [/* @__PURE__ */ z(U, {
					variant: "subtitle2",
					component: "dt",
					children: a("rights")
				}), n.map((e) => /* @__PURE__ */ z(U, {
					variant: "body1",
					component: "dd",
					children: /* @__PURE__ */ z(cr, {
						target: "_blank",
						rel: "noopener noreferrer",
						href: e,
						children: e
					})
				}, e.toString()))]
			})] }),
			e && /* @__PURE__ */ z(hl, { children: /* @__PURE__ */ z(pf, {
				src: [e],
				alt: "",
				role: "presentation",
				unloader: /* @__PURE__ */ z(mf, {
					variant: "rectangular",
					height: 60,
					width: 60
				})
			}) }),
			/* @__PURE__ */ z(cn, {
				targetName: "AttributionPanel",
				...o
			})
		]
	});
}
hf.propTypes = {
	id: W.default.string.isRequired,
	manifestLogo: W.default.string,
	requiredStatement: W.default.arrayOf(W.default.shape({
		label: W.default.string,
		value: W.default.string
	})),
	rights: W.default.arrayOf(W.default.string),
	windowId: W.default.string.isRequired
};
var gf = n(w((e, { id: t, windowId: n }) => ({
	manifestLogo: me(e, { windowId: n }),
	requiredStatement: He(e, { windowId: n }),
	rights: tt(e, { windowId: n })
})), m("AttributionPanel"))(hf), _f = /* @__PURE__ */ D(((e, t) => {
	function n(e) {
		return function(t) {
			return e?.[t];
		};
	}
	t.exports = n;
})), vf = /* @__PURE__ */ D(((e, t) => {
	t.exports = _f()({
		À: "A",
		Á: "A",
		Â: "A",
		Ã: "A",
		Ä: "A",
		Å: "A",
		à: "a",
		á: "a",
		â: "a",
		ã: "a",
		ä: "a",
		å: "a",
		Ç: "C",
		ç: "c",
		Ð: "D",
		ð: "d",
		È: "E",
		É: "E",
		Ê: "E",
		Ë: "E",
		è: "e",
		é: "e",
		ê: "e",
		ë: "e",
		Ì: "I",
		Í: "I",
		Î: "I",
		Ï: "I",
		ì: "i",
		í: "i",
		î: "i",
		ï: "i",
		Ñ: "N",
		ñ: "n",
		Ò: "O",
		Ó: "O",
		Ô: "O",
		Õ: "O",
		Ö: "O",
		Ø: "O",
		ò: "o",
		ó: "o",
		ô: "o",
		õ: "o",
		ö: "o",
		ø: "o",
		Ù: "U",
		Ú: "U",
		Û: "U",
		Ü: "U",
		ù: "u",
		ú: "u",
		û: "u",
		ü: "u",
		Ý: "Y",
		ý: "y",
		ÿ: "y",
		Æ: "Ae",
		æ: "ae",
		Þ: "Th",
		þ: "th",
		ß: "ss",
		Ā: "A",
		Ă: "A",
		Ą: "A",
		ā: "a",
		ă: "a",
		ą: "a",
		Ć: "C",
		Ĉ: "C",
		Ċ: "C",
		Č: "C",
		ć: "c",
		ĉ: "c",
		ċ: "c",
		č: "c",
		Ď: "D",
		Đ: "D",
		ď: "d",
		đ: "d",
		Ē: "E",
		Ĕ: "E",
		Ė: "E",
		Ę: "E",
		Ě: "E",
		ē: "e",
		ĕ: "e",
		ė: "e",
		ę: "e",
		ě: "e",
		Ĝ: "G",
		Ğ: "G",
		Ġ: "G",
		Ģ: "G",
		ĝ: "g",
		ğ: "g",
		ġ: "g",
		ģ: "g",
		Ĥ: "H",
		Ħ: "H",
		ĥ: "h",
		ħ: "h",
		Ĩ: "I",
		Ī: "I",
		Ĭ: "I",
		Į: "I",
		İ: "I",
		ĩ: "i",
		ī: "i",
		ĭ: "i",
		į: "i",
		ı: "i",
		Ĵ: "J",
		ĵ: "j",
		Ķ: "K",
		ķ: "k",
		ĸ: "k",
		Ĺ: "L",
		Ļ: "L",
		Ľ: "L",
		Ŀ: "L",
		Ł: "L",
		ĺ: "l",
		ļ: "l",
		ľ: "l",
		ŀ: "l",
		ł: "l",
		Ń: "N",
		Ņ: "N",
		Ň: "N",
		Ŋ: "N",
		ń: "n",
		ņ: "n",
		ň: "n",
		ŋ: "n",
		Ō: "O",
		Ŏ: "O",
		Ő: "O",
		ō: "o",
		ŏ: "o",
		ő: "o",
		Ŕ: "R",
		Ŗ: "R",
		Ř: "R",
		ŕ: "r",
		ŗ: "r",
		ř: "r",
		Ś: "S",
		Ŝ: "S",
		Ş: "S",
		Š: "S",
		ś: "s",
		ŝ: "s",
		ş: "s",
		š: "s",
		Ţ: "T",
		Ť: "T",
		Ŧ: "T",
		ţ: "t",
		ť: "t",
		ŧ: "t",
		Ũ: "U",
		Ū: "U",
		Ŭ: "U",
		Ů: "U",
		Ű: "U",
		Ų: "U",
		ũ: "u",
		ū: "u",
		ŭ: "u",
		ů: "u",
		ű: "u",
		ų: "u",
		Ŵ: "W",
		ŵ: "w",
		Ŷ: "Y",
		ŷ: "y",
		Ÿ: "Y",
		Ź: "Z",
		Ż: "Z",
		Ž: "Z",
		ź: "z",
		ż: "z",
		ž: "z",
		IJ: "IJ",
		ij: "ij",
		Œ: "Oe",
		œ: "oe",
		ʼn: "'n",
		ſ: "s"
	});
})), yf = /* @__PURE__ */ D(((e, t) => {
	var n = vf(), r = We(), i = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, a = RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", "g");
	function o(e) {
		return e = r(e), e && e.replace(i, n).replace(a, "");
	}
	t.exports = o;
})), bf = /* @__PURE__ */ p(a(), 1), xf = /* @__PURE__ */ p(yf(), 1), Sf = M(/*#__PURE__*/ z("path", { d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z" }), "ChevronLeftSharp"), Cf = M(/*#__PURE__*/ z("path", { d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }), "ChevronRightSharp");
//#endregion
//#region src/components/SearchPanelNavigation.jsx
function wf({ numTotal: e = void 0, searchHits: t = [], selectedContentSearchAnnotation: n, direction: r, selectAnnotation: i }) {
	let { t: a } = V(), o = (e) => {
		i(t[e + 1].annotations[0]);
	}, s = (e) => {
		i(t[e - 1].annotations[0]);
	}, c = (e) => t.length !== 0 && e < t.length - 1, l = (e) => t.length !== 0 && e > 0, u = r === "rtl" ? { transform: "rotate(180deg)" } : {}, d = t.findIndex((e) => e.annotations.includes(n[0])), f = t.length;
	return t.length < e && (f += "+"), t.length === 0 ? null : /* @__PURE__ */ B(U, {
		variant: "body2",
		align: "center",
		children: [
			/* @__PURE__ */ z(mn, {
				"aria-label": a("searchPreviousResult"),
				disabled: !l(d),
				onClick: () => s(d),
				children: /* @__PURE__ */ z(Sf, { style: u })
			}),
			/* @__PURE__ */ z("span", {
				style: { unicodeBidi: "plaintext" },
				role: "status",
				children: a("pagination", {
					current: d + 1,
					total: f
				})
			}),
			/* @__PURE__ */ z(mn, {
				"aria-label": a("searchNextResult"),
				disabled: !c(d),
				onClick: () => o(d),
				children: /* @__PURE__ */ z(Cf, { style: u })
			})
		]
	});
}
wf.propTypes = {
	direction: W.default.string.isRequired,
	numTotal: W.default.number,
	searchHits: W.default.arrayOf(W.default.object),
	selectAnnotation: W.default.func.isRequired,
	selectedContentSearchAnnotation: W.default.arrayOf(W.default.string).isRequired,
	windowId: W.default.string.isRequired
};
var Tf = n(w((e, { companionWindowId: t, windowId: n }) => ({
	direction: gt(e),
	numTotal: Mt(e, {
		companionWindowId: t,
		windowId: n
	}),
	searchHits: xt(e, {
		companionWindowId: t,
		windowId: n
	}),
	selectedContentSearchAnnotation: Ct(e, {
		companionWindowId: t,
		windowId: n
	})
}), (e, { windowId: t }) => ({ selectAnnotation: (...n) => e(wt(t, ...n)) })), m("SearchPanelNavigation"))(wf), Ef = H("form", {
	name: "SearchPanelControls",
	slot: "form"
})(({ theme: e }) => ({
	paddingBottom: e.spacing(1),
	paddingRight: e.spacing(1.5),
	width: "100%"
})), Df = (e) => (0, bf.default)(e) ? e.match : e;
function Of({ autocompleteService: e = void 0, companionWindowId: t, fetchSearch: n, query: r = "", searchIsFetching: i = !1, searchService: a, windowId: o }) {
	let { t: s } = V(), [c, l] = L(r), [u, d] = L(r), [f, p] = L([]);
	F(() => {
		l(r), d(r), p([]);
	}, [r]), F(() => {
		u && u !== "" && a && n(o, t, `${a.id}?${new URLSearchParams({ q: u })}`, u);
	}, [
		u,
		a,
		t,
		n,
		o
	]);
	let m = (e, t, n) => {
		n === "reset" && !t || (l(t), p([]), t && h(t));
	}, h = Ht(jn(() => {
		e && c && fetch(`${e.id}?${new URLSearchParams({ q: c })}`).then((e) => e.json()).then(g);
	}, [e, c]), 500), g = (e) => {
		p(e.terms);
	}, _ = (e) => {
		c && (e && e.preventDefault(), d(c));
	}, v = (e, t, n) => {
		t && Df(t) && d(Df(t));
	}, y = `search-${t}`;
	return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(Ef, {
		"aria-label": s("searchTitle"),
		onSubmit: _,
		children: /* @__PURE__ */ z(_r, {
			id: y,
			inputValue: c,
			options: f,
			getOptionLabel: Df,
			isOptionEqualToValue: (e, t) => (0, xf.default)(Df(e).trim()).toLowerCase() === (0, xf.default)(Df(t).trim()).toLowerCase(),
			noOptionsText: "",
			onChange: v,
			onInputChange: m,
			freeSolo: !0,
			disableClearable: !0,
			renderInput: (e) => /* @__PURE__ */ z(yr, {
				...e,
				label: s("searchInputLabel"),
				variant: "standard",
				InputProps: {
					...e.InputProps,
					endAdornment: /* @__PURE__ */ B(br, {
						sx: { position: "relative" },
						position: "end",
						children: [/* @__PURE__ */ z(mn, {
							"aria-label": s("searchSubmitAria"),
							type: "submit",
							children: /* @__PURE__ */ z(un, {})
						}), !!i && /* @__PURE__ */ z(vr, {
							sx: {
								left: "50%",
								marginLeft: "-25px",
								marginTop: "-25px",
								position: "absolute",
								top: "50%"
							},
							size: 50
						})]
					})
				}
			})
		})
	}), /* @__PURE__ */ z(Tf, {
		windowId: o,
		companionWindowId: t
	})] });
}
Of.propTypes = {
	autocompleteService: W.default.shape({ id: W.default.string }),
	companionWindowId: W.default.string.isRequired,
	fetchSearch: W.default.func.isRequired,
	query: W.default.string,
	searchIsFetching: W.default.bool,
	searchService: W.default.shape({ id: W.default.string }).isRequired,
	windowId: W.default.string.isRequired
};
var kf = n(w((e, { companionWindowId: t, windowId: n }) => ({
	autocompleteService: Ae(e, { windowId: n }),
	query: Ft(e, {
		companionWindowId: t,
		windowId: n
	}),
	searchIsFetching: St(e, {
		companionWindowId: t,
		windowId: n
	}),
	searchService: Se(e, { windowId: n })
}), { fetchSearch: ha }), m("SearchPanelControls"))(Of), Af = M(/*#__PURE__*/ z("path", { d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z" }), "ArrowBackSharp"), jf = 7e3, Mf = null;
function Nf(e, t = "assertive", n = jf) {
	Mf ? Mf.announce(e, t, n) : (Mf = new Pf(), (typeof IS_REACT_ACT_ENVIRONMENT == "boolean" ? IS_REACT_ACT_ENVIRONMENT : typeof jest < "u") ? Mf.announce(e, t, n) : setTimeout(() => {
		Mf?.isAttached() && Mf?.announce(e, t, n);
	}, 100));
}
var Pf = class {
	constructor() {
		this.node = null, this.assertiveLog = null, this.politeLog = null, typeof document < "u" && (this.node = document.createElement("div"), this.node.dataset.liveAnnouncer = "true", Object.assign(this.node.style, {
			border: 0,
			clip: "rect(0 0 0 0)",
			clipPath: "inset(50%)",
			height: "1px",
			margin: "-1px",
			overflow: "hidden",
			padding: 0,
			position: "absolute",
			width: "1px",
			whiteSpace: "nowrap"
		}), this.assertiveLog = this.createLog("assertive"), this.node.appendChild(this.assertiveLog), this.politeLog = this.createLog("polite"), this.node.appendChild(this.politeLog), document.body.prepend(this.node));
	}
	isAttached() {
		return this.node?.isConnected;
	}
	createLog(e) {
		let t = document.createElement("div");
		return t.setAttribute("role", "log"), t.setAttribute("aria-live", e), t.setAttribute("aria-relevant", "additions"), t;
	}
	destroy() {
		this.node &&= (document.body.removeChild(this.node), null);
	}
	announce(e, t = "assertive", n = jf) {
		if (!this.node) return;
		let r = document.createElement("div");
		typeof e == "object" ? (r.setAttribute("role", "img"), r.setAttribute("aria-labelledby", e["aria-labelledby"])) : r.textContent = e, t === "assertive" ? this.assertiveLog?.appendChild(r) : this.politeLog?.appendChild(r), e !== "" && setTimeout(() => {
			r.remove();
		}, n);
	}
	clear(e) {
		this.node && ((!e || e === "assertive") && this.assertiveLog && (this.assertiveLog.innerHTML = ""), (!e || e === "polite") && this.politeLog && (this.politeLog.innerHTML = ""));
	}
}, Ff = P.createContext(!0);
function If() {
	throw Error("A function wrapped in useEffectEvent can't be called during rendering.");
}
var Lf = "use" in P ? () => {
	try {
		return P.use(Ff);
	} catch {
		return !1;
	}
} : () => !1;
function Rf(e) {
	let t = P.useRef(If);
	return P.useInsertionEffect(() => {
		t.current = e;
	}, [e]), (...e) => {
		Lf() && If();
		let n = t.current;
		return n(...e);
	};
}
//#endregion
//#region src/lib/TruncatedHit.js
var zf = class {
	constructor(e, t = void 0, { maxChars: n = 200, minimum: r = 20 } = {}) {
		this.hit = e, this.annotation = t, this.maxChars = n || 200, this.minimum = r || 20;
	}
	get match() {
		return this.hit.match || this.annotation && this.annotation.resource.resource.chars || "-";
	}
	get charsOnSide() {
		let e = (this.maxChars - this.match.length) / 2, t = [(this.hit.before || "").length, (this.hit.after || "").length].filter((e) => e > 0);
		return Math.max(Math.min(e, ...t), this.minimum);
	}
	get before() {
		return this.hit.before ? this.hit.before.substring(this.hit.before.length - this.charsOnSide, this.hit.before.length) : "";
	}
	get after() {
		return this.hit.after ? this.hit.after.substring(0, Math.min(this.hit.after.length, this.charsOnSide)) : "";
	}
}, Bf = H(Sr, {
	name: "SearchHit",
	slot: "root"
})(({ ownerState: e, theme: t }) => ({
	"&.Mui-focused": {
		"&:hover": { ...e.windowSelected && { backgroundColor: "inherit" } },
		...e.windowSelected && { backgroundColor: "inherit" }
	},
	paddingRight: t.spacing(1)
})), Vf = H("h4", {
	name: "SearchHit",
	slot: "canvasLabel"
})(({ theme: e }) => ({
	display: "inline",
	marginBottom: e.spacing(1.5)
})), Hf = H(Jn, {
	name: "SearchHit",
	slot: "counter"
})(({ ownerState: e, theme: t }) => ({
	backgroundColor: t.palette.hitCounter.default,
	...e.windowSelected && { backgroundColor: t.palette.highlights.primary },
	...e.adjacent && !e.windowSelected && { backgroundColor: t.palette.highlights.secondary },
	height: 30,
	marginRight: t.spacing(1),
	typography: "subtitle2",
	verticalAlign: "inherit"
}));
function Uf({ adjacent: e = !1, annotation: t = void 0, annotationId: n = void 0, annotationLabel: r = void 0, announcer: i = void 0, canvasLabel: a = void 0, companionWindowId: o = void 0, containerRef: s = void 0, focused: c = !1, hit: l = void 0, index: u = void 0, selectAnnotation: d = () => {}, selected: f = !1, showDetails: p = () => {}, total: m = void 0, windowId: h, windowSelected: g = !1 }) {
	let { t: _ } = V();
	F(() => {
		f && b();
	}, [f]);
	let v = () => {
		t && n && d(n);
	}, y = In(() => l && new zf(l, t), [l, t]), b = Rf(() => {
		!i || !y || i([
			_("pagination", {
				current: u + 1,
				total: m
			}),
			a,
			r,
			y.before,
			y.match,
			y.after
		].join(" "), "polite");
	}), x = Nn();
	if (c && !f) return null;
	let S = c ? l : l && y, C = l && (S.before !== l.before || S.after !== l.after), w = {
		adjacent: e,
		focused: c,
		selected: f,
		windowSelected: g
	}, T = /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(Hf, {
		component: "span",
		ownerState: w,
		label: u + 1
	}), /* @__PURE__ */ B(Vf, {
		id: x,
		children: [a, r && /* @__PURE__ */ z(U, {
			component: "span",
			sx: {
				display: "block",
				marginTop: 1
			},
			children: r
		})]
	})] });
	return /* @__PURE__ */ z(ks, {
		containerRef: s,
		offsetTop: 96,
		scrollTo: g && !c,
		children: /* @__PURE__ */ z(Bf, {
			ownerState: w,
			className: g ? "windowSelected" : "",
			divider: !0,
			component: f ? "li" : Cr,
			onClick: v,
			selected: f,
			children: /* @__PURE__ */ z(Zn, {
				primary: T,
				primaryTypographyProps: {
					component: "div",
					sx: { marginBottom: 1 },
					variant: "subtitle2"
				},
				secondaryTypographyProps: { variant: "body1" },
				secondary: /* @__PURE__ */ B(R, { children: [l && /* @__PURE__ */ B(R, { children: [
					/* @__PURE__ */ z(Es, {
						ruleSet: "iiif",
						htmlString: S.before
					}),
					" ",
					/* @__PURE__ */ z("strong", { children: /* @__PURE__ */ z(Es, {
						ruleSet: "iiif",
						htmlString: S.match
					}) }),
					" ",
					/* @__PURE__ */ z(Es, {
						ruleSet: "iiif",
						htmlString: S.after
					}),
					" ",
					C && !c && /* @__PURE__ */ z(sr, {
						sx: {
							"& span": { lineHeight: "1.5em" },
							margin: 0,
							padding: 0,
							textTransform: "none"
						},
						onClick: p,
						color: "secondary",
						size: "small",
						"aria-describedby": x,
						children: _("more")
					})
				] }), !l && t && /* @__PURE__ */ z(Es, {
					ruleSet: "iiif",
					htmlString: t.chars
				})] })
			})
		})
	});
}
Uf.propTypes = {
	adjacent: W.default.bool,
	annotation: W.default.shape({
		chars: W.default.string,
		targetId: W.default.string
	}),
	annotationId: W.default.string,
	annotationLabel: W.default.string,
	announcer: W.default.func,
	canvasLabel: W.default.string,
	companionWindowId: W.default.string,
	containerRef: W.default.oneOfType([W.default.func, W.default.shape({ current: W.default.instanceOf(Element) })]),
	focused: W.default.bool,
	hit: W.default.shape({
		after: W.default.string,
		before: W.default.string,
		match: W.default.string
	}),
	index: W.default.number,
	selectAnnotation: W.default.func,
	selected: W.default.bool,
	showDetails: W.default.func,
	total: W.default.number,
	windowId: W.default.string.isRequired,
	windowSelected: W.default.bool
};
var Wf = n(w((e, { annotationId: t, hit: n = { annotations: [] }, companionWindowId: r, windowId: i }) => {
	let a = t || n.annotations[0], o = Et(e, {
		annotationUri: a,
		companionWindowId: r,
		windowId: i
	}), s = At(e, {
		annotationUri: a,
		companionWindowId: r,
		windowId: i
	}), c = st(e, { windowId: i }), l = Ct(e, {
		companionWindowId: r,
		windowId: i
	}), u = Dt(e, { windowId: i }), d = [t, ...n.annotations];
	return {
		adjacent: c.includes(o?.targetId),
		annotation: o,
		annotationId: a,
		annotationLabel: s[0],
		canvasLabel: o && Re(e, {
			canvasId: o.targetId,
			windowId: i
		}),
		selected: l[0] && d.includes(l[0]),
		windowSelected: u && d.includes(u)
	};
}, (e, { windowId: t }) => ({ selectAnnotation: (...n) => e(wt(t, ...n)) })), m("SearchHit"))(Uf);
//#endregion
//#region src/components/SearchResults.jsx
function Gf({ companionWindowId: e, containerRef: t, searchAnnotations: n, searchHits: r, windowId: i, focused: a, toggleFocus: o }) {
	return r.length === 0 && n.length > 0 ? n.map((r, s) => /* @__PURE__ */ z(Wf, {
		announcer: Nf,
		annotationId: r.id,
		companionWindowId: e,
		containerRef: t,
		focused: a,
		index: s,
		total: n.length,
		windowId: i,
		showDetails: o
	}, r.id)) : r.map((n, s) => /* @__PURE__ */ z(Wf, {
		announcer: Nf,
		containerRef: t,
		companionWindowId: e,
		focused: a,
		hit: n,
		index: s,
		total: r.length,
		windowId: i,
		showDetails: o
	}, n.annotations[0]));
}
function Kf({ companionWindowId: e, containerRef: t = void 0, isFetching: n = !1, fetchSearch: r, nextSearch: i = void 0, query: a = void 0, searchAnnotations: o = [], searchHits: s = [], searchNumTotal: c = void 0, windowId: l }) {
	let { t: u } = V(), [d, f] = L(!1), p = jn(() => {
		f(!d);
	}, [f, d]), m = a && !n && s.length === 0 && o.length === 0;
	return /* @__PURE__ */ B(R, { children: [
		d && /* @__PURE__ */ z(ks, {
			containerRef: t,
			offsetTop: 96,
			scrollTo: !0,
			children: /* @__PURE__ */ B(sr, {
				onClick: p,
				sx: { textTransform: "none" },
				size: "small",
				children: [/* @__PURE__ */ z(Af, {}), u("backToResults")]
			})
		}),
		m && /* @__PURE__ */ z(U, {
			sx: {
				padding: 2,
				typography: "h6"
			},
			children: u("searchNoResults")
		}),
		/* @__PURE__ */ z(xr, {
			disablePadding: !0,
			children: /* @__PURE__ */ z(Gf, {
				companionWindowId: e,
				containerRef: t,
				searchAnnotations: o,
				searchHits: s,
				windowId: l,
				focused: d,
				toggleFocus: p
			})
		}),
		i && /* @__PURE__ */ B(sr, {
			sx: { width: "100%" },
			color: "secondary",
			onClick: () => r(l, e, i, a),
			children: [
				u("moreResults"),
				/* @__PURE__ */ z("br", {}),
				`(${u("searchResultsRemaining", { numLeft: c - s.length })})`
			]
		})
	] });
}
Kf.propTypes = {
	companionWindowId: W.default.string.isRequired,
	containerRef: W.default.oneOfType([W.default.func, W.default.shape({ current: W.default.instanceOf(Element) })]),
	fetchSearch: W.default.func.isRequired,
	isFetching: W.default.bool,
	nextSearch: W.default.string,
	query: W.default.string,
	searchAnnotations: W.default.arrayOf(W.default.object),
	searchHits: W.default.arrayOf(W.default.object),
	searchNumTotal: W.default.number,
	windowId: W.default.string.isRequired
};
var qf = n(w((e, { companionWindowId: t, windowId: n }) => ({
	isFetching: St(e, {
		companionWindowId: t,
		windowId: n
	}),
	nextSearch: Tt(e, {
		companionWindowId: t,
		windowId: n
	}),
	query: Ft(e, {
		companionWindowId: t,
		windowId: n
	}),
	searchAnnotations: Pt(e, {
		companionWindowId: t,
		windowId: n
	}),
	searchHits: xt(e, {
		companionWindowId: t,
		windowId: n
	}),
	searchNumTotal: Mt(e, {
		companionWindowId: t,
		windowId: n
	})
}), { fetchSearch: ha }), m("SearchResults"))(Kf);
//#endregion
//#region src/components/SearchPanel.jsx
function Jf({ fetchSearch: e = void 0, id: t, query: n = "", removeSearch: r, searchService: i, suggestedSearches: a = [], windowId: o }) {
	let { t: s } = V(), c = I(null);
	return /* @__PURE__ */ B(ml, {
		ariaLabel: s("searchTitle"),
		title: /* @__PURE__ */ B(R, { children: [s("searchTitle"), n && n !== "" && /* @__PURE__ */ z(Jn, {
			"aria-label": s("clearSearchAria"),
			role: "button",
			sx: { marginLeft: 1 },
			color: "secondary",
			label: s("clearSearch"),
			onClick: r,
			onDelete: r,
			size: "small",
			tabIndex: 0,
			variant: "outlined"
		})] }),
		windowId: o,
		id: t,
		titleControls: /* @__PURE__ */ z(kf, {
			companionWindowId: t,
			windowId: o
		}),
		ref: c,
		children: [/* @__PURE__ */ z(qf, {
			containerRef: c,
			companionWindowId: t,
			windowId: o
		}), e && a && n === "" && a.map((t) => /* @__PURE__ */ z(U, {
			component: "p",
			variant: "body1",
			sx: { margin: 2 },
			children: /* @__PURE__ */ z(sr, {
				variant: "inlineText",
				color: "secondary",
				onClick: () => e(`${i.id}?${new URLSearchParams({ q: t })}`, t),
				children: s("suggestSearch", { query: t })
			})
		}, t))]
	});
}
Jf.propTypes = {
	fetchSearch: W.default.func,
	id: W.default.string.isRequired,
	query: W.default.string,
	removeSearch: W.default.func.isRequired,
	searchService: W.default.shape({ id: W.default.string }).isRequired,
	suggestedSearches: W.default.arrayOf(W.default.string),
	windowId: W.default.string.isRequired
};
var Yf = n(w((e, { id: t, windowId: n }) => ({
	query: Ft(e, {
		companionWindowId: t,
		windowId: n
	}),
	searchService: Se(e, { windowId: n }),
	suggestedSearches: s(e, { windowId: n }).suggestedSearches
}), (e, t) => ({
	fetchSearch: (n, r) => e(ha(t.windowId, t.id, n, r)),
	removeSearch: () => e(ma(t.windowId, t.id))
})), m("SearchPanel"))(Jf), Xf = M(/*#__PURE__*/ z("path", { d: "M20 9H4v2h16zM4 15h16v-2H4z" }), "DragHandleSharp"), Zf = M(/*#__PURE__*/ z("path", { d: "M8 11h3v10h2V11h3l-4-4zM4 3v2h16V3z" }), "VerticalAlignTopSharp"), Qf = M(/*#__PURE__*/ z("path", { d: "M16 13h-3V3h-2v10H8l4 4zM4 19v2h16v-2z" }), "VerticalAlignBottomSharp"), $f = M(/*#__PURE__*/ z("path", { d: "M17.66 8 12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8M6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14z" }), "OpacitySharp"), ep = "Invariant failed";
function tp(e, t) {
	if (!e) throw Error(ep);
}
//#endregion
//#region node_modules/css-box-model/dist/css-box-model.esm.js
var np = function(e) {
	var t = e.top, n = e.right, r = e.bottom, i = e.left;
	return {
		top: t,
		right: n,
		bottom: r,
		left: i,
		width: n - i,
		height: r - t,
		x: i,
		y: t,
		center: {
			x: (n + i) / 2,
			y: (r + t) / 2
		}
	};
}, rp = function(e, t) {
	return {
		top: e.top - t.top,
		left: e.left - t.left,
		bottom: e.bottom + t.bottom,
		right: e.right + t.right
	};
}, ip = function(e, t) {
	return {
		top: e.top + t.top,
		left: e.left + t.left,
		bottom: e.bottom - t.bottom,
		right: e.right - t.right
	};
}, ap = function(e, t) {
	return {
		top: e.top + t.y,
		left: e.left + t.x,
		bottom: e.bottom + t.y,
		right: e.right + t.x
	};
}, op = {
	top: 0,
	right: 0,
	bottom: 0,
	left: 0
}, sp = function(e) {
	var t = e.borderBox, n = e.margin, r = n === void 0 ? op : n, i = e.border, a = i === void 0 ? op : i, o = e.padding, s = o === void 0 ? op : o, c = np(rp(t, r)), l = np(ip(t, a)), u = np(ip(l, s));
	return {
		marginBox: c,
		borderBox: np(t),
		paddingBox: l,
		contentBox: u,
		margin: r,
		border: a,
		padding: s
	};
}, cp = function(e) {
	var t = e.slice(0, -2);
	if (e.slice(-2) !== "px") return 0;
	var n = Number(t);
	return isNaN(n) && tp(!1), n;
}, lp = function() {
	return {
		x: window.pageXOffset,
		y: window.pageYOffset
	};
}, up = function(e, t) {
	var n = e.borderBox, r = e.border, i = e.margin, a = e.padding;
	return sp({
		borderBox: ap(n, t),
		border: r,
		margin: i,
		padding: a
	});
}, dp = function(e, t) {
	return t === void 0 && (t = lp()), up(e, t);
}, fp = function(e, t) {
	return sp({
		borderBox: e,
		margin: {
			top: cp(t.marginTop),
			right: cp(t.marginRight),
			bottom: cp(t.marginBottom),
			left: cp(t.marginLeft)
		},
		padding: {
			top: cp(t.paddingTop),
			right: cp(t.paddingRight),
			bottom: cp(t.paddingBottom),
			left: cp(t.paddingLeft)
		},
		border: {
			top: cp(t.borderTopWidth),
			right: cp(t.borderRightWidth),
			bottom: cp(t.borderBottomWidth),
			left: cp(t.borderLeftWidth)
		}
	});
}, pp = function(e) {
	return fp(e.getBoundingClientRect(), window.getComputedStyle(e));
}, mp = function(e) {
	var t = [], n = null, r = function() {
		t = [...arguments], !n && (n = requestAnimationFrame(function() {
			n = null, e.apply(void 0, t);
		}));
	};
	return r.cancel = function() {
		n &&= (cancelAnimationFrame(n), null);
	}, r;
};
//#endregion
//#region node_modules/@hello-pangea/dnd/dist/dnd.esm.js
function hp(e, t) {}
hp.bind(null, "warn"), hp.bind(null, "error");
function gp() {}
function _p(e, t) {
	return {
		...e,
		...t
	};
}
function vp(e, t, n) {
	let r = t.map((t) => {
		let r = _p(n, t.options);
		return e.addEventListener(t.eventName, t.fn, r), function() {
			e.removeEventListener(t.eventName, t.fn, r);
		};
	});
	return function() {
		r.forEach((e) => {
			e();
		});
	};
}
var yp = "Invariant failed", bp = class extends Error {};
bp.prototype.toString = function() {
	return this.message;
};
function J(e, t) {
	throw new bp(yp);
}
var xp = class extends P.Component {
	constructor(...e) {
		super(...e), this.callbacks = null, this.unbind = gp, this.onWindowError = (e) => {
			let t = this.getCallbacks();
			t.isDragging() && t.tryAbort(), e.error instanceof bp && e.preventDefault();
		}, this.getCallbacks = () => {
			if (!this.callbacks) throw Error("Unable to find AppCallbacks in <ErrorBoundary/>");
			return this.callbacks;
		}, this.setCallbacks = (e) => {
			this.callbacks = e;
		};
	}
	componentDidMount() {
		this.unbind = vp(window, [{
			eventName: "error",
			fn: this.onWindowError
		}]);
	}
	componentDidCatch(e) {
		if (e instanceof bp) {
			this.setState({});
			return;
		}
		throw e;
	}
	componentWillUnmount() {
		this.unbind();
	}
	render() {
		return this.props.children(this.setCallbacks);
	}
}, Sp = "\n  Press space bar to start a drag.\n  When dragging you can use the arrow keys to move the item around and escape to cancel.\n  Some screen readers may require you to be in focus mode or to use your pass through key\n", Cp = (e) => e + 1, wp = (e) => `
  You have lifted an item in position ${Cp(e.source.index)}
`, Tp = (e, t) => {
	let n = e.droppableId === t.droppableId, r = Cp(e.index), i = Cp(t.index);
	return n ? `
      You have moved the item from position ${r}
      to position ${i}
    ` : `
    You have moved the item from position ${r}
    in list ${e.droppableId}
    to list ${t.droppableId}
    in position ${i}
  `;
}, Ep = (e, t, n) => t.droppableId === n.droppableId ? `
      The item ${e}
      has been combined with ${n.draggableId}` : `
      The item ${e}
      in list ${t.droppableId}
      has been combined with ${n.draggableId}
      in list ${n.droppableId}
    `, Dp = (e) => {
	let t = e.destination;
	if (t) return Tp(e.source, t);
	let n = e.combine;
	return n ? Ep(e.draggableId, e.source, n) : "You are over an area that cannot be dropped on";
}, Op = (e) => `
  The item has returned to its starting position
  of ${Cp(e.index)}
`, kp = {
	dragHandleUsageInstructions: Sp,
	onDragStart: wp,
	onDragUpdate: Dp,
	onDragEnd: (e) => {
		if (e.reason === "CANCEL") return `
      Movement cancelled.
      ${Op(e.source)}
    `;
		let t = e.destination, n = e.combine;
		return t ? `
      You have dropped the item.
      ${Tp(e.source, t)}
    ` : n ? `
      You have dropped the item.
      ${Ep(e.draggableId, e.source, n)}
    ` : `
    The item has been dropped while not over a drop area.
    ${Op(e.source)}
  `;
	}
};
function Ap(e, t) {
	return !!(e === t || Number.isNaN(e) && Number.isNaN(t));
}
function jp(e, t) {
	if (e.length !== t.length) return !1;
	for (let n = 0; n < e.length; n++) if (!Ap(e[n], t[n])) return !1;
	return !0;
}
function Y(e, t) {
	let n = L(() => ({
		inputs: t,
		result: e()
	}))[0], r = I(!0), i = I(n), a = r.current || t && i.current.inputs && jp(t, i.current.inputs) ? i.current : {
		inputs: t,
		result: e()
	};
	return F(() => {
		r.current = !1, i.current = a;
	}, [a]), a.result;
}
function X(e, t) {
	return Y(() => e, t);
}
var Mp = {
	x: 0,
	y: 0
}, Np = (e, t) => ({
	x: e.x + t.x,
	y: e.y + t.y
}), Pp = (e, t) => ({
	x: e.x - t.x,
	y: e.y - t.y
}), Fp = (e, t) => e.x === t.x && e.y === t.y, Ip = (e) => ({
	x: e.x === 0 ? 0 : -e.x,
	y: e.y === 0 ? 0 : -e.y
}), Lp = (e, t, n = 0) => e === "x" ? {
	x: t,
	y: n
} : {
	x: n,
	y: t
}, Rp = (e, t) => Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2), zp = (e, t) => Math.min(...t.map((t) => Rp(e, t))), Bp = (e) => (t) => ({
	x: e(t.x),
	y: e(t.y)
}), Vp = (e, t) => {
	let n = np({
		top: Math.max(t.top, e.top),
		right: Math.min(t.right, e.right),
		bottom: Math.min(t.bottom, e.bottom),
		left: Math.max(t.left, e.left)
	});
	return n.width <= 0 || n.height <= 0 ? null : n;
}, Hp = (e, t) => ({
	top: e.top + t.y,
	left: e.left + t.x,
	bottom: e.bottom + t.y,
	right: e.right + t.x
}), Up = (e) => [
	{
		x: e.left,
		y: e.top
	},
	{
		x: e.right,
		y: e.top
	},
	{
		x: e.left,
		y: e.bottom
	},
	{
		x: e.right,
		y: e.bottom
	}
], Wp = {
	top: 0,
	right: 0,
	bottom: 0,
	left: 0
}, Gp = (e, t) => t ? Hp(e, t.scroll.diff.displacement) : e, Kp = (e, t, n) => n && n.increasedBy ? {
	...e,
	[t.end]: e[t.end] + n.increasedBy[t.line]
} : e, qp = (e, t) => t && t.shouldClipSubject ? Vp(t.pageMarginBox, e) : np(e), Jp = ({ page: e, withPlaceholder: t, axis: n, frame: r }) => ({
	page: e,
	withPlaceholder: t,
	active: qp(Kp(Gp(e.marginBox, r), n, t), r)
}), Yp = (e, t) => {
	!e.frame && J();
	let n = e.frame, r = Pp(t, n.scroll.initial), i = Ip(r), a = {
		...n,
		scroll: {
			initial: n.scroll.initial,
			current: t,
			diff: {
				value: r,
				displacement: i
			},
			max: n.scroll.max
		}
	}, o = Jp({
		page: e.subject.page,
		withPlaceholder: e.subject.withPlaceholder,
		axis: e.axis,
		frame: a
	});
	return {
		...e,
		frame: a,
		subject: o
	};
};
function Xp(e, t = jp) {
	let n = null;
	function r(...r) {
		if (n && n.lastThis === this && t(r, n.lastArgs)) return n.lastResult;
		let i = e.apply(this, r);
		return n = {
			lastResult: i,
			lastArgs: r,
			lastThis: this
		}, i;
	}
	return r.clear = function() {
		n = null;
	}, r;
}
var Zp = Xp((e) => e.reduce((e, t) => (e[t.descriptor.id] = t, e), {})), Qp = Xp((e) => e.reduce((e, t) => (e[t.descriptor.id] = t, e), {})), $p = Xp((e) => Object.values(e)), em = Xp((e) => Object.values(e)), tm = Xp((e, t) => em(t).filter((t) => e === t.descriptor.droppableId).sort((e, t) => e.descriptor.index - t.descriptor.index));
function nm(e) {
	return e.at && e.at.type === "REORDER" ? e.at.destination : null;
}
function rm(e) {
	return e.at && e.at.type === "COMBINE" ? e.at.combine : null;
}
var im = Xp((e, t) => t.filter((t) => t.descriptor.id !== e.descriptor.id)), am = ({ isMovingForward: e, draggable: t, destination: n, insideDestination: r, previousImpact: i }) => {
	if (!n.isCombineEnabled || !nm(i)) return null;
	function a(e) {
		let t = {
			type: "COMBINE",
			combine: {
				draggableId: e,
				droppableId: n.descriptor.id
			}
		};
		return {
			...i,
			at: t
		};
	}
	let o = i.displaced.all, s = o.length ? o[0] : null;
	if (e) return s ? a(s) : null;
	let c = im(t, r);
	if (!s) {
		if (!c.length) return null;
		let e = c[c.length - 1];
		return a(e.descriptor.id);
	}
	let l = c.findIndex((e) => e.descriptor.id === s);
	l === -1 && J();
	let u = l - 1;
	if (u < 0) return null;
	let d = c[u];
	return a(d.descriptor.id);
}, om = (e, t) => e.descriptor.droppableId === t.descriptor.id, sm = {
	point: Mp,
	value: 0
}, cm = {
	invisible: {},
	visible: {},
	all: []
}, lm = {
	displaced: cm,
	displacedBy: sm,
	at: null
}, um = (e, t) => (n) => e <= n && n <= t, dm = (e) => {
	let t = um(e.top, e.bottom), n = um(e.left, e.right);
	return (r) => {
		if (t(r.top) && t(r.bottom) && n(r.left) && n(r.right)) return !0;
		let i = t(r.top) || t(r.bottom), a = n(r.left) || n(r.right);
		if (i && a) return !0;
		let o = r.top < e.top && r.bottom > e.bottom, s = r.left < e.left && r.right > e.right;
		return o && s ? !0 : o && a || s && i;
	};
}, fm = (e) => {
	let t = um(e.top, e.bottom), n = um(e.left, e.right);
	return (e) => t(e.top) && t(e.bottom) && n(e.left) && n(e.right);
}, pm = {
	direction: "vertical",
	line: "y",
	crossAxisLine: "x",
	start: "top",
	end: "bottom",
	size: "height",
	crossAxisStart: "left",
	crossAxisEnd: "right",
	crossAxisSize: "width"
}, mm = {
	direction: "horizontal",
	line: "x",
	crossAxisLine: "y",
	start: "left",
	end: "right",
	size: "width",
	crossAxisStart: "top",
	crossAxisEnd: "bottom",
	crossAxisSize: "height"
}, hm = (e) => (t) => {
	let n = um(t.top, t.bottom), r = um(t.left, t.right);
	return (t) => e === pm ? n(t.top) && n(t.bottom) : r(t.left) && r(t.right);
}, gm = (e, t) => Hp(e, t.frame ? t.frame.scroll.diff.displacement : Mp), _m = (e, t, n) => t.subject.active ? n(t.subject.active)(e) : !1, vm = (e, t, n) => n(t)(e), ym = ({ target: e, destination: t, viewport: n, withDroppableDisplacement: r, isVisibleThroughFrameFn: i }) => {
	let a = r ? gm(e, t) : e;
	return _m(a, t, i) && vm(a, n, i);
}, bm = (e) => ym({
	...e,
	isVisibleThroughFrameFn: dm
}), xm = (e) => ym({
	...e,
	isVisibleThroughFrameFn: fm
}), Sm = (e) => ym({
	...e,
	isVisibleThroughFrameFn: hm(e.destination.axis)
}), Cm = (e, t, n) => {
	if (typeof n == "boolean") return n;
	if (!t) return !0;
	let { invisible: r, visible: i } = t;
	if (r[e]) return !1;
	let a = i[e];
	return !a || a.shouldAnimate;
};
function wm(e, t) {
	let n = e.page.marginBox;
	return np(rp(n, {
		top: t.point.y,
		right: 0,
		bottom: 0,
		left: t.point.x
	}));
}
function Tm({ afterDragging: e, destination: t, displacedBy: n, viewport: r, forceShouldAnimate: i, last: a }) {
	return e.reduce(function(e, o) {
		let s = wm(o, n), c = o.descriptor.id;
		if (e.all.push(c), !bm({
			target: s,
			destination: t,
			viewport: r,
			withDroppableDisplacement: !0
		})) return e.invisible[o.descriptor.id] = !0, e;
		let l = {
			draggableId: c,
			shouldAnimate: Cm(c, a, i)
		};
		return e.visible[c] = l, e;
	}, {
		all: [],
		visible: {},
		invisible: {}
	});
}
function Em(e, t) {
	if (!e.length) return 0;
	let n = e[e.length - 1].descriptor.index;
	return t.inHomeList ? n : n + 1;
}
function Dm({ insideDestination: e, inHomeList: t, displacedBy: n, destination: r }) {
	let i = Em(e, { inHomeList: t });
	return {
		displaced: cm,
		displacedBy: n,
		at: {
			type: "REORDER",
			destination: {
				droppableId: r.descriptor.id,
				index: i
			}
		}
	};
}
function Om({ draggable: e, insideDestination: t, destination: n, viewport: r, displacedBy: i, last: a, index: o, forceShouldAnimate: s }) {
	let c = om(e, n);
	if (o == null) return Dm({
		insideDestination: t,
		inHomeList: c,
		displacedBy: i,
		destination: n
	});
	let l = t.find((e) => e.descriptor.index === o);
	if (!l) return Dm({
		insideDestination: t,
		inHomeList: c,
		displacedBy: i,
		destination: n
	});
	let u = im(e, t), d = t.indexOf(l);
	return {
		displaced: Tm({
			afterDragging: u.slice(d),
			destination: n,
			displacedBy: i,
			last: a,
			viewport: r.frame,
			forceShouldAnimate: s
		}),
		displacedBy: i,
		at: {
			type: "REORDER",
			destination: {
				droppableId: n.descriptor.id,
				index: o
			}
		}
	};
}
function km(e, t) {
	return !!t.effected[e];
}
var Am = ({ isMovingForward: e, destination: t, draggables: n, combine: r, afterCritical: i }) => {
	if (!t.isCombineEnabled) return null;
	let a = r.draggableId, o = n[a].descriptor.index;
	return km(a, i) ? e ? o : o - 1 : e ? o + 1 : o;
}, jm = ({ isMovingForward: e, isInHomeList: t, insideDestination: n, location: r }) => {
	if (!n.length) return null;
	let i = r.index, a = e ? i + 1 : i - 1, o = n[0].descriptor.index, s = n[n.length - 1].descriptor.index, c = t ? s : s + 1;
	return a < o || a > c ? null : a;
}, Mm = ({ isMovingForward: e, isInHomeList: t, draggable: n, draggables: r, destination: i, insideDestination: a, previousImpact: o, viewport: s, afterCritical: c }) => {
	let l = o.at;
	if (!l && J(), l.type === "REORDER") {
		let r = jm({
			isMovingForward: e,
			isInHomeList: t,
			location: l.destination,
			insideDestination: a
		});
		return r == null ? null : Om({
			draggable: n,
			insideDestination: a,
			destination: i,
			viewport: s,
			last: o.displaced,
			displacedBy: o.displacedBy,
			index: r
		});
	}
	let u = Am({
		isMovingForward: e,
		destination: i,
		displaced: o.displaced,
		draggables: r,
		combine: l.combine,
		afterCritical: c
	});
	return u == null ? null : Om({
		draggable: n,
		insideDestination: a,
		destination: i,
		viewport: s,
		last: o.displaced,
		displacedBy: o.displacedBy,
		index: u
	});
}, Nm = ({ displaced: e, afterCritical: t, combineWith: n, displacedBy: r }) => {
	let i = !!(e.visible[n] || e.invisible[n]);
	return km(n, t) ? i ? Mp : Ip(r.point) : i ? r.point : Mp;
}, Pm = ({ afterCritical: e, impact: t, draggables: n }) => {
	let r = rm(t);
	!r && J();
	let i = r.draggableId, a = n[i].page.borderBox.center;
	return Np(a, Nm({
		displaced: t.displaced,
		afterCritical: e,
		combineWith: i,
		displacedBy: t.displacedBy
	}));
}, Fm = (e, t) => t.margin[e.start] + t.borderBox[e.size] / 2, Im = (e, t) => t.margin[e.end] + t.borderBox[e.size] / 2, Lm = (e, t, n) => t[e.crossAxisStart] + n.margin[e.crossAxisStart] + n.borderBox[e.crossAxisSize] / 2, Rm = ({ axis: e, moveRelativeTo: t, isMoving: n }) => Lp(e.line, t.marginBox[e.end] + Fm(e, n), Lm(e, t.marginBox, n)), zm = ({ axis: e, moveRelativeTo: t, isMoving: n }) => Lp(e.line, t.marginBox[e.start] - Im(e, n), Lm(e, t.marginBox, n)), Bm = ({ axis: e, moveInto: t, isMoving: n }) => Lp(e.line, t.contentBox[e.start] + Fm(e, n), Lm(e, t.contentBox, n)), Vm = ({ impact: e, draggable: t, draggables: n, droppable: r, afterCritical: i }) => {
	let a = tm(r.descriptor.id, n), o = t.page, s = r.axis;
	if (!a.length) return Bm({
		axis: s,
		moveInto: r.page,
		isMoving: o
	});
	let { displaced: c, displacedBy: l } = e, u = c.all[0];
	if (u) {
		let e = n[u];
		return km(u, i) ? zm({
			axis: s,
			moveRelativeTo: e.page,
			isMoving: o
		}) : zm({
			axis: s,
			moveRelativeTo: up(e.page, l.point),
			isMoving: o
		});
	}
	let d = a[a.length - 1];
	return d.descriptor.id === t.descriptor.id ? o.borderBox.center : km(d.descriptor.id, i) ? Rm({
		axis: s,
		moveRelativeTo: up(d.page, Ip(i.displacedBy.point)),
		isMoving: o
	}) : Rm({
		axis: s,
		moveRelativeTo: d.page,
		isMoving: o
	});
}, Hm = (e, t) => {
	let n = e.frame;
	return n ? Np(t, n.scroll.diff.displacement) : t;
}, Um = ({ impact: e, draggable: t, droppable: n, draggables: r, afterCritical: i }) => {
	let a = t.page.borderBox.center, o = e.at;
	return !n || !o ? a : o.type === "REORDER" ? Vm({
		impact: e,
		draggable: t,
		draggables: r,
		droppable: n,
		afterCritical: i
	}) : Pm({
		impact: e,
		draggables: r,
		afterCritical: i
	});
}, Wm = (e) => {
	let t = Um(e), n = e.droppable;
	return n ? Hm(n, t) : t;
}, Gm = (e, t) => {
	let n = Pp(t, e.scroll.initial), r = Ip(n);
	return {
		frame: np({
			top: t.y,
			bottom: t.y + e.frame.height,
			left: t.x,
			right: t.x + e.frame.width
		}),
		scroll: {
			initial: e.scroll.initial,
			max: e.scroll.max,
			current: t,
			diff: {
				value: n,
				displacement: r
			}
		}
	};
};
function Km(e, t) {
	return e.map((e) => t[e]);
}
function qm(e, t) {
	for (let n = 0; n < t.length; n++) {
		let r = t[n].visible[e];
		if (r) return r;
	}
	return null;
}
var Jm = ({ impact: e, viewport: t, destination: n, draggables: r, maxScrollChange: i }) => {
	let a = Gm(t, Np(t.scroll.current, i)), o = n.frame ? Yp(n, Np(n.frame.scroll.current, i)) : n, s = e.displaced, c = Tm({
		afterDragging: Km(s.all, r),
		destination: n,
		displacedBy: e.displacedBy,
		viewport: a.frame,
		last: s,
		forceShouldAnimate: !1
	}), l = Tm({
		afterDragging: Km(s.all, r),
		destination: o,
		displacedBy: e.displacedBy,
		viewport: t.frame,
		last: s,
		forceShouldAnimate: !1
	}), u = {}, d = {}, f = [
		s,
		c,
		l
	];
	return s.all.forEach((e) => {
		let t = qm(e, f);
		if (t) {
			d[e] = t;
			return;
		}
		u[e] = !0;
	}), {
		...e,
		displaced: {
			all: s.all,
			invisible: u,
			visible: d
		}
	};
}, Ym = (e, t) => Np(e.scroll.diff.displacement, t), Xm = ({ pageBorderBoxCenter: e, draggable: t, viewport: n }) => {
	let r = Pp(Ym(n, e), t.page.borderBox.center);
	return Np(t.client.borderBox.center, r);
}, Zm = ({ draggable: e, destination: t, newPageBorderBoxCenter: n, viewport: r, withDroppableDisplacement: i, onlyOnMainAxis: a = !1 }) => {
	let o = Pp(n, e.page.borderBox.center), s = {
		target: Hp(e.page.borderBox, o),
		destination: t,
		withDroppableDisplacement: i,
		viewport: r
	};
	return a ? Sm(s) : xm(s);
}, Qm = ({ isMovingForward: e, draggable: t, destination: n, draggables: r, previousImpact: i, viewport: a, previousPageBorderBoxCenter: o, previousClientSelection: s, afterCritical: c }) => {
	if (!n.isEnabled) return null;
	let l = tm(n.descriptor.id, r), u = om(t, n), d = am({
		isMovingForward: e,
		draggable: t,
		destination: n,
		insideDestination: l,
		previousImpact: i
	}) || Mm({
		isMovingForward: e,
		isInHomeList: u,
		draggable: t,
		draggables: r,
		destination: n,
		insideDestination: l,
		previousImpact: i,
		viewport: a,
		afterCritical: c
	});
	if (!d) return null;
	let f = Wm({
		impact: d,
		draggable: t,
		droppable: n,
		draggables: r,
		afterCritical: c
	});
	if (Zm({
		draggable: t,
		destination: n,
		newPageBorderBoxCenter: f,
		viewport: a.frame,
		withDroppableDisplacement: !1,
		onlyOnMainAxis: !0
	})) return {
		clientSelection: Xm({
			pageBorderBoxCenter: f,
			draggable: t,
			viewport: a
		}),
		impact: d,
		scrollJumpRequest: null
	};
	let p = Pp(f, o);
	return {
		clientSelection: s,
		impact: Jm({
			impact: d,
			viewport: a,
			destination: n,
			draggables: r,
			maxScrollChange: p
		}),
		scrollJumpRequest: p
	};
}, $m = (e) => {
	let t = e.subject.active;
	return !t && J(), t;
}, eh = ({ isMovingForward: e, pageBorderBoxCenter: t, source: n, droppables: r, viewport: i }) => {
	let a = n.subject.active;
	if (!a) return null;
	let o = n.axis, s = um(a[o.start], a[o.end]), c = $p(r).filter((e) => e !== n).filter((e) => e.isEnabled).filter((e) => !!e.subject.active).filter((e) => dm(i.frame)($m(e))).filter((t) => {
		let n = $m(t);
		return e ? a[o.crossAxisEnd] < n[o.crossAxisEnd] : n[o.crossAxisStart] < a[o.crossAxisStart];
	}).filter((e) => {
		let t = $m(e), n = um(t[o.start], t[o.end]);
		return s(t[o.start]) || s(t[o.end]) || n(a[o.start]) || n(a[o.end]);
	}).sort((t, n) => {
		let r = $m(t)[o.crossAxisStart], i = $m(n)[o.crossAxisStart];
		return e ? r - i : i - r;
	}).filter((e, t, n) => $m(e)[o.crossAxisStart] === $m(n[0])[o.crossAxisStart]);
	if (!c.length) return null;
	if (c.length === 1) return c[0];
	let l = c.filter((e) => um($m(e)[o.start], $m(e)[o.end])(t[o.line]));
	return l.length === 1 ? l[0] : l.length > 1 ? l.sort((e, t) => $m(e)[o.start] - $m(t)[o.start])[0] : c.sort((e, n) => {
		let r = zp(t, Up($m(e))), i = zp(t, Up($m(n)));
		return r === i ? $m(e)[o.start] - $m(n)[o.start] : r - i;
	})[0];
}, th = (e, t) => {
	let n = e.page.borderBox.center;
	return km(e.descriptor.id, t) ? Pp(n, t.displacedBy.point) : n;
}, nh = (e, t) => {
	let n = e.page.borderBox;
	return km(e.descriptor.id, t) ? Hp(n, Ip(t.displacedBy.point)) : n;
}, rh = ({ pageBorderBoxCenter: e, viewport: t, destination: n, insideDestination: r, afterCritical: i }) => r.filter((e) => xm({
	target: nh(e, i),
	destination: n,
	viewport: t.frame,
	withDroppableDisplacement: !0
})).sort((t, r) => {
	let a = Rp(e, Hm(n, th(t, i))), o = Rp(e, Hm(n, th(r, i)));
	return a < o ? -1 : o < a ? 1 : t.descriptor.index - r.descriptor.index;
})[0] || null, ih = Xp(function(e, t) {
	let n = t[e.line];
	return {
		value: n,
		point: Lp(e.line, n)
	};
}), ah = (e, t, n) => {
	let r = e.axis;
	if (e.descriptor.mode === "virtual") return Lp(r.line, t[r.line]);
	let i = e.subject.page.contentBox[r.size], a = tm(e.descriptor.id, n).reduce((e, t) => e + t.client.marginBox[r.size], 0) + t[r.line] - i;
	return a <= 0 ? null : Lp(r.line, a);
}, oh = (e, t) => ({
	...e,
	scroll: {
		...e.scroll,
		max: t
	}
}), sh = (e, t, n) => {
	let r = e.frame;
	om(t, e) && J(), e.subject.withPlaceholder && J();
	let i = ih(e.axis, t.displaceBy).point, a = ah(e, i, n), o = {
		placeholderSize: i,
		increasedBy: a,
		oldFrameMaxScroll: e.frame ? e.frame.scroll.max : null
	};
	if (!r) {
		let t = Jp({
			page: e.subject.page,
			withPlaceholder: o,
			axis: e.axis,
			frame: e.frame
		});
		return {
			...e,
			subject: t
		};
	}
	let s = oh(r, a ? Np(r.scroll.max, a) : r.scroll.max), c = Jp({
		page: e.subject.page,
		withPlaceholder: o,
		axis: e.axis,
		frame: s
	});
	return {
		...e,
		subject: c,
		frame: s
	};
}, ch = (e) => {
	let t = e.subject.withPlaceholder;
	!t && J();
	let n = e.frame;
	if (!n) {
		let t = Jp({
			page: e.subject.page,
			axis: e.axis,
			frame: null,
			withPlaceholder: null
		});
		return {
			...e,
			subject: t
		};
	}
	let r = t.oldFrameMaxScroll;
	!r && J();
	let i = oh(n, r), a = Jp({
		page: e.subject.page,
		axis: e.axis,
		frame: i,
		withPlaceholder: null
	});
	return {
		...e,
		subject: a,
		frame: i
	};
}, lh = ({ previousPageBorderBoxCenter: e, moveRelativeTo: t, insideDestination: n, draggable: r, draggables: i, destination: a, viewport: o, afterCritical: s }) => {
	if (!t) {
		if (n.length) return null;
		let e = {
			displaced: cm,
			displacedBy: sm,
			at: {
				type: "REORDER",
				destination: {
					droppableId: a.descriptor.id,
					index: 0
				}
			}
		}, t = Wm({
			impact: e,
			draggable: r,
			droppable: a,
			draggables: i,
			afterCritical: s
		});
		return Zm({
			draggable: r,
			destination: om(r, a) ? a : sh(a, r, i),
			newPageBorderBoxCenter: t,
			viewport: o.frame,
			withDroppableDisplacement: !1,
			onlyOnMainAxis: !0
		}) ? e : null;
	}
	let c = e[a.axis.line] <= t.page.borderBox.center[a.axis.line], l = (() => {
		let e = t.descriptor.index;
		return t.descriptor.id === r.descriptor.id || c ? e : e + 1;
	})();
	return Om({
		draggable: r,
		insideDestination: n,
		destination: a,
		viewport: o,
		displacedBy: ih(a.axis, r.displaceBy),
		last: cm,
		index: l
	});
}, uh = ({ isMovingForward: e, previousPageBorderBoxCenter: t, draggable: n, isOver: r, draggables: i, droppables: a, viewport: o, afterCritical: s }) => {
	let c = eh({
		isMovingForward: e,
		pageBorderBoxCenter: t,
		source: r,
		droppables: a,
		viewport: o
	});
	if (!c) return null;
	let l = tm(c.descriptor.id, i), u = lh({
		previousPageBorderBoxCenter: t,
		destination: c,
		draggable: n,
		draggables: i,
		moveRelativeTo: rh({
			pageBorderBoxCenter: t,
			viewport: o,
			destination: c,
			insideDestination: l,
			afterCritical: s
		}),
		insideDestination: l,
		viewport: o,
		afterCritical: s
	});
	return u ? {
		clientSelection: Xm({
			pageBorderBoxCenter: Wm({
				impact: u,
				draggable: n,
				droppable: c,
				draggables: i,
				afterCritical: s
			}),
			draggable: n,
			viewport: o
		}),
		impact: u,
		scrollJumpRequest: null
	} : null;
}, dh = (e) => {
	let t = e.at;
	return t ? t.type === "REORDER" ? t.destination.droppableId : t.combine.droppableId : null;
}, fh = (e, t) => {
	let n = dh(e);
	return n ? t[n] : null;
}, ph = ({ state: e, type: t }) => {
	let n = fh(e.impact, e.dimensions.droppables), r = !!n, i = e.dimensions.droppables[e.critical.droppable.id], a = n || i, o = a.axis.direction, s = o === "vertical" && (t === "MOVE_UP" || t === "MOVE_DOWN") || o === "horizontal" && (t === "MOVE_LEFT" || t === "MOVE_RIGHT");
	if (s && !r) return null;
	let c = t === "MOVE_DOWN" || t === "MOVE_RIGHT", l = e.dimensions.draggables[e.critical.draggable.id], u = e.current.page.borderBoxCenter, { draggables: d, droppables: f } = e.dimensions;
	return s ? Qm({
		isMovingForward: c,
		previousPageBorderBoxCenter: u,
		draggable: l,
		destination: a,
		draggables: d,
		viewport: e.viewport,
		previousClientSelection: e.current.client.selection,
		previousImpact: e.impact,
		afterCritical: e.afterCritical
	}) : uh({
		isMovingForward: c,
		previousPageBorderBoxCenter: u,
		draggable: l,
		isOver: a,
		draggables: d,
		droppables: f,
		viewport: e.viewport,
		afterCritical: e.afterCritical
	});
};
function mh(e) {
	return e.phase === "DRAGGING" || e.phase === "COLLECTING";
}
function hh(e) {
	let t = um(e.top, e.bottom), n = um(e.left, e.right);
	return function(e) {
		return t(e.y) && n(e.x);
	};
}
function gh(e, t) {
	return e.left < t.right && e.right > t.left && e.top < t.bottom && e.bottom > t.top;
}
function _h({ pageBorderBox: e, draggable: t, candidates: n }) {
	let r = t.page.borderBox.center, i = n.map((t) => {
		let n = t.axis, i = Lp(t.axis.line, e.center[n.line], t.page.borderBox.center[n.crossAxisLine]);
		return {
			id: t.descriptor.id,
			distance: Rp(r, i)
		};
	}).sort((e, t) => t.distance - e.distance);
	return i[0] ? i[0].id : null;
}
function vh({ pageBorderBox: e, draggable: t, droppables: n }) {
	let r = $p(n).filter((t) => {
		if (!t.isEnabled) return !1;
		let n = t.subject.active;
		if (!n || !gh(e, n)) return !1;
		if (hh(n)(e.center)) return !0;
		let r = t.axis, i = n.center[r.crossAxisLine], a = e[r.crossAxisStart], o = e[r.crossAxisEnd], s = um(n[r.crossAxisStart], n[r.crossAxisEnd]), c = s(a), l = s(o);
		return !c && !l ? !0 : c ? a < i : o > i;
	});
	return r.length ? r.length === 1 ? r[0].descriptor.id : _h({
		pageBorderBox: e,
		draggable: t,
		candidates: r
	}) : null;
}
var yh = (e, t) => np(Hp(e, t)), bh = (e, t) => {
	let n = e.frame;
	return n ? yh(t, n.scroll.diff.value) : t;
};
function xh({ displaced: e, id: t }) {
	return !!(e.visible[t] || e.invisible[t]);
}
function Sh({ draggable: e, closest: t, inHomeList: n }) {
	return t ? n && t.descriptor.index > e.descriptor.index ? t.descriptor.index - 1 : t.descriptor.index : null;
}
var Ch = ({ pageBorderBoxWithDroppableScroll: e, draggable: t, destination: n, insideDestination: r, last: i, viewport: a, afterCritical: o }) => {
	let s = n.axis, c = ih(n.axis, t.displaceBy), l = c.value, u = e[s.start], d = e[s.end];
	return Om({
		draggable: t,
		insideDestination: r,
		destination: n,
		viewport: a,
		last: i,
		displacedBy: c,
		index: Sh({
			draggable: t,
			closest: im(t, r).find((e) => {
				let t = e.descriptor.id, n = e.page.borderBox.center[s.line], r = km(t, o), a = xh({
					displaced: i,
					id: t
				});
				return r ? a ? d <= n : u < n - l : a ? d <= n + l : u < n;
			}) || null,
			inHomeList: om(t, n)
		})
	});
}, wh = 4, Th = ({ draggable: e, pageBorderBoxWithDroppableScroll: t, previousImpact: n, destination: r, insideDestination: i, afterCritical: a }) => {
	if (!r.isCombineEnabled) return null;
	let o = r.axis, s = ih(r.axis, e.displaceBy), c = s.value, l = t[o.start], u = t[o.end], d = im(e, i).find((e) => {
		let t = e.descriptor.id, r = e.page.borderBox, i = r[o.size] / wh, s = km(t, a), d = xh({
			displaced: n.displaced,
			id: t
		});
		return s ? d ? u > r[o.start] + i && u < r[o.end] - i : l > r[o.start] - c + i && l < r[o.end] - c - i : d ? u > r[o.start] + c + i && u < r[o.end] + c - i : l > r[o.start] + i && l < r[o.end] - i;
	});
	return d ? {
		displacedBy: s,
		displaced: n.displaced,
		at: {
			type: "COMBINE",
			combine: {
				draggableId: d.descriptor.id,
				droppableId: r.descriptor.id
			}
		}
	} : null;
}, Eh = ({ pageOffset: e, draggable: t, draggables: n, droppables: r, previousImpact: i, viewport: a, afterCritical: o }) => {
	let s = yh(t.page.borderBox, e), c = vh({
		pageBorderBox: s,
		draggable: t,
		droppables: r
	});
	if (!c) return lm;
	let l = r[c], u = tm(l.descriptor.id, n), d = bh(l, s);
	return Th({
		pageBorderBoxWithDroppableScroll: d,
		draggable: t,
		previousImpact: i,
		destination: l,
		insideDestination: u,
		afterCritical: o
	}) || Ch({
		pageBorderBoxWithDroppableScroll: d,
		draggable: t,
		destination: l,
		insideDestination: u,
		last: i.displaced,
		viewport: a,
		afterCritical: o
	});
}, Dh = (e, t) => ({
	...e,
	[t.descriptor.id]: t
}), Oh = ({ previousImpact: e, impact: t, droppables: n }) => {
	let r = dh(e), i = dh(t);
	if (!r || r === i) return n;
	let a = n[r];
	return a.subject.withPlaceholder ? Dh(n, ch(a)) : n;
}, kh = ({ draggable: e, draggables: t, droppables: n, previousImpact: r, impact: i }) => {
	let a = Oh({
		previousImpact: r,
		impact: i,
		droppables: n
	}), o = dh(i);
	if (!o) return a;
	let s = n[o];
	return om(e, s) || s.subject.withPlaceholder ? a : Dh(a, sh(s, e, t));
}, Ah = ({ state: e, clientSelection: t, dimensions: n, viewport: r, impact: i, scrollJumpRequest: a }) => {
	let o = r || e.viewport, s = n || e.dimensions, c = t || e.current.client.selection, l = Pp(c, e.initial.client.selection), u = {
		offset: l,
		selection: c,
		borderBoxCenter: Np(e.initial.client.borderBoxCenter, l)
	}, d = {
		selection: Np(u.selection, o.scroll.current),
		borderBoxCenter: Np(u.borderBoxCenter, o.scroll.current),
		offset: Np(u.offset, o.scroll.diff.value)
	}, f = {
		client: u,
		page: d
	};
	if (e.phase === "COLLECTING") return {
		...e,
		dimensions: s,
		viewport: o,
		current: f
	};
	let p = s.draggables[e.critical.draggable.id], m = i || Eh({
		pageOffset: d.offset,
		draggable: p,
		draggables: s.draggables,
		droppables: s.droppables,
		previousImpact: e.impact,
		viewport: o,
		afterCritical: e.afterCritical
	}), h = kh({
		draggable: p,
		impact: m,
		previousImpact: e.impact,
		draggables: s.draggables,
		droppables: s.droppables
	});
	return {
		...e,
		current: f,
		dimensions: {
			draggables: s.draggables,
			droppables: h
		},
		impact: m,
		viewport: o,
		scrollJumpRequest: a || null,
		forceShouldAnimate: !a && null
	};
};
function jh(e, t) {
	return e.map((e) => t[e]);
}
var Mh = ({ impact: e, viewport: t, draggables: n, destination: r, forceShouldAnimate: i }) => {
	let a = e.displaced, o = Tm({
		afterDragging: jh(a.all, n),
		destination: r,
		displacedBy: e.displacedBy,
		viewport: t.frame,
		forceShouldAnimate: i,
		last: a
	});
	return {
		...e,
		displaced: o
	};
}, Nh = ({ impact: e, draggable: t, droppable: n, draggables: r, viewport: i, afterCritical: a }) => Xm({
	pageBorderBoxCenter: Wm({
		impact: e,
		draggable: t,
		draggables: r,
		droppable: n,
		afterCritical: a
	}),
	draggable: t,
	viewport: i
}), Ph = ({ state: e, dimensions: t, viewport: n }) => {
	e.movementMode !== "SNAP" && J();
	let r = e.impact, i = n || e.viewport, a = t || e.dimensions, { draggables: o, droppables: s } = a, c = o[e.critical.draggable.id], l = dh(r);
	!l && J();
	let u = s[l], d = Mh({
		impact: r,
		viewport: i,
		destination: u,
		draggables: o
	});
	return Ah({
		impact: d,
		clientSelection: Nh({
			impact: d,
			draggable: c,
			droppable: u,
			draggables: o,
			viewport: i,
			afterCritical: e.afterCritical
		}),
		state: e,
		dimensions: a,
		viewport: i
	});
}, Fh = (e) => ({
	index: e.index,
	droppableId: e.droppableId
}), Ih = ({ draggable: e, home: t, draggables: n, viewport: r }) => {
	let i = ih(t.axis, e.displaceBy), a = tm(t.descriptor.id, n), o = a.indexOf(e);
	o === -1 && J();
	let s = a.slice(o + 1), c = s.reduce((e, t) => (e[t.descriptor.id] = !0, e), {}), l = {
		inVirtualList: t.descriptor.mode === "virtual",
		displacedBy: i,
		effected: c
	};
	return {
		impact: {
			displaced: Tm({
				afterDragging: s,
				destination: t,
				displacedBy: i,
				last: null,
				viewport: r.frame,
				forceShouldAnimate: !1
			}),
			displacedBy: i,
			at: {
				type: "REORDER",
				destination: Fh(e.descriptor)
			}
		},
		afterCritical: l
	};
}, Lh = (e, t) => ({
	draggables: e.draggables,
	droppables: Dh(e.droppables, t)
}), Rh = ({ draggable: e, offset: t, initialWindowScroll: n }) => {
	let r = up(e.client, t), i = dp(r, n);
	return {
		...e,
		placeholder: {
			...e.placeholder,
			client: r
		},
		client: r,
		page: i
	};
}, zh = (e) => {
	let t = e.frame;
	return !t && J(), t;
}, Bh = ({ additions: e, updatedDroppables: t, viewport: n }) => {
	let r = n.scroll.diff.value;
	return e.map((e) => {
		let i = t[e.descriptor.droppableId], a = zh(i).scroll.diff.value;
		return Rh({
			draggable: e,
			offset: Np(r, a),
			initialWindowScroll: n.scroll.initial
		});
	});
}, Vh = ({ state: e, published: t }) => {
	let n = t.modified.map((t) => {
		let n = e.dimensions.droppables[t.droppableId];
		return Yp(n, t.scroll);
	}), r = {
		...e.dimensions.droppables,
		...Zp(n)
	}, i = Qp(Bh({
		additions: t.additions,
		updatedDroppables: r,
		viewport: e.viewport
	})), a = {
		...e.dimensions.draggables,
		...i
	};
	t.removals.forEach((e) => {
		delete a[e];
	});
	let o = {
		droppables: r,
		draggables: a
	}, s = dh(e.impact), c = s ? o.droppables[s] : null, l = o.draggables[e.critical.draggable.id], u = o.droppables[e.critical.droppable.id], { impact: d, afterCritical: f } = Ih({
		draggable: l,
		home: u,
		draggables: a,
		viewport: e.viewport
	}), p = c && c.isCombineEnabled ? e.impact : d, m = Eh({
		pageOffset: e.current.page.offset,
		draggable: o.draggables[e.critical.draggable.id],
		draggables: o.draggables,
		droppables: o.droppables,
		previousImpact: p,
		viewport: e.viewport,
		afterCritical: f
	}), h = {
		...e,
		phase: "DRAGGING",
		impact: m,
		onLiftImpact: d,
		dimensions: o,
		afterCritical: f,
		forceShouldAnimate: !1
	};
	return e.phase === "COLLECTING" ? h : {
		...h,
		phase: "DROP_PENDING",
		reason: e.reason,
		isWaiting: !1
	};
}, Hh = (e) => e.movementMode === "SNAP", Uh = (e, t, n) => {
	let r = Lh(e.dimensions, t);
	return !Hh(e) || n ? Ah({
		state: e,
		dimensions: r
	}) : Ph({
		state: e,
		dimensions: r
	});
};
function Wh(e) {
	return e.isDragging && e.movementMode === "SNAP" ? {
		...e,
		scrollJumpRequest: null
	} : e;
}
var Gh = {
	phase: "IDLE",
	completed: null,
	shouldFlush: !1
}, Kh = (e = Gh, t) => {
	if (t.type === "FLUSH") return {
		...Gh,
		shouldFlush: !0
	};
	if (t.type === "INITIAL_PUBLISH") {
		e.phase !== "IDLE" && J();
		let { critical: n, clientSelection: r, viewport: i, dimensions: a, movementMode: o } = t.payload, s = a.draggables[n.draggable.id], c = a.droppables[n.droppable.id], l = {
			selection: r,
			borderBoxCenter: s.client.borderBox.center,
			offset: Mp
		}, u = {
			client: l,
			page: {
				selection: Np(l.selection, i.scroll.initial),
				borderBoxCenter: Np(l.selection, i.scroll.initial),
				offset: Np(l.selection, i.scroll.diff.value)
			}
		}, d = $p(a.droppables).every((e) => !e.isFixedOnPage), { impact: f, afterCritical: p } = Ih({
			draggable: s,
			home: c,
			draggables: a.draggables,
			viewport: i
		});
		return {
			phase: "DRAGGING",
			isDragging: !0,
			critical: n,
			movementMode: o,
			dimensions: a,
			initial: u,
			current: u,
			isWindowScrollAllowed: d,
			impact: f,
			afterCritical: p,
			onLiftImpact: f,
			viewport: i,
			scrollJumpRequest: null,
			forceShouldAnimate: null
		};
	}
	if (t.type === "COLLECTION_STARTING") return e.phase === "COLLECTING" || e.phase === "DROP_PENDING" ? e : (e.phase !== "DRAGGING" && J(), {
		...e,
		phase: "COLLECTING"
	});
	if (t.type === "PUBLISH_WHILE_DRAGGING") return e.phase !== "COLLECTING" && e.phase !== "DROP_PENDING" && J(), Vh({
		state: e,
		published: t.payload
	});
	if (t.type === "MOVE") {
		if (e.phase === "DROP_PENDING") return e;
		!mh(e) && J();
		let { client: n } = t.payload;
		return Fp(n, e.current.client.selection) ? e : Ah({
			state: e,
			clientSelection: n,
			impact: Hh(e) ? e.impact : null
		});
	}
	if (t.type === "UPDATE_DROPPABLE_SCROLL") {
		if (e.phase === "DROP_PENDING" || e.phase === "COLLECTING") return Wh(e);
		!mh(e) && J();
		let { id: n, newScroll: r } = t.payload, i = e.dimensions.droppables[n];
		return i ? Uh(e, Yp(i, r), !1) : e;
	}
	if (t.type === "UPDATE_DROPPABLE_IS_ENABLED") {
		if (e.phase === "DROP_PENDING") return e;
		!mh(e) && J();
		let { id: n, isEnabled: r } = t.payload, i = e.dimensions.droppables[n];
		return !i && J(), i.isEnabled === r && J(), Uh(e, {
			...i,
			isEnabled: r
		}, !0);
	}
	if (t.type === "UPDATE_DROPPABLE_IS_COMBINE_ENABLED") {
		if (e.phase === "DROP_PENDING") return e;
		!mh(e) && J();
		let { id: n, isCombineEnabled: r } = t.payload, i = e.dimensions.droppables[n];
		return !i && J(), i.isCombineEnabled === r && J(), Uh(e, {
			...i,
			isCombineEnabled: r
		}, !0);
	}
	if (t.type === "MOVE_BY_WINDOW_SCROLL") {
		if (e.phase === "DROP_PENDING" || e.phase === "DROP_ANIMATING") return e;
		!mh(e) && J(), !e.isWindowScrollAllowed && J();
		let n = t.payload.newScroll;
		if (Fp(e.viewport.scroll.current, n)) return Wh(e);
		let r = Gm(e.viewport, n);
		return Hh(e) ? Ph({
			state: e,
			viewport: r
		}) : Ah({
			state: e,
			viewport: r
		});
	}
	if (t.type === "UPDATE_VIEWPORT_MAX_SCROLL") {
		if (!mh(e)) return e;
		let n = t.payload.maxScroll;
		if (Fp(n, e.viewport.scroll.max)) return e;
		let r = {
			...e.viewport,
			scroll: {
				...e.viewport.scroll,
				max: n
			}
		};
		return {
			...e,
			viewport: r
		};
	}
	if (t.type === "MOVE_UP" || t.type === "MOVE_DOWN" || t.type === "MOVE_LEFT" || t.type === "MOVE_RIGHT") {
		if (e.phase === "COLLECTING" || e.phase === "DROP_PENDING") return e;
		e.phase !== "DRAGGING" && J();
		let n = ph({
			state: e,
			type: t.type
		});
		return n ? Ah({
			state: e,
			impact: n.impact,
			clientSelection: n.clientSelection,
			scrollJumpRequest: n.scrollJumpRequest
		}) : e;
	}
	if (t.type === "DROP_PENDING") {
		let n = t.payload.reason;
		return e.phase !== "COLLECTING" && J(), {
			...e,
			phase: "DROP_PENDING",
			isWaiting: !0,
			reason: n
		};
	}
	if (t.type === "DROP_ANIMATE") {
		let { completed: n, dropDuration: r, newHomeClientOffset: i } = t.payload;
		return e.phase !== "DRAGGING" && e.phase !== "DROP_PENDING" && J(), {
			phase: "DROP_ANIMATING",
			completed: n,
			dropDuration: r,
			newHomeClientOffset: i,
			dimensions: e.dimensions
		};
	}
	if (t.type === "DROP_COMPLETE") {
		let { completed: e } = t.payload;
		return {
			phase: "IDLE",
			completed: e,
			shouldFlush: !1
		};
	}
	return e;
};
function Z(e, t) {
	return e instanceof Object && "type" in e && e.type === t;
}
var qh = (e) => ({
	type: "BEFORE_INITIAL_CAPTURE",
	payload: e
}), Jh = (e) => ({
	type: "LIFT",
	payload: e
}), Yh = (e) => ({
	type: "INITIAL_PUBLISH",
	payload: e
}), Xh = (e) => ({
	type: "PUBLISH_WHILE_DRAGGING",
	payload: e
}), Zh = () => ({
	type: "COLLECTION_STARTING",
	payload: null
}), Qh = (e) => ({
	type: "UPDATE_DROPPABLE_SCROLL",
	payload: e
}), $h = (e) => ({
	type: "UPDATE_DROPPABLE_IS_ENABLED",
	payload: e
}), eg = (e) => ({
	type: "UPDATE_DROPPABLE_IS_COMBINE_ENABLED",
	payload: e
}), tg = (e) => ({
	type: "MOVE",
	payload: e
}), ng = (e) => ({
	type: "MOVE_BY_WINDOW_SCROLL",
	payload: e
}), rg = (e) => ({
	type: "UPDATE_VIEWPORT_MAX_SCROLL",
	payload: e
}), ig = () => ({
	type: "MOVE_UP",
	payload: null
}), ag = () => ({
	type: "MOVE_DOWN",
	payload: null
}), og = () => ({
	type: "MOVE_RIGHT",
	payload: null
}), sg = () => ({
	type: "MOVE_LEFT",
	payload: null
}), cg = () => ({
	type: "FLUSH",
	payload: null
}), lg = (e) => ({
	type: "DROP_ANIMATE",
	payload: e
}), ug = (e) => ({
	type: "DROP_COMPLETE",
	payload: e
}), dg = (e) => ({
	type: "DROP",
	payload: e
}), fg = (e) => ({
	type: "DROP_PENDING",
	payload: e
}), pg = () => ({
	type: "DROP_ANIMATION_FINISHED",
	payload: null
}), mg = (e) => ({ getState: t, dispatch: n }) => (r) => (i) => {
	if (!Z(i, "LIFT")) {
		r(i);
		return;
	}
	let { id: a, clientSelection: o, movementMode: s } = i.payload, c = t();
	c.phase === "DROP_ANIMATING" && n(ug({ completed: c.completed })), t().phase !== "IDLE" && J(), n(cg()), n(qh({
		draggableId: a,
		movementMode: s
	}));
	let l = {
		draggableId: a,
		scrollOptions: { shouldPublishImmediately: s === "SNAP" }
	}, { critical: u, dimensions: d, viewport: f } = e.startPublishing(l);
	n(Yh({
		critical: u,
		dimensions: d,
		clientSelection: o,
		movementMode: s,
		viewport: f
	}));
}, hg = (e) => () => (t) => (n) => {
	Z(n, "INITIAL_PUBLISH") && e.dragging(), Z(n, "DROP_ANIMATE") && e.dropping(n.payload.completed.result.reason), (Z(n, "FLUSH") || Z(n, "DROP_COMPLETE")) && e.resting(), t(n);
}, gg = {
	outOfTheWay: "cubic-bezier(0.2, 0, 0, 1)",
	drop: "cubic-bezier(.2,1,.1,1)"
}, _g = {
	opacity: {
		drop: 0,
		combining: .7
	},
	scale: { drop: .75 }
}, vg = {
	outOfTheWay: .2,
	minDropTime: .33,
	maxDropTime: .55
}, yg = `${vg.outOfTheWay}s ${gg.outOfTheWay}`, bg = {
	fluid: `opacity ${yg}`,
	snap: `transform ${yg}, opacity ${yg}`,
	drop: (e) => {
		let t = `${e}s ${gg.drop}`;
		return `transform ${t}, opacity ${t}`;
	},
	outOfTheWay: `transform ${yg}`,
	placeholder: `height ${yg}, width ${yg}, margin ${yg}`
}, xg = (e) => Fp(e, Mp) ? void 0 : `translate(${e.x}px, ${e.y}px)`, Sg = {
	moveTo: xg,
	drop: (e, t) => {
		let n = xg(e);
		if (n) return t ? `${n} scale(${_g.scale.drop})` : n;
	}
}, { minDropTime: Cg, maxDropTime: wg } = vg, Tg = wg - Cg, Eg = 1500, Dg = .6, Og = ({ current: e, destination: t, reason: n }) => {
	let r = Rp(e, t);
	if (r <= 0) return Cg;
	if (r >= Eg) return wg;
	let i = Cg + r / Eg * Tg, a = n === "CANCEL" ? i * Dg : i;
	return Number(a.toFixed(2));
}, kg = ({ impact: e, draggable: t, dimensions: n, viewport: r, afterCritical: i }) => {
	let { draggables: a, droppables: o } = n, s = dh(e), c = s ? o[s] : null, l = o[t.descriptor.droppableId];
	return Pp(Nh({
		impact: e,
		draggable: t,
		draggables: a,
		afterCritical: i,
		droppable: c || l,
		viewport: r
	}), t.client.borderBox.center);
}, Ag = ({ draggables: e, reason: t, lastImpact: n, home: r, viewport: i, onLiftImpact: a }) => !n.at || t !== "DROP" ? {
	impact: Mh({
		draggables: e,
		impact: a,
		destination: r,
		viewport: i,
		forceShouldAnimate: !0
	}),
	didDropInsideDroppable: !1
} : n.at.type === "REORDER" ? {
	impact: n,
	didDropInsideDroppable: !0
} : {
	impact: {
		...n,
		displaced: cm
	},
	didDropInsideDroppable: !0
}, jg = ({ getState: e, dispatch: t }) => (n) => (r) => {
	if (!Z(r, "DROP")) {
		n(r);
		return;
	}
	let i = e(), a = r.payload.reason;
	if (i.phase === "COLLECTING") {
		t(fg({ reason: a }));
		return;
	}
	if (i.phase === "IDLE") return;
	i.phase === "DROP_PENDING" && i.isWaiting && J(), i.phase !== "DRAGGING" && i.phase !== "DROP_PENDING" && J();
	let o = i.critical, s = i.dimensions, c = s.draggables[i.critical.draggable.id], { impact: l, didDropInsideDroppable: u } = Ag({
		reason: a,
		lastImpact: i.impact,
		afterCritical: i.afterCritical,
		onLiftImpact: i.onLiftImpact,
		home: i.dimensions.droppables[i.critical.droppable.id],
		viewport: i.viewport,
		draggables: i.dimensions.draggables
	}), d = u ? nm(l) : null, f = u ? rm(l) : null, p = {
		index: o.draggable.index,
		droppableId: o.droppable.id
	}, m = {
		draggableId: c.descriptor.id,
		type: c.descriptor.type,
		source: p,
		reason: a,
		mode: i.movementMode,
		destination: d,
		combine: f
	}, h = kg({
		impact: l,
		draggable: c,
		dimensions: s,
		viewport: i.viewport,
		afterCritical: i.afterCritical
	}), g = {
		critical: i.critical,
		afterCritical: i.afterCritical,
		result: m,
		impact: l
	};
	if (!(!Fp(i.current.client.offset, h) || m.combine)) {
		t(ug({ completed: g }));
		return;
	}
	t(lg({
		newHomeClientOffset: h,
		dropDuration: Og({
			current: i.current.client.offset,
			destination: h,
			reason: a
		}),
		completed: g
	}));
}, Mg = () => ({
	x: window.pageXOffset,
	y: window.pageYOffset
});
function Ng(e) {
	return {
		eventName: "scroll",
		options: {
			passive: !0,
			capture: !1
		},
		fn: (t) => {
			(t.target === window || t.target === window.document) && e();
		}
	};
}
function Pg({ onWindowScroll: e }) {
	function t() {
		e(Mg());
	}
	let n = mp(t), r = Ng(n), i = gp;
	function a() {
		return i !== gp;
	}
	function o() {
		a() && J(), i = vp(window, [r]);
	}
	function s() {
		!a() && J(), n.cancel(), i(), i = gp;
	}
	return {
		start: o,
		stop: s,
		isActive: a
	};
}
var Fg = (e) => Z(e, "DROP_COMPLETE") || Z(e, "DROP_ANIMATE") || Z(e, "FLUSH"), Ig = (e) => {
	let t = Pg({ onWindowScroll: (t) => {
		e.dispatch(ng({ newScroll: t }));
	} });
	return (e) => (n) => {
		!t.isActive() && Z(n, "INITIAL_PUBLISH") && t.start(), t.isActive() && Fg(n) && t.stop(), e(n);
	};
}, Lg = (e) => {
	let t = !1, n = !1, r = setTimeout(() => {
		n = !0;
	}), i = (i) => {
		t || n || (t = !0, e(i), clearTimeout(r));
	};
	return i.wasCalled = () => t, i;
}, Rg = () => {
	let e = [], t = (t) => {
		let n = e.findIndex((e) => e.timerId === t);
		n === -1 && J();
		let [r] = e.splice(n, 1);
		r.callback();
	};
	return {
		add: (n) => {
			let r = setTimeout(() => t(r)), i = {
				timerId: r,
				callback: n
			};
			e.push(i);
		},
		flush: () => {
			if (!e.length) return;
			let t = [...e];
			e.length = 0, t.forEach((e) => {
				clearTimeout(e.timerId), e.callback();
			});
		}
	};
}, zg = (e, t) => e == null && t == null ? !0 : e == null || t == null ? !1 : e.droppableId === t.droppableId && e.index === t.index, Bg = (e, t) => e == null && t == null ? !0 : e == null || t == null ? !1 : e.draggableId === t.draggableId && e.droppableId === t.droppableId, Vg = (e, t) => {
	if (e === t) return !0;
	let n = e.draggable.id === t.draggable.id && e.draggable.droppableId === t.draggable.droppableId && e.draggable.type === t.draggable.type && e.draggable.index === t.draggable.index, r = e.droppable.id === t.droppable.id && e.droppable.type === t.droppable.type;
	return n && r;
}, Hg = (e, t) => {
	t();
}, Ug = (e, t) => ({
	draggableId: e.draggable.id,
	type: e.droppable.type,
	source: {
		droppableId: e.droppable.id,
		index: e.draggable.index
	},
	mode: t
});
function Wg(e, t, n, r) {
	if (!e) {
		n(r(t));
		return;
	}
	let i = Lg(n);
	e(t, { announce: i }), i.wasCalled() || n(r(t));
}
var Gg = (e, t) => {
	let n = Rg(), r = null, i = (t, n) => {
		r && J(), Hg("onBeforeCapture", () => {
			let r = e().onBeforeCapture;
			r && r({
				draggableId: t,
				mode: n
			});
		});
	}, a = (t, n) => {
		r && J(), Hg("onBeforeDragStart", () => {
			let r = e().onBeforeDragStart;
			r && r(Ug(t, n));
		});
	}, o = (i, a) => {
		r && J();
		let o = Ug(i, a);
		r = {
			mode: a,
			lastCritical: i,
			lastLocation: o.source,
			lastCombine: null
		}, n.add(() => {
			Hg("onDragStart", () => Wg(e().onDragStart, o, t, kp.onDragStart));
		});
	}, s = (i, a) => {
		let o = nm(a), s = rm(a);
		!r && J();
		let c = !Vg(i, r.lastCritical);
		c && (r.lastCritical = i);
		let l = !zg(r.lastLocation, o);
		l && (r.lastLocation = o);
		let u = !Bg(r.lastCombine, s);
		if (u && (r.lastCombine = s), !c && !l && !u) return;
		let d = {
			...Ug(i, r.mode),
			combine: s,
			destination: o
		};
		n.add(() => {
			Hg("onDragUpdate", () => Wg(e().onDragUpdate, d, t, kp.onDragUpdate));
		});
	}, c = () => {
		!r && J(), n.flush();
	}, l = (n) => {
		!r && J(), r = null, Hg("onDragEnd", () => Wg(e().onDragEnd, n, t, kp.onDragEnd));
	};
	return {
		beforeCapture: i,
		beforeStart: a,
		start: o,
		update: s,
		flush: c,
		drop: l,
		abort: () => {
			if (!r) return;
			let e = {
				...Ug(r.lastCritical, r.mode),
				combine: null,
				destination: null,
				reason: "CANCEL"
			};
			l(e);
		}
	};
}, Kg = (e, t) => {
	let n = Gg(e, t);
	return (e) => (t) => (r) => {
		if (Z(r, "BEFORE_INITIAL_CAPTURE")) {
			n.beforeCapture(r.payload.draggableId, r.payload.movementMode);
			return;
		}
		if (Z(r, "INITIAL_PUBLISH")) {
			let e = r.payload.critical;
			n.beforeStart(e, r.payload.movementMode), t(r), n.start(e, r.payload.movementMode);
			return;
		}
		if (Z(r, "DROP_COMPLETE")) {
			let e = r.payload.completed.result;
			n.flush(), t(r), n.drop(e);
			return;
		}
		if (t(r), Z(r, "FLUSH")) {
			n.abort();
			return;
		}
		let i = e.getState();
		i.phase === "DRAGGING" && n.update(i.critical, i.impact);
	};
}, qg = (e) => (t) => (n) => {
	if (!Z(n, "DROP_ANIMATION_FINISHED")) {
		t(n);
		return;
	}
	let r = e.getState();
	r.phase !== "DROP_ANIMATING" && J(), e.dispatch(ug({ completed: r.completed }));
}, Jg = (e) => {
	let t = null, n = null;
	function r() {
		n &&= (cancelAnimationFrame(n), null), t &&= (t(), null);
	}
	return (i) => (a) => {
		if ((Z(a, "FLUSH") || Z(a, "DROP_COMPLETE") || Z(a, "DROP_ANIMATION_FINISHED")) && r(), i(a), !Z(a, "DROP_ANIMATE")) return;
		let o = {
			eventName: "scroll",
			options: {
				capture: !0,
				passive: !1,
				once: !0
			},
			fn: function() {
				e.getState().phase === "DROP_ANIMATING" && e.dispatch(pg());
			}
		};
		n = requestAnimationFrame(() => {
			n = null, t = vp(window, [o]);
		});
	};
}, Yg = (e) => () => (t) => (n) => {
	(Z(n, "DROP_COMPLETE") || Z(n, "FLUSH") || Z(n, "DROP_ANIMATE")) && e.stopPublishing(), t(n);
}, Xg = (e) => {
	let t = !1;
	return () => (n) => (r) => {
		if (Z(r, "INITIAL_PUBLISH")) {
			t = !0, e.tryRecordFocus(r.payload.critical.draggable.id), n(r), e.tryRestoreFocusRecorded();
			return;
		}
		if (n(r), t) {
			if (Z(r, "FLUSH")) {
				t = !1, e.tryRestoreFocusRecorded();
				return;
			}
			if (Z(r, "DROP_COMPLETE")) {
				t = !1;
				let n = r.payload.completed.result;
				n.combine && e.tryShiftRecord(n.draggableId, n.combine.draggableId), e.tryRestoreFocusRecorded();
			}
		}
	};
}, Zg = (e) => Z(e, "DROP_COMPLETE") || Z(e, "DROP_ANIMATE") || Z(e, "FLUSH"), Qg = (e) => (t) => (n) => (r) => {
	if (Zg(r)) {
		e.stop(), n(r);
		return;
	}
	if (Z(r, "INITIAL_PUBLISH")) {
		n(r);
		let i = t.getState();
		i.phase !== "DRAGGING" && J(), e.start(i);
		return;
	}
	n(r), e.scroll(t.getState());
}, $g = (e) => (t) => (n) => {
	if (t(n), !Z(n, "PUBLISH_WHILE_DRAGGING")) return;
	let r = e.getState();
	r.phase === "DROP_PENDING" && (r.isWaiting || e.dispatch(dg({ reason: r.reason })));
}, e_ = n, t_ = ({ dimensionMarshal: t, focusMarshal: n, styleMarshal: r, getResponders: a, announce: o, autoScroller: s }) => i(Kh, e_(e(hg(r), Yg(t), mg(t), jg, qg, Jg, $g, Qg(s), Ig, Xg(n), Kg(a, o)))), n_ = () => ({
	additions: {},
	removals: {},
	modified: {}
});
function r_({ registry: e, callbacks: t }) {
	let n = n_(), r = null, i = () => {
		r ||= (t.collectionStarting(), requestAnimationFrame(() => {
			r = null;
			let { additions: i, removals: a, modified: o } = n, s = Object.keys(i).map((t) => e.draggable.getById(t).getDimension(Mp)).sort((e, t) => e.descriptor.index - t.descriptor.index), c = Object.keys(o).map((t) => ({
				droppableId: t,
				scroll: e.droppable.getById(t).callbacks.getScrollWhileDragging()
			})), l = {
				additions: s,
				removals: Object.keys(a),
				modified: c
			};
			n = n_(), t.publish(l);
		}));
	};
	return {
		add: (e) => {
			let t = e.descriptor.id;
			n.additions[t] = e, n.modified[e.descriptor.droppableId] = !0, n.removals[t] && delete n.removals[t], i();
		},
		remove: (e) => {
			let t = e.descriptor;
			n.removals[t.id] = !0, n.modified[t.droppableId] = !0, n.additions[t.id] && delete n.additions[t.id], i();
		},
		stop: () => {
			r && (cancelAnimationFrame(r), r = null, n = n_());
		}
	};
}
var i_ = ({ scrollHeight: e, scrollWidth: t, height: n, width: r }) => {
	let i = Pp({
		x: t,
		y: e
	}, {
		x: r,
		y: n
	});
	return {
		x: Math.max(0, i.x),
		y: Math.max(0, i.y)
	};
}, a_ = () => {
	let e = document.documentElement;
	return !e && J(), e;
}, o_ = () => {
	let e = a_();
	return i_({
		scrollHeight: e.scrollHeight,
		scrollWidth: e.scrollWidth,
		width: e.clientWidth,
		height: e.clientHeight
	});
}, s_ = () => {
	let e = Mg(), t = o_(), n = e.y, r = e.x, i = a_(), a = i.clientWidth, o = i.clientHeight;
	return {
		frame: np({
			top: n,
			left: r,
			right: r + a,
			bottom: n + o
		}),
		scroll: {
			initial: e,
			current: e,
			max: t,
			diff: {
				value: Mp,
				displacement: Mp
			}
		}
	};
}, c_ = ({ critical: e, scrollOptions: t, registry: n }) => {
	let r = s_(), i = r.scroll.current, a = e.droppable, o = n.droppable.getAllByType(a.type).map((e) => e.callbacks.getDimensionAndWatchScroll(i, t));
	return {
		dimensions: {
			draggables: Qp(n.draggable.getAllByType(e.draggable.type).map((e) => e.getDimension(i))),
			droppables: Zp(o)
		},
		critical: e,
		viewport: r
	};
};
function l_(e, t, n) {
	return n.descriptor.id !== t.id && n.descriptor.type === t.type && e.droppable.getById(n.descriptor.droppableId).descriptor.mode === "virtual";
}
var u_ = (e, t) => {
	let n = null, r = r_({
		callbacks: {
			publish: t.publishWhileDragging,
			collectionStarting: t.collectionStarting
		},
		registry: e
	}), i = (r, i) => {
		!e.droppable.exists(r) && J(), n && t.updateDroppableIsEnabled({
			id: r,
			isEnabled: i
		});
	}, a = (r, i) => {
		n && (!e.droppable.exists(r) && J(), t.updateDroppableIsCombineEnabled({
			id: r,
			isCombineEnabled: i
		}));
	}, o = (r, i) => {
		n && (!e.droppable.exists(r) && J(), t.updateDroppableScroll({
			id: r,
			newScroll: i
		}));
	}, s = (t, r) => {
		n && e.droppable.getById(t).callbacks.scroll(r);
	}, c = () => {
		if (!n) return;
		r.stop();
		let t = n.critical.droppable;
		e.droppable.getAllByType(t.type).forEach((e) => e.callbacks.dragStopped()), n.unsubscribe(), n = null;
	}, l = (t) => {
		!n && J();
		let i = n.critical.draggable;
		t.type === "ADDITION" && l_(e, i, t.value) && r.add(t.value), t.type === "REMOVAL" && l_(e, i, t.value) && r.remove(t.value);
	};
	return {
		updateDroppableIsEnabled: i,
		updateDroppableIsCombineEnabled: a,
		scrollDroppable: s,
		updateDroppableScroll: o,
		startPublishing: (t) => {
			n && J();
			let r = e.draggable.getById(t.draggableId), i = e.droppable.getById(r.descriptor.droppableId), a = {
				draggable: r.descriptor,
				droppable: i.descriptor
			};
			return n = {
				critical: a,
				unsubscribe: e.subscribe(l)
			}, c_({
				critical: a,
				registry: e,
				scrollOptions: t.scrollOptions
			});
		},
		stopPublishing: c
	};
}, d_ = (e, t) => e.phase === "IDLE" ? !0 : e.phase !== "DROP_ANIMATING" || e.completed.result.draggableId === t ? !1 : e.completed.result.reason === "DROP", f_ = (e) => {
	window.scrollBy(e.x, e.y);
}, p_ = Xp((e) => $p(e).filter((e) => !(!e.isEnabled || !e.frame))), m_ = (e, t) => p_(t).find((t) => (!t.frame && J(), hh(t.frame.pageMarginBox)(e))) || null, h_ = ({ center: e, destination: t, droppables: n }) => {
	if (t) {
		let e = n[t];
		return e.frame ? e : null;
	}
	return m_(e, n);
}, g_ = {
	startFromPercentage: .25,
	maxScrollAtPercentage: .05,
	maxPixelScroll: 28,
	ease: (e) => e ** 2,
	durationDampening: {
		stopDampeningAt: 1200,
		accelerateAt: 360
	},
	disabled: !1
}, __ = (e, t, n = () => g_) => {
	let r = n();
	return {
		startScrollingFrom: e[t.size] * r.startFromPercentage,
		maxScrollValueAt: e[t.size] * r.maxScrollAtPercentage
	};
}, v_ = ({ startOfRange: e, endOfRange: t, current: n }) => {
	let r = t - e;
	return r === 0 ? 0 : (n - e) / r;
}, y_ = 1, b_ = (e, t, n = () => g_) => {
	let r = n();
	if (e > t.startScrollingFrom) return 0;
	if (e <= t.maxScrollValueAt) return r.maxPixelScroll;
	if (e === t.startScrollingFrom) return y_;
	let i = 1 - v_({
		startOfRange: t.maxScrollValueAt,
		endOfRange: t.startScrollingFrom,
		current: e
	}), a = r.maxPixelScroll * r.ease(i);
	return Math.ceil(a);
}, x_ = (e, t, n) => {
	let r = n(), i = r.durationDampening.accelerateAt, a = r.durationDampening.stopDampeningAt, o = t, s = a, c = Date.now() - o;
	if (c >= a) return e;
	if (c < i) return y_;
	let l = v_({
		startOfRange: i,
		endOfRange: s,
		current: c
	}), u = e * r.ease(l);
	return Math.ceil(u);
}, S_ = ({ distanceToEdge: e, thresholds: t, dragStartTime: n, shouldUseTimeDampening: r, getAutoScrollerOptions: i }) => {
	let a = b_(e, t, i);
	return a === 0 ? 0 : r ? Math.max(x_(a, n, i), y_) : a;
}, C_ = ({ container: e, distanceToEdges: t, dragStartTime: n, axis: r, shouldUseTimeDampening: i, getAutoScrollerOptions: a }) => {
	let o = __(e, r, a);
	return t[r.end] < t[r.start] ? S_({
		distanceToEdge: t[r.end],
		thresholds: o,
		dragStartTime: n,
		shouldUseTimeDampening: i,
		getAutoScrollerOptions: a
	}) : -1 * S_({
		distanceToEdge: t[r.start],
		thresholds: o,
		dragStartTime: n,
		shouldUseTimeDampening: i,
		getAutoScrollerOptions: a
	});
}, w_ = ({ container: e, subject: t, proposedScroll: n }) => {
	let r = t.height > e.height, i = t.width > e.width;
	return !i && !r ? n : i && r ? null : {
		x: i ? 0 : n.x,
		y: r ? 0 : n.y
	};
}, T_ = Bp((e) => e === 0 ? 0 : e), E_ = ({ dragStartTime: e, container: t, subject: n, center: r, shouldUseTimeDampening: i, getAutoScrollerOptions: a }) => {
	let o = {
		top: r.y - t.top,
		right: t.right - r.x,
		bottom: t.bottom - r.y,
		left: r.x - t.left
	}, s = C_({
		container: t,
		distanceToEdges: o,
		dragStartTime: e,
		axis: pm,
		shouldUseTimeDampening: i,
		getAutoScrollerOptions: a
	}), c = T_({
		x: C_({
			container: t,
			distanceToEdges: o,
			dragStartTime: e,
			axis: mm,
			shouldUseTimeDampening: i,
			getAutoScrollerOptions: a
		}),
		y: s
	});
	if (Fp(c, Mp)) return null;
	let l = w_({
		container: t,
		subject: n,
		proposedScroll: c
	});
	return l ? Fp(l, Mp) ? null : l : null;
}, D_ = Bp((e) => e === 0 ? 0 : e > 0 ? 1 : -1), O_ = (() => {
	let e = (e, t) => e < 0 ? e : e > t ? e - t : 0;
	return ({ current: t, max: n, change: r }) => {
		let i = Np(t, r), a = {
			x: e(i.x, n.x),
			y: e(i.y, n.y)
		};
		return Fp(a, Mp) ? null : a;
	};
})(), k_ = ({ max: e, current: t, change: n }) => {
	let r = {
		x: Math.max(t.x, e.x),
		y: Math.max(t.y, e.y)
	}, i = D_(n), a = O_({
		max: r,
		current: t,
		change: i
	});
	return !a || i.x !== 0 && a.x === 0 || i.y !== 0 && a.y === 0;
}, A_ = (e, t) => k_({
	current: e.scroll.current,
	max: e.scroll.max,
	change: t
}), j_ = (e, t) => {
	if (!A_(e, t)) return null;
	let n = e.scroll.max, r = e.scroll.current;
	return O_({
		current: r,
		max: n,
		change: t
	});
}, M_ = (e, t) => {
	let n = e.frame;
	return n ? k_({
		current: n.scroll.current,
		max: n.scroll.max,
		change: t
	}) : !1;
}, N_ = (e, t) => {
	let n = e.frame;
	return !n || !M_(e, t) ? null : O_({
		current: n.scroll.current,
		max: n.scroll.max,
		change: t
	});
}, P_ = ({ viewport: e, subject: t, center: n, dragStartTime: r, shouldUseTimeDampening: i, getAutoScrollerOptions: a }) => {
	let o = E_({
		dragStartTime: r,
		container: e.frame,
		subject: t,
		center: n,
		shouldUseTimeDampening: i,
		getAutoScrollerOptions: a
	});
	return o && A_(e, o) ? o : null;
}, F_ = ({ droppable: e, subject: t, center: n, dragStartTime: r, shouldUseTimeDampening: i, getAutoScrollerOptions: a }) => {
	let o = e.frame;
	if (!o) return null;
	let s = E_({
		dragStartTime: r,
		container: o.pageMarginBox,
		subject: t,
		center: n,
		shouldUseTimeDampening: i,
		getAutoScrollerOptions: a
	});
	return s && M_(e, s) ? s : null;
}, I_ = ({ state: e, dragStartTime: t, shouldUseTimeDampening: n, scrollWindow: r, scrollDroppable: i, getAutoScrollerOptions: a }) => {
	let o = e.current.page.borderBoxCenter, s = e.dimensions.draggables[e.critical.draggable.id].page.marginBox;
	if (e.isWindowScrollAllowed) {
		let i = e.viewport, c = P_({
			dragStartTime: t,
			viewport: i,
			subject: s,
			center: o,
			shouldUseTimeDampening: n,
			getAutoScrollerOptions: a
		});
		if (c) {
			r(c);
			return;
		}
	}
	let c = h_({
		center: o,
		destination: dh(e.impact),
		droppables: e.dimensions.droppables
	});
	if (!c) return;
	let l = F_({
		dragStartTime: t,
		droppable: c,
		subject: s,
		center: o,
		shouldUseTimeDampening: n,
		getAutoScrollerOptions: a
	});
	l && i(c.descriptor.id, l);
}, L_ = ({ scrollWindow: e, scrollDroppable: t, getAutoScrollerOptions: n = () => g_ }) => {
	let r = mp(e), i = mp(t), a = null, o = (e) => {
		!a && J();
		let { shouldUseTimeDampening: t, dragStartTime: o } = a;
		I_({
			state: e,
			scrollWindow: r,
			scrollDroppable: i,
			dragStartTime: o,
			shouldUseTimeDampening: t,
			getAutoScrollerOptions: n
		});
	};
	return {
		start: (e) => {
			a && J();
			let t = Date.now(), r = !1, i = () => {
				r = !0;
			};
			I_({
				state: e,
				dragStartTime: 0,
				shouldUseTimeDampening: !1,
				scrollWindow: i,
				scrollDroppable: i,
				getAutoScrollerOptions: n
			}), a = {
				dragStartTime: t,
				shouldUseTimeDampening: r
			}, r && o(e);
		},
		stop: () => {
			a &&= (r.cancel(), i.cancel(), null);
		},
		scroll: o
	};
}, R_ = ({ move: e, scrollDroppable: t, scrollWindow: n }) => {
	let r = (t, n) => {
		e({ client: Np(t.current.client.selection, n) });
	}, i = (e, n) => {
		if (!M_(e, n)) return n;
		let r = N_(e, n);
		if (!r) return t(e.descriptor.id, n), null;
		let i = Pp(n, r);
		return t(e.descriptor.id, i), Pp(n, i);
	}, a = (e, t, r) => {
		if (!e || !A_(t, r)) return r;
		let i = j_(t, r);
		if (!i) return n(r), null;
		let a = Pp(r, i);
		return n(a), Pp(r, a);
	};
	return (e) => {
		let t = e.scrollJumpRequest;
		if (!t) return;
		let n = dh(e.impact);
		!n && J();
		let o = i(e.dimensions.droppables[n], t);
		if (!o) return;
		let s = e.viewport, c = a(e.isWindowScrollAllowed, s, o);
		c && r(e, c);
	};
}, z_ = ({ scrollDroppable: e, scrollWindow: t, move: n, getAutoScrollerOptions: r }) => {
	let i = L_({
		scrollWindow: t,
		scrollDroppable: e,
		getAutoScrollerOptions: r
	}), a = R_({
		move: n,
		scrollWindow: t,
		scrollDroppable: e
	});
	return {
		scroll: (e) => {
			if (!(r().disabled || e.phase !== "DRAGGING")) {
				if (e.movementMode === "FLUID") {
					i.scroll(e);
					return;
				}
				e.scrollJumpRequest && a(e);
			}
		},
		start: i.start,
		stop: i.stop
	};
}, B_ = "data-rfd", V_ = (() => {
	let e = `${B_}-drag-handle`;
	return {
		base: e,
		draggableId: `${e}-draggable-id`,
		contextId: `${e}-context-id`
	};
})(), H_ = (() => {
	let e = `${B_}-draggable`;
	return {
		base: e,
		contextId: `${e}-context-id`,
		id: `${e}-id`
	};
})(), U_ = (() => {
	let e = `${B_}-droppable`;
	return {
		base: e,
		contextId: `${e}-context-id`,
		id: `${e}-id`
	};
})(), W_ = { contextId: `${B_}-scroll-container-context-id` }, G_ = (e) => (t) => `[${t}="${e}"]`, K_ = (e, t) => e.map((e) => {
	let n = e.styles[t];
	return n ? `${e.selector} { ${n} }` : "";
}).join(" "), q_ = "pointer-events: none;", J_ = (e) => {
	let t = G_(e), n = (() => {
		let e = "\n      cursor: -webkit-grab;\n      cursor: grab;\n    ";
		return {
			selector: t(V_.contextId),
			styles: {
				always: "\n          -webkit-touch-callout: none;\n          -webkit-tap-highlight-color: rgba(0,0,0,0);\n          touch-action: manipulation;\n        ",
				resting: e,
				dragging: q_,
				dropAnimating: e
			}
		};
	})(), r = [
		(() => {
			let e = `
      transition: ${bg.outOfTheWay};
    `;
			return {
				selector: t(H_.contextId),
				styles: {
					dragging: e,
					dropAnimating: e,
					userCancel: e
				}
			};
		})(),
		n,
		{
			selector: t(U_.contextId),
			styles: { always: "overflow-anchor: none;" }
		},
		{
			selector: "body",
			styles: { dragging: "\n        cursor: grabbing;\n        cursor: -webkit-grabbing;\n        user-select: none;\n        -webkit-user-select: none;\n        -moz-user-select: none;\n        -ms-user-select: none;\n        overflow-anchor: none;\n      " }
		}
	];
	return {
		always: K_(r, "always"),
		resting: K_(r, "resting"),
		dragging: K_(r, "dragging"),
		dropAnimating: K_(r, "dropAnimating"),
		userCancel: K_(r, "userCancel")
	};
}, Y_ = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? Fn : F, X_ = () => {
	let e = document.querySelector("head");
	return !e && J(), e;
}, Z_ = (e) => {
	let t = document.createElement("style");
	return e && t.setAttribute("nonce", e), t.type = "text/css", t;
};
function Q_(e, t) {
	let n = Y(() => J_(e), [e]), r = I(null), i = I(null), a = X(Xp((e) => {
		let t = i.current;
		!t && J(), t.textContent = e;
	}), []), o = X((e) => {
		let t = r.current;
		!t && J(), t.textContent = e;
	}, []);
	Y_(() => {
		!(!r.current && !i.current) && J();
		let s = Z_(t), c = Z_(t);
		return r.current = s, i.current = c, s.setAttribute(`${B_}-always`, e), c.setAttribute(`${B_}-dynamic`, e), X_().appendChild(s), X_().appendChild(c), o(n.always), a(n.resting), () => {
			let e = (e) => {
				let t = e.current;
				!t && J(), X_().removeChild(t), e.current = null;
			};
			e(r), e(i);
		};
	}, [
		t,
		o,
		a,
		n.always,
		n.resting,
		e
	]);
	let s = X(() => a(n.dragging), [a, n.dragging]), c = X((e) => {
		if (e === "DROP") {
			a(n.dropAnimating);
			return;
		}
		a(n.userCancel);
	}, [
		a,
		n.dropAnimating,
		n.userCancel
	]), l = X(() => {
		i.current && a(n.resting);
	}, [a, n.resting]);
	return Y(() => ({
		dragging: s,
		dropping: c,
		resting: l
	}), [
		s,
		c,
		l
	]);
}
function $_(e, t) {
	return Array.from(e.querySelectorAll(t));
}
var ev = (e) => e && e.ownerDocument && e.ownerDocument.defaultView ? e.ownerDocument.defaultView : window;
function tv(e) {
	return e instanceof ev(e).HTMLElement;
}
function nv(e, t) {
	let n = `[${V_.contextId}="${e}"]`, r = $_(document, n);
	if (!r.length) return null;
	let i = r.find((e) => e.getAttribute(V_.draggableId) === t);
	return !i || !tv(i) ? null : i;
}
function rv(e) {
	let t = I({}), n = I(null), r = I(null), i = I(!1), a = X(function(e, n) {
		let r = {
			id: e,
			focus: n
		};
		return t.current[e] = r, function() {
			let n = t.current;
			n[e] !== r && delete n[e];
		};
	}, []), o = X(function(t) {
		let n = nv(e, t);
		n && n !== document.activeElement && n.focus();
	}, [e]), s = X(function(e, t) {
		n.current === e && (n.current = t);
	}, []), c = X(function() {
		r.current || i.current && (r.current = requestAnimationFrame(() => {
			r.current = null;
			let e = n.current;
			e && o(e);
		}));
	}, [o]), l = X(function(e) {
		n.current = null;
		let t = document.activeElement;
		t && t.getAttribute(V_.draggableId) === e && (n.current = e);
	}, []);
	return Y_(() => (i.current = !0, function() {
		i.current = !1;
		let e = r.current;
		e && cancelAnimationFrame(e);
	}), []), Y(() => ({
		register: a,
		tryRecordFocus: l,
		tryRestoreFocusRecorded: c,
		tryShiftRecord: s
	}), [
		a,
		l,
		c,
		s
	]);
}
function iv() {
	let e = {
		draggables: {},
		droppables: {}
	}, t = [];
	function n(e) {
		return t.push(e), function() {
			let n = t.indexOf(e);
			n !== -1 && t.splice(n, 1);
		};
	}
	function r(e) {
		t.length && t.forEach((t) => t(e));
	}
	function i(t) {
		return e.draggables[t] || null;
	}
	function a(e) {
		let t = i(e);
		return !t && J(), t;
	}
	let o = {
		register: (t) => {
			e.draggables[t.descriptor.id] = t, r({
				type: "ADDITION",
				value: t
			});
		},
		update: (t, n) => {
			let r = e.draggables[n.descriptor.id];
			r && r.uniqueId === t.uniqueId && (delete e.draggables[n.descriptor.id], e.draggables[t.descriptor.id] = t);
		},
		unregister: (t) => {
			let n = t.descriptor.id, a = i(n);
			a && t.uniqueId === a.uniqueId && (delete e.draggables[n], e.droppables[t.descriptor.droppableId] && r({
				type: "REMOVAL",
				value: t
			}));
		},
		getById: a,
		findById: i,
		exists: (e) => !!i(e),
		getAllByType: (t) => Object.values(e.draggables).filter((e) => e.descriptor.type === t)
	};
	function s(t) {
		return e.droppables[t] || null;
	}
	function c(e) {
		let t = s(e);
		return !t && J(), t;
	}
	let l = {
		register: (t) => {
			e.droppables[t.descriptor.id] = t;
		},
		unregister: (t) => {
			let n = s(t.descriptor.id);
			n && t.uniqueId === n.uniqueId && delete e.droppables[t.descriptor.id];
		},
		getById: c,
		findById: s,
		exists: (e) => !!s(e),
		getAllByType: (t) => Object.values(e.droppables).filter((e) => e.descriptor.type === t)
	};
	function u() {
		e.draggables = {}, e.droppables = {}, t.length = 0;
	}
	return {
		draggable: o,
		droppable: l,
		subscribe: n,
		clean: u
	};
}
function av() {
	let e = Y(iv, []);
	return F(() => function() {
		e.clean();
	}, [e]), e;
}
var ov = P.createContext(null), sv = () => {
	let e = document.body;
	return !e && J(), e;
}, cv = {
	position: "absolute",
	width: "1px",
	height: "1px",
	margin: "-1px",
	border: "0",
	padding: "0",
	overflow: "hidden",
	clip: "rect(0 0 0 0)",
	"clip-path": "inset(100%)"
}, lv = (e) => `rfd-announcement-${e}`;
function uv(e) {
	let t = Y(() => lv(e), [e]), n = I(null);
	return F(function() {
		let e = document.createElement("div");
		return n.current = e, e.id = t, e.setAttribute("aria-live", "assertive"), e.setAttribute("aria-atomic", "true"), q(e.style, cv), sv().appendChild(e), function() {
			setTimeout(function() {
				let t = sv();
				t.contains(e) && t.removeChild(e), e === n.current && (n.current = null);
			});
		};
	}, [t]), X((e) => {
		let t = n.current;
		if (t) {
			t.textContent = e;
			return;
		}
	}, []);
}
var dv = { separator: "::" };
function fv(e, t = dv) {
	let n = P.useId();
	return Y(() => `${e}${t.separator}${n}`, [
		t.separator,
		e,
		n
	]);
}
function pv({ contextId: e, uniqueId: t }) {
	return `rfd-hidden-text-${e}-${t}`;
}
function mv({ contextId: e, text: t }) {
	let n = fv("hidden-text", { separator: "-" }), r = Y(() => pv({
		contextId: e,
		uniqueId: n
	}), [n, e]);
	return F(function() {
		let e = document.createElement("div");
		return e.id = r, e.textContent = t, e.style.display = "none", sv().appendChild(e), function() {
			let t = sv();
			t.contains(e) && t.removeChild(e);
		};
	}, [r, t]), r;
}
var hv = P.createContext(null);
function gv(e) {
	let t = I(e);
	return F(() => {
		t.current = e;
	}), t;
}
function _v() {
	let e = null;
	function t() {
		return !!e;
	}
	function n(t) {
		return t === e;
	}
	function r(t) {
		e && J();
		let n = { abandon: t };
		return e = n, n;
	}
	function i() {
		!e && J(), e = null;
	}
	function a() {
		e && (e.abandon(), i());
	}
	return {
		isClaimed: t,
		isActive: n,
		claim: r,
		release: i,
		tryAbandon: a
	};
}
function vv(e) {
	return e.phase === "IDLE" || e.phase === "DROP_ANIMATING" ? !1 : e.isDragging;
}
var yv = 9, bv = 13, xv = 27, Sv = 32, Cv = 33, wv = 34, Tv = 35, Ev = 36, Dv = 37, Ov = 38, kv = 39, Av = 40, jv = {
	[bv]: !0,
	[yv]: !0
}, Mv = (e) => {
	jv[e.keyCode] && e.preventDefault();
}, Nv = (() => {
	let e = "visibilitychange";
	return typeof document > "u" ? e : [
		e,
		`ms${e}`,
		`webkit${e}`,
		`moz${e}`,
		`o${e}`
	].find((e) => `on${e}` in document) || e;
})(), Pv = 0, Fv = 5;
function Iv(e, t) {
	return Math.abs(t.x - e.x) >= Fv || Math.abs(t.y - e.y) >= Fv;
}
var Lv = { type: "IDLE" };
function Rv({ cancel: e, completed: t, getPhase: n, setPhase: r }) {
	return [
		{
			eventName: "mousemove",
			fn: (e) => {
				let { button: t, clientX: i, clientY: a } = e;
				if (t !== Pv) return;
				let o = {
					x: i,
					y: a
				}, s = n();
				if (s.type === "DRAGGING") {
					e.preventDefault(), s.actions.move(o);
					return;
				}
				s.type !== "PENDING" && J();
				let c = s.point;
				Iv(c, o) && (e.preventDefault(), r({
					type: "DRAGGING",
					actions: s.actions.fluidLift(o)
				}));
			}
		},
		{
			eventName: "mouseup",
			fn: (r) => {
				let i = n();
				if (i.type !== "DRAGGING") {
					e();
					return;
				}
				r.preventDefault(), i.actions.drop({ shouldBlockNextClick: !0 }), t();
			}
		},
		{
			eventName: "mousedown",
			fn: (t) => {
				n().type === "DRAGGING" && t.preventDefault(), e();
			}
		},
		{
			eventName: "keydown",
			fn: (t) => {
				if (n().type === "PENDING") {
					e();
					return;
				}
				if (t.keyCode === xv) {
					t.preventDefault(), e();
					return;
				}
				Mv(t);
			}
		},
		{
			eventName: "resize",
			fn: e
		},
		{
			eventName: "scroll",
			options: {
				passive: !0,
				capture: !1
			},
			fn: () => {
				n().type === "PENDING" && e();
			}
		},
		{
			eventName: "webkitmouseforcedown",
			fn: (t) => {
				let r = n();
				if (r.type === "IDLE" && J(), r.actions.shouldRespectForcePress()) {
					e();
					return;
				}
				t.preventDefault();
			}
		},
		{
			eventName: Nv,
			fn: e
		}
	];
}
function zv(e) {
	let t = I(Lv), n = I(gp), r = Y(() => ({
		eventName: "mousedown",
		fn: function(t) {
			if (t.defaultPrevented || t.button !== Pv || t.ctrlKey || t.metaKey || t.shiftKey || t.altKey) return;
			let r = e.findClosestDraggableId(t);
			if (!r) return;
			let i = e.tryGetLock(r, o, { sourceEvent: t });
			if (!i) return;
			t.preventDefault();
			let a = {
				x: t.clientX,
				y: t.clientY
			};
			n.current(), l(i, a);
		}
	}), [e]), i = Y(() => ({
		eventName: "webkitmouseforcewillbegin",
		fn: (t) => {
			if (t.defaultPrevented) return;
			let n = e.findClosestDraggableId(t);
			if (!n) return;
			let r = e.findOptionsForDraggable(n);
			r && (r.shouldRespectForcePress || e.canGetLock(n) && t.preventDefault());
		}
	}), [e]), a = X(function() {
		n.current = vp(window, [i, r], {
			passive: !1,
			capture: !0
		});
	}, [i, r]), o = X(() => {
		t.current.type !== "IDLE" && (t.current = Lv, n.current(), a());
	}, [a]), s = X(() => {
		let e = t.current;
		o(), e.type === "DRAGGING" && e.actions.cancel({ shouldBlockNextClick: !0 }), e.type === "PENDING" && e.actions.abort();
	}, [o]), c = X(function() {
		let e = {
			capture: !0,
			passive: !1
		}, r = Rv({
			cancel: s,
			completed: o,
			getPhase: () => t.current,
			setPhase: (e) => {
				t.current = e;
			}
		});
		n.current = vp(window, r, e);
	}, [s, o]), l = X(function(e, n) {
		t.current.type !== "IDLE" && J(), t.current = {
			type: "PENDING",
			point: n,
			actions: e
		}, c();
	}, [c]);
	Y_(function() {
		return a(), function() {
			n.current();
		};
	}, [a]);
}
function Bv() {}
var Vv = {
	[wv]: !0,
	[Cv]: !0,
	[Ev]: !0,
	[Tv]: !0
};
function Hv(e, t) {
	function n() {
		t(), e.cancel();
	}
	function r() {
		t(), e.drop();
	}
	return [
		{
			eventName: "keydown",
			fn: (t) => {
				if (t.keyCode === xv) {
					t.preventDefault(), n();
					return;
				}
				if (t.keyCode === Sv) {
					t.preventDefault(), r();
					return;
				}
				if (t.keyCode === Av) {
					t.preventDefault(), e.moveDown();
					return;
				}
				if (t.keyCode === Ov) {
					t.preventDefault(), e.moveUp();
					return;
				}
				if (t.keyCode === kv) {
					t.preventDefault(), e.moveRight();
					return;
				}
				if (t.keyCode === Dv) {
					t.preventDefault(), e.moveLeft();
					return;
				}
				if (Vv[t.keyCode]) {
					t.preventDefault();
					return;
				}
				Mv(t);
			}
		},
		{
			eventName: "mousedown",
			fn: n
		},
		{
			eventName: "mouseup",
			fn: n
		},
		{
			eventName: "click",
			fn: n
		},
		{
			eventName: "touchstart",
			fn: n
		},
		{
			eventName: "resize",
			fn: n
		},
		{
			eventName: "wheel",
			fn: n,
			options: { passive: !0 }
		},
		{
			eventName: Nv,
			fn: n
		}
	];
}
function Uv(e) {
	let t = I(Bv), n = Y(() => ({
		eventName: "keydown",
		fn: function(n) {
			if (n.defaultPrevented || n.keyCode !== Sv) return;
			let i = e.findClosestDraggableId(n);
			if (!i) return;
			let a = e.tryGetLock(i, c, { sourceEvent: n });
			if (!a) return;
			n.preventDefault();
			let o = !0, s = a.snapLift();
			t.current();
			function c() {
				!o && J(), o = !1, t.current(), r();
			}
			t.current = vp(window, Hv(s, c), {
				capture: !0,
				passive: !1
			});
		}
	}), [e]), r = X(function() {
		t.current = vp(window, [n], {
			passive: !1,
			capture: !0
		});
	}, [n]);
	Y_(function() {
		return r(), function() {
			t.current();
		};
	}, [r]);
}
var Wv = { type: "IDLE" }, Gv = 120, Kv = .15;
function qv({ cancel: e, getPhase: t }) {
	return [
		{
			eventName: "orientationchange",
			fn: e
		},
		{
			eventName: "resize",
			fn: e
		},
		{
			eventName: "contextmenu",
			fn: (e) => {
				e.preventDefault();
			}
		},
		{
			eventName: "keydown",
			fn: (n) => {
				if (t().type !== "DRAGGING") {
					e();
					return;
				}
				n.keyCode === xv && n.preventDefault(), e();
			}
		},
		{
			eventName: Nv,
			fn: e
		}
	];
}
function Jv({ cancel: e, completed: t, getPhase: n }) {
	return [
		{
			eventName: "touchmove",
			options: { capture: !1 },
			fn: (t) => {
				let r = n();
				if (r.type !== "DRAGGING") {
					e();
					return;
				}
				r.hasMoved = !0;
				let { clientX: i, clientY: a } = t.touches[0], o = {
					x: i,
					y: a
				};
				t.preventDefault(), r.actions.move(o);
			}
		},
		{
			eventName: "touchend",
			fn: (r) => {
				let i = n();
				if (i.type !== "DRAGGING") {
					e();
					return;
				}
				r.preventDefault(), i.actions.drop({ shouldBlockNextClick: !0 }), t();
			}
		},
		{
			eventName: "touchcancel",
			fn: (t) => {
				if (n().type !== "DRAGGING") {
					e();
					return;
				}
				t.preventDefault(), e();
			}
		},
		{
			eventName: "touchforcechange",
			fn: (t) => {
				let r = n();
				r.type === "IDLE" && J();
				let i = t.touches[0];
				if (!i || !(i.force >= Kv)) return;
				let a = r.actions.shouldRespectForcePress();
				if (r.type === "PENDING") {
					a && e();
					return;
				}
				if (a) {
					if (r.hasMoved) {
						t.preventDefault();
						return;
					}
					e();
					return;
				}
				t.preventDefault();
			}
		},
		{
			eventName: Nv,
			fn: e
		}
	];
}
function Yv(e) {
	let t = I(Wv), n = I(gp), r = X(function() {
		return t.current;
	}, []), i = X(function(e) {
		t.current = e;
	}, []), a = Y(() => ({
		eventName: "touchstart",
		fn: function(t) {
			if (t.defaultPrevented) return;
			let r = e.findClosestDraggableId(t);
			if (!r) return;
			let i = e.tryGetLock(r, s, { sourceEvent: t });
			if (!i) return;
			let { clientX: a, clientY: o } = t.touches[0], c = {
				x: a,
				y: o
			};
			n.current(), d(i, c);
		}
	}), [e]), o = X(function() {
		n.current = vp(window, [a], {
			capture: !0,
			passive: !1
		});
	}, [a]), s = X(() => {
		let e = t.current;
		e.type !== "IDLE" && (e.type === "PENDING" && clearTimeout(e.longPressTimerId), i(Wv), n.current(), o());
	}, [o, i]), c = X(() => {
		let e = t.current;
		s(), e.type === "DRAGGING" && e.actions.cancel({ shouldBlockNextClick: !0 }), e.type === "PENDING" && e.actions.abort();
	}, [s]), l = X(function() {
		let e = {
			capture: !0,
			passive: !1
		}, t = {
			cancel: c,
			completed: s,
			getPhase: r
		}, i = vp(window, Jv(t), e), a = vp(window, qv(t), e);
		n.current = function() {
			i(), a();
		};
	}, [
		c,
		r,
		s
	]), u = X(function() {
		let e = r();
		e.type !== "PENDING" && J();
		let t = e.actions.fluidLift(e.point);
		i({
			type: "DRAGGING",
			actions: t,
			hasMoved: !1
		});
	}, [r, i]), d = X(function(e, t) {
		r().type !== "IDLE" && J();
		let n = setTimeout(u, Gv);
		i({
			type: "PENDING",
			point: t,
			actions: e,
			longPressTimerId: n
		}), l();
	}, [
		l,
		r,
		i,
		u
	]);
	Y_(function() {
		return o(), function() {
			n.current();
			let e = r();
			e.type === "PENDING" && (clearTimeout(e.longPressTimerId), i(Wv));
		};
	}, [
		r,
		o,
		i
	]), Y_(function() {
		return vp(window, [{
			eventName: "touchmove",
			fn: () => {},
			options: {
				capture: !1,
				passive: !1
			}
		}]);
	}, []);
}
var Xv = [
	"input",
	"button",
	"textarea",
	"select",
	"option",
	"optgroup",
	"video",
	"audio"
];
function Zv(e, t) {
	if (t == null) return !1;
	if (Xv.includes(t.tagName.toLowerCase())) return !0;
	let n = t.getAttribute("contenteditable");
	return n === "true" || n === "" || t !== e && Zv(e, t.parentElement);
}
function Qv(e, t) {
	let n = t.target;
	return tv(n) ? Zv(e, n) : !1;
}
var $v = (e) => np(e.getBoundingClientRect()).center;
function ey(e) {
	return e instanceof ev(e).Element;
}
var ty = (() => {
	let e = "matches";
	return typeof document > "u" ? e : [
		e,
		"msMatchesSelector",
		"webkitMatchesSelector"
	].find((e) => e in Element.prototype) || e;
})();
function ny(e, t) {
	return e == null ? null : e[ty](t) ? e : ny(e.parentElement, t);
}
function ry(e, t) {
	return e.closest ? e.closest(t) : ny(e, t);
}
function iy(e) {
	return `[${V_.contextId}="${e}"]`;
}
function ay(e, t) {
	let n = t.target;
	if (!ey(n)) return null;
	let r = ry(n, iy(e));
	return !r || !tv(r) ? null : r;
}
function oy(e, t) {
	let n = ay(e, t);
	return n ? n.getAttribute(V_.draggableId) : null;
}
function sy(e, t) {
	let n = `[${H_.contextId}="${e}"]`, r = $_(document, n).find((e) => e.getAttribute(H_.id) === t);
	return !r || !tv(r) ? null : r;
}
function cy(e) {
	e.preventDefault();
}
function ly({ expected: e, phase: t, isLockActive: n, shouldWarn: r }) {
	return !(!n() || e !== t);
}
function uy({ lockAPI: e, store: t, registry: n, draggableId: r }) {
	if (e.isClaimed()) return !1;
	let i = n.draggable.findById(r);
	return !(!i || !i.options.isEnabled || !d_(t.getState(), r));
}
function dy({ lockAPI: e, contextId: t, store: n, registry: r, draggableId: i, forceSensorStop: a, sourceEvent: o }) {
	if (!uy({
		lockAPI: e,
		store: n,
		registry: r,
		draggableId: i
	})) return null;
	let s = r.draggable.getById(i), c = sy(t, s.descriptor.id);
	if (!c || o && !s.options.canDragInteractiveElements && Qv(c, o)) return null;
	let l = e.claim(a || gp), u = "PRE_DRAG";
	function d() {
		return s.options.shouldRespectForcePress;
	}
	function f() {
		return e.isActive(l);
	}
	function p(e, t) {
		ly({
			expected: e,
			phase: u,
			isLockActive: f,
			shouldWarn: !0
		}) && n.dispatch(t());
	}
	let m = p.bind(null, "DRAGGING");
	function h(t) {
		function r() {
			e.release(), u = "COMPLETED";
		}
		u !== "PRE_DRAG" && (r(), J()), n.dispatch(Jh(t.liftActionArgs)), u = "DRAGGING";
		function i(e, i = { shouldBlockNextClick: !1 }) {
			if (t.cleanup(), i.shouldBlockNextClick) {
				let e = vp(window, [{
					eventName: "click",
					fn: cy,
					options: {
						once: !0,
						passive: !1,
						capture: !0
					}
				}]);
				setTimeout(e);
			}
			r(), n.dispatch(dg({ reason: e }));
		}
		return {
			isActive: () => ly({
				expected: "DRAGGING",
				phase: u,
				isLockActive: f,
				shouldWarn: !1
			}),
			shouldRespectForcePress: d,
			drop: (e) => i("DROP", e),
			cancel: (e) => i("CANCEL", e),
			...t.actions
		};
	}
	function g(e) {
		let t = mp((e) => {
			m(() => tg({ client: e }));
		});
		return {
			...h({
				liftActionArgs: {
					id: i,
					clientSelection: e,
					movementMode: "FLUID"
				},
				cleanup: () => t.cancel(),
				actions: { move: t }
			}),
			move: t
		};
	}
	function _() {
		return h({
			liftActionArgs: {
				id: i,
				clientSelection: $v(c),
				movementMode: "SNAP"
			},
			cleanup: gp,
			actions: {
				moveUp: () => m(ig),
				moveRight: () => m(og),
				moveDown: () => m(ag),
				moveLeft: () => m(sg)
			}
		});
	}
	function v() {
		ly({
			expected: "PRE_DRAG",
			phase: u,
			isLockActive: f,
			shouldWarn: !0
		}) && e.release();
	}
	return {
		isActive: () => ly({
			expected: "PRE_DRAG",
			phase: u,
			isLockActive: f,
			shouldWarn: !1
		}),
		shouldRespectForcePress: d,
		fluidLift: g,
		snapLift: _,
		abort: v
	};
}
var fy = [
	zv,
	Uv,
	Yv
];
function py({ contextId: e, store: t, registry: n, customSensors: r, enableDefaultSensors: i }) {
	let a = [...i ? fy : [], ...r || []], o = L(() => _v())[0], s = X(function(e, t) {
		vv(e) && !vv(t) && o.tryAbandon();
	}, [o]);
	Y_(function() {
		let e = t.getState();
		return t.subscribe(() => {
			let n = t.getState();
			s(e, n), e = n;
		});
	}, [
		o,
		t,
		s
	]), Y_(() => o.tryAbandon, [o.tryAbandon]);
	let c = X((e) => uy({
		lockAPI: o,
		registry: n,
		store: t,
		draggableId: e
	}), [
		o,
		n,
		t
	]), l = X((r, i, a) => dy({
		lockAPI: o,
		registry: n,
		contextId: e,
		store: t,
		draggableId: r,
		forceSensorStop: i || null,
		sourceEvent: a && a.sourceEvent ? a.sourceEvent : null
	}), [
		e,
		o,
		n,
		t
	]), u = X((t) => oy(e, t), [e]), d = X((e) => {
		let t = n.draggable.findById(e);
		return t ? t.options : null;
	}, [n.draggable]), f = X(function() {
		o.isClaimed() && (o.tryAbandon(), t.getState().phase !== "IDLE" && t.dispatch(cg()));
	}, [o, t]), p = X(() => o.isClaimed(), [o]), m = Y(() => ({
		canGetLock: c,
		tryGetLock: l,
		findClosestDraggableId: u,
		findOptionsForDraggable: d,
		tryReleaseLock: f,
		isLockClaimed: p
	}), [
		c,
		l,
		u,
		d,
		f,
		p
	]);
	for (let e = 0; e < a.length; e++) a[e](m);
}
var my = (e) => ({
	onBeforeCapture: (t) => {
		er(() => {
			e.onBeforeCapture && e.onBeforeCapture(t);
		});
	},
	onBeforeDragStart: e.onBeforeDragStart,
	onDragStart: e.onDragStart,
	onDragEnd: e.onDragEnd,
	onDragUpdate: e.onDragUpdate
}), hy = (e) => ({
	...g_,
	...e.autoScrollerOptions,
	durationDampening: {
		...g_.durationDampening,
		...e.autoScrollerOptions
	}
});
function gy(e) {
	return !e.current && J(), e.current;
}
function _y(e) {
	let { contextId: t, setCallbacks: n, sensors: i, nonce: a, dragHandleUsageInstructions: o } = e, s = I(null), c = gv(e), l = X(() => my(c.current), [c]), u = X(() => hy(c.current), [c]), d = uv(t), f = mv({
		contextId: t,
		text: o
	}), p = Q_(t, a), m = X((e) => {
		gy(s).dispatch(e);
	}, []), h = Y(() => r({
		publishWhileDragging: Xh,
		updateDroppableScroll: Qh,
		updateDroppableIsEnabled: $h,
		updateDroppableIsCombineEnabled: eg,
		collectionStarting: Zh
	}, m), [m]), g = av(), _ = Y(() => u_(g, h), [g, h]), v = Y(() => z_({
		scrollWindow: f_,
		scrollDroppable: _.scrollDroppable,
		getAutoScrollerOptions: u,
		...r({ move: tg }, m)
	}), [
		_.scrollDroppable,
		m,
		u
	]), y = rv(t), b = Y(() => t_({
		announce: d,
		autoScroller: v,
		dimensionMarshal: _,
		focusMarshal: y,
		getResponders: l,
		styleMarshal: p
	}), [
		d,
		v,
		_,
		y,
		l,
		p
	]);
	s.current = b;
	let x = X(() => {
		let e = gy(s);
		e.getState().phase !== "IDLE" && e.dispatch(cg());
	}, []), C = X(() => {
		let e = gy(s).getState();
		return e.phase === "DROP_ANIMATING" || e.phase !== "IDLE" && e.isDragging;
	}, []);
	n(Y(() => ({
		isDragging: C,
		tryAbort: x
	}), [C, x]));
	let w = X((e) => d_(gy(s).getState(), e), []), T = X(() => mh(gy(s).getState()), []), E = Y(() => ({
		marshal: _,
		focus: y,
		contextId: t,
		canLift: w,
		isMovementAllowed: T,
		dragHandleUsageInstructionsId: f,
		registry: g
	}), [
		t,
		_,
		f,
		y,
		w,
		T,
		g
	]);
	return py({
		contextId: t,
		store: b,
		registry: g,
		customSensors: i || null,
		enableDefaultSensors: e.enableDefaultSensors !== !1
	}), F(() => x, [x]), P.createElement(hv.Provider, { value: E }, P.createElement(S, {
		context: ov,
		store: b
	}, e.children));
}
function vy() {
	return P.useId();
}
function yy(e) {
	let t = vy(), n = e.dragHandleUsageInstructions || kp.dragHandleUsageInstructions;
	return P.createElement(xp, null, (r) => P.createElement(_y, {
		nonce: e.nonce,
		contextId: t,
		setCallbacks: r,
		dragHandleUsageInstructions: n,
		enableDefaultSensors: e.enableDefaultSensors,
		sensors: e.sensors,
		onBeforeCapture: e.onBeforeCapture,
		onBeforeDragStart: e.onBeforeDragStart,
		onDragStart: e.onDragStart,
		onDragUpdate: e.onDragUpdate,
		onDragEnd: e.onDragEnd,
		autoScrollerOptions: e.autoScrollerOptions
	}, e.children));
}
var by = {
	dragging: 5e3,
	dropAnimating: 4500
}, xy = (e, t) => t ? bg.drop(t.duration) : e ? bg.snap : bg.fluid, Sy = (e, t) => {
	if (e) return t ? _g.opacity.drop : _g.opacity.combining;
}, Cy = (e) => e.forceShouldAnimate == null ? e.mode === "SNAP" : e.forceShouldAnimate;
function wy(e) {
	let t = e.dimension.client, { offset: n, combineWith: r, dropping: i } = e, a = !!r, o = Cy(e), s = !!i, c = s ? Sg.drop(n, a) : Sg.moveTo(n);
	return {
		position: "fixed",
		top: t.marginBox.top,
		left: t.marginBox.left,
		boxSizing: "border-box",
		width: t.borderBox.width,
		height: t.borderBox.height,
		transition: xy(o, i),
		transform: c,
		opacity: Sy(a, s),
		zIndex: s ? by.dropAnimating : by.dragging,
		pointerEvents: "none"
	};
}
function Ty(e) {
	return {
		transform: Sg.moveTo(e.offset),
		transition: e.shouldAnimateDisplacement ? void 0 : "none"
	};
}
function Ey(e) {
	return e.type === "DRAGGING" ? wy(e) : Ty(e);
}
function Dy(e, t, n = Mp) {
	let r = window.getComputedStyle(t), i = fp(t.getBoundingClientRect(), r), a = dp(i, n);
	return {
		descriptor: e,
		placeholder: {
			client: i,
			tagName: t.tagName.toLowerCase(),
			display: r.display
		},
		displaceBy: {
			x: i.marginBox.width,
			y: i.marginBox.height
		},
		client: i,
		page: a
	};
}
function Oy(e) {
	let t = fv("draggable"), { descriptor: n, registry: r, getDraggableRef: i, canDragInteractiveElements: a, shouldRespectForcePress: o, isEnabled: s } = e, c = Y(() => ({
		canDragInteractiveElements: a,
		shouldRespectForcePress: o,
		isEnabled: s
	}), [
		a,
		s,
		o
	]), l = X((e) => {
		let t = i();
		return !t && J(), Dy(n, t, e);
	}, [n, i]), u = Y(() => ({
		uniqueId: t,
		descriptor: n,
		options: c,
		getDimension: l
	}), [
		n,
		l,
		c,
		t
	]), d = I(u), f = I(!0);
	Y_(() => (r.draggable.register(d.current), () => r.draggable.unregister(d.current)), [r.draggable]), Y_(() => {
		if (f.current) {
			f.current = !1;
			return;
		}
		let e = d.current;
		d.current = u, r.draggable.update(u, e);
	}, [u, r.draggable]);
}
var ky = P.createContext(null);
function Ay(e) {
	let t = Mn(e);
	return !t && J(), t;
}
function jy(e) {
	e.preventDefault();
}
var My = (e) => {
	let t = I(null), n = X((e = null) => {
		t.current = e;
	}, []), r = X(() => t.current, []), { contextId: i, dragHandleUsageInstructionsId: a, registry: o } = Ay(hv), { type: s, droppableId: c } = Ay(ky), l = Y(() => ({
		id: e.draggableId,
		index: e.index,
		type: s,
		droppableId: c
	}), [
		e.draggableId,
		e.index,
		s,
		c
	]), { children: u, draggableId: d, isEnabled: f, shouldRespectForcePress: p, canDragInteractiveElements: m, isClone: h, mapped: g, dropAnimationFinished: _ } = e;
	h || Oy(Y(() => ({
		descriptor: l,
		registry: o,
		getDraggableRef: r,
		canDragInteractiveElements: m,
		shouldRespectForcePress: p,
		isEnabled: f
	}), [
		l,
		o,
		r,
		m,
		p,
		f
	]));
	let v = Y(() => f ? {
		tabIndex: 0,
		role: "button",
		"aria-describedby": a,
		"data-rfd-drag-handle-draggable-id": d,
		"data-rfd-drag-handle-context-id": i,
		draggable: !1,
		onDragStart: jy
	} : null, [
		i,
		a,
		d,
		f
	]), y = X((e) => {
		g.type === "DRAGGING" && g.dropping && e.propertyName === "transform" && er(_);
	}, [_, g]), b = Y(() => {
		let e = Ey(g), t = g.type === "DRAGGING" && g.dropping ? y : void 0;
		return {
			innerRef: n,
			draggableProps: {
				"data-rfd-draggable-context-id": i,
				"data-rfd-draggable-id": d,
				style: e,
				onTransitionEnd: t
			},
			dragHandleProps: v
		};
	}, [
		i,
		v,
		d,
		g,
		y,
		n
	]), x = Y(() => ({
		draggableId: l.id,
		type: l.type,
		source: {
			index: l.index,
			droppableId: l.droppableId
		}
	}), [
		l.droppableId,
		l.id,
		l.index,
		l.type
	]);
	return P.createElement(P.Fragment, null, u(b, g.snapshot, x));
}, Ny = (e, t) => e === t, Py = (e) => {
	let { combine: t, destination: n } = e;
	return n ? n.droppableId : t ? t.droppableId : null;
}, Fy = (e) => e.combine ? e.combine.draggableId : null, Iy = (e) => e.at && e.at.type === "COMBINE" ? e.at.combine.draggableId : null;
function Ly() {
	let e = Xp((e, t) => ({
		x: e,
		y: t
	})), t = Xp((e, t, n = null, r = null, i = null) => ({
		isDragging: !0,
		isClone: t,
		isDropAnimating: !!i,
		dropAnimation: i,
		mode: e,
		draggingOver: n,
		combineWith: r,
		combineTargetFor: null
	})), n = Xp((e, n, r, i, a = null, o = null, s = null) => ({ mapped: {
		type: "DRAGGING",
		dropping: null,
		draggingOver: a,
		combineWith: o,
		mode: n,
		offset: e,
		dimension: r,
		forceShouldAnimate: s,
		snapshot: t(n, i, a, o, null)
	} }));
	return (r, i) => {
		if (vv(r)) {
			if (r.critical.draggable.id !== i.draggableId) return null;
			let t = r.current.client.offset, a = r.dimensions.draggables[i.draggableId], o = dh(r.impact), s = Iy(r.impact), c = r.forceShouldAnimate;
			return n(e(t.x, t.y), r.movementMode, a, i.isClone, o, s, c);
		}
		if (r.phase === "DROP_ANIMATING") {
			let e = r.completed;
			if (e.result.draggableId !== i.draggableId) return null;
			let n = i.isClone, a = r.dimensions.draggables[i.draggableId], o = e.result, s = o.mode, c = Py(o), l = Fy(o), u = {
				duration: r.dropDuration,
				curve: gg.drop,
				moveTo: r.newHomeClientOffset,
				opacity: l ? _g.opacity.drop : null,
				scale: l ? _g.scale.drop : null
			};
			return { mapped: {
				type: "DRAGGING",
				offset: r.newHomeClientOffset,
				dimension: a,
				dropping: u,
				draggingOver: c,
				combineWith: l,
				mode: s,
				forceShouldAnimate: null,
				snapshot: t(s, n, c, l, u)
			} };
		}
		return null;
	};
}
function Ry(e = null) {
	return {
		isDragging: !1,
		isDropAnimating: !1,
		isClone: !1,
		dropAnimation: null,
		mode: null,
		draggingOver: null,
		combineTargetFor: e,
		combineWith: null
	};
}
var zy = { mapped: {
	type: "SECONDARY",
	offset: Mp,
	combineTargetFor: null,
	shouldAnimateDisplacement: !0,
	snapshot: Ry(null)
} };
function By() {
	let e = Xp((e, t) => ({
		x: e,
		y: t
	})), t = Xp(Ry), n = Xp((e, n = null, r) => ({ mapped: {
		type: "SECONDARY",
		offset: e,
		combineTargetFor: n,
		shouldAnimateDisplacement: r,
		snapshot: t(n)
	} })), r = (e) => e ? n(Mp, e, !0) : null, i = (t, i, a, o) => {
		let s = a.displaced.visible[t], c = !!(o.inVirtualList && o.effected[t]), l = rm(a), u = l && l.draggableId === t ? i : null;
		if (!s) {
			if (!c) return r(u);
			if (a.displaced.invisible[t]) return null;
			let i = Ip(o.displacedBy.point), s = e(i.x, i.y);
			return n(s, u, !0);
		}
		if (c) return r(u);
		let d = a.displacedBy.point, f = e(d.x, d.y);
		return n(f, u, s.shouldAnimate);
	};
	return (e, t) => {
		if (vv(e)) return e.critical.draggable.id === t.draggableId ? null : i(t.draggableId, e.critical.draggable.id, e.impact, e.afterCritical);
		if (e.phase === "DROP_ANIMATING") {
			let n = e.completed;
			return n.result.draggableId === t.draggableId ? null : i(t.draggableId, n.result.draggableId, n.impact, n.afterCritical);
		}
		return null;
	};
}
var Vy = w(() => {
	let e = Ly(), t = By();
	return (n, r) => e(n, r) || t(n, r) || zy;
}, { dropAnimationFinished: pg }, null, {
	context: ov,
	areStatePropsEqual: Ny
})(My);
function Hy(e) {
	return Ay(ky).isUsingCloneFor === e.draggableId && !e.isClone ? null : P.createElement(Vy, e);
}
function Uy(e) {
	let t = typeof e.isDragDisabled != "boolean" || !e.isDragDisabled, n = !!e.disableInteractiveElementBlocking, r = !!e.shouldRespectForcePress;
	return P.createElement(Hy, q({}, e, {
		isClone: !1,
		isEnabled: t,
		canDragInteractiveElements: n,
		shouldRespectForcePress: r
	}));
}
var Wy = (e) => (t) => e === t, Gy = Wy("scroll"), Ky = Wy("auto"), qy = (e, t) => t(e.overflowX) || t(e.overflowY), Jy = (e) => {
	let t = window.getComputedStyle(e), n = {
		overflowX: t.overflowX,
		overflowY: t.overflowY
	};
	return qy(n, Gy) || qy(n, Ky);
}, Yy = () => !1, Xy = (e) => e == null ? null : e === document.body ? Yy() ? e : null : e === document.documentElement ? null : Jy(e) ? e : Xy(e.parentElement), Zy = (e) => ({
	x: e.scrollLeft,
	y: e.scrollTop
}), Qy = (e) => e ? window.getComputedStyle(e).position === "fixed" || Qy(e.parentElement) : !1, $y = (e) => ({
	closestScrollable: Xy(e),
	isFixedOnPage: Qy(e)
}), eb = ({ descriptor: e, isEnabled: t, isCombineEnabled: n, isFixedOnPage: r, direction: i, client: a, page: o, closest: s }) => {
	let c = (() => {
		if (!s) return null;
		let { scrollSize: e, client: t } = s, n = i_({
			scrollHeight: e.scrollHeight,
			scrollWidth: e.scrollWidth,
			height: t.paddingBox.height,
			width: t.paddingBox.width
		});
		return {
			pageMarginBox: s.page.marginBox,
			frameClient: t,
			scrollSize: e,
			shouldClipSubject: s.shouldClipSubject,
			scroll: {
				initial: s.scroll,
				current: s.scroll,
				max: n,
				diff: {
					value: Mp,
					displacement: Mp
				}
			}
		};
	})(), l = i === "vertical" ? pm : mm;
	return {
		descriptor: e,
		isCombineEnabled: n,
		isFixedOnPage: r,
		axis: l,
		isEnabled: t,
		client: a,
		page: o,
		frame: c,
		subject: Jp({
			page: o,
			withPlaceholder: null,
			axis: l,
			frame: c
		})
	};
}, tb = (e, t) => {
	let n = pp(e);
	if (!t || e !== t) return n;
	let r = n.paddingBox.top - t.scrollTop, i = n.paddingBox.left - t.scrollLeft, a = r + t.scrollHeight;
	return sp({
		borderBox: rp({
			top: r,
			right: i + t.scrollWidth,
			bottom: a,
			left: i
		}, n.border),
		margin: n.margin,
		border: n.border,
		padding: n.padding
	});
}, nb = ({ ref: e, descriptor: t, env: n, windowScroll: r, direction: i, isDropDisabled: a, isCombineEnabled: o, shouldClipSubject: s }) => {
	let c = n.closestScrollable, l = tb(e, c), u = dp(l, r), d = (() => {
		if (!c) return null;
		let e = pp(c), t = {
			scrollHeight: c.scrollHeight,
			scrollWidth: c.scrollWidth
		};
		return {
			client: e,
			page: dp(e, r),
			scroll: Zy(c),
			scrollSize: t,
			shouldClipSubject: s
		};
	})();
	return eb({
		descriptor: t,
		isEnabled: !a,
		isCombineEnabled: o,
		isFixedOnPage: n.isFixedOnPage,
		direction: i,
		client: l,
		page: u,
		closest: d
	});
}, rb = { passive: !1 }, ib = { passive: !0 }, ab = (e) => e.shouldPublishImmediately ? rb : ib, ob = (e) => e && e.env.closestScrollable || null;
function sb(e) {
	let t = I(null), n = Ay(hv), r = fv("droppable"), { registry: i, marshal: a } = n, o = gv(e), s = Y(() => ({
		id: e.droppableId,
		type: e.type,
		mode: e.mode
	}), [
		e.droppableId,
		e.mode,
		e.type
	]), c = I(s), l = Y(() => Xp((e, n) => {
		!t.current && J();
		let r = {
			x: e,
			y: n
		};
		a.updateDroppableScroll(s.id, r);
	}), [s.id, a]), u = X(() => {
		let e = t.current;
		return !e || !e.env.closestScrollable ? Mp : Zy(e.env.closestScrollable);
	}, []), d = X(() => {
		let e = u();
		l(e.x, e.y);
	}, [u, l]), f = Y(() => mp(d), [d]), p = X(() => {
		let e = t.current, n = ob(e);
		if (!(e && n) && J(), e.scrollOptions.shouldPublishImmediately) {
			d();
			return;
		}
		f();
	}, [f, d]), m = X((e, r) => {
		t.current && J();
		let i = o.current, a = i.getDroppableRef();
		!a && J();
		let c = $y(a), l = {
			ref: a,
			descriptor: s,
			env: c,
			scrollOptions: r
		};
		t.current = l;
		let u = nb({
			ref: a,
			descriptor: s,
			env: c,
			windowScroll: e,
			direction: i.direction,
			isDropDisabled: i.isDropDisabled,
			isCombineEnabled: i.isCombineEnabled,
			shouldClipSubject: !i.ignoreContainerClipping
		}), d = c.closestScrollable;
		return d && (d.setAttribute(W_.contextId, n.contextId), d.addEventListener("scroll", p, ab(l.scrollOptions))), u;
	}, [
		n.contextId,
		s,
		p,
		o
	]), h = X(() => {
		let e = t.current, n = ob(e);
		return !(e && n) && J(), Zy(n);
	}, []), g = X(() => {
		let e = t.current;
		!e && J();
		let n = ob(e);
		t.current = null, n && (f.cancel(), n.removeAttribute(W_.contextId), n.removeEventListener("scroll", p, ab(e.scrollOptions)));
	}, [p, f]), _ = X((e) => {
		let n = t.current;
		!n && J();
		let r = ob(n);
		!r && J(), r.scrollTop += e.y, r.scrollLeft += e.x;
	}, []), v = Y(() => ({
		getDimensionAndWatchScroll: m,
		getScrollWhileDragging: h,
		dragStopped: g,
		scroll: _
	}), [
		g,
		m,
		h,
		_
	]), y = Y(() => ({
		uniqueId: r,
		descriptor: s,
		callbacks: v
	}), [
		v,
		s,
		r
	]);
	Y_(() => (c.current = y.descriptor, i.droppable.register(y), () => {
		t.current && g(), i.droppable.unregister(y);
	}), [
		v,
		s,
		g,
		y,
		a,
		i.droppable
	]), Y_(() => {
		t.current && a.updateDroppableIsEnabled(c.current.id, !e.isDropDisabled);
	}, [e.isDropDisabled, a]), Y_(() => {
		t.current && a.updateDroppableIsCombineEnabled(c.current.id, e.isCombineEnabled);
	}, [e.isCombineEnabled, a]);
}
function cb() {}
var lb = {
	width: 0,
	height: 0,
	margin: Wp
}, ub = ({ isAnimatingOpenOnMount: e, placeholder: t, animate: n }) => e || n === "close" ? lb : {
	height: t.client.borderBox.height,
	width: t.client.borderBox.width,
	margin: t.client.margin
}, db = ({ isAnimatingOpenOnMount: e, placeholder: t, animate: n }) => {
	let r = ub({
		isAnimatingOpenOnMount: e,
		placeholder: t,
		animate: n
	});
	return {
		display: t.display,
		boxSizing: "border-box",
		width: r.width,
		height: r.height,
		marginTop: r.margin.top,
		marginRight: r.margin.right,
		marginBottom: r.margin.bottom,
		marginLeft: r.margin.left,
		flexShrink: "0",
		flexGrow: "0",
		pointerEvents: "none",
		transition: n === "none" ? null : bg.placeholder
	};
}, fb = P.memo((e) => {
	let t = I(null), n = X(() => {
		t.current &&= (clearTimeout(t.current), null);
	}, []), { animate: r, onTransitionEnd: i, onClose: a, contextId: o } = e, [s, c] = L(e.animate === "open");
	F(() => s ? r === "open" ? t.current ? cb : (t.current = setTimeout(() => {
		t.current = null, c(!1);
	}), n) : (n(), c(!1), cb) : cb, [
		r,
		s,
		n
	]);
	let l = X((e) => {
		e.propertyName === "height" && (i(), r === "close" && a());
	}, [
		r,
		a,
		i
	]), u = db({
		isAnimatingOpenOnMount: s,
		animate: e.animate,
		placeholder: e.placeholder
	});
	return P.createElement(e.placeholder.tagName, {
		style: u,
		"data-rfd-placeholder-context-id": o,
		onTransitionEnd: l,
		ref: e.innerRef
	});
}), pb = class extends P.PureComponent {
	constructor(...e) {
		super(...e), this.state = {
			isVisible: !!this.props.on,
			data: this.props.on,
			animate: this.props.shouldAnimate && this.props.on ? "open" : "none"
		}, this.onClose = () => {
			this.state.animate === "close" && this.setState({ isVisible: !1 });
		};
	}
	static getDerivedStateFromProps(e, t) {
		return e.shouldAnimate ? e.on ? {
			isVisible: !0,
			data: e.on,
			animate: "open"
		} : t.isVisible ? {
			isVisible: !0,
			data: t.data,
			animate: "close"
		} : {
			isVisible: !1,
			animate: "close",
			data: null
		} : {
			isVisible: !!e.on,
			data: e.on,
			animate: "none"
		};
	}
	render() {
		if (!this.state.isVisible) return null;
		let e = {
			onClose: this.onClose,
			data: this.state.data,
			animate: this.state.animate
		};
		return this.props.children(e);
	}
}, mb = (e) => {
	let t = Mn(hv);
	!t && J();
	let { contextId: n, isMovementAllowed: r } = t, i = I(null), a = I(null), { children: o, droppableId: s, type: c, mode: l, direction: u, ignoreContainerClipping: d, isDropDisabled: f, isCombineEnabled: p, snapshot: m, useClone: h, updateViewportMaxScroll: g, getContainerForClone: _ } = e, v = X(() => i.current, []), y = X((e = null) => {
		i.current = e;
	}, []);
	X(() => a.current, []);
	let b = X((e = null) => {
		a.current = e;
	}, []), x = X(() => {
		r() && g({ maxScroll: o_() });
	}, [r, g]);
	sb({
		droppableId: s,
		type: c,
		mode: l,
		direction: u,
		isDropDisabled: f,
		isCombineEnabled: p,
		ignoreContainerClipping: d,
		getDroppableRef: v
	});
	let S = Y(() => P.createElement(pb, {
		on: e.placeholder,
		shouldAnimate: e.shouldAnimatePlaceholder
	}, ({ onClose: e, data: t, animate: r }) => P.createElement(fb, {
		placeholder: t,
		onClose: e,
		innerRef: b,
		animate: r,
		contextId: n,
		onTransitionEnd: x
	})), [
		n,
		x,
		e.placeholder,
		e.shouldAnimatePlaceholder,
		b
	]), C = Y(() => ({
		innerRef: y,
		placeholder: S,
		droppableProps: {
			"data-rfd-droppable-id": s,
			"data-rfd-droppable-context-id": n
		}
	}), [
		n,
		s,
		S,
		y
	]), w = h ? h.dragging.draggableId : null, T = Y(() => ({
		droppableId: s,
		type: c,
		isUsingCloneFor: w
	}), [
		s,
		w,
		c
	]);
	function E() {
		if (!h) return null;
		let { dragging: e, render: t } = h, n = P.createElement(Hy, {
			draggableId: e.draggableId,
			index: e.source.index,
			isClone: !0,
			isEnabled: !0,
			shouldRespectForcePress: !1,
			canDragInteractiveElements: !0
		}, (n, r) => t(n, r, e));
		return $n.createPortal(n, _());
	}
	return P.createElement(ky.Provider, { value: T }, o(C, m), E());
};
function hb() {
	return !document.body && J(), document.body;
}
var gb = {
	mode: "standard",
	type: "DEFAULT",
	direction: "vertical",
	isDropDisabled: !1,
	isCombineEnabled: !1,
	ignoreContainerClipping: !1,
	renderClone: null,
	getContainerForClone: hb
}, _b = (e) => {
	let t = { ...e }, n;
	for (n in gb) e[n] === void 0 && (t = {
		...t,
		[n]: gb[n]
	});
	return t;
}, vb = (e, t) => e === t.droppable.type, yb = (e, t) => t.draggables[e.draggable.id], bb = w(() => {
	let e = {
		placeholder: null,
		shouldAnimatePlaceholder: !0,
		snapshot: {
			isDraggingOver: !1,
			draggingOverWith: null,
			draggingFromThisWith: null,
			isUsingPlaceholder: !1
		},
		useClone: null
	}, t = {
		...e,
		shouldAnimatePlaceholder: !1
	}, n = Xp((e) => ({
		draggableId: e.id,
		type: e.type,
		source: {
			index: e.index,
			droppableId: e.droppableId
		}
	})), r = Xp((r, i, a, o, s, c) => {
		let l = s.descriptor.id;
		if (s.descriptor.droppableId === r) {
			let e = c ? {
				render: c,
				dragging: n(s.descriptor)
			} : null, t = {
				isDraggingOver: a,
				draggingOverWith: a ? l : null,
				draggingFromThisWith: l,
				isUsingPlaceholder: !0
			};
			return {
				placeholder: s.placeholder,
				shouldAnimatePlaceholder: !1,
				snapshot: t,
				useClone: e
			};
		}
		if (!i) return t;
		if (!o) return e;
		let u = {
			isDraggingOver: a,
			draggingOverWith: l,
			draggingFromThisWith: null,
			isUsingPlaceholder: !0
		};
		return {
			placeholder: s.placeholder,
			shouldAnimatePlaceholder: !0,
			snapshot: u,
			useClone: null
		};
	});
	return (n, i) => {
		let a = _b(i), o = a.droppableId, s = a.type, c = !a.isDropDisabled, l = a.renderClone;
		if (vv(n)) {
			let e = n.critical;
			if (!vb(s, e)) return t;
			let i = yb(e, n.dimensions), a = dh(n.impact) === o;
			return r(o, c, a, a, i, l);
		}
		if (n.phase === "DROP_ANIMATING") {
			let e = n.completed;
			if (!vb(s, e.critical)) return t;
			let i = yb(e.critical, n.dimensions);
			return r(o, c, Py(e.result) === o, dh(e.impact) === o, i, l);
		}
		if (n.phase === "IDLE" && n.completed && !n.shouldFlush) {
			let r = n.completed;
			if (!vb(s, r.critical)) return t;
			let i = dh(r.impact) === o, a = !!(r.impact.at && r.impact.at.type === "COMBINE"), c = r.critical.droppable.id === o;
			return i ? a ? e : t : c ? e : t;
		}
		return t;
	};
}, { updateViewportMaxScroll: rg }, (e, t, n) => ({
	..._b(n),
	...e,
	...t
}), {
	context: ov,
	areStatePropsEqual: Ny
})(mb), xb = H("div")(({ theme: e }) => ({
	alignItems: "center",
	borderRight: `0.5px solid ${e.palette.divider}`,
	display: "flex",
	flex: 1,
	flexDirection: "row",
	marginBottom: e.spacing(-2),
	marginRight: e.spacing(1),
	marginTop: e.spacing(-2),
	maxWidth: e.spacing(3),
	width: e.spacing(3)
})), Sb = (e, t, n) => {
	let r = Array.from(e), [i] = r.splice(t, 1);
	return r.splice(n, 0, i), r;
};
function Cb({ resource: e, layerMetadata: t = {}, index: n, handleOpacityChange: r, setLayerVisibility: i, moveToBackground: a, moveToFront: o }) {
	let { t: s } = V(), { width: c, height: l } = {
		height: void 0,
		width: 40
	}, u = {
		opacity: 1,
		visibility: !!e.preferred,
		...t || {}
	};
	return /* @__PURE__ */ B("div", {
		style: { flex: 1 },
		children: [/* @__PURE__ */ B("div", {
			style: {
				alignItems: "flex-start",
				display: "flex"
			},
			children: [/* @__PURE__ */ z(fn, {
				maxHeight: l,
				maxWidth: c,
				resource: e,
				border: !0
			}), /* @__PURE__ */ B(U, {
				sx: { paddingLeft: 1 },
				component: "div",
				variant: "body1",
				children: [/* @__PURE__ */ z(ln, {
					resource: e,
					fallback: n + 1
				}), /* @__PURE__ */ B("div", { children: [
					/* @__PURE__ */ z(mn, {
						"aria-label": s(u.visibility ? "layer_hide" : "layer_show"),
						edge: "start",
						size: "small",
						onClick: () => {
							i(e.id, !u.visibility);
						},
						children: u.visibility ? /* @__PURE__ */ z(Xa, {}) : /* @__PURE__ */ z(Za, {})
					}),
					u.index !== 0 && /* @__PURE__ */ z(mn, {
						"aria-label": s("layer_moveToBackground"),
						size: "small",
						onClick: () => {
							a(e.id);
						},
						children: /* @__PURE__ */ z(Zf, {})
					}),
					u.index !== t && /* @__PURE__ */ z(mn, {
						"aria-label": s("layer_moveToFront"),
						size: "small",
						onClick: () => {
							o(e.id);
						},
						children: /* @__PURE__ */ z(Qf, {})
					})
				] })]
			})]
		}), /* @__PURE__ */ B("div", {
			style: {
				alignItems: "center",
				display: "flex"
			},
			children: [
				/* @__PURE__ */ z(qn, {
					title: s("layer_opacity"),
					children: /* @__PURE__ */ z($f, {
						sx: { marginRight: .5 },
						color: u.visibility ? "inherit" : "disabled",
						fontSize: "small"
					})
				}),
				/* @__PURE__ */ z(wr, {
					sx: { "MuiInput-input": {
						"&::-webkit-outer-spin-button,&::-webkit-inner-spin-button": {
							margin: 0,
							WebkitAppearance: "none"
						},
						MozAppearance: "textfield",
						textAlign: "right",
						typography: "caption",
						width: "3ch"
					} },
					disabled: !u.visibility,
					value: Math.round(u.opacity * 100),
					type: "number",
					min: 0,
					max: 100,
					onChange: (t) => r(e.id, t.target.value),
					endAdornment: /* @__PURE__ */ z(br, {
						disableTypography: !0,
						position: "end",
						children: /* @__PURE__ */ z(U, {
							variant: "caption",
							children: "%"
						})
					}),
					inputProps: { "aria-label": s("layer_opacity") }
				}),
				/* @__PURE__ */ z(Tr, {
					sx: {
						marginLeft: 2,
						marginRight: 2,
						maxWidth: 150
					},
					disabled: !u.visibility,
					value: u.opacity * 100,
					onChange: (t, n) => r(e.id, n)
				})
			]
		})]
	});
}
Cb.propTypes = {
	handleOpacityChange: W.default.func.isRequired,
	index: W.default.number.isRequired,
	layerMetadata: W.default.objectOf(W.default.shape({
		opacity: W.default.number,
		visibility: W.default.bool
	})),
	moveToBackground: W.default.func.isRequired,
	moveToFront: W.default.func.isRequired,
	resource: W.default.object.isRequired,
	setLayerVisibility: W.default.func.isRequired
};
function wb({ children: e, resource: t, index: n }) {
	let { t: r } = V();
	return /* @__PURE__ */ z(Uy, {
		draggableId: t.id,
		index: n,
		children: (n, i) => /* @__PURE__ */ Tn(Sr, {
			ref: n.innerRef,
			...n.draggableProps,
			component: "li",
			divider: !0,
			sx: {
				alignItems: "stretch",
				cursor: "pointer",
				paddingBottom: 2,
				paddingRight: 2,
				paddingTop: 2,
				...i.isDragging && { backgroundColor: "action.hover" }
			},
			disableGutters: !0,
			key: t.id
		}, /* @__PURE__ */ z(xb, {
			...n.dragHandleProps,
			sx: {
				"&:hover": { backgroundColor: i.isDragging ? "action.selected" : "action.hover" },
				backgroundColor: i.isDragging ? "action.selected" : "shades.light"
			},
			children: /* @__PURE__ */ z(qn, {
				title: r("layer_move"),
				children: /* @__PURE__ */ z(Xf, {})
			})
		}), e)
	});
}
wb.propTypes = {
	children: W.default.node.isRequired,
	index: W.default.number.isRequired,
	resource: W.default.object.isRequired
};
function Tb({ canvasId: e, index: t, label: n, layers: r, layerMetadata: i = {}, totalSize: a, updateLayers: o, windowId: s }) {
	let { t: c } = V(), l = Nn(), u = jn((t, n) => {
		o(s, e, { [t]: { opacity: n / 100 } });
	}, [
		e,
		o,
		s
	]), d = jn((t) => {
		if (!t.destination || t.destination.droppableId !== l || t.source.droppableId !== l) return;
		let n = Sb(r.map((e) => e.id), t.source.index, t.destination.index);
		o(s, e, r.reduce((e, t) => (e[t.id] = { index: n.indexOf(t.id) }, e), {}));
	}, [
		e,
		l,
		r,
		o,
		s
	]), f = jn((t, n) => {
		o(s, e, { [t]: { visibility: n } });
	}, [
		e,
		o,
		s
	]), p = jn((t) => {
		let n = Sb(r.map((e) => e.id), r.findIndex((e) => e.id === t), 0);
		o(s, e, r.reduce((e, t) => (e[t.id] = { index: n.indexOf(t.id) }, e), {}));
	}, [
		e,
		r,
		o,
		s
	]), m = jn((t) => {
		let n = Sb(r.map((e) => e.id), r.findIndex((e) => e.id === t), r.length - 1);
		o(s, e, r.reduce((e, t) => (e[t.id] = { index: n.indexOf(t.id) }, e), {}));
	}, [
		e,
		r,
		o,
		s
	]);
	return /* @__PURE__ */ B(R, { children: [a > 1 && /* @__PURE__ */ z(U, {
		sx: {
			paddingLeft: 1,
			paddingRight: 1,
			paddingTop: 2
		},
		variant: "overline",
		children: c("annotationCanvasLabel", {
			context: `${t + 1}/${a}`,
			label: n
		})
	}), /* @__PURE__ */ z(yy, {
		onDragEnd: d,
		children: /* @__PURE__ */ z(bb, {
			droppableId: l,
			children: (e, t) => /* @__PURE__ */ B(xr, {
				sx: { paddingTop: 0 },
				...e.droppableProps,
				ref: e.innerRef,
				children: [r && r.map((e, t) => /* @__PURE__ */ z(wb, {
					resource: e,
					index: t,
					children: /* @__PURE__ */ z(Cb, {
						resource: e,
						index: t,
						layerMetadata: (i || {})[e.id] || {},
						handleOpacityChange: u,
						setLayerVisibility: f,
						moveToBackground: p,
						moveToFront: m
					})
				}, e.id)), e.placeholder]
			})
		})
	})] });
}
Tb.propTypes = {
	canvasId: W.default.string.isRequired,
	index: W.default.number.isRequired,
	label: W.default.string.isRequired,
	layerMetadata: W.default.objectOf(W.default.shape({ opacity: W.default.number })),
	layers: W.default.arrayOf(W.default.shape({})).isRequired,
	totalSize: W.default.number.isRequired,
	updateLayers: W.default.func.isRequired,
	windowId: W.default.string.isRequired
};
var Eb = n(w((e, { canvasId: t, companionWindowId: n, windowId: r }) => ({
	label: Re(e, {
		canvasId: t,
		companionWindowId: n,
		windowId: r
	}),
	layerMetadata: It(e, {
		canvasId: t,
		companionWindowId: n,
		windowId: r
	}),
	layers: Lt(e, {
		canvasId: t,
		companionWindowId: n,
		windowId: r
	})
}), { updateLayers: _a }))(Tb);
//#endregion
//#region src/components/LayersPanel.jsx
function Db({ canvasIds: e = [], id: t, windowId: n }) {
	let { t: r } = V();
	return /* @__PURE__ */ z(ml, {
		title: r("layers"),
		id: t,
		windowId: n,
		children: e.map((t, r) => /* @__PURE__ */ z(Eb, {
			canvasId: t,
			index: r,
			totalSize: e.length,
			windowId: n
		}, t))
	});
}
Db.propTypes = {
	canvasIds: W.default.arrayOf(W.default.string),
	id: W.default.string.isRequired,
	windowId: W.default.string.isRequired
};
var Ob = n(w((e, { id: t, windowId: n }) => ({ canvasIds: st(e, { windowId: n }) })), m("LayersPanel"))(Db);
//#endregion
//#region src/components/CustomPanel.jsx
function kb({ id: e, children: t = null, title: n, windowId: r }) {
	let { t: i } = V();
	return /* @__PURE__ */ z(ml, {
		title: i(n),
		id: e,
		windowId: r,
		children: t
	});
}
kb.propTypes = {
	children: W.default.node,
	id: W.default.string.isRequired,
	title: W.default.string.isRequired,
	windowId: W.default.string.isRequired
};
var Ab = n(w((e, { id: t, windowId: n }) => ({})), m("CustomPanel"))(kb), jb = M(/*#__PURE__*/ z("path", { d: "m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z" }), "ArrowUpwardSharp");
//#endregion
//#region src/components/WindowSideBarCollectionPanel.jsx
function Mb({ manifest: e, canvasNavigation: t, variant: n, ...r }) {
	return /* @__PURE__ */ B(Xn, {
		alignItems: "flex-start",
		divider: !0,
		component: "li",
		variant: "multiline",
		sx: { paddingRight: 1 },
		...r,
		children: [n === "thumbnail" && /* @__PURE__ */ z(Er, { children: /* @__PURE__ */ z(fn, {
			resource: e,
			maxHeight: t.height,
			maxWidth: t.width
		}) }), /* @__PURE__ */ z(Zn, { children: /* @__PURE__ */ z(ln, { resource: e }) })]
	});
}
Mb.propTypes = {
	canvasNavigation: W.default.shape({
		height: W.default.number,
		width: W.default.number
	}).isRequired,
	manifest: W.default.object.isRequired,
	variant: W.default.string.isRequired
};
function Nb({ canvasNavigation: e, collectionPath: t = [], collection: n = null, id: r, isFetching: i = !1, manifestId: a, parentCollection: o = null, updateCompanionWindow: s, updateWindow: c, variant: l = null, windowId: u }) {
	let { t: d } = V(), f = (() => {
		if (!n) return !1;
		let e = n.getProperty("behavior");
		return e ? Array.isArray(e) ? e.includes("multi-part") : e === "multi-part" : !1;
	})();
	return /* @__PURE__ */ z(ml, {
		title: d(f ? "multipartCollection" : "collection"),
		windowId: u,
		id: r,
		titleControls: /* @__PURE__ */ B(R, { children: [o && /* @__PURE__ */ z(xr, { children: /* @__PURE__ */ B(Cr, {
			onClick: () => s({ collectionPath: t.slice(0, -1) }),
			children: [/* @__PURE__ */ z(Er, { children: /* @__PURE__ */ z(jb, {}) }), /* @__PURE__ */ z(Zn, {
				primaryTypographyProps: { variant: "body1" },
				children: /* @__PURE__ */ z(ln, { resource: o })
			})]
		}) }), /* @__PURE__ */ B(U, {
			variant: "h6",
			children: [n && /* @__PURE__ */ z(ln, { resource: n }), i && /* @__PURE__ */ z(gr, { variant: "text" })]
		})] }),
		children: /* @__PURE__ */ B(Yn, { children: [
			i && /* @__PURE__ */ z(Xn, { children: /* @__PURE__ */ B(Zn, { children: [
				/* @__PURE__ */ z(gr, { variant: "text" }),
				/* @__PURE__ */ z(gr, { variant: "text" }),
				/* @__PURE__ */ z(gr, { variant: "text" })
			] }) }),
			n && n.getCollections().map((n) => /* @__PURE__ */ z(Mb, {
				onClick: () => {
					s({ collectionPath: [...t, n.id] });
				},
				canvasNavigation: e,
				manifest: n,
				variant: l,
				selected: a === n.id
			}, n.id)),
			n && n.getManifests().map((n) => /* @__PURE__ */ z(Mb, {
				onClick: () => {
					c({
						canvasId: null,
						collectionPath: t,
						manifestId: n.id
					}), s({ multipart: !1 });
				},
				canvasNavigation: e,
				manifest: n,
				variant: l,
				selected: a === n.id
			}, n.id))
		] })
	});
}
Nb.propTypes = {
	canvasNavigation: W.default.shape({
		height: W.default.number,
		width: W.default.number
	}).isRequired,
	collection: W.default.object,
	collectionPath: W.default.arrayOf(W.default.string),
	id: W.default.string.isRequired,
	isFetching: W.default.bool,
	manifestId: W.default.string.isRequired,
	parentCollection: W.default.object,
	updateCompanionWindow: W.default.func.isRequired,
	updateWindow: W.default.func.isRequired,
	variant: W.default.string,
	windowId: W.default.string.isRequired
};
var Pb = n(w((e, { id: t, windowId: n }) => {
	let r = s(e, { windowId: n }), i = se(e, { companionWindowId: t }), { collectionPath: a } = i, o = a || r.collectionPath, c = o && o[o.length - 1], l = o && o[o.length - 2], u = c && b(e, { manifestId: c }), d = l && b(e, { manifestId: l }), f = b(e, { windowId: n });
	return {
		canvasNavigation: e.config.canvasNavigation,
		collection: u && ze(e, { manifestId: u.id }),
		collectionId: c,
		collectionPath: o,
		error: u && u.error,
		isFetching: u && u.isFetching,
		manifestId: f && f.id,
		parentCollection: d && ze(e, { manifestId: d.id }),
		ready: u && !!u.json,
		variant: i.variant || Ei(e, { windowId: n })
	};
}, (e, { id: t, windowId: n }) => ({
	updateCompanionWindow: (...r) => e(Fi(n, t, ...r)),
	updateWindow: (...t) => e(qt(n, ...t))
})), m("WindowSideBarCollectionPanel"))(Nb), Fb = {
	annotations: _l,
	attribution: gf,
	canvas: of,
	collection: Pb,
	custom: Ab,
	info: Ll,
	layers: Ob,
	search: Yf,
	thumbnailNavigation: Ya
}, Ib = wn({ dragDropManager: void 0 });
//#endregion
//#region node_modules/dnd-core/node_modules/redux/es/redux.js
function Lb(e) {
	return "Minified Redux error #" + e + "; visit https://redux.js.org/Errors?code=" + e + " for the full message or use the non-minified dev environment for full errors. ";
}
var Rb = (function() {
	return typeof Symbol == "function" && Symbol.observable || "@@observable";
})(), zb = function() {
	return Math.random().toString(36).substring(7).split("").join(".");
}, Bb = {
	INIT: "@@redux/INIT" + zb(),
	REPLACE: "@@redux/REPLACE" + zb(),
	PROBE_UNKNOWN_ACTION: function() {
		return "@@redux/PROBE_UNKNOWN_ACTION" + zb();
	}
};
function Vb(e) {
	if (typeof e != "object" || !e) return !1;
	for (var t = e; Object.getPrototypeOf(t) !== null;) t = Object.getPrototypeOf(t);
	return Object.getPrototypeOf(e) === t;
}
function Hb(e, t, n) {
	var r;
	if (typeof t == "function" && typeof n == "function" || typeof n == "function" && typeof arguments[3] == "function") throw Error(Lb(0));
	if (typeof t == "function" && n === void 0 && (n = t, t = void 0), n !== void 0) {
		if (typeof n != "function") throw Error(Lb(1));
		return n(Hb)(e, t);
	}
	if (typeof e != "function") throw Error(Lb(2));
	var i = e, a = t, o = [], s = o, c = !1;
	function l() {
		s === o && (s = o.slice());
	}
	function u() {
		if (c) throw Error(Lb(3));
		return a;
	}
	function d(e) {
		if (typeof e != "function") throw Error(Lb(4));
		if (c) throw Error(Lb(5));
		var t = !0;
		return l(), s.push(e), function() {
			if (t) {
				if (c) throw Error(Lb(6));
				t = !1, l();
				var n = s.indexOf(e);
				s.splice(n, 1), o = null;
			}
		};
	}
	function f(e) {
		if (!Vb(e)) throw Error(Lb(7));
		if (e.type === void 0) throw Error(Lb(8));
		if (c) throw Error(Lb(9));
		try {
			c = !0, a = i(a, e);
		} finally {
			c = !1;
		}
		for (var t = o = s, n = 0; n < t.length; n++) {
			var r = t[n];
			r();
		}
		return e;
	}
	function p(e) {
		if (typeof e != "function") throw Error(Lb(10));
		i = e, f({ type: Bb.REPLACE });
	}
	function m() {
		var e, t = d;
		return e = { subscribe: function(e) {
			if (typeof e != "object" || !e) throw Error(Lb(11));
			function n() {
				e.next && e.next(u());
			}
			return n(), { unsubscribe: t(n) };
		} }, e[Rb] = function() {
			return this;
		}, e;
	}
	return f({ type: Bb.INIT }), r = {
		dispatch: f,
		subscribe: d,
		getState: u,
		replaceReducer: p
	}, r[Rb] = m, r;
}
//#endregion
//#region node_modules/@react-dnd/invariant/dist/index.js
function Q(e, t, ...n) {
	if (Ub() && t === void 0) throw Error("invariant requires an error message argument");
	if (!e) {
		let e;
		if (t === void 0) e = /* @__PURE__ */ Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
		else {
			let r = 0;
			e = Error(t.replace(/%s/g, function() {
				return n[r++];
			})), e.name = "Invariant Violation";
		}
		throw e.framesToPop = 1, e;
	}
}
function Ub() {
	return typeof process < "u" && !0;
}
//#endregion
//#region node_modules/dnd-core/dist/utils/js_utils.js
function Wb(e, t, n) {
	return t.split(".").reduce((e, t) => e && e[t] ? e[t] : n || null, e);
}
function Gb(e, t) {
	return e.filter((e) => e !== t);
}
function Kb(e) {
	return typeof e == "object";
}
function qb(e, t) {
	let n = /* @__PURE__ */ new Map(), r = (e) => {
		n.set(e, n.has(e) ? n.get(e) + 1 : 1);
	};
	e.forEach(r), t.forEach(r);
	let i = [];
	return n.forEach((e, t) => {
		e === 1 && i.push(t);
	}), i;
}
function Jb(e, t) {
	return e.filter((e) => t.indexOf(e) > -1);
}
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/types.js
var Yb = "dnd-core/INIT_COORDS", Xb = "dnd-core/BEGIN_DRAG", Zb = "dnd-core/PUBLISH_DRAG_SOURCE", Qb = "dnd-core/HOVER", $b = "dnd-core/DROP", ex = "dnd-core/END_DRAG";
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/local/setClientOffset.js
function tx(e, t) {
	return {
		type: Yb,
		payload: {
			sourceClientOffset: t || null,
			clientOffset: e || null
		}
	};
}
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/beginDrag.js
var nx = {
	type: Yb,
	payload: {
		clientOffset: null,
		sourceClientOffset: null
	}
};
function rx(e) {
	return function(t = [], n = { publishSource: !0 }) {
		let { publishSource: r = !0, clientOffset: i, getSourceClientOffset: a } = n, o = e.getMonitor(), s = e.getRegistry();
		e.dispatch(tx(i)), ix(t, o, s);
		let c = sx(t, o);
		if (c == null) {
			e.dispatch(nx);
			return;
		}
		let l = null;
		if (i) {
			if (!a) throw Error("getSourceClientOffset must be defined");
			ax(a), l = a(c);
		}
		e.dispatch(tx(i, l));
		let u = s.getSource(c).beginDrag(o, c);
		return u == null ? void 0 : (ox(u), s.pinSource(c), {
			type: Xb,
			payload: {
				itemType: s.getSourceType(c),
				item: u,
				sourceId: c,
				clientOffset: i || null,
				sourceClientOffset: l || null,
				isSourcePublic: !!r
			}
		});
	};
}
function ix(e, t, n) {
	Q(!t.isDragging(), "Cannot call beginDrag while dragging."), e.forEach(function(e) {
		Q(n.getSource(e), "Expected sourceIds to be registered.");
	});
}
function ax(e) {
	Q(typeof e == "function", "When clientOffset is provided, getSourceClientOffset must be a function.");
}
function ox(e) {
	Q(Kb(e), "Item must be an object.");
}
function sx(e, t) {
	let n = null;
	for (let r = e.length - 1; r >= 0; r--) if (t.canDragSource(e[r])) {
		n = e[r];
		break;
	}
	return n;
}
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/drop.js
function cx(e, t, n) {
	return t in e ? Object.defineProperty(e, t, {
		value: n,
		enumerable: !0,
		configurable: !0,
		writable: !0
	}) : e[t] = n, e;
}
function lx(e) {
	for (var t = 1; t < arguments.length; t++) {
		var n = arguments[t] == null ? {} : arguments[t], r = Object.keys(n);
		typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(n).filter(function(e) {
			return Object.getOwnPropertyDescriptor(n, e).enumerable;
		}))), r.forEach(function(t) {
			cx(e, t, n[t]);
		});
	}
	return e;
}
function ux(e) {
	return function(t = {}) {
		let n = e.getMonitor(), r = e.getRegistry();
		dx(n), mx(n).forEach((i, a) => {
			let o = {
				type: $b,
				payload: { dropResult: lx({}, t, fx(i, a, r, n)) }
			};
			e.dispatch(o);
		});
	};
}
function dx(e) {
	Q(e.isDragging(), "Cannot call drop while not dragging."), Q(!e.didDrop(), "Cannot call drop twice during one drag operation.");
}
function fx(e, t, n, r) {
	let i = n.getTarget(e), a = i ? i.drop(r, e) : void 0;
	return px(a), a === void 0 && (a = t === 0 ? {} : r.getDropResult()), a;
}
function px(e) {
	Q(e === void 0 || Kb(e), "Drop result must either be an object or undefined.");
}
function mx(e) {
	let t = e.getTargetIds().filter(e.canDropOnTarget, e);
	return t.reverse(), t;
}
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/endDrag.js
function hx(e) {
	return function() {
		let t = e.getMonitor(), n = e.getRegistry();
		gx(t);
		let r = t.getSourceId();
		return r != null && (n.getSource(r, !0).endDrag(t, r), n.unpinSource()), { type: ex };
	};
}
function gx(e) {
	Q(e.isDragging(), "Cannot call endDrag while not dragging.");
}
//#endregion
//#region node_modules/dnd-core/dist/utils/matchesType.js
function _x(e, t) {
	return t === null ? e === null : Array.isArray(e) ? e.some((e) => e === t) : e === t;
}
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/hover.js
function vx(e) {
	return function(t, { clientOffset: n } = {}) {
		yx(t);
		let r = t.slice(0), i = e.getMonitor(), a = e.getRegistry();
		return xx(r, a, i.getItemType()), bx(r, i, a), Sx(r, i, a), {
			type: Qb,
			payload: {
				targetIds: r,
				clientOffset: n || null
			}
		};
	};
}
function yx(e) {
	Q(Array.isArray(e), "Expected targetIds to be an array.");
}
function bx(e, t, n) {
	Q(t.isDragging(), "Cannot call hover while not dragging."), Q(!t.didDrop(), "Cannot call hover after drop.");
	for (let t = 0; t < e.length; t++) {
		let r = e[t];
		Q(e.lastIndexOf(r) === t, "Expected targetIds to be unique in the passed array."), Q(n.getTarget(r), "Expected targetIds to be registered.");
	}
}
function xx(e, t, n) {
	for (let r = e.length - 1; r >= 0; r--) {
		let i = e[r];
		_x(t.getTargetType(i), n) || e.splice(r, 1);
	}
}
function Sx(e, t, n) {
	e.forEach(function(e) {
		n.getTarget(e).hover(t, e);
	});
}
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/publishDragSource.js
function Cx(e) {
	return function() {
		if (e.getMonitor().isDragging()) return { type: Zb };
	};
}
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/index.js
function wx(e) {
	return {
		beginDrag: rx(e),
		publishDragSource: Cx(e),
		hover: vx(e),
		drop: ux(e),
		endDrag: hx(e)
	};
}
//#endregion
//#region node_modules/dnd-core/dist/classes/DragDropManagerImpl.js
var Tx = class {
	receiveBackend(e) {
		this.backend = e;
	}
	getMonitor() {
		return this.monitor;
	}
	getBackend() {
		return this.backend;
	}
	getRegistry() {
		return this.monitor.registry;
	}
	getActions() {
		let e = this, { dispatch: t } = this.store;
		function n(n) {
			return (...r) => {
				let i = n.apply(e, r);
				i !== void 0 && t(i);
			};
		}
		let r = wx(this);
		return Object.keys(r).reduce((e, t) => {
			let i = r[t];
			return e[t] = n(i), e;
		}, {});
	}
	dispatch(e) {
		this.store.dispatch(e);
	}
	constructor(e, t) {
		this.isSetUp = !1, this.handleRefCountChange = () => {
			let e = this.store.getState().refCount > 0;
			this.backend && (e && !this.isSetUp ? (this.backend.setup(), this.isSetUp = !0) : !e && this.isSetUp && (this.backend.teardown(), this.isSetUp = !1));
		}, this.store = e, this.monitor = t, e.subscribe(this.handleRefCountChange);
	}
};
//#endregion
//#region node_modules/dnd-core/dist/utils/coords.js
function Ex(e, t) {
	return {
		x: e.x + t.x,
		y: e.y + t.y
	};
}
function Dx(e, t) {
	return {
		x: e.x - t.x,
		y: e.y - t.y
	};
}
function Ox(e) {
	let { clientOffset: t, initialClientOffset: n, initialSourceClientOffset: r } = e;
	return !t || !n || !r ? null : Dx(Ex(t, r), n);
}
function kx(e) {
	let { clientOffset: t, initialClientOffset: n } = e;
	return !t || !n ? null : Dx(t, n);
}
//#endregion
//#region node_modules/dnd-core/dist/utils/dirtiness.js
var Ax = [], jx = [];
Ax.__IS_NONE__ = !0, jx.__IS_ALL__ = !0;
function Mx(e, t) {
	return e === Ax ? !1 : e === jx || t === void 0 || Jb(t, e).length > 0;
}
//#endregion
//#region node_modules/dnd-core/dist/classes/DragDropMonitorImpl.js
var Nx = class {
	subscribeToStateChange(e, t = {}) {
		let { handlerIds: n } = t;
		Q(typeof e == "function", "listener must be a function."), Q(n === void 0 || Array.isArray(n), "handlerIds, when specified, must be an array of strings.");
		let r = this.store.getState().stateId;
		return this.store.subscribe(() => {
			let t = this.store.getState(), i = t.stateId;
			try {
				i === r || i === r + 1 && !Mx(t.dirtyHandlerIds, n) || e();
			} finally {
				r = i;
			}
		});
	}
	subscribeToOffsetChange(e) {
		Q(typeof e == "function", "listener must be a function.");
		let t = this.store.getState().dragOffset;
		return this.store.subscribe(() => {
			let n = this.store.getState().dragOffset;
			n !== t && (t = n, e());
		});
	}
	canDragSource(e) {
		if (!e) return !1;
		let t = this.registry.getSource(e);
		return Q(t, `Expected to find a valid source. sourceId=${e}`), !this.isDragging() && t.canDrag(this, e);
	}
	canDropOnTarget(e) {
		if (!e) return !1;
		let t = this.registry.getTarget(e);
		return Q(t, `Expected to find a valid target. targetId=${e}`), !this.isDragging() || this.didDrop() ? !1 : _x(this.registry.getTargetType(e), this.getItemType()) && t.canDrop(this, e);
	}
	isDragging() {
		return !!this.getItemType();
	}
	isDraggingSource(e) {
		if (!e) return !1;
		let t = this.registry.getSource(e, !0);
		return Q(t, `Expected to find a valid source. sourceId=${e}`), !this.isDragging() || !this.isSourcePublic() || this.registry.getSourceType(e) !== this.getItemType() ? !1 : t.isDragging(this, e);
	}
	isOverTarget(e, t = { shallow: !1 }) {
		if (!e) return !1;
		let { shallow: n } = t;
		if (!this.isDragging()) return !1;
		let r = this.registry.getTargetType(e), i = this.getItemType();
		if (i && !_x(r, i)) return !1;
		let a = this.getTargetIds();
		if (!a.length) return !1;
		let o = a.indexOf(e);
		return n ? o === a.length - 1 : o > -1;
	}
	getItemType() {
		return this.store.getState().dragOperation.itemType;
	}
	getItem() {
		return this.store.getState().dragOperation.item;
	}
	getSourceId() {
		return this.store.getState().dragOperation.sourceId;
	}
	getTargetIds() {
		return this.store.getState().dragOperation.targetIds;
	}
	getDropResult() {
		return this.store.getState().dragOperation.dropResult;
	}
	didDrop() {
		return this.store.getState().dragOperation.didDrop;
	}
	isSourcePublic() {
		return !!this.store.getState().dragOperation.isSourcePublic;
	}
	getInitialClientOffset() {
		return this.store.getState().dragOffset.initialClientOffset;
	}
	getInitialSourceClientOffset() {
		return this.store.getState().dragOffset.initialSourceClientOffset;
	}
	getClientOffset() {
		return this.store.getState().dragOffset.clientOffset;
	}
	getSourceClientOffset() {
		return Ox(this.store.getState().dragOffset);
	}
	getDifferenceFromInitialOffset() {
		return kx(this.store.getState().dragOffset);
	}
	constructor(e, t) {
		this.store = e, this.registry = t;
	}
}, Px = typeof global < "u" ? global : self, Fx = Px.MutationObserver || Px.WebKitMutationObserver;
function Ix(e) {
	return function() {
		let t = setTimeout(r, 0), n = setInterval(r, 50);
		function r() {
			clearTimeout(t), clearInterval(n), e();
		}
	};
}
function Lx(e) {
	let t = 1, n = new Fx(e), r = document.createTextNode("");
	return n.observe(r, { characterData: !0 }), function() {
		t = -t, r.data = t;
	};
}
var Rx = typeof Fx == "function" ? Lx : Ix, zx = class {
	enqueueTask(e) {
		let { queue: t, requestFlush: n } = this;
		t.length || (n(), this.flushing = !0), t[t.length] = e;
	}
	constructor() {
		this.queue = [], this.pendingErrors = [], this.flushing = !1, this.index = 0, this.capacity = 1024, this.flush = () => {
			let { queue: e } = this;
			for (; this.index < e.length;) {
				let t = this.index;
				if (this.index++, e[t].call(), this.index > this.capacity) {
					for (let t = 0, n = e.length - this.index; t < n; t++) e[t] = e[t + this.index];
					e.length -= this.index, this.index = 0;
				}
			}
			e.length = 0, this.index = 0, this.flushing = !1;
		}, this.registerPendingError = (e) => {
			this.pendingErrors.push(e), this.requestErrorThrow();
		}, this.requestFlush = Rx(this.flush), this.requestErrorThrow = Ix(() => {
			if (this.pendingErrors.length) throw this.pendingErrors.shift();
		});
	}
}, Bx = class {
	call() {
		try {
			this.task && this.task();
		} catch (e) {
			this.onError(e);
		} finally {
			this.task = null, this.release(this);
		}
	}
	constructor(e, t) {
		this.onError = e, this.release = t, this.task = null;
	}
}, Vx = class {
	create(e) {
		let t = this.freeTasks, n = t.length ? t.pop() : new Bx(this.onError, (e) => t[t.length] = e);
		return n.task = e, n;
	}
	constructor(e) {
		this.onError = e, this.freeTasks = [];
	}
}, Hx = new zx(), Ux = new Vx(Hx.registerPendingError);
function Wx(e) {
	Hx.enqueueTask(Ux.create(e));
}
//#endregion
//#region node_modules/dnd-core/dist/actions/registry.js
var Gx = "dnd-core/ADD_SOURCE", Kx = "dnd-core/ADD_TARGET", qx = "dnd-core/REMOVE_SOURCE", Jx = "dnd-core/REMOVE_TARGET";
function Yx(e) {
	return {
		type: Gx,
		payload: { sourceId: e }
	};
}
function Xx(e) {
	return {
		type: Kx,
		payload: { targetId: e }
	};
}
function Zx(e) {
	return {
		type: qx,
		payload: { sourceId: e }
	};
}
function Qx(e) {
	return {
		type: Jx,
		payload: { targetId: e }
	};
}
//#endregion
//#region node_modules/dnd-core/dist/contracts.js
function $x(e) {
	Q(typeof e.canDrag == "function", "Expected canDrag to be a function."), Q(typeof e.beginDrag == "function", "Expected beginDrag to be a function."), Q(typeof e.endDrag == "function", "Expected endDrag to be a function.");
}
function eS(e) {
	Q(typeof e.canDrop == "function", "Expected canDrop to be a function."), Q(typeof e.hover == "function", "Expected hover to be a function."), Q(typeof e.drop == "function", "Expected beginDrag to be a function.");
}
function tS(e, t) {
	if (t && Array.isArray(e)) {
		e.forEach((e) => tS(e, !1));
		return;
	}
	Q(typeof e == "string" || typeof e == "symbol", t ? "Type can only be a string, a symbol, or an array of either." : "Type can only be a string or a symbol.");
}
//#endregion
//#region node_modules/dnd-core/dist/interfaces.js
var nS;
(function(e) {
	e.SOURCE = "SOURCE", e.TARGET = "TARGET";
})(nS ||= {});
//#endregion
//#region node_modules/dnd-core/dist/utils/getNextUniqueId.js
var rS = 0;
function iS() {
	return rS++;
}
//#endregion
//#region node_modules/dnd-core/dist/classes/HandlerRegistryImpl.js
function aS(e) {
	let t = iS().toString();
	switch (e) {
		case nS.SOURCE: return `S${t}`;
		case nS.TARGET: return `T${t}`;
		default: throw Error(`Unknown Handler Role: ${e}`);
	}
}
function oS(e) {
	switch (e[0]) {
		case "S": return nS.SOURCE;
		case "T": return nS.TARGET;
		default: throw Error(`Cannot parse handler ID: ${e}`);
	}
}
function sS(e, t) {
	let n = e.entries(), r = !1;
	do {
		let { done: e, value: [, i] } = n.next();
		if (i === t) return !0;
		r = !!e;
	} while (!r);
	return !1;
}
var cS = class {
	addSource(e, t) {
		tS(e), $x(t);
		let n = this.addHandler(nS.SOURCE, e, t);
		return this.store.dispatch(Yx(n)), n;
	}
	addTarget(e, t) {
		tS(e, !0), eS(t);
		let n = this.addHandler(nS.TARGET, e, t);
		return this.store.dispatch(Xx(n)), n;
	}
	containsHandler(e) {
		return sS(this.dragSources, e) || sS(this.dropTargets, e);
	}
	getSource(e, t = !1) {
		return Q(this.isSourceId(e), "Expected a valid source ID."), t && e === this.pinnedSourceId ? this.pinnedSource : this.dragSources.get(e);
	}
	getTarget(e) {
		return Q(this.isTargetId(e), "Expected a valid target ID."), this.dropTargets.get(e);
	}
	getSourceType(e) {
		return Q(this.isSourceId(e), "Expected a valid source ID."), this.types.get(e);
	}
	getTargetType(e) {
		return Q(this.isTargetId(e), "Expected a valid target ID."), this.types.get(e);
	}
	isSourceId(e) {
		return oS(e) === nS.SOURCE;
	}
	isTargetId(e) {
		return oS(e) === nS.TARGET;
	}
	removeSource(e) {
		Q(this.getSource(e), "Expected an existing source."), this.store.dispatch(Zx(e)), Wx(() => {
			this.dragSources.delete(e), this.types.delete(e);
		});
	}
	removeTarget(e) {
		Q(this.getTarget(e), "Expected an existing target."), this.store.dispatch(Qx(e)), this.dropTargets.delete(e), this.types.delete(e);
	}
	pinSource(e) {
		let t = this.getSource(e);
		Q(t, "Expected an existing source."), this.pinnedSourceId = e, this.pinnedSource = t;
	}
	unpinSource() {
		Q(this.pinnedSource, "No source is pinned at the time."), this.pinnedSourceId = null, this.pinnedSource = null;
	}
	addHandler(e, t, n) {
		let r = aS(e);
		return this.types.set(r, t), e === nS.SOURCE ? this.dragSources.set(r, n) : e === nS.TARGET && this.dropTargets.set(r, n), r;
	}
	constructor(e) {
		this.types = /* @__PURE__ */ new Map(), this.dragSources = /* @__PURE__ */ new Map(), this.dropTargets = /* @__PURE__ */ new Map(), this.pinnedSourceId = null, this.pinnedSource = null, this.store = e;
	}
}, lS = (e, t) => e === t;
function uS(e, t) {
	return !e && !t ? !0 : !e || !t ? !1 : e.x === t.x && e.y === t.y;
}
function dS(e, t, n = lS) {
	if (e.length !== t.length) return !1;
	for (let r = 0; r < e.length; ++r) if (!n(e[r], t[r])) return !1;
	return !0;
}
//#endregion
//#region node_modules/dnd-core/dist/reducers/dirtyHandlerIds.js
function fS(e = Ax, t) {
	switch (t.type) {
		case Qb: break;
		case Gx:
		case Kx:
		case Jx:
		case qx: return Ax;
		case Xb:
		case Zb:
		case ex:
		case $b:
		default: return jx;
	}
	let { targetIds: n = [], prevTargetIds: r = [] } = t.payload, i = qb(n, r);
	if (!(i.length > 0 || !dS(n, r))) return Ax;
	let a = r[r.length - 1], o = n[n.length - 1];
	return a !== o && (a && i.push(a), o && i.push(o)), i;
}
//#endregion
//#region node_modules/dnd-core/dist/reducers/dragOffset.js
function pS(e, t, n) {
	return t in e ? Object.defineProperty(e, t, {
		value: n,
		enumerable: !0,
		configurable: !0,
		writable: !0
	}) : e[t] = n, e;
}
function mS(e) {
	for (var t = 1; t < arguments.length; t++) {
		var n = arguments[t] == null ? {} : arguments[t], r = Object.keys(n);
		typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(n).filter(function(e) {
			return Object.getOwnPropertyDescriptor(n, e).enumerable;
		}))), r.forEach(function(t) {
			pS(e, t, n[t]);
		});
	}
	return e;
}
var hS = {
	initialSourceClientOffset: null,
	initialClientOffset: null,
	clientOffset: null
};
function gS(e = hS, t) {
	let { payload: n } = t;
	switch (t.type) {
		case Yb:
		case Xb: return {
			initialSourceClientOffset: n.sourceClientOffset,
			initialClientOffset: n.clientOffset,
			clientOffset: n.clientOffset
		};
		case Qb: return uS(e.clientOffset, n.clientOffset) ? e : mS({}, e, { clientOffset: n.clientOffset });
		case ex:
		case $b: return hS;
		default: return e;
	}
}
//#endregion
//#region node_modules/dnd-core/dist/reducers/dragOperation.js
function _S(e, t, n) {
	return t in e ? Object.defineProperty(e, t, {
		value: n,
		enumerable: !0,
		configurable: !0,
		writable: !0
	}) : e[t] = n, e;
}
function vS(e) {
	for (var t = 1; t < arguments.length; t++) {
		var n = arguments[t] == null ? {} : arguments[t], r = Object.keys(n);
		typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(n).filter(function(e) {
			return Object.getOwnPropertyDescriptor(n, e).enumerable;
		}))), r.forEach(function(t) {
			_S(e, t, n[t]);
		});
	}
	return e;
}
var yS = {
	itemType: null,
	item: null,
	sourceId: null,
	targetIds: [],
	dropResult: null,
	didDrop: !1,
	isSourcePublic: null
};
function bS(e = yS, t) {
	let { payload: n } = t;
	switch (t.type) {
		case Xb: return vS({}, e, {
			itemType: n.itemType,
			item: n.item,
			sourceId: n.sourceId,
			isSourcePublic: n.isSourcePublic,
			dropResult: null,
			didDrop: !1
		});
		case Zb: return vS({}, e, { isSourcePublic: !0 });
		case Qb: return vS({}, e, { targetIds: n.targetIds });
		case Jx: return e.targetIds.indexOf(n.targetId) === -1 ? e : vS({}, e, { targetIds: Gb(e.targetIds, n.targetId) });
		case $b: return vS({}, e, {
			dropResult: n.dropResult,
			didDrop: !0,
			targetIds: []
		});
		case ex: return vS({}, e, {
			itemType: null,
			item: null,
			sourceId: null,
			dropResult: null,
			didDrop: !1,
			isSourcePublic: null,
			targetIds: []
		});
		default: return e;
	}
}
//#endregion
//#region node_modules/dnd-core/dist/reducers/refCount.js
function xS(e = 0, t) {
	switch (t.type) {
		case Gx:
		case Kx: return e + 1;
		case qx:
		case Jx: return e - 1;
		default: return e;
	}
}
//#endregion
//#region node_modules/dnd-core/dist/reducers/stateId.js
function SS(e = 0) {
	return e + 1;
}
//#endregion
//#region node_modules/dnd-core/dist/reducers/index.js
function CS(e, t, n) {
	return t in e ? Object.defineProperty(e, t, {
		value: n,
		enumerable: !0,
		configurable: !0,
		writable: !0
	}) : e[t] = n, e;
}
function wS(e) {
	for (var t = 1; t < arguments.length; t++) {
		var n = arguments[t] == null ? {} : arguments[t], r = Object.keys(n);
		typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(n).filter(function(e) {
			return Object.getOwnPropertyDescriptor(n, e).enumerable;
		}))), r.forEach(function(t) {
			CS(e, t, n[t]);
		});
	}
	return e;
}
function TS(e = {}, t) {
	return {
		dirtyHandlerIds: fS(e.dirtyHandlerIds, {
			type: t.type,
			payload: wS({}, t.payload, { prevTargetIds: Wb(e, "dragOperation.targetIds", []) })
		}),
		dragOffset: gS(e.dragOffset, t),
		refCount: xS(e.refCount, t),
		dragOperation: bS(e.dragOperation, t),
		stateId: SS(e.stateId)
	};
}
//#endregion
//#region node_modules/dnd-core/dist/createDragDropManager.js
function ES(e, t = void 0, n = {}, r = !1) {
	let i = DS(r), a = new Tx(i, new Nx(i, new cS(i))), o = e(a, t, n);
	return a.receiveBackend(o), a;
}
function DS(e) {
	let t = typeof window < "u" && window.__REDUX_DEVTOOLS_EXTENSION__;
	return Hb(TS, e && t && t({
		name: "dnd-core",
		instanceId: "dnd-core"
	}));
}
//#endregion
//#region node_modules/react-dnd/dist/core/DndProvider.js
function OS(e, t) {
	if (e == null) return {};
	var n = kS(e, t), r, i;
	if (Object.getOwnPropertySymbols) {
		var a = Object.getOwnPropertySymbols(e);
		for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
	}
	return n;
}
function kS(e, t) {
	if (e == null) return {};
	var n = {}, r = Object.keys(e), i, a;
	for (a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
	return n;
}
var AS = 0, jS = Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"), MS = /*#__PURE__*/ An(function(e) {
	var { children: t } = e;
	let [n, r] = NS(OS(e, ["children"]));
	return F(() => {
		if (r) {
			let e = FS();
			return ++AS, () => {
				--AS === 0 && (e[jS] = null);
			};
		}
	}, []), /*#__PURE__*/ z(Ib.Provider, {
		value: n,
		children: t
	});
});
function NS(e) {
	return "manager" in e ? [{ dragDropManager: e.manager }, !1] : [PS(e.backend, e.context, e.options, e.debugMode), !e.context];
}
function PS(e, t = FS(), n, r) {
	let i = t;
	return i[jS] || (i[jS] = { dragDropManager: ES(e, t, n, r) }), i[jS];
}
function FS() {
	return typeof global < "u" ? global : window;
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useIsomorphicLayoutEffect.js
var IS = /* @__PURE__ */ p((/* @__PURE__ */ D(((e, t) => {
	t.exports = function e(t, n) {
		if (t === n) return !0;
		if (t && n && typeof t == "object" && typeof n == "object") {
			if (t.constructor !== n.constructor) return !1;
			var r, i, a;
			if (Array.isArray(t)) {
				if (r = t.length, r != n.length) return !1;
				for (i = r; i-- !== 0;) if (!e(t[i], n[i])) return !1;
				return !0;
			}
			if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;
			if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();
			if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();
			if (a = Object.keys(t), r = a.length, r !== Object.keys(n).length) return !1;
			for (i = r; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(n, a[i])) return !1;
			for (i = r; i-- !== 0;) {
				var o = a[i];
				if (!e(t[o], n[o])) return !1;
			}
			return !0;
		}
		return t !== t && n !== n;
	};
})))(), 1), LS = typeof window < "u" ? Fn : F;
//#endregion
//#region node_modules/react-dnd/dist/hooks/useCollector.js
function RS(e, t, n) {
	let [r, i] = L(() => t(e)), a = jn(() => {
		let a = t(e);
		(0, IS.default)(r, a) || (i(a), n && n());
	}, [
		r,
		e,
		n
	]);
	return LS(a), [r, a];
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useMonitorOutput.js
function zS(e, t, n) {
	let [r, i] = RS(e, t, n);
	return LS(function() {
		let t = e.getHandlerId();
		if (t != null) return e.subscribeToStateChange(i, { handlerIds: [t] });
	}, [e, i]), r;
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useCollectedProps.js
function BS(e, t, n) {
	return zS(t, e || (() => ({})), () => n.reconnect());
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useOptionalFactory.js
function VS(e, t) {
	let n = [...t || []];
	return t == null && typeof e != "function" && n.push(e), In(() => typeof e == "function" ? e() : e, n);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/connectors.js
function HS(e) {
	return In(() => e.hooks.dragSource(), [e]);
}
function US(e) {
	return In(() => e.hooks.dragPreview(), [e]);
}
//#endregion
//#region node_modules/react-dnd/dist/internals/DragSourceMonitorImpl.js
var WS = !1, GS = !1, KS = class {
	receiveHandlerId(e) {
		this.sourceId = e;
	}
	getHandlerId() {
		return this.sourceId;
	}
	canDrag() {
		Q(!WS, "You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");
		try {
			return WS = !0, this.internalMonitor.canDragSource(this.sourceId);
		} finally {
			WS = !1;
		}
	}
	isDragging() {
		if (!this.sourceId) return !1;
		Q(!GS, "You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");
		try {
			return GS = !0, this.internalMonitor.isDraggingSource(this.sourceId);
		} finally {
			GS = !1;
		}
	}
	subscribeToStateChange(e, t) {
		return this.internalMonitor.subscribeToStateChange(e, t);
	}
	isDraggingSource(e) {
		return this.internalMonitor.isDraggingSource(e);
	}
	isOverTarget(e, t) {
		return this.internalMonitor.isOverTarget(e, t);
	}
	getTargetIds() {
		return this.internalMonitor.getTargetIds();
	}
	isSourcePublic() {
		return this.internalMonitor.isSourcePublic();
	}
	getSourceId() {
		return this.internalMonitor.getSourceId();
	}
	subscribeToOffsetChange(e) {
		return this.internalMonitor.subscribeToOffsetChange(e);
	}
	canDragSource(e) {
		return this.internalMonitor.canDragSource(e);
	}
	canDropOnTarget(e) {
		return this.internalMonitor.canDropOnTarget(e);
	}
	getItemType() {
		return this.internalMonitor.getItemType();
	}
	getItem() {
		return this.internalMonitor.getItem();
	}
	getDropResult() {
		return this.internalMonitor.getDropResult();
	}
	didDrop() {
		return this.internalMonitor.didDrop();
	}
	getInitialClientOffset() {
		return this.internalMonitor.getInitialClientOffset();
	}
	getInitialSourceClientOffset() {
		return this.internalMonitor.getInitialSourceClientOffset();
	}
	getSourceClientOffset() {
		return this.internalMonitor.getSourceClientOffset();
	}
	getClientOffset() {
		return this.internalMonitor.getClientOffset();
	}
	getDifferenceFromInitialOffset() {
		return this.internalMonitor.getDifferenceFromInitialOffset();
	}
	constructor(e) {
		this.sourceId = null, this.internalMonitor = e.getMonitor();
	}
}, qS = !1, JS = class {
	receiveHandlerId(e) {
		this.targetId = e;
	}
	getHandlerId() {
		return this.targetId;
	}
	subscribeToStateChange(e, t) {
		return this.internalMonitor.subscribeToStateChange(e, t);
	}
	canDrop() {
		if (!this.targetId) return !1;
		Q(!qS, "You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");
		try {
			return qS = !0, this.internalMonitor.canDropOnTarget(this.targetId);
		} finally {
			qS = !1;
		}
	}
	isOver(e) {
		return this.targetId ? this.internalMonitor.isOverTarget(this.targetId, e) : !1;
	}
	getItemType() {
		return this.internalMonitor.getItemType();
	}
	getItem() {
		return this.internalMonitor.getItem();
	}
	getDropResult() {
		return this.internalMonitor.getDropResult();
	}
	didDrop() {
		return this.internalMonitor.didDrop();
	}
	getInitialClientOffset() {
		return this.internalMonitor.getInitialClientOffset();
	}
	getInitialSourceClientOffset() {
		return this.internalMonitor.getInitialSourceClientOffset();
	}
	getSourceClientOffset() {
		return this.internalMonitor.getSourceClientOffset();
	}
	getClientOffset() {
		return this.internalMonitor.getClientOffset();
	}
	getDifferenceFromInitialOffset() {
		return this.internalMonitor.getDifferenceFromInitialOffset();
	}
	constructor(e) {
		this.targetId = null, this.internalMonitor = e.getMonitor();
	}
};
//#endregion
//#region node_modules/react-dnd/dist/internals/registration.js
function YS(e, t, n) {
	let r = n.getRegistry(), i = r.addTarget(e, t);
	return [i, () => r.removeTarget(i)];
}
function XS(e, t, n) {
	let r = n.getRegistry(), i = r.addSource(e, t);
	return [i, () => r.removeSource(i)];
}
//#endregion
//#region node_modules/@react-dnd/shallowequal/dist/index.js
function ZS(e, t, n, r) {
	let i = n ? n.call(r, e, t) : void 0;
	if (i !== void 0) return !!i;
	if (e === t) return !0;
	if (typeof e != "object" || !e || typeof t != "object" || !t) return !1;
	let a = Object.keys(e), o = Object.keys(t);
	if (a.length !== o.length) return !1;
	let s = Object.prototype.hasOwnProperty.bind(t);
	for (let o = 0; o < a.length; o++) {
		let c = a[o];
		if (!s(c)) return !1;
		let l = e[c], u = t[c];
		if (i = n ? n.call(r, l, u, c) : void 0, i === !1 || i === void 0 && l !== u) return !1;
	}
	return !0;
}
//#endregion
//#region node_modules/react-dnd/dist/internals/isRef.js
function QS(e) {
	return typeof e == "object" && !!e && Object.prototype.hasOwnProperty.call(e, "current");
}
//#endregion
//#region node_modules/react-dnd/dist/internals/wrapConnectorHooks.js
function $S(e) {
	if (typeof e.type == "string") return;
	let t = e.type.displayName || e.type.name || "the component";
	throw Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`);
}
function eC(e) {
	return (t = null, n = null) => {
		if (!On(t)) {
			let r = t;
			return e(r, n), r;
		}
		let r = t;
		return $S(r), rC(r, n ? (t) => e(t, n) : e);
	};
}
function tC(e) {
	let t = {};
	return Object.keys(e).forEach((n) => {
		let r = e[n];
		if (n.endsWith("Ref")) t[n] = e[n];
		else {
			let e = eC(r);
			t[n] = () => e;
		}
	}), t;
}
function nC(e, t) {
	typeof e == "function" ? e(t) : e.current = t;
}
function rC(e, t) {
	let n = e.ref;
	return Q(typeof n != "string", "Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"), n ? Cn(e, { ref: (e) => {
		nC(n, e), nC(t, e);
	} }) : Cn(e, { ref: t });
}
//#endregion
//#region node_modules/react-dnd/dist/internals/SourceConnector.js
var iC = class {
	receiveHandlerId(e) {
		this.handlerId !== e && (this.handlerId = e, this.reconnect());
	}
	get connectTarget() {
		return this.dragSource;
	}
	get dragSourceOptions() {
		return this.dragSourceOptionsInternal;
	}
	set dragSourceOptions(e) {
		this.dragSourceOptionsInternal = e;
	}
	get dragPreviewOptions() {
		return this.dragPreviewOptionsInternal;
	}
	set dragPreviewOptions(e) {
		this.dragPreviewOptionsInternal = e;
	}
	reconnect() {
		let e = this.reconnectDragSource();
		this.reconnectDragPreview(e);
	}
	reconnectDragSource() {
		let e = this.dragSource, t = this.didHandlerIdChange() || this.didConnectedDragSourceChange() || this.didDragSourceOptionsChange();
		return t && this.disconnectDragSource(), this.handlerId ? e ? (t && (this.lastConnectedHandlerId = this.handlerId, this.lastConnectedDragSource = e, this.lastConnectedDragSourceOptions = this.dragSourceOptions, this.dragSourceUnsubscribe = this.backend.connectDragSource(this.handlerId, e, this.dragSourceOptions)), t) : (this.lastConnectedDragSource = e, t) : t;
	}
	reconnectDragPreview(e = !1) {
		let t = this.dragPreview, n = e || this.didHandlerIdChange() || this.didConnectedDragPreviewChange() || this.didDragPreviewOptionsChange();
		if (n && this.disconnectDragPreview(), this.handlerId) {
			if (!t) {
				this.lastConnectedDragPreview = t;
				return;
			}
			n && (this.lastConnectedHandlerId = this.handlerId, this.lastConnectedDragPreview = t, this.lastConnectedDragPreviewOptions = this.dragPreviewOptions, this.dragPreviewUnsubscribe = this.backend.connectDragPreview(this.handlerId, t, this.dragPreviewOptions));
		}
	}
	didHandlerIdChange() {
		return this.lastConnectedHandlerId !== this.handlerId;
	}
	didConnectedDragSourceChange() {
		return this.lastConnectedDragSource !== this.dragSource;
	}
	didConnectedDragPreviewChange() {
		return this.lastConnectedDragPreview !== this.dragPreview;
	}
	didDragSourceOptionsChange() {
		return !ZS(this.lastConnectedDragSourceOptions, this.dragSourceOptions);
	}
	didDragPreviewOptionsChange() {
		return !ZS(this.lastConnectedDragPreviewOptions, this.dragPreviewOptions);
	}
	disconnectDragSource() {
		this.dragSourceUnsubscribe &&= (this.dragSourceUnsubscribe(), void 0);
	}
	disconnectDragPreview() {
		this.dragPreviewUnsubscribe && (this.dragPreviewUnsubscribe(), this.dragPreviewUnsubscribe = void 0, this.dragPreviewNode = null, this.dragPreviewRef = null);
	}
	get dragSource() {
		return this.dragSourceNode || this.dragSourceRef && this.dragSourceRef.current;
	}
	get dragPreview() {
		return this.dragPreviewNode || this.dragPreviewRef && this.dragPreviewRef.current;
	}
	clearDragSource() {
		this.dragSourceNode = null, this.dragSourceRef = null;
	}
	clearDragPreview() {
		this.dragPreviewNode = null, this.dragPreviewRef = null;
	}
	constructor(e) {
		this.hooks = tC({
			dragSource: (e, t) => {
				this.clearDragSource(), this.dragSourceOptions = t || null, QS(e) ? this.dragSourceRef = e : this.dragSourceNode = e, this.reconnectDragSource();
			},
			dragPreview: (e, t) => {
				this.clearDragPreview(), this.dragPreviewOptions = t || null, QS(e) ? this.dragPreviewRef = e : this.dragPreviewNode = e, this.reconnectDragPreview();
			}
		}), this.handlerId = null, this.dragSourceRef = null, this.dragSourceOptionsInternal = null, this.dragPreviewRef = null, this.dragPreviewOptionsInternal = null, this.lastConnectedHandlerId = null, this.lastConnectedDragSource = null, this.lastConnectedDragSourceOptions = null, this.lastConnectedDragPreview = null, this.lastConnectedDragPreviewOptions = null, this.backend = e;
	}
}, aC = class {
	get connectTarget() {
		return this.dropTarget;
	}
	reconnect() {
		let e = this.didHandlerIdChange() || this.didDropTargetChange() || this.didOptionsChange();
		e && this.disconnectDropTarget();
		let t = this.dropTarget;
		if (this.handlerId) {
			if (!t) {
				this.lastConnectedDropTarget = t;
				return;
			}
			e && (this.lastConnectedHandlerId = this.handlerId, this.lastConnectedDropTarget = t, this.lastConnectedDropTargetOptions = this.dropTargetOptions, this.unsubscribeDropTarget = this.backend.connectDropTarget(this.handlerId, t, this.dropTargetOptions));
		}
	}
	receiveHandlerId(e) {
		e !== this.handlerId && (this.handlerId = e, this.reconnect());
	}
	get dropTargetOptions() {
		return this.dropTargetOptionsInternal;
	}
	set dropTargetOptions(e) {
		this.dropTargetOptionsInternal = e;
	}
	didHandlerIdChange() {
		return this.lastConnectedHandlerId !== this.handlerId;
	}
	didDropTargetChange() {
		return this.lastConnectedDropTarget !== this.dropTarget;
	}
	didOptionsChange() {
		return !ZS(this.lastConnectedDropTargetOptions, this.dropTargetOptions);
	}
	disconnectDropTarget() {
		this.unsubscribeDropTarget &&= (this.unsubscribeDropTarget(), void 0);
	}
	get dropTarget() {
		return this.dropTargetNode || this.dropTargetRef && this.dropTargetRef.current;
	}
	clearDropTarget() {
		this.dropTargetRef = null, this.dropTargetNode = null;
	}
	constructor(e) {
		this.hooks = tC({ dropTarget: (e, t) => {
			this.clearDropTarget(), this.dropTargetOptions = t, QS(e) ? this.dropTargetRef = e : this.dropTargetNode = e, this.reconnect();
		} }), this.handlerId = null, this.dropTargetRef = null, this.dropTargetOptionsInternal = null, this.lastConnectedHandlerId = null, this.lastConnectedDropTarget = null, this.lastConnectedDropTargetOptions = null, this.backend = e;
	}
};
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDragDropManager.js
function oC() {
	let { dragDropManager: e } = Mn(Ib);
	return Q(e != null, "Expected drag drop context"), e;
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/useDragSourceConnector.js
function sC(e, t) {
	let n = oC(), r = In(() => new iC(n.getBackend()), [n]);
	return LS(() => (r.dragSourceOptions = e || null, r.reconnect(), () => r.disconnectDragSource()), [r, e]), LS(() => (r.dragPreviewOptions = t || null, r.reconnect(), () => r.disconnectDragPreview()), [r, t]), r;
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/useDragSourceMonitor.js
function cC() {
	let e = oC();
	return In(() => new KS(e), [e]);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/DragSourceImpl.js
var lC = class {
	beginDrag() {
		let e = this.spec, t = this.monitor, n = null;
		return n = typeof e.item == "object" ? e.item : typeof e.item == "function" ? e.item(t) : {}, n ?? null;
	}
	canDrag() {
		let e = this.spec, t = this.monitor;
		return typeof e.canDrag == "boolean" ? e.canDrag : typeof e.canDrag != "function" || e.canDrag(t);
	}
	isDragging(e, t) {
		let n = this.spec, r = this.monitor, { isDragging: i } = n;
		return i ? i(r) : t === e.getSourceId();
	}
	endDrag() {
		let e = this.spec, t = this.monitor, n = this.connector, { end: r } = e;
		r && r(t.getItem(), t), n.reconnect();
	}
	constructor(e, t, n) {
		this.spec = e, this.monitor = t, this.connector = n;
	}
};
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/useDragSource.js
function uC(e, t, n) {
	let r = In(() => new lC(e, t, n), [t, n]);
	return F(() => {
		r.spec = e;
	}, [e]), r;
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/useDragType.js
function dC(e) {
	return In(() => {
		let t = e.type;
		return Q(t != null, "spec.type must be defined"), t;
	}, [e]);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/useRegisteredDragSource.js
function fC(e, t, n) {
	let r = oC(), i = uC(e, t, n), a = dC(e);
	LS(function() {
		if (a != null) {
			let [e, o] = XS(a, i, r);
			return t.receiveHandlerId(e), n.receiveHandlerId(e), o;
		}
	}, [
		r,
		t,
		n,
		i,
		a
	]);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/useDrag.js
function pC(e, t) {
	let n = VS(e, t);
	Q(!n.begin, "useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");
	let r = cC(), i = sC(n.options, n.previewOptions);
	return fC(n, r, i), [
		BS(n.collect, r, i),
		HS(i),
		US(i)
	];
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/connectors.js
function mC(e) {
	return In(() => e.hooks.dropTarget(), [e]);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/useDropTargetConnector.js
function hC(e) {
	let t = oC(), n = In(() => new aC(t.getBackend()), [t]);
	return LS(() => (n.dropTargetOptions = e || null, n.reconnect(), () => n.disconnectDropTarget()), [e]), n;
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/useDropTargetMonitor.js
function gC() {
	let e = oC();
	return In(() => new JS(e), [e]);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/useAccept.js
function _C(e) {
	let { accept: t } = e;
	return In(() => (Q(e.accept != null, "accept must be defined"), Array.isArray(t) ? t : [t]), [t]);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/DropTargetImpl.js
var vC = class {
	canDrop() {
		let e = this.spec, t = this.monitor;
		return !e.canDrop || e.canDrop(t.getItem(), t);
	}
	hover() {
		let e = this.spec, t = this.monitor;
		e.hover && e.hover(t.getItem(), t);
	}
	drop() {
		let e = this.spec, t = this.monitor;
		if (e.drop) return e.drop(t.getItem(), t);
	}
	constructor(e, t) {
		this.spec = e, this.monitor = t;
	}
};
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/useDropTarget.js
function yC(e, t) {
	let n = In(() => new vC(e, t), [t]);
	return F(() => {
		n.spec = e;
	}, [e]), n;
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/useRegisteredDropTarget.js
function bC(e, t, n) {
	let r = oC(), i = yC(e, t), a = _C(e);
	LS(function() {
		let [e, o] = YS(a, i, r);
		return t.receiveHandlerId(e), n.receiveHandlerId(e), o;
	}, [
		r,
		t,
		i,
		n,
		a.map((e) => e.toString()).join("|")
	]);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/useDrop.js
function xC(e, t) {
	let n = VS(e, t), r = gC(), i = hC(n.options);
	return bC(n, r, i), [BS(n.collect, r, i), mC(i)];
}
//#endregion
//#region node_modules/dnd-multi-backend/dist/index.js
var SC = (e) => {
	throw TypeError(e);
}, CC = (e, t, n) => t.has(e) || SC("Cannot " + n), $ = (e, t, n) => (CC(e, t, "read from private field"), n ? n.call(e) : t.get(e)), wC = (e, t, n) => t.has(e) ? SC("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), TC = (e, t, n, r) => (CC(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), EC, DC = class {
	constructor() {
		wC(this, EC), this.register = (e) => {
			$(this, EC).push(e);
		}, this.unregister = (e) => {
			for (; $(this, EC).indexOf(e) !== -1;) $(this, EC).splice($(this, EC).indexOf(e), 1);
		}, this.backendChanged = (e) => {
			for (let t of $(this, EC)) t.backendChanged(e);
		}, TC(this, EC, []);
	}
};
EC = /* @__PURE__ */ new WeakMap();
var OC, kC, AC, jC, MC, NC, PC, FC, IC, LC, RC, zC = class e {
	constructor(t, n, r) {
		if (wC(this, OC), wC(this, kC), wC(this, AC), wC(this, jC), wC(this, MC), wC(this, NC, (e, t, n) => {
			if (!n.backend) throw Error(`You must specify a 'backend' property in your Backend entry: ${JSON.stringify(n)}`);
			let r = n.backend(e, t, n.options), i = n.id, a = !n.id && r && r.constructor;
			if (a && (i = r.constructor.name), !i) throw Error(`You must specify an 'id' property in your Backend entry: ${JSON.stringify(n)}
        see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx`);
			if (a && console.warn("Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.\n        This might be unsupported in the future, please specify 'id' explicitely for every backend."), $(this, AC)[i]) throw Error(`You must specify a unique 'id' property in your Backend entry:
        ${JSON.stringify(n)} (conflicts with: ${JSON.stringify($(this, AC)[i])})`);
			return {
				id: i,
				instance: r,
				preview: n.preview ?? !1,
				transition: n.transition,
				skipDispatchOnTransition: n.skipDispatchOnTransition ?? !1
			};
		}), this.setup = () => {
			if (!(typeof window > "u")) {
				if (e.isSetUp) throw Error("Cannot have two MultiBackends at the same time.");
				e.isSetUp = !0, $(this, PC).call(this, window), $(this, AC)[$(this, OC)].instance.setup();
			}
		}, this.teardown = () => {
			typeof window > "u" || (e.isSetUp = !1, $(this, FC).call(this, window), $(this, AC)[$(this, OC)].instance.teardown());
		}, this.connectDragSource = (e, t, n) => $(this, RC).call(this, "connectDragSource", e, t, n), this.connectDragPreview = (e, t, n) => $(this, RC).call(this, "connectDragPreview", e, t, n), this.connectDropTarget = (e, t, n) => $(this, RC).call(this, "connectDropTarget", e, t, n), this.profile = () => $(this, AC)[$(this, OC)].instance.profile(), this.previewEnabled = () => $(this, AC)[$(this, OC)].preview, this.previewsList = () => $(this, kC), this.backendsList = () => $(this, jC), wC(this, PC, (e) => {
			for (let t of $(this, jC)) t.transition && e.addEventListener(t.transition.event, $(this, IC));
		}), wC(this, FC, (e) => {
			for (let t of $(this, jC)) t.transition && e.removeEventListener(t.transition.event, $(this, IC));
		}), wC(this, IC, (e) => {
			let t = $(this, OC);
			if ($(this, jC).some((t) => t.id !== $(this, OC) && t.transition && t.transition.check(e) ? (TC(this, OC, t.id), !0) : !1), $(this, OC) !== t) {
				$(this, AC)[t].instance.teardown();
				for (let [e, t] of Object.entries($(this, MC))) t.unsubscribe(), t.unsubscribe = $(this, LC).call(this, t.func, ...t.args);
				$(this, kC).backendChanged(this);
				let n = $(this, AC)[$(this, OC)];
				if (n.instance.setup(), n.skipDispatchOnTransition) return;
				let r = e.constructor, i = new r(e.type, e);
				e.target?.dispatchEvent(i);
			}
		}), wC(this, LC, (e, t, n, r) => $(this, AC)[$(this, OC)].instance[e](t, n, r)), wC(this, RC, (e, t, n, r) => {
			let i = `${e}_${t}`, a = $(this, LC).call(this, e, t, n, r);
			return $(this, MC)[i] = {
				func: e,
				args: [
					t,
					n,
					r
				],
				unsubscribe: a
			}, () => {
				$(this, MC)[i].unsubscribe(), delete $(this, MC)[i];
			};
		}), !r || !r.backends || r.backends.length < 1) throw Error("You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)\n        see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx");
		TC(this, kC, new DC()), TC(this, AC, {}), TC(this, jC, []);
		for (let e of r.backends) {
			let r = $(this, NC).call(this, t, n, e);
			$(this, AC)[r.id] = r, $(this, jC).push(r);
		}
		TC(this, OC, $(this, jC)[0].id), TC(this, MC, {});
	}
};
OC = /* @__PURE__ */ new WeakMap(), kC = /* @__PURE__ */ new WeakMap(), AC = /* @__PURE__ */ new WeakMap(), jC = /* @__PURE__ */ new WeakMap(), MC = /* @__PURE__ */ new WeakMap(), NC = /* @__PURE__ */ new WeakMap(), PC = /* @__PURE__ */ new WeakMap(), FC = /* @__PURE__ */ new WeakMap(), IC = /* @__PURE__ */ new WeakMap(), LC = /* @__PURE__ */ new WeakMap(), RC = /* @__PURE__ */ new WeakMap(), zC.isSetUp = !1;
var BC = zC, VC = (e, t, n) => new BC(e, t, n), HC = (e, t) => ({
	event: e,
	check: t
}), UC = HC("touchstart", (e) => {
	let t = e;
	return t.touches !== null && t.touches !== void 0;
}), WC = HC("pointerdown", (e) => e.pointerType === "mouse");
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/utils/js_utils.js
function GC(e) {
	let t = null;
	return () => (t ??= e(), t);
}
function KC(e, t) {
	return e.filter((e) => e !== t);
}
function qC(e, t) {
	let n = /* @__PURE__ */ new Set(), r = (e) => n.add(e);
	e.forEach(r), t.forEach(r);
	let i = [];
	return n.forEach((e) => i.push(e)), i;
}
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/EnterLeaveCounter.js
var JC = class {
	enter(e) {
		let t = this.entered.length, n = (t) => this.isNodeInDocument(t) && (!t.contains || t.contains(e));
		return this.entered = qC(this.entered.filter(n), [e]), t === 0 && this.entered.length > 0;
	}
	leave(e) {
		let t = this.entered.length;
		return this.entered = KC(this.entered.filter(this.isNodeInDocument), e), t > 0 && this.entered.length === 0;
	}
	reset() {
		this.entered = [];
	}
	constructor(e) {
		this.entered = [], this.isNodeInDocument = e;
	}
}, YC = class {
	initializeExposedProperties() {
		Object.keys(this.config.exposeProperties).forEach((e) => {
			Object.defineProperty(this.item, e, {
				configurable: !0,
				enumerable: !0,
				get() {
					return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`), null;
				}
			});
		});
	}
	loadDataTransfer(e) {
		if (e) {
			let t = {};
			Object.keys(this.config.exposeProperties).forEach((n) => {
				let r = this.config.exposeProperties[n];
				r != null && (t[n] = {
					value: r(e, this.config.matchesTypes),
					configurable: !0,
					enumerable: !0
				});
			}), Object.defineProperties(this.item, t);
		}
	}
	canDrag() {
		return !0;
	}
	beginDrag() {
		return this.item;
	}
	isDragging(e, t) {
		return t === e.getSourceId();
	}
	endDrag() {}
	constructor(e) {
		this.config = e, this.item = {}, this.initializeExposedProperties();
	}
}, XC = /* @__PURE__ */ d({
	FILE: () => ZC,
	HTML: () => ew,
	TEXT: () => $C,
	URL: () => QC
}), ZC = "__NATIVE_FILE__", QC = "__NATIVE_URL__", $C = "__NATIVE_TEXT__", ew = "__NATIVE_HTML__";
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/NativeDragSources/getDataFromDataTransfer.js
function tw(e, t, n) {
	return t.reduce((t, n) => t || e.getData(n), "") ?? n;
}
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/NativeDragSources/nativeTypesConfig.js
var nw = {
	[ZC]: {
		exposeProperties: {
			files: (e) => Array.prototype.slice.call(e.files),
			items: (e) => e.items,
			dataTransfer: (e) => e
		},
		matchesTypes: ["Files"]
	},
	[ew]: {
		exposeProperties: {
			html: (e, t) => tw(e, t, ""),
			dataTransfer: (e) => e
		},
		matchesTypes: ["Html", "text/html"]
	},
	[QC]: {
		exposeProperties: {
			urls: (e, t) => tw(e, t, "").split("\n"),
			dataTransfer: (e) => e
		},
		matchesTypes: ["Url", "text/uri-list"]
	},
	[$C]: {
		exposeProperties: {
			text: (e, t) => tw(e, t, ""),
			dataTransfer: (e) => e
		},
		matchesTypes: ["Text", "text/plain"]
	}
};
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/NativeDragSources/index.js
function rw(e, t) {
	let n = nw[e];
	if (!n) throw Error(`native type ${e} has no configuration`);
	let r = new YC(n);
	return r.loadDataTransfer(t), r;
}
function iw(e) {
	if (!e) return null;
	let t = Array.prototype.slice.call(e.types || []);
	return Object.keys(nw).filter((e) => {
		let n = nw[e];
		return n?.matchesTypes ? n.matchesTypes.some((e) => t.indexOf(e) > -1) : !1;
	})[0] || null;
}
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/BrowserDetector.js
var aw = GC(() => /firefox/i.test(navigator.userAgent)), ow = GC(() => !!window.safari), sw = class {
	interpolate(e) {
		let { xs: t, ys: n, c1s: r, c2s: i, c3s: a } = this, o = t.length - 1;
		if (e === t[o]) return n[o];
		let s = 0, c = a.length - 1, l;
		for (; s <= c;) {
			l = Math.floor(.5 * (s + c));
			let r = t[l];
			if (r < e) s = l + 1;
			else if (r > e) c = l - 1;
			else return n[l];
		}
		o = Math.max(0, c);
		let u = e - t[o], d = u * u;
		return n[o] + r[o] * u + i[o] * d + a[o] * u * d;
	}
	constructor(e, t) {
		let { length: n } = e, r = [];
		for (let e = 0; e < n; e++) r.push(e);
		r.sort((t, n) => e[t] < e[n] ? -1 : 1);
		let i = [], a = [], o = [], s, c;
		for (let r = 0; r < n - 1; r++) s = e[r + 1] - e[r], c = t[r + 1] - t[r], a.push(s), i.push(c), o.push(c / s);
		let l = [o[0]];
		for (let e = 0; e < a.length - 1; e++) {
			let t = o[e], n = o[e + 1];
			if (t * n <= 0) l.push(0);
			else {
				s = a[e];
				let r = a[e + 1], i = s + r;
				l.push(3 * i / ((i + r) / t + (i + s) / n));
			}
		}
		l.push(o[o.length - 1]);
		let u = [], d = [], f;
		for (let e = 0; e < l.length - 1; e++) {
			f = o[e];
			let t = l[e], n = 1 / a[e], r = t + l[e + 1] - f - f;
			u.push((f - t - r) * n), d.push(r * n * n);
		}
		this.xs = e, this.ys = t, this.c1s = l, this.c2s = u, this.c3s = d;
	}
}, cw = 1;
function lw(e) {
	let t = e.nodeType === cw ? e : e.parentElement;
	if (!t) return null;
	let { top: n, left: r } = t.getBoundingClientRect();
	return {
		x: r,
		y: n
	};
}
function uw(e) {
	return {
		x: e.clientX,
		y: e.clientY
	};
}
function dw(e) {
	return e.nodeName === "IMG" && (aw() || !document.documentElement?.contains(e));
}
function fw(e, t, n, r) {
	let i = e ? t.width : n, a = e ? t.height : r;
	return ow() && e && (a /= window.devicePixelRatio, i /= window.devicePixelRatio), {
		dragPreviewWidth: i,
		dragPreviewHeight: a
	};
}
function pw(e, t, n, r, i) {
	let a = dw(t), o = lw(a ? e : t), s = {
		x: n.x - o.x,
		y: n.y - o.y
	}, { offsetWidth: c, offsetHeight: l } = e, { anchorX: u, anchorY: d } = r, { dragPreviewWidth: f, dragPreviewHeight: p } = fw(a, t, c, l), m = () => {
		let e = new sw([
			0,
			.5,
			1
		], [
			s.y,
			s.y / l * p,
			s.y + p - l
		]).interpolate(d);
		return ow() && a && (e += (window.devicePixelRatio - 1) * p), e;
	}, h = () => new sw([
		0,
		.5,
		1
	], [
		s.x,
		s.x / c * f,
		s.x + f - c
	]).interpolate(u), { offsetX: g, offsetY: _ } = i, v = g === 0 || g, y = _ === 0 || _;
	return {
		x: v ? g : h(),
		y: y ? _ : m()
	};
}
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/OptionsReader.js
var mw = class {
	get window() {
		if (this.globalContext) return this.globalContext;
		if (typeof window < "u") return window;
	}
	get document() {
		if (this.globalContext?.document) return this.globalContext.document;
		if (this.window) return this.window.document;
	}
	get rootElement() {
		return this.optionsArgs?.rootElement || this.window;
	}
	constructor(e, t) {
		this.ownerDocument = null, this.globalContext = e, this.optionsArgs = t;
	}
};
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/HTML5BackendImpl.js
function hw(e, t, n) {
	return t in e ? Object.defineProperty(e, t, {
		value: n,
		enumerable: !0,
		configurable: !0,
		writable: !0
	}) : e[t] = n, e;
}
function gw(e) {
	for (var t = 1; t < arguments.length; t++) {
		var n = arguments[t] == null ? {} : arguments[t], r = Object.keys(n);
		typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(n).filter(function(e) {
			return Object.getOwnPropertyDescriptor(n, e).enumerable;
		}))), r.forEach(function(t) {
			hw(e, t, n[t]);
		});
	}
	return e;
}
var _w = class {
	profile() {
		return {
			sourcePreviewNodes: this.sourcePreviewNodes.size,
			sourcePreviewNodeOptions: this.sourcePreviewNodeOptions.size,
			sourceNodeOptions: this.sourceNodeOptions.size,
			sourceNodes: this.sourceNodes.size,
			dragStartSourceIds: this.dragStartSourceIds?.length || 0,
			dropTargetIds: this.dropTargetIds.length,
			dragEnterTargetIds: this.dragEnterTargetIds.length,
			dragOverTargetIds: this.dragOverTargetIds?.length || 0
		};
	}
	get window() {
		return this.options.window;
	}
	get document() {
		return this.options.document;
	}
	get rootElement() {
		return this.options.rootElement;
	}
	setup() {
		let e = this.rootElement;
		if (e !== void 0) {
			if (e.__isReactDndBackendSetUp) throw Error("Cannot have two HTML5 backends at the same time.");
			e.__isReactDndBackendSetUp = !0, this.addEventListeners(e);
		}
	}
	teardown() {
		let e = this.rootElement;
		if (e !== void 0 && (e.__isReactDndBackendSetUp = !1, this.removeEventListeners(this.rootElement), this.clearCurrentDragSourceNode(), this.asyncEndDragFrameId)) {
			var t;
			(t = this.window) == null || t.cancelAnimationFrame(this.asyncEndDragFrameId);
		}
	}
	connectDragPreview(e, t, n) {
		return this.sourcePreviewNodeOptions.set(e, n), this.sourcePreviewNodes.set(e, t), () => {
			this.sourcePreviewNodes.delete(e), this.sourcePreviewNodeOptions.delete(e);
		};
	}
	connectDragSource(e, t, n) {
		this.sourceNodes.set(e, t), this.sourceNodeOptions.set(e, n);
		let r = (t) => this.handleDragStart(t, e), i = (e) => this.handleSelectStart(e);
		return t.setAttribute("draggable", "true"), t.addEventListener("dragstart", r), t.addEventListener("selectstart", i), () => {
			this.sourceNodes.delete(e), this.sourceNodeOptions.delete(e), t.removeEventListener("dragstart", r), t.removeEventListener("selectstart", i), t.setAttribute("draggable", "false");
		};
	}
	connectDropTarget(e, t) {
		let n = (t) => this.handleDragEnter(t, e), r = (t) => this.handleDragOver(t, e), i = (t) => this.handleDrop(t, e);
		return t.addEventListener("dragenter", n), t.addEventListener("dragover", r), t.addEventListener("drop", i), () => {
			t.removeEventListener("dragenter", n), t.removeEventListener("dragover", r), t.removeEventListener("drop", i);
		};
	}
	addEventListeners(e) {
		e.addEventListener && (e.addEventListener("dragstart", this.handleTopDragStart), e.addEventListener("dragstart", this.handleTopDragStartCapture, !0), e.addEventListener("dragend", this.handleTopDragEndCapture, !0), e.addEventListener("dragenter", this.handleTopDragEnter), e.addEventListener("dragenter", this.handleTopDragEnterCapture, !0), e.addEventListener("dragleave", this.handleTopDragLeaveCapture, !0), e.addEventListener("dragover", this.handleTopDragOver), e.addEventListener("dragover", this.handleTopDragOverCapture, !0), e.addEventListener("drop", this.handleTopDrop), e.addEventListener("drop", this.handleTopDropCapture, !0));
	}
	removeEventListeners(e) {
		e.removeEventListener && (e.removeEventListener("dragstart", this.handleTopDragStart), e.removeEventListener("dragstart", this.handleTopDragStartCapture, !0), e.removeEventListener("dragend", this.handleTopDragEndCapture, !0), e.removeEventListener("dragenter", this.handleTopDragEnter), e.removeEventListener("dragenter", this.handleTopDragEnterCapture, !0), e.removeEventListener("dragleave", this.handleTopDragLeaveCapture, !0), e.removeEventListener("dragover", this.handleTopDragOver), e.removeEventListener("dragover", this.handleTopDragOverCapture, !0), e.removeEventListener("drop", this.handleTopDrop), e.removeEventListener("drop", this.handleTopDropCapture, !0));
	}
	getCurrentSourceNodeOptions() {
		let e = this.monitor.getSourceId(), t = this.sourceNodeOptions.get(e);
		return gw({ dropEffect: this.altKeyPressed ? "copy" : "move" }, t || {});
	}
	getCurrentDropEffect() {
		return this.isDraggingNativeItem() ? "copy" : this.getCurrentSourceNodeOptions().dropEffect;
	}
	getCurrentSourcePreviewNodeOptions() {
		let e = this.monitor.getSourceId();
		return gw({
			anchorX: .5,
			anchorY: .5,
			captureDraggingState: !1
		}, this.sourcePreviewNodeOptions.get(e) || {});
	}
	isDraggingNativeItem() {
		let e = this.monitor.getItemType();
		return Object.keys(XC).some((t) => XC[t] === e);
	}
	beginDragNativeItem(e, t) {
		this.clearCurrentDragSourceNode(), this.currentNativeSource = rw(e, t), this.currentNativeHandle = this.registry.addSource(e, this.currentNativeSource), this.actions.beginDrag([this.currentNativeHandle]);
	}
	setCurrentDragSourceNode(e) {
		this.clearCurrentDragSourceNode(), this.currentDragSourceNode = e, this.mouseMoveTimeoutTimer = setTimeout(() => this.rootElement?.addEventListener("mousemove", this.endDragIfSourceWasRemovedFromDOM, !0), 1e3);
	}
	clearCurrentDragSourceNode() {
		if (this.currentDragSourceNode) {
			if (this.currentDragSourceNode = null, this.rootElement) {
				var e;
				(e = this.window) == null || e.clearTimeout(this.mouseMoveTimeoutTimer || void 0), this.rootElement.removeEventListener("mousemove", this.endDragIfSourceWasRemovedFromDOM, !0);
			}
			return this.mouseMoveTimeoutTimer = null, !0;
		}
		return !1;
	}
	handleDragStart(e, t) {
		e.defaultPrevented || (this.dragStartSourceIds ||= [], this.dragStartSourceIds.unshift(t));
	}
	handleDragEnter(e, t) {
		this.dragEnterTargetIds.unshift(t);
	}
	handleDragOver(e, t) {
		this.dragOverTargetIds === null && (this.dragOverTargetIds = []), this.dragOverTargetIds.unshift(t);
	}
	handleDrop(e, t) {
		this.dropTargetIds.unshift(t);
	}
	constructor(e, t, n) {
		this.sourcePreviewNodes = /* @__PURE__ */ new Map(), this.sourcePreviewNodeOptions = /* @__PURE__ */ new Map(), this.sourceNodes = /* @__PURE__ */ new Map(), this.sourceNodeOptions = /* @__PURE__ */ new Map(), this.dragStartSourceIds = null, this.dropTargetIds = [], this.dragEnterTargetIds = [], this.currentNativeSource = null, this.currentNativeHandle = null, this.currentDragSourceNode = null, this.altKeyPressed = !1, this.mouseMoveTimeoutTimer = null, this.asyncEndDragFrameId = null, this.dragOverTargetIds = null, this.lastClientOffset = null, this.hoverRafId = null, this.getSourceClientOffset = (e) => {
			let t = this.sourceNodes.get(e);
			return t && lw(t) || null;
		}, this.endDragNativeItem = () => {
			this.isDraggingNativeItem() && (this.actions.endDrag(), this.currentNativeHandle && this.registry.removeSource(this.currentNativeHandle), this.currentNativeHandle = null, this.currentNativeSource = null);
		}, this.isNodeInDocument = (e) => !!(e && this.document && this.document.body && this.document.body.contains(e)), this.endDragIfSourceWasRemovedFromDOM = () => {
			let e = this.currentDragSourceNode;
			e == null || this.isNodeInDocument(e) || (this.clearCurrentDragSourceNode() && this.monitor.isDragging() && this.actions.endDrag(), this.cancelHover());
		}, this.scheduleHover = (e) => {
			this.hoverRafId === null && typeof requestAnimationFrame < "u" && (this.hoverRafId = requestAnimationFrame(() => {
				this.monitor.isDragging() && this.actions.hover(e || [], { clientOffset: this.lastClientOffset }), this.hoverRafId = null;
			}));
		}, this.cancelHover = () => {
			this.hoverRafId !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(this.hoverRafId), this.hoverRafId = null);
		}, this.handleTopDragStartCapture = () => {
			this.clearCurrentDragSourceNode(), this.dragStartSourceIds = [];
		}, this.handleTopDragStart = (e) => {
			if (e.defaultPrevented) return;
			let { dragStartSourceIds: t } = this;
			this.dragStartSourceIds = null;
			let n = uw(e);
			this.monitor.isDragging() && (this.actions.endDrag(), this.cancelHover()), this.actions.beginDrag(t || [], {
				publishSource: !1,
				getSourceClientOffset: this.getSourceClientOffset,
				clientOffset: n
			});
			let { dataTransfer: r } = e, i = iw(r);
			if (this.monitor.isDragging()) {
				if (r && typeof r.setDragImage == "function") {
					let e = this.monitor.getSourceId(), t = this.sourceNodes.get(e), i = this.sourcePreviewNodes.get(e) || t;
					if (i) {
						let { anchorX: e, anchorY: a, offsetX: o, offsetY: s } = this.getCurrentSourcePreviewNodeOptions(), c = pw(t, i, n, {
							anchorX: e,
							anchorY: a
						}, {
							offsetX: o,
							offsetY: s
						});
						r.setDragImage(i, c.x, c.y);
					}
				}
				try {
					r?.setData("application/json", {});
				} catch {}
				this.setCurrentDragSourceNode(e.target);
				let { captureDraggingState: t } = this.getCurrentSourcePreviewNodeOptions();
				t ? this.actions.publishDragSource() : setTimeout(() => this.actions.publishDragSource(), 0);
			} else if (i) this.beginDragNativeItem(i);
			else if (r && !r.types && (e.target && !e.target.hasAttribute || !e.target.hasAttribute("draggable"))) return;
			else e.preventDefault();
		}, this.handleTopDragEndCapture = () => {
			this.clearCurrentDragSourceNode() && this.monitor.isDragging() && this.actions.endDrag(), this.cancelHover();
		}, this.handleTopDragEnterCapture = (e) => {
			if (this.dragEnterTargetIds = [], this.isDraggingNativeItem()) {
				var t;
				(t = this.currentNativeSource) == null || t.loadDataTransfer(e.dataTransfer);
			}
			if (!this.enterLeaveCounter.enter(e.target) || this.monitor.isDragging()) return;
			let { dataTransfer: n } = e, r = iw(n);
			r && this.beginDragNativeItem(r, n);
		}, this.handleTopDragEnter = (e) => {
			let { dragEnterTargetIds: t } = this;
			this.dragEnterTargetIds = [], this.monitor.isDragging() && (this.altKeyPressed = e.altKey, t.length > 0 && this.actions.hover(t, { clientOffset: uw(e) }), t.some((e) => this.monitor.canDropOnTarget(e)) && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = this.getCurrentDropEffect())));
		}, this.handleTopDragOverCapture = (e) => {
			if (this.dragOverTargetIds = [], this.isDraggingNativeItem()) {
				var t;
				(t = this.currentNativeSource) == null || t.loadDataTransfer(e.dataTransfer);
			}
		}, this.handleTopDragOver = (e) => {
			let { dragOverTargetIds: t } = this;
			if (this.dragOverTargetIds = [], !this.monitor.isDragging()) {
				e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "none");
				return;
			}
			this.altKeyPressed = e.altKey, this.lastClientOffset = uw(e), this.scheduleHover(t), (t || []).some((e) => this.monitor.canDropOnTarget(e)) ? (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = this.getCurrentDropEffect())) : this.isDraggingNativeItem() ? e.preventDefault() : (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "none"));
		}, this.handleTopDragLeaveCapture = (e) => {
			this.isDraggingNativeItem() && e.preventDefault(), this.enterLeaveCounter.leave(e.target) && (this.isDraggingNativeItem() && setTimeout(() => this.endDragNativeItem(), 0), this.cancelHover());
		}, this.handleTopDropCapture = (e) => {
			if (this.dropTargetIds = [], this.isDraggingNativeItem()) {
				var t;
				e.preventDefault(), (t = this.currentNativeSource) == null || t.loadDataTransfer(e.dataTransfer);
			} else iw(e.dataTransfer) && e.preventDefault();
			this.enterLeaveCounter.reset();
		}, this.handleTopDrop = (e) => {
			let { dropTargetIds: t } = this;
			this.dropTargetIds = [], this.actions.hover(t, { clientOffset: uw(e) }), this.actions.drop({ dropEffect: this.getCurrentDropEffect() }), this.isDraggingNativeItem() ? this.endDragNativeItem() : this.monitor.isDragging() && this.actions.endDrag(), this.cancelHover();
		}, this.handleSelectStart = (e) => {
			let t = e.target;
			typeof t.dragDrop == "function" && (t.tagName === "INPUT" || t.tagName === "SELECT" || t.tagName === "TEXTAREA" || t.isContentEditable || (e.preventDefault(), t.dragDrop()));
		}, this.options = new mw(t, n), this.actions = e.getActions(), this.monitor = e.getMonitor(), this.registry = e.getRegistry(), this.enterLeaveCounter = new JC(this.isNodeInDocument);
	}
}, vw = function(e, t, n) {
	return new _w(e, t, n);
}, yw;
(function(e) {
	e.mouse = "mouse", e.touch = "touch", e.keyboard = "keyboard";
})(yw ||= {});
//#endregion
//#region node_modules/react-dnd-touch-backend/dist/OptionsReader.js
var bw = class {
	get delay() {
		return this.args.delay ?? 0;
	}
	get scrollAngleRanges() {
		return this.args.scrollAngleRanges;
	}
	get getDropTargetElementsAtPoint() {
		return this.args.getDropTargetElementsAtPoint;
	}
	get ignoreContextMenu() {
		return this.args.ignoreContextMenu ?? !1;
	}
	get enableHoverOutsideTarget() {
		return this.args.enableHoverOutsideTarget ?? !1;
	}
	get enableKeyboardEvents() {
		return this.args.enableKeyboardEvents ?? !1;
	}
	get enableMouseEvents() {
		return this.args.enableMouseEvents ?? !1;
	}
	get enableTouchEvents() {
		return this.args.enableTouchEvents ?? !0;
	}
	get touchSlop() {
		return this.args.touchSlop || 0;
	}
	get delayTouchStart() {
		return this.args?.delayTouchStart ?? this.args?.delay ?? 0;
	}
	get delayMouseStart() {
		return this.args?.delayMouseStart ?? this.args?.delay ?? 0;
	}
	get window() {
		if (this.context && this.context.window) return this.context.window;
		if (typeof window < "u") return window;
	}
	get document() {
		if (this.context?.document) return this.context.document;
		if (this.window) return this.window.document;
	}
	get rootElement() {
		return this.args?.rootElement || this.document;
	}
	constructor(e, t) {
		this.args = e, this.context = t;
	}
};
//#endregion
//#region node_modules/react-dnd-touch-backend/dist/utils/math.js
function xw(e, t, n, r) {
	return Math.sqrt(Math.abs(n - e) ** 2 + Math.abs(r - t) ** 2);
}
function Sw(e, t, n, r, i) {
	if (!i) return !1;
	let a = Math.atan2(r - t, n - e) * 180 / Math.PI + 180;
	for (let e = 0; e < i.length; ++e) {
		let t = i[e];
		if (t && (t.start == null || a >= t.start) && (t.end == null || a <= t.end)) return !0;
	}
	return !1;
}
//#endregion
//#region node_modules/react-dnd-touch-backend/dist/utils/predicates.js
var Cw = {
	Left: 1,
	Right: 2,
	Center: 4
}, ww = {
	Left: 0,
	Center: 1,
	Right: 2
};
function Tw(e) {
	return e.button === void 0 || e.button === ww.Left;
}
function Ew(e) {
	return e.buttons === void 0 || (e.buttons & Cw.Left) === 0;
}
function Dw(e) {
	return !!e.targetTouches;
}
//#endregion
//#region node_modules/react-dnd-touch-backend/dist/utils/offsets.js
var Ow = 1;
function kw(e) {
	let t = e.nodeType === Ow ? e : e.parentElement;
	if (!t) return;
	let { top: n, left: r } = t.getBoundingClientRect();
	return {
		x: r,
		y: n
	};
}
function Aw(e, t) {
	if (e.targetTouches.length === 1) return jw(e.targetTouches[0]);
	if (t && e.touches.length === 1 && e.touches[0].target === t.target) return jw(e.touches[0]);
}
function jw(e, t) {
	return Dw(e) ? Aw(e, t) : {
		x: e.clientX,
		y: e.clientY
	};
}
//#endregion
//#region node_modules/react-dnd-touch-backend/dist/utils/supportsPassive.js
var Mw = (() => {
	let e = !1;
	try {
		addEventListener("test", () => {}, Object.defineProperty({}, "passive", { get() {
			return e = !0, !0;
		} }));
	} catch {}
	return e;
})(), Nw = {
	[yw.mouse]: {
		start: "mousedown",
		move: "mousemove",
		end: "mouseup",
		contextmenu: "contextmenu"
	},
	[yw.touch]: {
		start: "touchstart",
		move: "touchmove",
		end: "touchend"
	},
	[yw.keyboard]: { keydown: "keydown" }
}, Pw = class e {
	profile() {
		return {
			sourceNodes: this.sourceNodes.size,
			sourcePreviewNodes: this.sourcePreviewNodes.size,
			sourcePreviewNodeOptions: this.sourcePreviewNodeOptions.size,
			targetNodes: this.targetNodes.size,
			dragOverTargetIds: this.dragOverTargetIds?.length || 0
		};
	}
	get document() {
		return this.options.document;
	}
	setup() {
		let t = this.options.rootElement;
		t && (Q(!e.isSetUp, "Cannot have two Touch backends at the same time."), e.isSetUp = !0, this.addEventListener(t, "start", this.getTopMoveStartHandler()), this.addEventListener(t, "start", this.handleTopMoveStartCapture, !0), this.addEventListener(t, "move", this.handleTopMove), this.addEventListener(t, "move", this.handleTopMoveCapture, !0), this.addEventListener(t, "end", this.handleTopMoveEndCapture, !0), this.options.enableMouseEvents && !this.options.ignoreContextMenu && this.addEventListener(t, "contextmenu", this.handleTopMoveEndCapture), this.options.enableKeyboardEvents && this.addEventListener(t, "keydown", this.handleCancelOnEscape, !0));
	}
	teardown() {
		let t = this.options.rootElement;
		t && (e.isSetUp = !1, this._mouseClientOffset = {}, this.removeEventListener(t, "start", this.handleTopMoveStartCapture, !0), this.removeEventListener(t, "start", this.handleTopMoveStart), this.removeEventListener(t, "move", this.handleTopMoveCapture, !0), this.removeEventListener(t, "move", this.handleTopMove), this.removeEventListener(t, "end", this.handleTopMoveEndCapture, !0), this.options.enableMouseEvents && !this.options.ignoreContextMenu && this.removeEventListener(t, "contextmenu", this.handleTopMoveEndCapture), this.options.enableKeyboardEvents && this.removeEventListener(t, "keydown", this.handleCancelOnEscape, !0), this.uninstallSourceNodeRemovalObserver());
	}
	addEventListener(e, t, n, r = !1) {
		let i = Mw ? {
			capture: r,
			passive: !1
		} : r;
		this.listenerTypes.forEach(function(r) {
			let a = Nw[r][t];
			a && e.addEventListener(a, n, i);
		});
	}
	removeEventListener(e, t, n, r = !1) {
		let i = Mw ? {
			capture: r,
			passive: !1
		} : r;
		this.listenerTypes.forEach(function(r) {
			let a = Nw[r][t];
			a && e.removeEventListener(a, n, i);
		});
	}
	connectDragSource(e, t) {
		let n = this.handleMoveStart.bind(this, e);
		return this.sourceNodes.set(e, t), this.addEventListener(t, "start", n), () => {
			this.sourceNodes.delete(e), this.removeEventListener(t, "start", n);
		};
	}
	connectDragPreview(e, t, n) {
		return this.sourcePreviewNodeOptions.set(e, n), this.sourcePreviewNodes.set(e, t), () => {
			this.sourcePreviewNodes.delete(e), this.sourcePreviewNodeOptions.delete(e);
		};
	}
	connectDropTarget(e, t) {
		let n = this.options.rootElement;
		if (!this.document || !n) return () => {};
		let r = (r) => {
			if (!this.document || !n || !this.monitor.isDragging()) return;
			let i;
			switch (r.type) {
				case Nw.mouse.move:
					i = {
						x: r.clientX,
						y: r.clientY
					};
					break;
				case Nw.touch.move: i = {
					x: r.touches[0]?.clientX || 0,
					y: r.touches[0]?.clientY || 0
				};
			}
			let a = i == null ? void 0 : this.document.elementFromPoint(i.x, i.y), o = a && t.contains(a);
			if (a === t || o) return this.handleMove(r, e);
		};
		return this.addEventListener(this.document.body, "move", r), this.targetNodes.set(e, t), () => {
			this.document && (this.targetNodes.delete(e), this.removeEventListener(this.document.body, "move", r));
		};
	}
	getTopMoveStartHandler() {
		return !this.options.delayTouchStart && !this.options.delayMouseStart ? this.handleTopMoveStart : this.handleTopMoveStartDelay;
	}
	installSourceNodeRemovalObserver(e) {
		this.uninstallSourceNodeRemovalObserver(), this.draggedSourceNode = e, this.draggedSourceNodeRemovalObserver = new MutationObserver(() => {
			e && !e.parentElement && (this.resurrectSourceNode(), this.uninstallSourceNodeRemovalObserver());
		}), !(!e || !e.parentElement) && this.draggedSourceNodeRemovalObserver.observe(e.parentElement, { childList: !0 });
	}
	resurrectSourceNode() {
		this.document && this.draggedSourceNode && (this.draggedSourceNode.style.display = "none", this.draggedSourceNode.removeAttribute("data-reactid"), this.document.body.appendChild(this.draggedSourceNode));
	}
	uninstallSourceNodeRemovalObserver() {
		this.draggedSourceNodeRemovalObserver && this.draggedSourceNodeRemovalObserver.disconnect(), this.draggedSourceNodeRemovalObserver = void 0, this.draggedSourceNode = void 0;
	}
	constructor(e, t, n) {
		this.getSourceClientOffset = (e) => {
			let t = this.sourceNodes.get(e);
			return t && kw(t);
		}, this.handleTopMoveStartCapture = (e) => {
			Tw(e) && (this.moveStartSourceIds = []);
		}, this.handleMoveStart = (e) => {
			Array.isArray(this.moveStartSourceIds) && this.moveStartSourceIds.unshift(e);
		}, this.handleTopMoveStart = (e) => {
			if (!Tw(e)) return;
			let t = jw(e);
			t && (Dw(e) && (this.lastTargetTouchFallback = e.targetTouches[0]), this._mouseClientOffset = t), this.waitingForDelay = !1;
		}, this.handleTopMoveStartDelay = (e) => {
			if (!Tw(e)) return;
			let t = e.type === Nw.touch.start ? this.options.delayTouchStart : this.options.delayMouseStart;
			this.timeout = setTimeout(this.handleTopMoveStart.bind(this, e), t), this.waitingForDelay = !0;
		}, this.handleTopMoveCapture = () => {
			this.dragOverTargetIds = [];
		}, this.handleMove = (e, t) => {
			this.dragOverTargetIds && this.dragOverTargetIds.unshift(t);
		}, this.handleTopMove = (e) => {
			if (this.timeout && clearTimeout(this.timeout), !this.document || this.waitingForDelay) return;
			let { moveStartSourceIds: t, dragOverTargetIds: n } = this, r = this.options.enableHoverOutsideTarget, i = jw(e, this.lastTargetTouchFallback);
			if (!i) return;
			if (this._isScrolling || !this.monitor.isDragging() && Sw(this._mouseClientOffset.x || 0, this._mouseClientOffset.y || 0, i.x, i.y, this.options.scrollAngleRanges)) {
				this._isScrolling = !0;
				return;
			}
			if (!this.monitor.isDragging() && this._mouseClientOffset.hasOwnProperty("x") && t && xw(this._mouseClientOffset.x || 0, this._mouseClientOffset.y || 0, i.x, i.y) > (this.options.touchSlop ? this.options.touchSlop : 0) && (this.moveStartSourceIds = void 0, this.actions.beginDrag(t, {
				clientOffset: this._mouseClientOffset,
				getSourceClientOffset: this.getSourceClientOffset,
				publishSource: !1
			})), !this.monitor.isDragging()) return;
			let a = this.sourceNodes.get(this.monitor.getSourceId());
			this.installSourceNodeRemovalObserver(a), this.actions.publishDragSource(), e.cancelable && e.preventDefault();
			let o = (n || []).map((e) => this.targetNodes.get(e)).filter((e) => !!e), s = this.options.getDropTargetElementsAtPoint ? this.options.getDropTargetElementsAtPoint(i.x, i.y, o) : this.document.elementsFromPoint(i.x, i.y), c = [];
			for (let e in s) {
				if (!s.hasOwnProperty(e)) continue;
				let t = s[e];
				for (t != null && c.push(t); t;) t = t.parentElement, t && c.indexOf(t) === -1 && c.push(t);
			}
			let l = c.filter((e) => o.indexOf(e) > -1).map((e) => this._getDropTargetId(e)).filter((e) => !!e).filter((e, t, n) => n.indexOf(e) === t);
			if (r) for (let e in this.targetNodes) {
				let t = this.targetNodes.get(e);
				if (a && t && t.contains(a) && l.indexOf(e) === -1) {
					l.unshift(e);
					break;
				}
			}
			l.reverse(), this.actions.hover(l, { clientOffset: i });
		}, this._getDropTargetId = (e) => {
			let t = this.targetNodes.keys(), n = t.next();
			for (; n.done === !1;) {
				let r = n.value;
				if (e === this.targetNodes.get(r)) return r;
				n = t.next();
			}
		}, this.handleTopMoveEndCapture = (e) => {
			if (this._isScrolling = !1, this.lastTargetTouchFallback = void 0, Ew(e)) {
				if (!this.monitor.isDragging() || this.monitor.didDrop()) {
					this.moveStartSourceIds = void 0;
					return;
				}
				e.cancelable && e.preventDefault(), this._mouseClientOffset = {}, this.uninstallSourceNodeRemovalObserver(), this.actions.drop(), this.actions.endDrag();
			}
		}, this.handleCancelOnEscape = (e) => {
			e.key === "Escape" && this.monitor.isDragging() && (this._mouseClientOffset = {}, this.uninstallSourceNodeRemovalObserver(), this.actions.endDrag());
		}, this.options = new bw(n, t), this.actions = e.getActions(), this.monitor = e.getMonitor(), this.sourceNodes = /* @__PURE__ */ new Map(), this.sourcePreviewNodes = /* @__PURE__ */ new Map(), this.sourcePreviewNodeOptions = /* @__PURE__ */ new Map(), this.targetNodes = /* @__PURE__ */ new Map(), this.listenerTypes = [], this._mouseClientOffset = {}, this._isScrolling = !1, this.options.enableMouseEvents && this.listenerTypes.push(yw.mouse), this.options.enableTouchEvents && this.listenerTypes.push(yw.touch), this.options.enableKeyboardEvents && this.listenerTypes.push(yw.keyboard);
	}
}, Fw = { backends: [{
	id: "html5",
	backend: vw,
	transition: WC
}, {
	id: "touch",
	backend: function(e, t = {}, n = {}) {
		return new Pw(e, t, n);
	},
	options: { enableMouseEvents: !0 },
	preview: !0,
	transition: UC
}] }, Iw = wn(), Lw = /* @__PURE__ */ D(((e, t) => {
	function n(e) {
		return e === void 0;
	}
	t.exports = n;
})), Rw = /* @__PURE__ */ D(((e, t) => {
	function n(e, t, n) {
		var r = -1, i = e.length;
		t < 0 && (t = -t > i ? 0 : i + t), n = n > i ? i : n, n < 0 && (n += i), i = t > n ? 0 : n - t >>> 0, t >>>= 0;
		for (var a = Array(i); ++r < i;) a[r] = e[r + t];
		return a;
	}
	t.exports = n;
})), zw = /* @__PURE__ */ D(((e) => {
	Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
	var t = n(v());
	function n(e) {
		return e && e.__esModule ? e : { default: e };
	}
	function r(e) {
		return r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
			return typeof e;
		} : function(e) {
			return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
		}, r(e);
	}
	function i(e) {
		for (var t = 1; t < arguments.length; t++) {
			var n = arguments[t] == null ? {} : arguments[t], r = Object.keys(n);
			typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(n).filter(function(e) {
				return Object.getOwnPropertyDescriptor(n, e).enumerable;
			}))), r.forEach(function(t) {
				p(e, t, n[t]);
			});
		}
		return e;
	}
	function a(e, t) {
		if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
	}
	function o(e, t) {
		if (typeof t != "function" && t !== null) throw TypeError("Super expression must either be null or a function");
		s(e.prototype, t && t.prototype), t && s(e, t);
	}
	function s(e, t) {
		return s = Object.setPrototypeOf || function(e, t) {
			return e.__proto__ = t, e;
		}, s(e, t);
	}
	function c(e, t) {
		for (var n = 0; n < t.length; n++) {
			var r = t[n];
			r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
		}
	}
	function l(e, t, n) {
		return t && c(e.prototype, t), n && c(e, n), e;
	}
	function u(e, t) {
		return t && (r(t) === "object" || typeof t == "function") ? t : f(e);
	}
	function d(e) {
		return d = Object.getPrototypeOf || function(e) {
			return e.__proto__;
		}, d(e);
	}
	function f(e) {
		if (e === void 0) throw ReferenceError("this hasn't been initialised - super() hasn't been called");
		return e;
	}
	function p(e, t, n) {
		return t in e ? Object.defineProperty(e, t, {
			value: n,
			enumerable: !0,
			configurable: !0,
			writable: !0
		}) : e[t] = n, e;
	}
	var m = {
		position: "absolute",
		left: 0,
		top: 0,
		right: 0,
		bottom: 0,
		overflow: "hidden",
		zIndex: -1,
		visibility: "hidden",
		pointerEvents: "none"
	}, h = {
		position: "absolute",
		left: 0,
		top: 0,
		transition: "0s"
	};
	function g(e, t) {
		for (var n = e.parentNode; n;) {
			if (n === t) return !0;
			n = n.parentNode;
		}
		return !1;
	}
	var _ = /*#__PURE__*/ function(e) {
		function n() {
			var e, t, r;
			a(this, n);
			var i = [...arguments];
			return u(r, (t = r = u(this, (e = d(n)).call.apply(e, [this].concat(i))), p(f(f(r)), "_expandRef", null), p(f(f(r)), "_shrinkRef", null), p(f(f(r)), "_node", null), p(f(f(r)), "_lastWidth", void 0), p(f(f(r)), "_lastHeight", void 0), p(f(f(r)), "_lastRect", void 0), p(f(f(r)), "_hasResize", !1), p(f(f(r)), "_handleScroll", function(e) {
				(r.props.onPosition || r.props.onReflow || r.props.onResize) && (r._globalScollTarget(e.target) || r._refScrollTarget(e.target) || r._ancestorScollTarget(e.target)) && r._reflow();
			}), p(f(f(r)), "_globalScollTarget", function(e) {
				return e instanceof Node && (r.props.onPosition || r.props.onReflow) && (e === document || e === document.documentElement || e === document.body);
			}), p(f(f(r)), "_refScrollTarget", function(e) {
				if (e instanceof HTMLElement && (e === r._expandRef || e === r._shrinkRef)) {
					var t = e.offsetWidth, n = e.offsetHeight;
					if (t !== r._lastWidth || n !== r._lastHeight) return r._lastWidth = t, r._lastHeight = n, r._reset(r._expandRef), r._reset(r._shrinkRef), !0;
				}
				return !1;
			}), p(f(f(r)), "_ancestorScollTarget", function(e) {
				return e instanceof Node && (r.props.onPosition || r.props.onReflow) && r._node && g(r._node, e);
			}), p(f(f(r)), "_reflow", function() {
				if (!(!r._node || !(r._node.parentNode instanceof Element))) {
					var e = r._node.parentNode.getBoundingClientRect(), t = !0, n = !0;
					r._lastRect && (t = e.width !== r._lastRect.width || e.height !== r._lastRect.height, n = e.top !== r._lastRect.top || e.left !== r._lastRect.left), r._lastRect = e, t && r.props.onResize && r.props.onResize(e), n && r.props.onPosition && r.props.onPosition(e), (t || n) && r.props.onReflow && r.props.onReflow(e);
				}
			}), p(f(f(r)), "_handleRef", function(e) {
				r._node = e;
			}), p(f(f(r)), "_handleExpandRef", function(e) {
				r._reset(e), r._expandRef = e;
			}), p(f(f(r)), "_handleShrinkRef", function(e) {
				r._reset(e), r._shrinkRef = e;
			}), t));
		}
		return l(n, [
			{
				key: "componentDidMount",
				value: function() {
					this._reflow(), window.addEventListener("scroll", this._handleScroll, !0), (this.props.onPosition || this.props.onReflow) && (window.addEventListener("resize", this._reflow, !0), this._hasResize = !0);
				}
			},
			{
				key: "componentDidUpdate",
				value: function() {
					(this.props.onPosition || this.props.onReflow) && !this._hasResize ? (window.addEventListener("resize", this._reflow, !0), this._hasResize = !0) : !(this.props.onPosition || this.props.onReflow) && this._hasResize && (window.removeEventListener("resize", this._reflow, !0), this._hasResize = !1);
				}
			},
			{
				key: "componentWillUnmount",
				value: function() {
					window.removeEventListener("scroll", this._handleScroll, !0), this._hasResize && window.removeEventListener("resize", this._reflow, !0);
				}
			},
			{
				key: "_reset",
				value: function(e) {
					e && (e.scrollLeft = 1e5, e.scrollTop = 1e5);
				}
			},
			{
				key: "render",
				value: function() {
					return this.props.onResize || this.props.onReflow ? t.default.createElement("div", {
						style: m,
						ref: this._handleRef
					}, t.default.createElement("div", {
						ref: this._handleExpandRef,
						style: m
					}, t.default.createElement("div", { style: i({}, h, {
						width: 1e5,
						height: 1e5
					}) })), t.default.createElement("div", {
						ref: this._handleShrinkRef,
						style: m
					}, t.default.createElement("div", { style: i({}, h, {
						width: "200%",
						height: "200%"
					}) }))) : t.default.createElement("noscript", { ref: this._handleRef });
				}
			}
		]), o(n, e), n;
	}(t.default.Component);
	p(_, "displayName", "ResizeObserver"), e.default = _;
})), Bw = typeof global == "object" && global && global.Object === Object && global, Vw = typeof self == "object" && self && self.Object === Object && self, Hw = Bw || Vw || Function("return this")(), Uw = Hw.Symbol, Ww = Object.prototype, Gw = Ww.hasOwnProperty, Kw = Ww.toString, qw = Uw ? Uw.toStringTag : void 0;
function Jw(e) {
	var t = Gw.call(e, qw), n = e[qw];
	try {
		e[qw] = void 0;
		var r = !0;
	} catch {}
	var i = Kw.call(e);
	return r && (t ? e[qw] = n : delete e[qw]), i;
}
//#endregion
//#region node_modules/lodash-es/_objectToString.js
var Yw = Object.prototype.toString;
function Xw(e) {
	return Yw.call(e);
}
//#endregion
//#region node_modules/lodash-es/_baseGetTag.js
var Zw = "[object Null]", Qw = "[object Undefined]", $w = Uw ? Uw.toStringTag : void 0;
function eT(e) {
	return e == null ? e === void 0 ? Qw : Zw : $w && $w in Object(e) ? Jw(e) : Xw(e);
}
//#endregion
//#region node_modules/lodash-es/isObjectLike.js
function tT(e) {
	return typeof e == "object" && !!e;
}
//#endregion
//#region node_modules/lodash-es/isSymbol.js
var nT = "[object Symbol]";
function rT(e) {
	return typeof e == "symbol" || tT(e) && eT(e) == nT;
}
//#endregion
//#region node_modules/lodash-es/_arrayMap.js
function iT(e, t) {
	for (var n = -1, r = e == null ? 0 : e.length, i = Array(r); ++n < r;) i[n] = t(e[n], n, e);
	return i;
}
//#endregion
//#region node_modules/lodash-es/isArray.js
var aT = Array.isArray, oT = 1 / 0, sT = Uw ? Uw.prototype : void 0, cT = sT ? sT.toString : void 0;
function lT(e) {
	if (typeof e == "string") return e;
	if (aT(e)) return iT(e, lT) + "";
	if (rT(e)) return cT ? cT.call(e) : "";
	var t = e + "";
	return t == "0" && 1 / e == -oT ? "-0" : t;
}
//#endregion
//#region node_modules/lodash-es/_trimmedEndIndex.js
var uT = /\s/;
function dT(e) {
	for (var t = e.length; t-- && uT.test(e.charAt(t)););
	return t;
}
//#endregion
//#region node_modules/lodash-es/_baseTrim.js
var fT = /^\s+/;
function pT(e) {
	return e && e.slice(0, dT(e) + 1).replace(fT, "");
}
//#endregion
//#region node_modules/lodash-es/isObject.js
function mT(e) {
	var t = typeof e;
	return e != null && (t == "object" || t == "function");
}
//#endregion
//#region node_modules/lodash-es/toNumber.js
var hT = NaN, gT = /^[-+]0x[0-9a-f]+$/i, _T = /^0b[01]+$/i, vT = /^0o[0-7]+$/i, yT = parseInt;
function bT(e) {
	if (typeof e == "number") return e;
	if (rT(e)) return hT;
	if (mT(e)) {
		var t = typeof e.valueOf == "function" ? e.valueOf() : e;
		e = mT(t) ? t + "" : t;
	}
	if (typeof e != "string") return e === 0 ? e : +e;
	e = pT(e);
	var n = _T.test(e);
	return n || vT.test(e) ? yT(e.slice(2), n ? 2 : 8) : gT.test(e) ? hT : +e;
}
//#endregion
//#region node_modules/lodash-es/toFinite.js
var xT = 1 / 0, ST = 17976931348623157e292;
function CT(e) {
	return e ? (e = bT(e), e === xT || e === -xT ? (e < 0 ? -1 : 1) * ST : e === e ? e : 0) : e === 0 ? e : 0;
}
//#endregion
//#region node_modules/lodash-es/toInteger.js
function wT(e) {
	var t = CT(e), n = t % 1;
	return t === t ? n ? t - n : t : 0;
}
//#endregion
//#region node_modules/lodash-es/identity.js
function TT(e) {
	return e;
}
//#endregion
//#region node_modules/lodash-es/isFunction.js
var ET = "[object AsyncFunction]", DT = "[object Function]", OT = "[object GeneratorFunction]", kT = "[object Proxy]";
function AT(e) {
	if (!mT(e)) return !1;
	var t = eT(e);
	return t == DT || t == OT || t == ET || t == kT;
}
//#endregion
//#region node_modules/lodash-es/_coreJsData.js
var jT = Hw["__core-js_shared__"], MT = function() {
	var e = /[^.]+$/.exec(jT && jT.keys && jT.keys.IE_PROTO || "");
	return e ? "Symbol(src)_1." + e : "";
}();
function NT(e) {
	return !!MT && MT in e;
}
//#endregion
//#region node_modules/lodash-es/_toSource.js
var PT = Function.prototype.toString;
function FT(e) {
	if (e != null) {
		try {
			return PT.call(e);
		} catch {}
		try {
			return e + "";
		} catch {}
	}
	return "";
}
//#endregion
//#region node_modules/lodash-es/_baseIsNative.js
var IT = /[\\^$.*+?()[\]{}|]/g, LT = /^\[object .+?Constructor\]$/, RT = Function.prototype, zT = Object.prototype, BT = RT.toString, VT = zT.hasOwnProperty, HT = RegExp("^" + BT.call(VT).replace(IT, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
function UT(e) {
	return !mT(e) || NT(e) ? !1 : (AT(e) ? HT : LT).test(FT(e));
}
//#endregion
//#region node_modules/lodash-es/_getValue.js
function WT(e, t) {
	return e?.[t];
}
//#endregion
//#region node_modules/lodash-es/_getNative.js
function GT(e, t) {
	var n = WT(e, t);
	return UT(n) ? n : void 0;
}
//#endregion
//#region node_modules/lodash-es/_WeakMap.js
var KT = GT(Hw, "WeakMap"), qT = Object.create, JT = function() {
	function e() {}
	return function(t) {
		if (!mT(t)) return {};
		if (qT) return qT(t);
		e.prototype = t;
		var n = new e();
		return e.prototype = void 0, n;
	};
}();
//#endregion
//#region node_modules/lodash-es/_apply.js
function YT(e, t, n) {
	switch (n.length) {
		case 0: return e.call(t);
		case 1: return e.call(t, n[0]);
		case 2: return e.call(t, n[0], n[1]);
		case 3: return e.call(t, n[0], n[1], n[2]);
	}
	return e.apply(t, n);
}
//#endregion
//#region node_modules/lodash-es/noop.js
function XT() {}
//#endregion
//#region node_modules/lodash-es/_copyArray.js
function ZT(e, t) {
	var n = -1, r = e.length;
	for (t ||= Array(r); ++n < r;) t[n] = e[n];
	return t;
}
//#endregion
//#region node_modules/lodash-es/_shortOut.js
var QT = 800, $T = 16, eE = Date.now;
function tE(e) {
	var t = 0, n = 0;
	return function() {
		var r = eE(), i = $T - (r - n);
		if (n = r, i > 0) {
			if (++t >= QT) return arguments[0];
		} else t = 0;
		return e.apply(void 0, arguments);
	};
}
//#endregion
//#region node_modules/lodash-es/constant.js
function nE(e) {
	return function() {
		return e;
	};
}
//#endregion
//#region node_modules/lodash-es/_defineProperty.js
var rE = function() {
	try {
		var e = GT(Object, "defineProperty");
		return e({}, "", {}), e;
	} catch {}
}(), iE = tE(rE ? function(e, t) {
	return rE(e, "toString", {
		configurable: !0,
		enumerable: !1,
		value: nE(t),
		writable: !0
	});
} : TT);
//#endregion
//#region node_modules/lodash-es/_arrayEach.js
function aE(e, t) {
	for (var n = -1, r = e == null ? 0 : e.length; ++n < r && t(e[n], n, e) !== !1;);
	return e;
}
//#endregion
//#region node_modules/lodash-es/_isIndex.js
var oE = 9007199254740991, sE = /^(?:0|[1-9]\d*)$/;
function cE(e, t) {
	var n = typeof e;
	return t ??= oE, !!t && (n == "number" || n != "symbol" && sE.test(e)) && e > -1 && e % 1 == 0 && e < t;
}
//#endregion
//#region node_modules/lodash-es/_baseAssignValue.js
function lE(e, t, n) {
	t == "__proto__" && rE ? rE(e, t, {
		configurable: !0,
		enumerable: !0,
		value: n,
		writable: !0
	}) : e[t] = n;
}
//#endregion
//#region node_modules/lodash-es/eq.js
function uE(e, t) {
	return e === t || e !== e && t !== t;
}
//#endregion
//#region node_modules/lodash-es/_assignValue.js
var dE = Object.prototype.hasOwnProperty;
function fE(e, t, n) {
	var r = e[t];
	(!(dE.call(e, t) && uE(r, n)) || n === void 0 && !(t in e)) && lE(e, t, n);
}
//#endregion
//#region node_modules/lodash-es/_copyObject.js
function pE(e, t, n, r) {
	var i = !n;
	n ||= {};
	for (var a = -1, o = t.length; ++a < o;) {
		var s = t[a], c = r ? r(n[s], e[s], s, n, e) : void 0;
		c === void 0 && (c = e[s]), i ? lE(n, s, c) : fE(n, s, c);
	}
	return n;
}
//#endregion
//#region node_modules/lodash-es/_overRest.js
var mE = Math.max;
function hE(e, t, n) {
	return t = mE(t === void 0 ? e.length - 1 : t, 0), function() {
		for (var r = arguments, i = -1, a = mE(r.length - t, 0), o = Array(a); ++i < a;) o[i] = r[t + i];
		i = -1;
		for (var s = Array(t + 1); ++i < t;) s[i] = r[i];
		return s[t] = n(o), YT(e, this, s);
	};
}
//#endregion
//#region node_modules/lodash-es/_baseRest.js
function gE(e, t) {
	return iE(hE(e, t, TT), e + "");
}
//#endregion
//#region node_modules/lodash-es/isLength.js
var _E = 9007199254740991;
function vE(e) {
	return typeof e == "number" && e > -1 && e % 1 == 0 && e <= _E;
}
//#endregion
//#region node_modules/lodash-es/isArrayLike.js
function yE(e) {
	return e != null && vE(e.length) && !AT(e);
}
//#endregion
//#region node_modules/lodash-es/_isPrototype.js
var bE = Object.prototype;
function xE(e) {
	var t = e && e.constructor;
	return e === (typeof t == "function" && t.prototype || bE);
}
//#endregion
//#region node_modules/lodash-es/_baseTimes.js
function SE(e, t) {
	for (var n = -1, r = Array(e); ++n < e;) r[n] = t(n);
	return r;
}
//#endregion
//#region node_modules/lodash-es/_baseIsArguments.js
var CE = "[object Arguments]";
function wE(e) {
	return tT(e) && eT(e) == CE;
}
//#endregion
//#region node_modules/lodash-es/isArguments.js
var TE = Object.prototype, EE = TE.hasOwnProperty, DE = TE.propertyIsEnumerable, OE = wE(function() {
	return arguments;
}()) ? wE : function(e) {
	return tT(e) && EE.call(e, "callee") && !DE.call(e, "callee");
};
//#endregion
//#region node_modules/lodash-es/stubFalse.js
function kE() {
	return !1;
}
//#endregion
//#region node_modules/lodash-es/isBuffer.js
var AE = typeof exports == "object" && exports && !exports.nodeType && exports, jE = AE && typeof module == "object" && module && !module.nodeType && module, ME = jE && jE.exports === AE ? Hw.Buffer : void 0, NE = (ME ? ME.isBuffer : void 0) || kE, PE = "[object Arguments]", FE = "[object Array]", IE = "[object Boolean]", LE = "[object Date]", RE = "[object Error]", zE = "[object Function]", BE = "[object Map]", VE = "[object Number]", HE = "[object Object]", UE = "[object RegExp]", WE = "[object Set]", GE = "[object String]", KE = "[object WeakMap]", qE = "[object ArrayBuffer]", JE = "[object DataView]", YE = "[object Float32Array]", XE = "[object Float64Array]", ZE = "[object Int8Array]", QE = "[object Int16Array]", $E = "[object Int32Array]", eD = "[object Uint8Array]", tD = "[object Uint8ClampedArray]", nD = "[object Uint16Array]", rD = "[object Uint32Array]", iD = {};
iD[YE] = iD[XE] = iD[ZE] = iD[QE] = iD[$E] = iD[eD] = iD[tD] = iD[nD] = iD[rD] = !0, iD[PE] = iD[FE] = iD[qE] = iD[IE] = iD[JE] = iD[LE] = iD[RE] = iD[zE] = iD[BE] = iD[VE] = iD[HE] = iD[UE] = iD[WE] = iD[GE] = iD[KE] = !1;
function aD(e) {
	return tT(e) && vE(e.length) && !!iD[eT(e)];
}
//#endregion
//#region node_modules/lodash-es/_baseUnary.js
function oD(e) {
	return function(t) {
		return e(t);
	};
}
//#endregion
//#region node_modules/lodash-es/_nodeUtil.js
var sD = typeof exports == "object" && exports && !exports.nodeType && exports, cD = sD && typeof module == "object" && module && !module.nodeType && module, lD = cD && cD.exports === sD && Bw.process, uD = function() {
	try {
		return cD && cD.require && cD.require("util").types || lD && lD.binding && lD.binding("util");
	} catch {}
}(), dD = uD && uD.isTypedArray, fD = dD ? oD(dD) : aD, pD = Object.prototype.hasOwnProperty;
function mD(e, t) {
	var n = aT(e), r = !n && OE(e), i = !n && !r && NE(e), a = !n && !r && !i && fD(e), o = n || r || i || a, s = o ? SE(e.length, String) : [], c = s.length;
	for (var l in e) (t || pD.call(e, l)) && !(o && (l == "length" || i && (l == "offset" || l == "parent") || a && (l == "buffer" || l == "byteLength" || l == "byteOffset") || cE(l, c))) && s.push(l);
	return s;
}
//#endregion
//#region node_modules/lodash-es/_overArg.js
function hD(e, t) {
	return function(n) {
		return e(t(n));
	};
}
//#endregion
//#region node_modules/lodash-es/_nativeKeys.js
var gD = hD(Object.keys, Object), _D = Object.prototype.hasOwnProperty;
function vD(e) {
	if (!xE(e)) return gD(e);
	var t = [];
	for (var n in Object(e)) _D.call(e, n) && n != "constructor" && t.push(n);
	return t;
}
//#endregion
//#region node_modules/lodash-es/keys.js
function yD(e) {
	return yE(e) ? mD(e) : vD(e);
}
//#endregion
//#region node_modules/lodash-es/_nativeKeysIn.js
function bD(e) {
	var t = [];
	if (e != null) for (var n in Object(e)) t.push(n);
	return t;
}
//#endregion
//#region node_modules/lodash-es/_baseKeysIn.js
var xD = Object.prototype.hasOwnProperty;
function SD(e) {
	if (!mT(e)) return bD(e);
	var t = xE(e), n = [];
	for (var r in e) r == "constructor" && (t || !xD.call(e, r)) || n.push(r);
	return n;
}
//#endregion
//#region node_modules/lodash-es/keysIn.js
function CD(e) {
	return yE(e) ? mD(e, !0) : SD(e);
}
//#endregion
//#region node_modules/lodash-es/_nativeCreate.js
var wD = GT(Object, "create");
//#endregion
//#region node_modules/lodash-es/_hashClear.js
function TD() {
	this.__data__ = wD ? wD(null) : {}, this.size = 0;
}
//#endregion
//#region node_modules/lodash-es/_hashDelete.js
function ED(e) {
	var t = this.has(e) && delete this.__data__[e];
	return this.size -= +!!t, t;
}
//#endregion
//#region node_modules/lodash-es/_hashGet.js
var DD = "__lodash_hash_undefined__", OD = Object.prototype.hasOwnProperty;
function kD(e) {
	var t = this.__data__;
	if (wD) {
		var n = t[e];
		return n === DD ? void 0 : n;
	}
	return OD.call(t, e) ? t[e] : void 0;
}
//#endregion
//#region node_modules/lodash-es/_hashHas.js
var AD = Object.prototype.hasOwnProperty;
function jD(e) {
	var t = this.__data__;
	return wD ? t[e] !== void 0 : AD.call(t, e);
}
//#endregion
//#region node_modules/lodash-es/_hashSet.js
var MD = "__lodash_hash_undefined__";
function ND(e, t) {
	var n = this.__data__;
	return this.size += +!this.has(e), n[e] = wD && t === void 0 ? MD : t, this;
}
//#endregion
//#region node_modules/lodash-es/_Hash.js
function PD(e) {
	var t = -1, n = e == null ? 0 : e.length;
	for (this.clear(); ++t < n;) {
		var r = e[t];
		this.set(r[0], r[1]);
	}
}
PD.prototype.clear = TD, PD.prototype.delete = ED, PD.prototype.get = kD, PD.prototype.has = jD, PD.prototype.set = ND;
//#endregion
//#region node_modules/lodash-es/_listCacheClear.js
function FD() {
	this.__data__ = [], this.size = 0;
}
//#endregion
//#region node_modules/lodash-es/_assocIndexOf.js
function ID(e, t) {
	for (var n = e.length; n--;) if (uE(e[n][0], t)) return n;
	return -1;
}
//#endregion
//#region node_modules/lodash-es/_listCacheDelete.js
var LD = Array.prototype.splice;
function RD(e) {
	var t = this.__data__, n = ID(t, e);
	return n < 0 ? !1 : (n == t.length - 1 ? t.pop() : LD.call(t, n, 1), --this.size, !0);
}
//#endregion
//#region node_modules/lodash-es/_listCacheGet.js
function zD(e) {
	var t = this.__data__, n = ID(t, e);
	return n < 0 ? void 0 : t[n][1];
}
//#endregion
//#region node_modules/lodash-es/_listCacheHas.js
function BD(e) {
	return ID(this.__data__, e) > -1;
}
//#endregion
//#region node_modules/lodash-es/_listCacheSet.js
function VD(e, t) {
	var n = this.__data__, r = ID(n, e);
	return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this;
}
//#endregion
//#region node_modules/lodash-es/_ListCache.js
function HD(e) {
	var t = -1, n = e == null ? 0 : e.length;
	for (this.clear(); ++t < n;) {
		var r = e[t];
		this.set(r[0], r[1]);
	}
}
HD.prototype.clear = FD, HD.prototype.delete = RD, HD.prototype.get = zD, HD.prototype.has = BD, HD.prototype.set = VD;
//#endregion
//#region node_modules/lodash-es/_Map.js
var UD = GT(Hw, "Map");
//#endregion
//#region node_modules/lodash-es/_mapCacheClear.js
function WD() {
	this.size = 0, this.__data__ = {
		hash: new PD(),
		map: new (UD || HD)(),
		string: new PD()
	};
}
//#endregion
//#region node_modules/lodash-es/_isKeyable.js
function GD(e) {
	var t = typeof e;
	return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
}
//#endregion
//#region node_modules/lodash-es/_getMapData.js
function KD(e, t) {
	var n = e.__data__;
	return GD(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
}
//#endregion
//#region node_modules/lodash-es/_mapCacheDelete.js
function qD(e) {
	var t = KD(this, e).delete(e);
	return this.size -= +!!t, t;
}
//#endregion
//#region node_modules/lodash-es/_mapCacheGet.js
function JD(e) {
	return KD(this, e).get(e);
}
//#endregion
//#region node_modules/lodash-es/_mapCacheHas.js
function YD(e) {
	return KD(this, e).has(e);
}
//#endregion
//#region node_modules/lodash-es/_mapCacheSet.js
function XD(e, t) {
	var n = KD(this, e), r = n.size;
	return n.set(e, t), this.size += n.size == r ? 0 : 1, this;
}
//#endregion
//#region node_modules/lodash-es/_MapCache.js
function ZD(e) {
	var t = -1, n = e == null ? 0 : e.length;
	for (this.clear(); ++t < n;) {
		var r = e[t];
		this.set(r[0], r[1]);
	}
}
ZD.prototype.clear = WD, ZD.prototype.delete = qD, ZD.prototype.get = JD, ZD.prototype.has = YD, ZD.prototype.set = XD;
//#endregion
//#region node_modules/lodash-es/toString.js
function QD(e) {
	return e == null ? "" : lT(e);
}
//#endregion
//#region node_modules/lodash-es/_arrayPush.js
function $D(e, t) {
	for (var n = -1, r = t.length, i = e.length; ++n < r;) e[i + n] = t[n];
	return e;
}
//#endregion
//#region node_modules/lodash-es/_isFlattenable.js
var eO = Uw ? Uw.isConcatSpreadable : void 0;
function tO(e) {
	return aT(e) || OE(e) || !!(eO && e && e[eO]);
}
//#endregion
//#region node_modules/lodash-es/_baseFlatten.js
function nO(e, t, n, r, i) {
	var a = -1, o = e.length;
	for (n ||= tO, i ||= []; ++a < o;) {
		var s = e[a];
		t > 0 && n(s) ? t > 1 ? nO(s, t - 1, n, r, i) : $D(i, s) : r || (i[i.length] = s);
	}
	return i;
}
//#endregion
//#region node_modules/lodash-es/flatten.js
function rO(e) {
	return e != null && e.length ? nO(e, 1) : [];
}
//#endregion
//#region node_modules/lodash-es/_getPrototype.js
var iO = hD(Object.getPrototypeOf, Object);
//#endregion
//#region node_modules/lodash-es/_baseSlice.js
function aO(e, t, n) {
	var r = -1, i = e.length;
	t < 0 && (t = -t > i ? 0 : i + t), n = n > i ? i : n, n < 0 && (n += i), i = t > n ? 0 : n - t >>> 0, t >>>= 0;
	for (var a = Array(i); ++r < i;) a[r] = e[r + t];
	return a;
}
//#endregion
//#region node_modules/lodash-es/_arrayReduce.js
function oO(e, t, n, r) {
	var i = -1, a = e == null ? 0 : e.length;
	for (r && a && (n = e[++i]); ++i < a;) n = t(n, e[i], i, e);
	return n;
}
//#endregion
//#region node_modules/lodash-es/_basePropertyOf.js
function sO(e) {
	return function(t) {
		return e?.[t];
	};
}
//#endregion
//#region node_modules/lodash-es/_deburrLetter.js
var cO = sO({
	À: "A",
	Á: "A",
	Â: "A",
	Ã: "A",
	Ä: "A",
	Å: "A",
	à: "a",
	á: "a",
	â: "a",
	ã: "a",
	ä: "a",
	å: "a",
	Ç: "C",
	ç: "c",
	Ð: "D",
	ð: "d",
	È: "E",
	É: "E",
	Ê: "E",
	Ë: "E",
	è: "e",
	é: "e",
	ê: "e",
	ë: "e",
	Ì: "I",
	Í: "I",
	Î: "I",
	Ï: "I",
	ì: "i",
	í: "i",
	î: "i",
	ï: "i",
	Ñ: "N",
	ñ: "n",
	Ò: "O",
	Ó: "O",
	Ô: "O",
	Õ: "O",
	Ö: "O",
	Ø: "O",
	ò: "o",
	ó: "o",
	ô: "o",
	õ: "o",
	ö: "o",
	ø: "o",
	Ù: "U",
	Ú: "U",
	Û: "U",
	Ü: "U",
	ù: "u",
	ú: "u",
	û: "u",
	ü: "u",
	Ý: "Y",
	ý: "y",
	ÿ: "y",
	Æ: "Ae",
	æ: "ae",
	Þ: "Th",
	þ: "th",
	ß: "ss",
	Ā: "A",
	Ă: "A",
	Ą: "A",
	ā: "a",
	ă: "a",
	ą: "a",
	Ć: "C",
	Ĉ: "C",
	Ċ: "C",
	Č: "C",
	ć: "c",
	ĉ: "c",
	ċ: "c",
	č: "c",
	Ď: "D",
	Đ: "D",
	ď: "d",
	đ: "d",
	Ē: "E",
	Ĕ: "E",
	Ė: "E",
	Ę: "E",
	Ě: "E",
	ē: "e",
	ĕ: "e",
	ė: "e",
	ę: "e",
	ě: "e",
	Ĝ: "G",
	Ğ: "G",
	Ġ: "G",
	Ģ: "G",
	ĝ: "g",
	ğ: "g",
	ġ: "g",
	ģ: "g",
	Ĥ: "H",
	Ħ: "H",
	ĥ: "h",
	ħ: "h",
	Ĩ: "I",
	Ī: "I",
	Ĭ: "I",
	Į: "I",
	İ: "I",
	ĩ: "i",
	ī: "i",
	ĭ: "i",
	į: "i",
	ı: "i",
	Ĵ: "J",
	ĵ: "j",
	Ķ: "K",
	ķ: "k",
	ĸ: "k",
	Ĺ: "L",
	Ļ: "L",
	Ľ: "L",
	Ŀ: "L",
	Ł: "L",
	ĺ: "l",
	ļ: "l",
	ľ: "l",
	ŀ: "l",
	ł: "l",
	Ń: "N",
	Ņ: "N",
	Ň: "N",
	Ŋ: "N",
	ń: "n",
	ņ: "n",
	ň: "n",
	ŋ: "n",
	Ō: "O",
	Ŏ: "O",
	Ő: "O",
	ō: "o",
	ŏ: "o",
	ő: "o",
	Ŕ: "R",
	Ŗ: "R",
	Ř: "R",
	ŕ: "r",
	ŗ: "r",
	ř: "r",
	Ś: "S",
	Ŝ: "S",
	Ş: "S",
	Š: "S",
	ś: "s",
	ŝ: "s",
	ş: "s",
	š: "s",
	Ţ: "T",
	Ť: "T",
	Ŧ: "T",
	ţ: "t",
	ť: "t",
	ŧ: "t",
	Ũ: "U",
	Ū: "U",
	Ŭ: "U",
	Ů: "U",
	Ű: "U",
	Ų: "U",
	ũ: "u",
	ū: "u",
	ŭ: "u",
	ů: "u",
	ű: "u",
	ų: "u",
	Ŵ: "W",
	ŵ: "w",
	Ŷ: "Y",
	ŷ: "y",
	Ÿ: "Y",
	Ź: "Z",
	Ż: "Z",
	Ž: "Z",
	ź: "z",
	ż: "z",
	ž: "z",
	IJ: "IJ",
	ij: "ij",
	Œ: "Oe",
	œ: "oe",
	ʼn: "'n",
	ſ: "s"
}), lO = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, uO = RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", "g");
function dO(e) {
	return e = QD(e), e && e.replace(lO, cO).replace(uO, "");
}
//#endregion
//#region node_modules/lodash-es/_asciiWords.js
var fO = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
function pO(e) {
	return e.match(fO) || [];
}
//#endregion
//#region node_modules/lodash-es/_hasUnicodeWord.js
var mO = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
function hO(e) {
	return mO.test(e);
}
//#endregion
//#region node_modules/lodash-es/_unicodeWords.js
var gO = "\\ud800-\\udfff", _O = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", vO = "\\u2700-\\u27bf", yO = "a-z\\xdf-\\xf6\\xf8-\\xff", bO = "\\xac\\xb1\\xd7\\xf7", xO = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", SO = "\\u2000-\\u206f", CO = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", wO = "A-Z\\xc0-\\xd6\\xd8-\\xde", TO = "\\ufe0e\\ufe0f", EO = bO + xO + SO + CO, DO = "['’]", OO = "[" + EO + "]", kO = "[" + _O + "]", AO = "\\d+", jO = "[" + vO + "]", MO = "[" + yO + "]", NO = "[^" + gO + EO + AO + vO + yO + wO + "]", PO = "(?:" + kO + "|\\ud83c[\\udffb-\\udfff])", FO = "[^" + gO + "]", IO = "(?:\\ud83c[\\udde6-\\uddff]){2}", LO = "[\\ud800-\\udbff][\\udc00-\\udfff]", RO = "[" + wO + "]", zO = "\\u200d", BO = "(?:" + MO + "|" + NO + ")", VO = "(?:" + RO + "|" + NO + ")", HO = "(?:" + DO + "(?:d|ll|m|re|s|t|ve))?", UO = "(?:" + DO + "(?:D|LL|M|RE|S|T|VE))?", WO = PO + "?", GO = "[" + TO + "]?", KO = "(?:" + zO + "(?:" + [
	FO,
	IO,
	LO
].join("|") + ")" + GO + WO + ")*", qO = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", JO = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", YO = GO + WO + KO, XO = "(?:" + [
	jO,
	IO,
	LO
].join("|") + ")" + YO, ZO = RegExp([
	RO + "?" + MO + "+" + HO + "(?=" + [
		OO,
		RO,
		"$"
	].join("|") + ")",
	VO + "+" + UO + "(?=" + [
		OO,
		RO + BO,
		"$"
	].join("|") + ")",
	RO + "?" + BO + "+" + HO,
	RO + "+" + UO,
	JO,
	qO,
	AO,
	XO
].join("|"), "g");
function QO(e) {
	return e.match(ZO) || [];
}
//#endregion
//#region node_modules/lodash-es/words.js
function $O(e, t, n) {
	return e = QD(e), t = n ? void 0 : t, t === void 0 ? hO(e) ? QO(e) : pO(e) : e.match(t) || [];
}
//#endregion
//#region node_modules/lodash-es/_createCompounder.js
var ek = RegExp("['’]", "g");
function tk(e) {
	return function(t) {
		return oO($O(dO(t).replace(ek, "")), e, "");
	};
}
//#endregion
//#region node_modules/lodash-es/_baseClamp.js
function nk(e, t, n) {
	return e === e && (n !== void 0 && (e = e <= n ? e : n), t !== void 0 && (e = e >= t ? e : t)), e;
}
//#endregion
//#region node_modules/lodash-es/clamp.js
function rk(e, t, n) {
	return n === void 0 && (n = t, t = void 0), n !== void 0 && (n = bT(n), n = n === n ? n : 0), t !== void 0 && (t = bT(t), t = t === t ? t : 0), nk(bT(e), t, n);
}
//#endregion
//#region node_modules/lodash-es/_stackClear.js
function ik() {
	this.__data__ = new HD(), this.size = 0;
}
//#endregion
//#region node_modules/lodash-es/_stackDelete.js
function ak(e) {
	var t = this.__data__, n = t.delete(e);
	return this.size = t.size, n;
}
//#endregion
//#region node_modules/lodash-es/_stackGet.js
function ok(e) {
	return this.__data__.get(e);
}
//#endregion
//#region node_modules/lodash-es/_stackHas.js
function sk(e) {
	return this.__data__.has(e);
}
//#endregion
//#region node_modules/lodash-es/_stackSet.js
var ck = 200;
function lk(e, t) {
	var n = this.__data__;
	if (n instanceof HD) {
		var r = n.__data__;
		if (!UD || r.length < ck - 1) return r.push([e, t]), this.size = ++n.size, this;
		n = this.__data__ = new ZD(r);
	}
	return n.set(e, t), this.size = n.size, this;
}
//#endregion
//#region node_modules/lodash-es/_Stack.js
function uk(e) {
	var t = this.__data__ = new HD(e);
	this.size = t.size;
}
uk.prototype.clear = ik, uk.prototype.delete = ak, uk.prototype.get = ok, uk.prototype.has = sk, uk.prototype.set = lk;
//#endregion
//#region node_modules/lodash-es/_baseAssign.js
function dk(e, t) {
	return e && pE(t, yD(t), e);
}
//#endregion
//#region node_modules/lodash-es/_baseAssignIn.js
function fk(e, t) {
	return e && pE(t, CD(t), e);
}
//#endregion
//#region node_modules/lodash-es/_cloneBuffer.js
var pk = typeof exports == "object" && exports && !exports.nodeType && exports, mk = pk && typeof module == "object" && module && !module.nodeType && module, hk = mk && mk.exports === pk ? Hw.Buffer : void 0, gk = hk ? hk.allocUnsafe : void 0;
function _k(e, t) {
	if (t) return e.slice();
	var n = e.length, r = gk ? gk(n) : new e.constructor(n);
	return e.copy(r), r;
}
//#endregion
//#region node_modules/lodash-es/_arrayFilter.js
function vk(e, t) {
	for (var n = -1, r = e == null ? 0 : e.length, i = 0, a = []; ++n < r;) {
		var o = e[n];
		t(o, n, e) && (a[i++] = o);
	}
	return a;
}
//#endregion
//#region node_modules/lodash-es/stubArray.js
function yk() {
	return [];
}
//#endregion
//#region node_modules/lodash-es/_getSymbols.js
var bk = Object.prototype.propertyIsEnumerable, xk = Object.getOwnPropertySymbols, Sk = xk ? function(e) {
	return e == null ? [] : (e = Object(e), vk(xk(e), function(t) {
		return bk.call(e, t);
	}));
} : yk;
//#endregion
//#region node_modules/lodash-es/_copySymbols.js
function Ck(e, t) {
	return pE(e, Sk(e), t);
}
//#endregion
//#region node_modules/lodash-es/_getSymbolsIn.js
var wk = Object.getOwnPropertySymbols ? function(e) {
	for (var t = []; e;) $D(t, Sk(e)), e = iO(e);
	return t;
} : yk;
//#endregion
//#region node_modules/lodash-es/_copySymbolsIn.js
function Tk(e, t) {
	return pE(e, wk(e), t);
}
//#endregion
//#region node_modules/lodash-es/_baseGetAllKeys.js
function Ek(e, t, n) {
	var r = t(e);
	return aT(e) ? r : $D(r, n(e));
}
//#endregion
//#region node_modules/lodash-es/_getAllKeys.js
function Dk(e) {
	return Ek(e, yD, Sk);
}
//#endregion
//#region node_modules/lodash-es/_getAllKeysIn.js
function Ok(e) {
	return Ek(e, CD, wk);
}
//#endregion
//#region node_modules/lodash-es/_DataView.js
var kk = GT(Hw, "DataView"), Ak = GT(Hw, "Promise"), jk = GT(Hw, "Set"), Mk = "[object Map]", Nk = "[object Object]", Pk = "[object Promise]", Fk = "[object Set]", Ik = "[object WeakMap]", Lk = "[object DataView]", Rk = FT(kk), zk = FT(UD), Bk = FT(Ak), Vk = FT(jk), Hk = FT(KT), Uk = eT;
(kk && Uk(new kk(/* @__PURE__ */ new ArrayBuffer(1))) != Lk || UD && Uk(new UD()) != Mk || Ak && Uk(Ak.resolve()) != Pk || jk && Uk(new jk()) != Fk || KT && Uk(new KT()) != Ik) && (Uk = function(e) {
	var t = eT(e), n = t == Nk ? e.constructor : void 0, r = n ? FT(n) : "";
	if (r) switch (r) {
		case Rk: return Lk;
		case zk: return Mk;
		case Bk: return Pk;
		case Vk: return Fk;
		case Hk: return Ik;
	}
	return t;
});
var Wk = Uk, Gk = Object.prototype.hasOwnProperty;
function Kk(e) {
	var t = e.length, n = new e.constructor(t);
	return t && typeof e[0] == "string" && Gk.call(e, "index") && (n.index = e.index, n.input = e.input), n;
}
//#endregion
//#region node_modules/lodash-es/_Uint8Array.js
var qk = Hw.Uint8Array;
//#endregion
//#region node_modules/lodash-es/_cloneArrayBuffer.js
function Jk(e) {
	var t = new e.constructor(e.byteLength);
	return new qk(t).set(new qk(e)), t;
}
//#endregion
//#region node_modules/lodash-es/_cloneDataView.js
function Yk(e, t) {
	var n = t ? Jk(e.buffer) : e.buffer;
	return new e.constructor(n, e.byteOffset, e.byteLength);
}
//#endregion
//#region node_modules/lodash-es/_cloneRegExp.js
var Xk = /\w*$/;
function Zk(e) {
	var t = new e.constructor(e.source, Xk.exec(e));
	return t.lastIndex = e.lastIndex, t;
}
//#endregion
//#region node_modules/lodash-es/_cloneSymbol.js
var Qk = Uw ? Uw.prototype : void 0, $k = Qk ? Qk.valueOf : void 0;
function eA(e) {
	return $k ? Object($k.call(e)) : {};
}
//#endregion
//#region node_modules/lodash-es/_cloneTypedArray.js
function tA(e, t) {
	var n = t ? Jk(e.buffer) : e.buffer;
	return new e.constructor(n, e.byteOffset, e.length);
}
//#endregion
//#region node_modules/lodash-es/_initCloneByTag.js
var nA = "[object Boolean]", rA = "[object Date]", iA = "[object Map]", aA = "[object Number]", oA = "[object RegExp]", sA = "[object Set]", cA = "[object String]", lA = "[object Symbol]", uA = "[object ArrayBuffer]", dA = "[object DataView]", fA = "[object Float32Array]", pA = "[object Float64Array]", mA = "[object Int8Array]", hA = "[object Int16Array]", gA = "[object Int32Array]", _A = "[object Uint8Array]", vA = "[object Uint8ClampedArray]", yA = "[object Uint16Array]", bA = "[object Uint32Array]";
function xA(e, t, n) {
	var r = e.constructor;
	switch (t) {
		case uA: return Jk(e);
		case nA:
		case rA: return new r(+e);
		case dA: return Yk(e, n);
		case fA:
		case pA:
		case mA:
		case hA:
		case gA:
		case _A:
		case vA:
		case yA:
		case bA: return tA(e, n);
		case iA: return new r();
		case aA:
		case cA: return new r(e);
		case oA: return Zk(e);
		case sA: return new r();
		case lA: return eA(e);
	}
}
//#endregion
//#region node_modules/lodash-es/_initCloneObject.js
function SA(e) {
	return typeof e.constructor == "function" && !xE(e) ? JT(iO(e)) : {};
}
//#endregion
//#region node_modules/lodash-es/_baseIsMap.js
var CA = "[object Map]";
function wA(e) {
	return tT(e) && Wk(e) == CA;
}
//#endregion
//#region node_modules/lodash-es/isMap.js
var TA = uD && uD.isMap, EA = TA ? oD(TA) : wA, DA = "[object Set]";
function OA(e) {
	return tT(e) && Wk(e) == DA;
}
//#endregion
//#region node_modules/lodash-es/isSet.js
var kA = uD && uD.isSet, AA = kA ? oD(kA) : OA, jA = 1, MA = 2, NA = 4, PA = "[object Arguments]", FA = "[object Array]", IA = "[object Boolean]", LA = "[object Date]", RA = "[object Error]", zA = "[object Function]", BA = "[object GeneratorFunction]", VA = "[object Map]", HA = "[object Number]", UA = "[object Object]", WA = "[object RegExp]", GA = "[object Set]", KA = "[object String]", qA = "[object Symbol]", JA = "[object WeakMap]", YA = "[object ArrayBuffer]", XA = "[object DataView]", ZA = "[object Float32Array]", QA = "[object Float64Array]", $A = "[object Int8Array]", ej = "[object Int16Array]", tj = "[object Int32Array]", nj = "[object Uint8Array]", rj = "[object Uint8ClampedArray]", ij = "[object Uint16Array]", aj = "[object Uint32Array]", oj = {};
oj[PA] = oj[FA] = oj[YA] = oj[XA] = oj[IA] = oj[LA] = oj[ZA] = oj[QA] = oj[$A] = oj[ej] = oj[tj] = oj[VA] = oj[HA] = oj[UA] = oj[WA] = oj[GA] = oj[KA] = oj[qA] = oj[nj] = oj[rj] = oj[ij] = oj[aj] = !0, oj[RA] = oj[zA] = oj[JA] = !1;
function sj(e, t, n, r, i, a) {
	var o, s = t & jA, c = t & MA, l = t & NA;
	if (n && (o = i ? n(e, r, i, a) : n(e)), o !== void 0) return o;
	if (!mT(e)) return e;
	var u = aT(e);
	if (u) {
		if (o = Kk(e), !s) return ZT(e, o);
	} else {
		var d = Wk(e), f = d == zA || d == BA;
		if (NE(e)) return _k(e, s);
		if (d == UA || d == PA || f && !i) {
			if (o = c || f ? {} : SA(e), !s) return c ? Tk(e, fk(o, e)) : Ck(e, dk(o, e));
		} else {
			if (!oj[d]) return i ? e : {};
			o = xA(e, d, s);
		}
	}
	a ||= new uk();
	var p = a.get(e);
	if (p) return p;
	a.set(e, o), AA(e) ? e.forEach(function(r) {
		o.add(sj(r, t, n, r, e, a));
	}) : EA(e) && e.forEach(function(r, i) {
		o.set(i, sj(r, t, n, i, e, a));
	});
	var m = u ? void 0 : (l ? c ? Ok : Dk : c ? CD : yD)(e);
	return aE(m || e, function(r, i) {
		m && (i = r, r = e[i]), fE(o, i, sj(r, t, n, i, e, a));
	}), o;
}
//#endregion
//#region node_modules/lodash-es/clone.js
var cj = 4;
function lj(e) {
	return sj(e, cj);
}
//#endregion
//#region node_modules/lodash-es/_setCacheAdd.js
var uj = "__lodash_hash_undefined__";
function dj(e) {
	return this.__data__.set(e, uj), this;
}
//#endregion
//#region node_modules/lodash-es/_setCacheHas.js
function fj(e) {
	return this.__data__.has(e);
}
//#endregion
//#region node_modules/lodash-es/_SetCache.js
function pj(e) {
	var t = -1, n = e == null ? 0 : e.length;
	for (this.__data__ = new ZD(); ++t < n;) this.add(e[t]);
}
pj.prototype.add = pj.prototype.push = dj, pj.prototype.has = fj;
//#endregion
//#region node_modules/lodash-es/_arraySome.js
function mj(e, t) {
	for (var n = -1, r = e == null ? 0 : e.length; ++n < r;) if (t(e[n], n, e)) return !0;
	return !1;
}
//#endregion
//#region node_modules/lodash-es/_cacheHas.js
function hj(e, t) {
	return e.has(t);
}
//#endregion
//#region node_modules/lodash-es/_equalArrays.js
var gj = 1, _j = 2;
function vj(e, t, n, r, i, a) {
	var o = n & gj, s = e.length, c = t.length;
	if (s != c && !(o && c > s)) return !1;
	var l = a.get(e), u = a.get(t);
	if (l && u) return l == t && u == e;
	var d = -1, f = !0, p = n & _j ? new pj() : void 0;
	for (a.set(e, t), a.set(t, e); ++d < s;) {
		var m = e[d], h = t[d];
		if (r) var g = o ? r(h, m, d, t, e, a) : r(m, h, d, e, t, a);
		if (g !== void 0) {
			if (g) continue;
			f = !1;
			break;
		}
		if (p) {
			if (!mj(t, function(e, t) {
				if (!hj(p, t) && (m === e || i(m, e, n, r, a))) return p.push(t);
			})) {
				f = !1;
				break;
			}
		} else if (!(m === h || i(m, h, n, r, a))) {
			f = !1;
			break;
		}
	}
	return a.delete(e), a.delete(t), f;
}
//#endregion
//#region node_modules/lodash-es/_mapToArray.js
function yj(e) {
	var t = -1, n = Array(e.size);
	return e.forEach(function(e, r) {
		n[++t] = [r, e];
	}), n;
}
//#endregion
//#region node_modules/lodash-es/_setToArray.js
function bj(e) {
	var t = -1, n = Array(e.size);
	return e.forEach(function(e) {
		n[++t] = e;
	}), n;
}
//#endregion
//#region node_modules/lodash-es/_equalByTag.js
var xj = 1, Sj = 2, Cj = "[object Boolean]", wj = "[object Date]", Tj = "[object Error]", Ej = "[object Map]", Dj = "[object Number]", Oj = "[object RegExp]", kj = "[object Set]", Aj = "[object String]", jj = "[object Symbol]", Mj = "[object ArrayBuffer]", Nj = "[object DataView]", Pj = Uw ? Uw.prototype : void 0, Fj = Pj ? Pj.valueOf : void 0;
function Ij(e, t, n, r, i, a, o) {
	switch (n) {
		case Nj:
			if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1;
			e = e.buffer, t = t.buffer;
		case Mj: return !(e.byteLength != t.byteLength || !a(new qk(e), new qk(t)));
		case Cj:
		case wj:
		case Dj: return uE(+e, +t);
		case Tj: return e.name == t.name && e.message == t.message;
		case Oj:
		case Aj: return e == t + "";
		case Ej: var s = yj;
		case kj:
			var c = r & xj;
			if (s ||= bj, e.size != t.size && !c) return !1;
			var l = o.get(e);
			if (l) return l == t;
			r |= Sj, o.set(e, t);
			var u = vj(s(e), s(t), r, i, a, o);
			return o.delete(e), u;
		case jj: if (Fj) return Fj.call(e) == Fj.call(t);
	}
	return !1;
}
//#endregion
//#region node_modules/lodash-es/_equalObjects.js
var Lj = 1, Rj = Object.prototype.hasOwnProperty;
function zj(e, t, n, r, i, a) {
	var o = n & Lj, s = Dk(e), c = s.length;
	if (c != Dk(t).length && !o) return !1;
	for (var l = c; l--;) {
		var u = s[l];
		if (!(o ? u in t : Rj.call(t, u))) return !1;
	}
	var d = a.get(e), f = a.get(t);
	if (d && f) return d == t && f == e;
	var p = !0;
	a.set(e, t), a.set(t, e);
	for (var m = o; ++l < c;) {
		u = s[l];
		var h = e[u], g = t[u];
		if (r) var _ = o ? r(g, h, u, t, e, a) : r(h, g, u, e, t, a);
		if (!(_ === void 0 ? h === g || i(h, g, n, r, a) : _)) {
			p = !1;
			break;
		}
		m ||= u == "constructor";
	}
	if (p && !m) {
		var v = e.constructor, y = t.constructor;
		v != y && "constructor" in e && "constructor" in t && !(typeof v == "function" && v instanceof v && typeof y == "function" && y instanceof y) && (p = !1);
	}
	return a.delete(e), a.delete(t), p;
}
//#endregion
//#region node_modules/lodash-es/_baseIsEqualDeep.js
var Bj = 1, Vj = "[object Arguments]", Hj = "[object Array]", Uj = "[object Object]", Wj = Object.prototype.hasOwnProperty;
function Gj(e, t, n, r, i, a) {
	var o = aT(e), s = aT(t), c = o ? Hj : Wk(e), l = s ? Hj : Wk(t);
	c = c == Vj ? Uj : c, l = l == Vj ? Uj : l;
	var u = c == Uj, d = l == Uj, f = c == l;
	if (f && NE(e)) {
		if (!NE(t)) return !1;
		o = !0, u = !1;
	}
	if (f && !u) return a ||= new uk(), o || fD(e) ? vj(e, t, n, r, i, a) : Ij(e, t, c, n, r, i, a);
	if (!(n & Bj)) {
		var p = u && Wj.call(e, "__wrapped__"), m = d && Wj.call(t, "__wrapped__");
		if (p || m) {
			var h = p ? e.value() : e, g = m ? t.value() : t;
			return a ||= new uk(), i(h, g, n, r, a);
		}
	}
	return f ? (a ||= new uk(), zj(e, t, n, r, i, a)) : !1;
}
//#endregion
//#region node_modules/lodash-es/_baseIsEqual.js
function Kj(e, t, n, r, i) {
	return e === t ? !0 : e == null || t == null || !tT(e) && !tT(t) ? e !== e && t !== t : Gj(e, t, n, r, Kj, i);
}
//#endregion
//#region node_modules/lodash-es/now.js
var qj = function() {
	return Hw.Date.now();
}, Jj = "Expected a function", Yj = Math.max, Xj = Math.min;
function Zj(e, t, n) {
	var r, i, a, o, s, c, l = 0, u = !1, d = !1, f = !0;
	if (typeof e != "function") throw TypeError(Jj);
	t = bT(t) || 0, mT(n) && (u = !!n.leading, d = "maxWait" in n, a = d ? Yj(bT(n.maxWait) || 0, t) : a, f = "trailing" in n ? !!n.trailing : f);
	function p(t) {
		var n = r, a = i;
		return r = i = void 0, l = t, o = e.apply(a, n), o;
	}
	function m(e) {
		return l = e, s = setTimeout(_, t), u ? p(e) : o;
	}
	function h(e) {
		var n = e - c, r = e - l, i = t - n;
		return d ? Xj(i, a - r) : i;
	}
	function g(e) {
		var n = e - c, r = e - l;
		return c === void 0 || n >= t || n < 0 || d && r >= a;
	}
	function _() {
		var e = qj();
		if (g(e)) return v(e);
		s = setTimeout(_, h(e));
	}
	function v(e) {
		return s = void 0, f && r ? p(e) : (r = i = void 0, o);
	}
	function y() {
		s !== void 0 && clearTimeout(s), l = 0, r = c = i = s = void 0;
	}
	function b() {
		return s === void 0 ? o : v(qj());
	}
	function x() {
		var e = qj(), n = g(e);
		if (r = arguments, i = this, c = e, n) {
			if (s === void 0) return m(c);
			if (d) return clearTimeout(s), s = setTimeout(_, t), p(c);
		}
		return s === void 0 && (s = setTimeout(_, t)), o;
	}
	return x.cancel = y, x.flush = b, x;
}
//#endregion
//#region node_modules/lodash-es/_baseDelay.js
var Qj = "Expected a function";
function $j(e, t, n) {
	if (typeof e != "function") throw TypeError(Qj);
	return setTimeout(function() {
		e.apply(void 0, n);
	}, t);
}
//#endregion
//#region node_modules/lodash-es/defer.js
var eM = gE(function(e, t) {
	return $j(e, 1, t);
});
//#endregion
//#region node_modules/lodash-es/drop.js
function tM(e, t, n) {
	var r = e == null ? 0 : e.length;
	return r ? (t = n || t === void 0 ? 1 : wT(t), aO(e, t < 0 ? 0 : t, r)) : [];
}
//#endregion
//#region node_modules/lodash-es/dropRight.js
function nM(e, t, n) {
	var r = e == null ? 0 : e.length;
	return r ? (t = n || t === void 0 ? 1 : wT(t), t = r - t, aO(e, 0, t < 0 ? 0 : t)) : [];
}
//#endregion
//#region node_modules/lodash-es/_baseValues.js
function rM(e, t) {
	return iT(t, function(t) {
		return e[t];
	});
}
//#endregion
//#region node_modules/lodash-es/values.js
function iM(e) {
	return e == null ? [] : rM(e, yD(e));
}
//#endregion
//#region node_modules/lodash-es/isEqual.js
function aM(e, t) {
	return Kj(e, t);
}
//#endregion
//#region node_modules/lodash-es/kebabCase.js
var oM = tk(function(e, t, n) {
	return e + (n ? "-" : "") + t.toLowerCase();
});
//#endregion
//#region node_modules/lodash-es/_baseSum.js
function sM(e, t) {
	for (var n, r = -1, i = e.length; ++r < i;) {
		var a = t(e[r]);
		a !== void 0 && (n = n === void 0 ? a : n + a);
	}
	return n;
}
//#endregion
//#region node_modules/lodash-es/sum.js
function cM(e) {
	return e && e.length ? sM(e, TT) : 0;
}
//#endregion
//#region node_modules/lodash-es/throttle.js
var lM = "Expected a function";
function uM(e, t, n) {
	var r = !0, i = !0;
	if (typeof e != "function") throw TypeError(lM);
	return mT(n) && (r = "leading" in n ? !!n.leading : r, i = "trailing" in n ? !!n.trailing : i), Zj(e, t, {
		leading: r,
		maxWait: t,
		trailing: i
	});
}
//#endregion
//#region node_modules/react-mosaic-component/lib/contextTypes.mjs
var dM = P.createContext(void 0), fM = P.createContext(void 0);
//#endregion
//#region node_modules/react-mosaic-component/lib/util/assertNever.mjs
function pM(e) {
	throw Error("Unhandled case: " + JSON.stringify(e));
}
//#endregion
//#region node_modules/react-mosaic-component/lib/util/BoundingBox.mjs
function mM() {
	return {
		top: 0,
		right: 0,
		bottom: 0,
		left: 0
	};
}
function hM(e, t, n) {
	let r = [], i = 0;
	for (let a of t) {
		let t = { ...e };
		switch (n) {
			case "row": {
				let n = 100 - e.left - e.right;
				t.left = e.left + n * i / 100, t.right = e.right + n * (100 - (i + a)) / 100;
				break;
			}
			case "column": {
				let n = 100 - e.top - e.bottom;
				t.top = e.top + n * i / 100, t.bottom = e.bottom + n * (100 - (i + a)) / 100;
				break;
			}
			default: pM(n);
		}
		r.push(t), i += a;
	}
	return r;
}
function gM({ top: e, right: t, bottom: n, left: r }) {
	return {
		top: `${e}%`,
		right: `${t}%`,
		bottom: `${n}%`,
		left: `${r}%`
	};
}
function _M(e, t, n) {
	let { top: r, right: i, bottom: a, left: o } = e;
	return n === "column" ? (100 - r - a) * t / 100 + r : n === "row" ? (100 - i - o) * t / 100 + o : pM(n);
}
function vM(e, t, n) {
	let { top: r, right: i, bottom: a, left: o } = e;
	if (n === "column") {
		let e = 100 - r - a;
		return e === 0 ? 0 : (t - r) / e * 100;
	}
	if (n === "row") {
		let e = 100 - i - o;
		return e === 0 ? 0 : (t - o) / e * 100;
	}
	return pM(n);
}
//#endregion
//#region node_modules/react-mosaic-component/lib/Split.mjs
var yM = 1e3 / 30, bM = {
	capture: !0,
	passive: !1
}, xM = class extends P.PureComponent {
	rootElement = P.createRef();
	listenersBound = !1;
	static defaultProps = {
		onChange: () => void 0,
		onRelease: () => void 0,
		minimumPaneSizePercentage: 10
	};
	render() {
		let { direction: e } = this.props;
		return /* @__PURE__ */ P.createElement("div", {
			className: (0, G.default)("mosaic-split", {
				"-row": e === "row",
				"-column": e === "column"
			}),
			ref: this.rootElement,
			onMouseDown: this.onMouseDown,
			style: this.computeStyle()
		}, /* @__PURE__ */ P.createElement("div", { className: "mosaic-split-line" }));
	}
	componentDidMount() {
		this.rootElement.current.addEventListener("touchstart", this.onMouseDown, bM);
	}
	componentWillUnmount() {
		this.unbindListeners(), this.rootElement.current && this.rootElement.current.ownerDocument.removeEventListener("touchstart", this.onMouseDown, bM);
	}
	computeStyle() {
		let { boundingBox: e, direction: t, splitPercentages: n, splitIndex: r } = this.props, i = _M(e, cM(n.slice(0, r + 1)), t), a = t === "column" ? "top" : "left";
		return {
			...gM(e),
			[a]: `${i}%`
		};
	}
	onMouseDown = (e) => {
		!SM(e) && e.button !== 0 || (e.preventDefault(), this.bindListeners());
	};
	onMouseUp = (e) => {
		this.unbindListeners();
		let t = this.calculateNewPercentages(e);
		this.props.onRelease(t);
	};
	onMouseMove = (e) => {
		e.preventDefault(), this.throttledUpdatePercentage(e);
	};
	throttledUpdatePercentage = uM((e) => {
		let t = this.calculateNewPercentages(e);
		this.props.onChange(t);
	}, yM);
	calculateNewPercentages(e) {
		let { minimumPaneSizePercentage: t, direction: n, boundingBox: r, splitPercentages: i, splitIndex: a } = this.props, o = this.rootElement.current.parentElement.getBoundingClientRect(), s = SM(e) ? e.changedTouches[0] : e, c;
		c = n === "column" ? (s.clientY - o.top) / o.height * 100 : (s.clientX - o.left) / o.width * 100;
		let l = vM(r, c, n), u = cM(i.slice(0, a)), d = i[a] + i[a + 1], f = l - u;
		f = rk(f, t, d - t);
		let p = d - f, m = [...i];
		return m[a] = f, m[a + 1] = p, m;
	}
	bindListeners() {
		if (!this.listenersBound) {
			let e = this.rootElement.current.ownerDocument;
			e.addEventListener("mousemove", this.onMouseMove, !0), e.addEventListener("touchmove", this.onMouseMove, bM), e.addEventListener("mouseup", this.onMouseUp, !0), e.addEventListener("touchend", this.onMouseUp, !0), this.listenersBound = !0;
		}
	}
	unbindListeners() {
		if (this.listenersBound && this.rootElement.current) {
			let e = this.rootElement.current.ownerDocument;
			e.removeEventListener("mousemove", this.onMouseMove, !0), e.removeEventListener("touchmove", this.onMouseMove, bM), e.removeEventListener("mouseup", this.onMouseUp, !0), e.removeEventListener("touchend", this.onMouseUp, !0), this.listenersBound = !1;
		}
	}
};
function SM(e) {
	return e.changedTouches != null;
}
//#endregion
//#region node_modules/react-mosaic-component/lib/util/mosaicUtilities.mjs
var CM = /* @__PURE__ */ p((/* @__PURE__ */ D(((e, t) => {
	Object.defineProperty(e, "__esModule", { value: !0 });
	function n(e) {
		/* istanbul ignore next */
		return typeof e == "object" && !("toString" in e) ? Object.prototype.toString.call(e).slice(8, -1) : e;
	}
	var r = typeof process == "object" && !0;
	function i(e, t) {
		if (!e) throw Error(r ? "Invariant failed" : t());
	}
	e.invariant = i;
	var a = Object.prototype.hasOwnProperty, o = Array.prototype.splice, s = Object.prototype.toString;
	function c(e) {
		return s.call(e).slice(8, -1);
	}
	var l = Object.assign || (function(e, t) {
		return u(t).forEach(function(n) {
			a.call(t, n) && (e[n] = t[n]);
		}), e;
	}), u = typeof Object.getOwnPropertySymbols == "function" ? function(e) {
		return Object.keys(e).concat(Object.getOwnPropertySymbols(e));
	} : function(e) {
		return Object.keys(e);
	};
	function d(e) {
		return Array.isArray(e) ? l(e.constructor(e.length), e) : c(e) === "Map" ? new Map(e) : c(e) === "Set" ? new Set(e) : e && typeof e == "object" ? l(Object.create(Object.getPrototypeOf(e)), e) : e;
	}
	var f = function() {
		function e() {
			this.commands = l({}, p), this.update = this.update.bind(this), this.update.extend = this.extend = this.extend.bind(this), this.update.isEquals = function(e, t) {
				return e === t;
			}, this.update.newContext = function() {
				return new e().update;
			};
		}
		return Object.defineProperty(e.prototype, "isEquals", {
			get: function() {
				return this.update.isEquals;
			},
			set: function(e) {
				this.update.isEquals = e;
			},
			enumerable: !0,
			configurable: !0
		}), e.prototype.extend = function(e, t) {
			this.commands[e] = t;
		}, e.prototype.update = function(e, t) {
			var n = this, r = typeof t == "function" ? { $apply: t } : t;
			Array.isArray(e) && Array.isArray(r) || i(!Array.isArray(r), function() {
				return "update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value.";
			}), i(typeof r == "object" && !!r, function() {
				return "update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the " + ("following commands: " + Object.keys(n.commands).join(", ") + ".");
			});
			var o = e;
			return u(r).forEach(function(t) {
				if (a.call(n.commands, t)) {
					var i = e === o;
					o = n.commands[t](r[t], o, r, e), i && n.isEquals(o, e) && (o = e);
				} else {
					var s = c(e) === "Map" ? n.update(e.get(t), r[t]) : n.update(e[t], r[t]), l = c(o) === "Map" ? o.get(t) : o[t];
					(!n.isEquals(s, l) || s === void 0 && !a.call(e, t)) && (o === e && (o = d(e)), c(o) === "Map" ? o.set(t, s) : o[t] = s);
				}
			}), o;
		}, e;
	}();
	e.Context = f;
	var p = {
		$push: function(e, t, n) {
			return h(t, n, "$push"), e.length ? t.concat(e) : t;
		},
		$unshift: function(e, t, n) {
			return h(t, n, "$unshift"), e.length ? e.concat(t) : t;
		},
		$splice: function(e, t, n, r) {
			return _(t, n), e.forEach(function(e) {
				v(e), t === r && e.length && (t = d(r)), o.apply(t, e);
			}), t;
		},
		$set: function(e, t, n) {
			return b(n), e;
		},
		$toggle: function(e, t) {
			g(e, "$toggle");
			var n = e.length ? d(t) : t;
			return e.forEach(function(e) {
				n[e] = !t[e];
			}), n;
		},
		$unset: function(e, t, n, r) {
			return g(e, "$unset"), e.forEach(function(e) {
				Object.hasOwnProperty.call(t, e) && (t === r && (t = d(r)), delete t[e]);
			}), t;
		},
		$add: function(e, t, n, r) {
			return S(t, "$add"), g(e, "$add"), c(t) === "Map" ? e.forEach(function(e) {
				var n = e[0], i = e[1];
				t === r && t.get(n) !== i && (t = d(r)), t.set(n, i);
			}) : e.forEach(function(e) {
				t === r && !t.has(e) && (t = d(r)), t.add(e);
			}), t;
		},
		$remove: function(e, t, n, r) {
			return S(t, "$remove"), g(e, "$remove"), e.forEach(function(e) {
				t === r && t.has(e) && (t = d(r)), t.delete(e);
			}), t;
		},
		$merge: function(e, t, n, r) {
			return x(t, e), u(e).forEach(function(n) {
				e[n] !== t[n] && (t === r && (t = d(r)), t[n] = e[n]);
			}), t;
		},
		$apply: function(e, t) {
			return y(e), e(t);
		}
	}, m = new f();
	e.isEquals = m.update.isEquals, e.extend = m.extend, e.default = m.update, e.default.default = t.exports = l(e.default, e);
	function h(e, t, r) {
		i(Array.isArray(e), function() {
			return "update(): expected target of " + n(r) + " to be an array; got " + n(e) + ".";
		}), g(t[r], r);
	}
	function g(e, t) {
		i(Array.isArray(e), function() {
			return "update(): expected spec of " + n(t) + " to be an array; got " + n(e) + ". Did you forget to wrap your parameter in an array?";
		});
	}
	function _(e, t) {
		i(Array.isArray(e), function() {
			return "Expected $splice target to be an array; got " + n(e);
		}), v(t.$splice);
	}
	function v(e) {
		i(Array.isArray(e), function() {
			return "update(): expected spec of $splice to be an array of arrays; got " + n(e) + ". Did you forget to wrap your parameters in an array?";
		});
	}
	function y(e) {
		i(typeof e == "function", function() {
			return "update(): expected spec of $apply to be a function; got " + n(e) + ".";
		});
	}
	function b(e) {
		i(Object.keys(e).length === 1, function() {
			return "Cannot have more than one key in an object with $set";
		});
	}
	function x(e, t) {
		i(t && typeof t == "object", function() {
			return "update(): $merge expects a spec of type 'object'; got " + n(t);
		}), i(e && typeof e == "object", function() {
			return "update(): $merge expects a target of type 'object'; got " + n(e);
		});
	}
	function S(e, t) {
		var r = c(e);
		i(r === "Map" || r === "Set", function() {
			return "update(): " + n(t) + " expects a target of type Set or Map; got " + n(r);
		});
	}
})))(), 1);
function wM(e, t = "row") {
	if (EM(e)) {
		let n = jM(t);
		return {
			type: "split",
			direction: t,
			children: e.children.map((e) => wM(e, n)),
			splitPercentages: e.splitPercentages
		};
	}
	return e;
}
var TM = /* @__PURE__ */ ((e) => (e[e.TOP_LEFT = 1] = "TOP_LEFT", e[e.TOP_RIGHT = 2] = "TOP_RIGHT", e[e.BOTTOM_LEFT = 3] = "BOTTOM_LEFT", e[e.BOTTOM_RIGHT = 4] = "BOTTOM_RIGHT", e))(TM || {});
function EM(e) {
	return typeof e == "object" && !!e && "type" in e && e.type === "split";
}
function DM(e) {
	return typeof e == "object" && !!e && "tabs" in e && Array.isArray(e.tabs);
}
function OM(e, t) {
	return IM(e, kM(t));
}
function kM(e) {
	return e.slice(0, -1);
}
function AM(e, t = "row") {
	if (e.length === 0) return null;
	if (e.length === 1) return e[0];
	let n = lj(e), r = [];
	for (; n.length > 1;) {
		for (; n.length > 0;) if (n.length > 1) {
			let e = n.shift(), t = n.shift();
			r.push({
				type: "split",
				direction: "row",
				children: [e, t],
				splitPercentages: [50, 50]
			});
		} else r.unshift(n.shift());
		n = r, r = [];
	}
	return wM(n[0], t);
}
function jM(e) {
	return e === "row" ? "column" : "row";
}
function MM(e, t) {
	let n = e, r = [];
	for (; EM(n);) {
		let e;
		e = n.direction === "row" ? t === 1 || t === 3 ? 0 : n.children.length - 1 : t === 1 || t === 2 ? 0 : n.children.length - 1, r.push(e), n = n.children[e];
	}
	return r;
}
function NM(e) {
	return e == null ? [] : EM(e) ? e.children.flatMap((e) => NM(e)) : DM(e) ? e.tabs : [e];
}
function PM(e) {
	if (typeof e != "object" || !e || !("first" in e)) return e;
	let t = e;
	return {
		type: "split",
		direction: t.direction,
		children: [PM(t.first), PM(t.second)],
		splitPercentages: t.splitPercentage === void 0 ? void 0 : [t.splitPercentage, 100 - t.splitPercentage]
	};
}
function FM(e) {
	if (typeof e != "object" || !e) return e;
	if (e.type === "split") {
		let t = e.children.map((e) => FM(e)).filter((e) => e !== null);
		if (t.length === 0) return null;
		if (t.length === 1) return t[0];
		let n = [], r = [], i = !0;
		for (let a = 0; a < t.length; a++) {
			let o = t[a];
			if (EM(o) && o.direction === e.direction) {
				if (n.push(...o.children), i && e.splitPercentages && o.splitPercentages) {
					let t = e.splitPercentages[a], n = o.splitPercentages.map((e) => e * t / 100);
					r.push(...n);
				} else i = !1;
			} else n.push(o), i && e.splitPercentages ? r.push(e.splitPercentages[a]) : i = !1;
		}
		let a, o = n.length !== t.length, s = e.children.length !== t.length;
		if (i && r.length === n.length) a = r;
		else if (!o && !s && e.splitPercentages) a = e.splitPercentages;
		else if (s && e.splitPercentages) {
			let r = [], i = 0;
			for (let n = 0; n < t.length; n++) {
				let a = t[n], o = e.children.findIndex((e) => FM(e) === a);
				o >= 0 && e.splitPercentages[o] ? (r.push(e.splitPercentages[o]), i += e.splitPercentages[o]) : r.push(0);
			}
			if (i > 0) a = r.map((e) => e / i * 100);
			else {
				let e = 100 / n.length;
				a = Array(n.length).fill(e);
			}
		} else {
			let e = 100 / n.length;
			a = Array(n.length).fill(e);
		}
		return {
			...e,
			children: n,
			splitPercentages: a
		};
	}
	if (e.type === "tabs") {
		let t = e.tabs;
		if (t.length === 0) return null;
		if (t.length === 1) return t[0];
		let n = Math.max(0, Math.min(e.activeTabIndex, t.length - 1));
		return {
			...e,
			activeTabIndex: n
		};
	}
	return e;
}
function IM(e, t) {
	if (!e) return null;
	let n = e;
	for (let e of t) {
		if (typeof n != "object" || !n) return null;
		if ("type" in n) switch (n.type) {
			case "split":
				n = n.children[e] ?? null;
				break;
			case "tabs":
				n = n.tabs[e] ?? null;
				break;
			default: return null;
		}
		else return null;
	}
	return n;
}
function LM(e, t) {
	if (e == null) throw Error("Root is empty, cannot fetch path");
	let n = IM(e, t);
	if (n == null) throw Error(`Path [${t.join(", ")}] did not resolve to a node`);
	return n;
}
function RM(e, t) {
	if (t.length === 0 || e == null) return null;
	let n = t.slice(0, -1), r = t[t.length - 1], i = typeof r == "number" ? r : Number(r);
	if (!Number.isInteger(i) || i < 0) return null;
	let a = IM(e, n);
	return a ? EM(a) ? i >= a.children.length ? null : {
		parent: a,
		childIndex: i
	} : DM(a) ? i >= a.tabs.length ? null : {
		parent: a,
		childIndex: i
	} : null : null;
}
//#endregion
//#region node_modules/react-mosaic-component/lib/types.mjs
var zM = { WINDOW: "MosaicWindow" }, BM = {
	TOP: "top",
	BOTTOM: "bottom",
	LEFT: "left",
	RIGHT: "right"
};
//#endregion
//#region node_modules/react-mosaic-component/lib/util/mosaicUpdates.mjs
function VM(e, t, n) {
	return t.reduceRight((n, r, i) => {
		let a = IM(e, t.slice(0, i)), o = "children";
		return a && typeof a == "object" && "type" in a && a.type === "tabs" && (o = "tabs"), { [o]: { [r]: n } };
	}, n);
}
function HM(e, t) {
	if (t.length === 0) return e;
	let n = e;
	for (let { path: e, spec: r } of t) if (e.length === 0) n = (0, CM.default)(n, r);
	else {
		let t = VM(n, e, r);
		n = (0, CM.default)(n, t);
	}
	return n;
}
function UM(e, t) {
	if (t.length === 0) throw Error("Cannot remove root node");
	let n = RM(e, t);
	if (!n) throw Error("Cannot find parent for removal");
	let { parent: r, childIndex: i } = n;
	if (EM(r)) {
		if (r.children.length === 2) {
			let e = +(i === 0), n = r.children[e];
			return {
				path: nM(t),
				spec: { $set: n }
			};
		}
		{
			let e = r.children.filter((e, t) => t !== i), n = r.splitPercentages || Array(r.children.length).fill(100 / r.children.length), a = n[i] / e.length, o = n.filter((e, t) => t !== i).map((e) => e + a);
			return {
				path: nM(t),
				spec: {
					children: { $set: e },
					splitPercentages: { $set: o }
				}
			};
		}
	}
	if (DM(r)) {
		let e = r.tabs.filter((e, t) => t !== i);
		if (e.length === 0) throw Error("Cannot remove last tab from tabs node");
		let n = r.activeTabIndex;
		return i === r.activeTabIndex ? n = i > 0 ? i - 1 : 0 : i < r.activeTabIndex && (n = r.activeTabIndex - 1), {
			path: nM(t),
			spec: {
				tabs: { $set: e },
				activeTabIndex: { $set: n }
			}
		};
	}
	throw Error("Invalid parent node type for removal");
}
function WM(e, t, n, r) {
	if (aM(t, n)) return [];
	let i = LM(e, n), a = LM(e, t);
	switch (r.type) {
		case "tab-container":
		case "tab-reorder": {
			if (!DM(i)) throw Error(`Expected tab container at destination path ${n.join(", ")}, but found: ${JSON.stringify(i)}`);
			let o = [];
			o.push(UM(e, t));
			let s = GM(t, n), c = HM(e, o), l = IM(c, s);
			if (!l || !DM(l)) {
				let e = function(t, n = []) {
					if (t && typeof t == "object") {
						if (DM(t) && DM(i) && t.tabs && JSON.stringify(t.tabs) === JSON.stringify(i.tabs)) return {
							node: t,
							path: n
						};
						if (EM(t)) for (let r = 0; r < t.children.length; r++) {
							let i = e(t.children[r], [...n, r]);
							if (i) return i;
						}
					}
					return null;
				}, t = e(c);
				t && (s = t.path, l = t.node);
			}
			if (!l || !DM(l)) throw Error(`Could not find tabs container after removal. Original path: ${n.join(", ")}, Adjusted path: ${s.join(", ")}`);
			if (r.type === "tab-reorder") {
				let e = [...l.tabs];
				e.splice(r.insertIndex, 0, a), o.push({
					path: s,
					spec: {
						tabs: { $set: e },
						activeTabIndex: { $set: r.insertIndex }
					}
				});
			} else o.push({
				path: s,
				spec: {
					tabs: { $push: [a] },
					activeTabIndex: { $set: l.tabs.length }
				}
			});
			return o;
		}
		case "split": {
			let i = [];
			i.push(UM(e, t));
			let o = GM(t, n), s = HM(e, i), c = IM(s, o);
			if (!c) {
				for (let e = o.length - 1; e >= 0; e--) {
					let t = o.slice(0, e), n = IM(s, t);
					if (n) {
						o = t, c = n;
						break;
					}
				}
				c ||= (o = [], s);
			}
			if (!c) throw console.error("Could not find valid destination after removing source from:", t, "original destination was:", n), Error(`Could not find valid destination after removing source from [${t.join(", ")}]`);
			let l = "column";
			if ((r.position === BM.LEFT || r.position === BM.RIGHT) && (l = "row"), EM(c) && c.direction === l) {
				let e = r.position === BM.LEFT || r.position === BM.TOP ? 0 : c.children.length;
				i.push(JM(o, a, e));
			} else {
				let e, t;
				r.position === BM.LEFT || r.position === BM.TOP ? (e = a, t = c) : (e = c, t = a), i.push({
					path: o,
					spec: { $set: {
						type: "split",
						direction: l,
						children: [e, t],
						splitPercentages: [50, 50]
					} }
				});
			}
			return i;
		}
		default: pM(r);
	}
}
function GM(e, t) {
	if (e.length === 0 || t.length === 0) return t;
	if (aM(e, t)) return [];
	if (!aM(e.slice(0, -1), t.slice(0, -1))) return t;
	let n = e[e.length - 1], r = t[t.length - 1];
	if (typeof n == "number" && typeof r == "number" && r > n) {
		let e = [...t];
		return e[e.length - 1] = r - 1, e;
	}
	return t;
}
function KM(e, t) {
	if (t.length === 0) throw Error("Cannot hide root node");
	let n = RM(e, t);
	if (!n) throw Error("Cannot hide node: parent not found");
	let { parent: r, childIndex: i } = n;
	if (EM(r)) {
		let e = r.splitPercentages || Array(r.children.length).fill(100 / r.children.length), n = e[i], a = e.map((e, t) => t).filter((e) => e !== i);
		if (a.length === 0) throw Error("Cannot hide the only child of a split node");
		let o = n / a.length, s = e.map((e, t) => t === i ? 0 : e + o);
		return {
			path: nM(t),
			spec: { splitPercentages: { $set: s } }
		};
	}
	if (DM(r)) {
		if (r.tabs.length <= 1) throw Error("Cannot hide the only tab in a tab container");
		let e = r.activeTabIndex;
		return i === r.activeTabIndex && (e = i > 0 ? i - 1 : i + 1), {
			path: nM(t),
			spec: { activeTabIndex: { $set: e } }
		};
	}
	throw Error("Cannot hide node: parent is not a split or tabs node");
}
function qM(e, t) {
	let n = {};
	for (let r = e.length - 1; r >= 0; r--) {
		let i = typeof e[r] == "number" ? e[r] : Number(e[r]);
		n = {
			splitPercentages: { $apply: (e) => {
				if (!e) throw Error("Cannot expand: parent node has no splitPercentages defined");
				let n = [...e], r = t, a = n.length - 1;
				if (a === 0) return [100];
				let o = (100 - r) / a;
				for (let e = 0; e < n.length; e++) e === i ? n[e] = r : n[e] = o;
				return n;
			} },
			children: { [i]: n }
		};
	}
	return {
		spec: n,
		path: []
	};
}
function JM(e, t, n) {
	return {
		path: e,
		spec: {
			children: { $apply: (e) => {
				let r = [...e], i = n === void 0 ? r.length : n;
				return r.splice(i, 0, t), r;
			} },
			splitPercentages: { $apply: (e) => {
				let t = (e ? e.length : 0) + 1, n = 100 / t;
				return Array(t).fill(n);
			} }
		}
	};
}
//#endregion
//#region node_modules/react-mosaic-component/lib/util/OptionalBlueprint.mjs
var YM;
((e) => {
	e.Icon = ({ icon: e, className: t, size: r = "standard" }) => {
		let { blueprintNamespace: i } = N.useContext(dM);
		return /* @__PURE__ */ N.createElement("span", { className: (0, G.default)(t, n(i, e), {
			[`${i}-icon`]: r === "empty",
			[`${i}-icon-${r}`]: r !== "empty"
		}) });
	};
	function t(e, ...t) {
		return t.map((t) => `${e}-${oM(t)}`).join(" ");
	}
	e.getClasses = t;
	function n(e, t) {
		return `${e}-icon-${oM(t)}`;
	}
	e.getIconClass = n;
})(YM ||= {});
//#endregion
//#region node_modules/react-mosaic-component/lib/DraggableTab.mjs
var XM = ({ tabKey: e, tabIndex: t, tabContainerPath: n, mosaicActions: r, mosaicId: i, children: a }) => {
	let o = n.concat(t), [{ isDragging: s }, c, l] = pC({
		type: zM.WINDOW,
		item: () => (r.hide(o, !0), {
			mosaicId: i,
			isTab: !0,
			tabIndex: t,
			tabKey: e,
			tabContainerPath: n
		}),
		end: (i, a) => {
			let s = a.getDropResult(), c = a.didDrop(), l = o, u = s?.tabReorderIndex, d = u !== void 0 && s?.path && aM(s.path, n), f = u !== void 0 && s?.path && !aM(s.path, n), p = s?.path && aM(s.path, n) && u === void 0, m = s?.path && s.path.length > l.length && aM(s.path.slice(0, l.length), l);
			if (!c || !s || m) {
				r.show(l, !0);
				return;
			}
			if (d) {
				let e = IM(r.getRoot(), n);
				if (e && DM(e)) {
					let i = [...e.tabs], a = e.activeTabIndex, [o] = i.splice(t, 1), s = t < u ? u - 1 : u;
					i.splice(s, 0, o);
					let c = a;
					t === a ? c = s : t < a && s >= a ? c = a - 1 : t > a && s <= a && (c = a + 1), r.updateTree([{
						path: n,
						spec: {
							tabs: { $set: i },
							activeTabIndex: { $set: c }
						}
					}]);
				} else console.warn("Could not find tabs node at path:", n);
				return;
			}
			if (f) {
				let i = r.getRoot(), a = IM(i, s.path);
				if (a && DM(a)) {
					let o = IM(i, n), c = [...o.tabs];
					c.splice(t, 1);
					let l = [{
						path: n,
						spec: {
							tabs: { $set: c },
							activeTabIndex: { $set: Math.max(0, Math.min(t, o.tabs.length - 2)) }
						}
					}], d = [...a.tabs];
					d.splice(u, 0, e);
					let f = [{
						path: s.path,
						spec: {
							tabs: { $set: d },
							activeTabIndex: { $set: u }
						}
					}];
					r.updateTree([...l, ...f]);
				} else console.warn("Could not find destination tabs node at path:", s.path);
				return;
			}
			if (p || s.path === void 0) {
				r.show(l, !0);
				return;
			}
			let h = WM(r.getRoot(), l, s.path, s.position === void 0 ? { type: "tab-container" } : {
				type: "split",
				position: s.position
			});
			r.updateTree(h, { shouldNormalize: !0 });
		},
		collect: (e) => ({ isDragging: e.isDragging() })
	});
	return a({
		isDragging: s,
		connectDragSource: c,
		connectDragPreview: l
	});
}, ZM = ({ title: e, className: t, onClick: n, text: r }) => {
	let { blueprintNamespace: i } = P.useContext(dM);
	return /* @__PURE__ */ P.createElement("button", {
		title: e,
		onClick: n,
		className: (0, G.default)("mosaic-default-control", YM.getClasses(i, "BUTTON", "MINIMAL", "SMALL"), t)
	}, r && /* @__PURE__ */ P.createElement("span", { className: "control-text" }, r));
}, QM = class extends P.PureComponent {
	static contextType = fM;
	render() {
		return /* @__PURE__ */ P.createElement(dM.Consumer, null, ({ mosaicActions: e }) => /* @__PURE__ */ P.createElement(ZM, {
			title: "Expand",
			className: (0, G.default)("expand-button", YM.getIconClass(this.context.blueprintNamespace, "MAXIMIZE")),
			onClick: this.createExpand(e)
		}));
	}
	createExpand(e) {
		return () => {
			e.expand(this.context.mosaicWindowActions.getPath()), this.props.onClick && this.props.onClick();
		};
	}
}, $M = class extends P.PureComponent {
	static contextType = fM;
	render() {
		return /* @__PURE__ */ P.createElement(dM.Consumer, null, ({ mosaicActions: e, blueprintNamespace: t }) => /* @__PURE__ */ P.createElement(ZM, {
			title: "Close Window",
			className: (0, G.default)("close-button", YM.getIconClass(t, "CROSS")),
			onClick: this.createRemove(e)
		}));
	}
	createRemove(e) {
		return () => {
			e.remove(this.context.mosaicWindowActions.getPath()), this.props.onClick && this.props.onClick();
		};
	}
}, eN = class extends P.PureComponent {
	static contextType = fM;
	render() {
		return /* @__PURE__ */ P.createElement(ZM, {
			title: "Replace Window",
			className: (0, G.default)("replace-button", YM.getIconClass(this.context.blueprintNamespace, "EXCHANGE")),
			onClick: this.replace
		});
	}
	replace = () => {
		this.context.mosaicWindowActions.replaceWithNew().then(() => {
			this.props.onClick && this.props.onClick();
		}).catch(XT);
	};
}, tN = class extends P.PureComponent {
	static contextType = fM;
	render() {
		return /* @__PURE__ */ P.createElement(ZM, {
			title: "Split Window",
			className: (0, G.default)("split-button", YM.getIconClass(this.context.blueprintNamespace, "SPLIT_COLUMNS")),
			onClick: this.split
		});
	}
	split = () => {
		this.context.mosaicWindowActions.split().then(() => {
			this.props.onClick && this.props.onClick();
		}).catch(XT);
	};
}, nN = class extends P.PureComponent {
	static contextType = fM;
	render() {
		return /* @__PURE__ */ P.createElement(ZM, {
			title: "Add Tab",
			className: (0, G.default)("add-tab-button", YM.getIconClass(this.context.blueprintNamespace, "ADD_COLUMN_RIGHT")),
			onClick: this.addTab
		});
	}
	addTab = () => {
		this.context.mosaicWindowActions.addTab().then(() => {
			this.props.onClick && this.props.onClick();
		}).catch(XT);
	};
}, rN = class extends P.PureComponent {
	static contextType = dM;
	render() {
		return /* @__PURE__ */ P.createElement(ZM, {
			title: "Split Tab Group",
			className: (0, G.default)("split-button", YM.getIconClass(this.context.blueprintNamespace, "SPLIT_COLUMNS")),
			onClick: this.split
		});
	}
	split = () => {
		let { mosaicActions: e } = this.context, { path: t } = this.props;
		if (e.createNode == null) {
			console.error("Operation invalid unless `createNode` is defined on Mosaic");
			return;
		}
		Promise.resolve(e.createNode()).then((n) => {
			if (!n) return;
			let r = this.getCurrentTabsNode();
			if (!r) return;
			let i = {
				type: "split",
				direction: "row",
				splitPercentages: [50, 50],
				children: [r, n]
			};
			e.replaceWith(t, i), this.props.onClick && this.props.onClick();
		}).catch(XT);
	};
	getCurrentTabsNode = () => {
		let e = this.context.mosaicActions.getRoot();
		if (!e) return null;
		let t = e;
		for (let e of this.props.path) if (typeof t == "object" && "children" in t) t = t.children[e];
		else return null;
		return t;
	};
}, iN = class extends P.PureComponent {
	static contextType = dM;
	render() {
		return /* @__PURE__ */ P.createElement(ZM, {
			title: "Close Tab Group",
			className: (0, G.default)("close-button", YM.getIconClass(this.context.blueprintNamespace, "CROSS")),
			onClick: this.remove
		});
	}
	remove = () => {
		let { mosaicActions: e } = this.context, { path: t } = this.props;
		e.remove(t), this.props.onClick && this.props.onClick();
	};
}, aN = class extends P.PureComponent {
	static contextType = dM;
	render() {
		return this.props.connectDragSource(/* @__PURE__ */ P.createElement("button", {
			title: "Drag to move",
			className: (0, G.default)("mosaic-default-control", "mosaic-tab-drag-button", YM.getClasses(this.context.blueprintNamespace, "BUTTON", "MINIMAL", "SMALL"), YM.getIconClass(this.context.blueprintNamespace, "DRAG_HANDLE_VERTICAL"))
		}));
	}
}, oN = ({ path: e, className: t, title: n = "Add new tab", ariaLabel: r = "Add new tab", children: i = "+" }) => {
	let { mosaicActions: a } = P.useContext(dM);
	return /* @__PURE__ */ P.createElement("button", {
		className: (0, G.default)("mosaic-tab-add-button", t),
		onClick: () => {
			a.addTab(e).catch((e) => console.error(e));
		},
		"aria-label": r,
		title: n
	}, i);
}, sN = P.Children.toArray([/* @__PURE__ */ P.createElement($M, null)]), cN = (e, t) => P.Children.toArray([
	...t ? [/* @__PURE__ */ P.createElement(aN, {
		connectDragSource: t,
		key: "tab-drag-btn"
	})] : [],
	/* @__PURE__ */ P.createElement(oN, {
		path: e,
		key: "tab-add-btn"
	}),
	/* @__PURE__ */ P.createElement(rN, {
		path: e,
		key: "tab-split-btn"
	}),
	/* @__PURE__ */ P.createElement(iN, {
		path: e,
		key: "tab-remove-btn"
	})
]), lN = P.Children.toArray([
	/* @__PURE__ */ P.createElement(eN, { key: "replace-btn" }),
	/* @__PURE__ */ P.createElement(tN, { key: "split-btn" }),
	/* @__PURE__ */ P.createElement(nN, { key: "add-tab-btn" }),
	/* @__PURE__ */ P.createElement(QM, { key: "expand-btn" }),
	/* @__PURE__ */ P.createElement($M, { key: "remove-btn" })
]), uN = P.Children.toArray([/* @__PURE__ */ P.createElement(QM, { key: "expand-btn" }), /* @__PURE__ */ P.createElement($M, { key: "remove-btn" })]), dN = ({ tabKey: e, index: t, isActive: n, path: r, mosaicId: i, onTabClick: a, mosaicActions: o, renderTabTitle: s = ({ tabKey: e }) => `Tab ${e}`, canClose: c = () => "canClose", onTabClose: l, tabs: u }) => {
	let d = (n) => {
		n.stopPropagation(), l?.(e, t);
	}, f = c(e, u, t, r);
	return /* @__PURE__ */ P.createElement(XM, {
		tabKey: e,
		tabIndex: t,
		tabContainerPath: r,
		mosaicActions: o,
		mosaicId: i
	}, ({ isDragging: o, connectDragSource: c, connectDragPreview: l }) => /* @__PURE__ */ P.createElement("button", {
		className: (0, G.default)("mosaic-tab-button", {
			"-active": n,
			"-dragging": o
		}),
		onClick: a,
		title: `${e}`,
		ref: (e) => {
			c(e), l(e);
		}
	}, /* @__PURE__ */ P.createElement("span", { className: "mosaic-tab-button-content" }, s({
		tabKey: e,
		path: r,
		isActive: n,
		index: t,
		mosaicId: i
	})), f !== "noClose" && /* @__PURE__ */ P.createElement("span", {
		className: (0, G.default)("mosaic-tab-close-button", {
			"-can-close": f === "canClose",
			"-cannot-close": f === "cannotClose",
			"-active-tab": n,
			"-inactive-tab": !n
		}),
		onClick: f === "canClose" ? d : void 0,
		title: f === "canClose" ? "Close tab" : "Cannot close tab"
	}, /* @__PURE__ */ P.createElement(YM.Icon, {
		size: "empty",
		icon: "CROSS"
	}))));
}, fN = ({ tabContainerPath: e, insertIndex: t }) => {
	let [{ isOver: n, canDrop: r, draggedMosaicId: i }, a] = xC({
		accept: zM.WINDOW,
		canDrop: (t) => {
			let n = t?.isTab && t?.tabContainerPath && aM(t.tabContainerPath, e), r = !t?.isTab || !aM(t.tabContainerPath, e);
			return n || r;
		},
		drop: () => ({
			path: e,
			position: void 0,
			tabReorderIndex: t
		}),
		hover: () => {},
		collect: (e) => ({
			isOver: e.isOver(),
			canDrop: e.canDrop(),
			draggedMosaicId: e.getItem()?.mosaicId
		})
	}), o = i != null;
	return a(/* @__PURE__ */ P.createElement("div", { className: (0, G.default)("tab-drop-target", {
		"tab-drop-target-hover": n,
		dragging: o
	}) }, n ? /* @__PURE__ */ P.createElement("div", { className: "tab-drop-placeholder" }, /* @__PURE__ */ P.createElement("div", { className: "tab-drop-arrow" }), "``") : /* @__PURE__ */ P.createElement("div", { className: (0, G.default)("tab-drop-indicator", {
		"can-drop": r,
		default: !r
	}) })));
}, pN = ({ node: e, path: t, renderTile: n, renderTabToolbar: r, boundingBox: i, renderTabTitle: a, renderTabButton: o, renderTabToolbarControls: s, canClose: c, showTabDragButton: l }) => {
	let { mosaicActions: u, mosaicId: d } = P.useContext(dM), { tabs: f, activeTabIndex: p } = e, [, m, h] = pC({
		type: zM.WINDOW,
		item: () => {
			let e = eM(() => u.hide(t));
			return {
				mosaicId: d,
				hideTimer: e
			};
		},
		end: ({ hideTimer: e }, n) => {
			window.clearTimeout(e);
			let r = t, i = n.getDropResult() || {}, { position: a, path: o } = i, s = o != null, c = s && aM(o, r), l = s && DM(IM(u.getRoot(), o)) && aM(r, o), d = s && o.length > r.length && aM(r, tM(o, o.length - r.length));
			if (s && !c && !d && !l) {
				let e = WM(u.getRoot(), r, o, i.tabReorderIndex === void 0 ? a === void 0 ? { type: "tab-container" } : {
					type: "split",
					position: a
				} : {
					type: "tab-reorder",
					insertIndex: i.tabReorderIndex
				});
				u.updateTree(e, { shouldNormalize: !0 });
			} else u.show(r, !0);
		}
	}), [, g] = xC({
		accept: zM.WINDOW,
		canDrop: () => !1,
		collect: (e) => ({
			isOver: e.isOver({ shallow: !0 }),
			draggedMosaicId: e.getItem()?.mosaicId
		})
	}), [{ isOver: _, draggedMosaicId: v }, y] = xC({
		accept: zM.WINDOW,
		canDrop: (e, t) => t.isOver({ shallow: !0 }),
		drop: () => ({
			path: t,
			position: void 0
		}),
		collect: (e) => ({
			isOver: e.isOver({ shallow: !0 }),
			draggedMosaicId: e.getItem()?.mosaicId
		})
	}), b = (e) => {
		e !== p && u.updateTree([{
			path: t,
			spec: { activeTabIndex: { $set: e } }
		}]);
	}, x = (e, n) => {
		(c ? c(e, f, n, t) : "noClose") === "canClose" && (f.length <= 1 || u.removeTab(t, n));
	}, S = () => {
		let e = t.length > 0, n = {
			tabs: f,
			activeTabIndex: p,
			path: t,
			mosaicId: d
		}, r = e && (!l || l(t)), i = r && s !== void 0 ? /* @__PURE__ */ P.createElement(aN, { connectDragSource: m }) : null, h = s ? s(n) : cN(t, r ? m : void 0);
		return y(/* @__PURE__ */ P.createElement("div", { className: (0, G.default)("mosaic-tab-bar", {
			"tab-bar-drop-target-hover": _ && v === d,
			draggable: e
		}) }, /* @__PURE__ */ P.createElement("div", { className: "mosaic-tab-bar-tabs" }, /* @__PURE__ */ P.createElement(fN, {
			tabContainerPath: t,
			insertIndex: 0,
			mosaicActions: u,
			mosaicId: d
		}), f.map((e, n) => {
			let r = o || dN;
			return /* @__PURE__ */ P.createElement(P.Fragment, { key: e }, /* @__PURE__ */ P.createElement(r, {
				tabKey: e,
				index: n,
				isActive: n === p,
				path: t,
				mosaicId: d,
				onTabClick: () => b(n),
				mosaicActions: u,
				renderTabTitle: a,
				canClose: c,
				onTabClose: x,
				tabs: f
			}), /* @__PURE__ */ P.createElement(fN, {
				tabContainerPath: t,
				insertIndex: n + 1,
				mosaicActions: u,
				mosaicId: d
			}));
		})), /* @__PURE__ */ P.createElement("div", { className: "mosaic-tab-bar-controls" }, i, /* @__PURE__ */ P.createElement("div", { className: "mosaic-tab-toolbar-controls" }, h))));
	}, C = f[p], w = t.concat(p);
	return /* @__PURE__ */ P.createElement("div", {
		className: "mosaic-tabs-container",
		style: gM(i)
	}, r ? r({
		tabs: f,
		activeTabIndex: p,
		path: t,
		DraggableTab: (e) => /* @__PURE__ */ P.createElement(XM, {
			key: e.tabKey,
			...e,
			tabContainerPath: t,
			mosaicActions: u,
			mosaicId: d
		})
	}) : S(), g(/* @__PURE__ */ P.createElement("div", { className: "mosaic-tile" }, n(C, w))), h(/* @__PURE__ */ P.createElement("div", { className: "mosaic-preview" }, /* @__PURE__ */ P.createElement("div", { className: "mosaic-tab-bar" }, /* @__PURE__ */ P.createElement("div", { className: "mosaic-tab-bar-tabs" }, f.map((e, n) => /* @__PURE__ */ P.createElement("button", {
		key: e,
		className: (0, G.default)("mosaic-tab-button", { "-active": n === p })
	}, /* @__PURE__ */ P.createElement("span", { className: "mosaic-tab-button-content" }, a ? a({
		tabKey: e,
		path: t,
		isActive: n === p,
		index: n,
		mosaicId: d
	}) : `Tab ${e}`))))), /* @__PURE__ */ P.createElement("div", { className: "mosaic-window-body" }, /* @__PURE__ */ P.createElement("h4", null, "Tab Container"), /* @__PURE__ */ P.createElement(YM.Icon, {
		className: "default-preview-icon",
		size: "large",
		icon: "APPLICATION"
	})))));
}, mN = class extends P.PureComponent {
	static contextType = dM;
	render() {
		let e = PM(this.props.root);
		return e === null ? null : /* @__PURE__ */ P.createElement("div", { className: "mosaic-root" }, this.renderRecursively(e, mM(), []));
	}
	renderRecursively(e, t, n) {
		if (typeof e == "string" || typeof e == "number") return /* @__PURE__ */ P.createElement("div", {
			key: e,
			className: "mosaic-tile",
			style: { ...gM(t) }
		}, this.props.renderTile(e, n));
		switch (e.type) {
			case "split": {
				let { children: r, direction: i } = e, a = hM(t, e.splitPercentages ?? r.map(() => 100 / r.length), i), o = rO(r.flatMap((i, o) => {
					let s = n.concat(o), c = [this.renderRecursively(i, a[o], s)];
					return o < r.length - 1 && c.push(this.renderSplit(e, n, o, t)), c;
				})).filter(hN);
				return /* @__PURE__ */ P.createElement(P.Fragment, null, o.map((e, t) => P.cloneElement(e, { key: e.key || `${n.join("-")}-${t}` })));
			}
			case "tabs": return /* @__PURE__ */ P.createElement(pN, {
				node: e,
				path: n,
				renderTile: this.props.renderTile,
				renderTabToolbar: this.props.renderTabToolbar,
				boundingBox: t,
				renderTabTitle: this.props.renderTabTitle,
				renderTabButton: this.props.renderTabButton,
				showTabDragButton: this.props.showTabDragButton,
				renderTabToolbarControls: this.props.renderTabToolbarControls,
				canClose: this.props.canClose
			});
			default: return console.error("Unknown mosaic node type:", e), null;
		}
	}
	renderSplit(e, t, n, r) {
		let { resize: i } = this.props;
		if (i !== "DISABLED" && e.children.length > 1) {
			let { direction: a } = e, o = e.splitPercentages ?? e.children.map(() => 100 / e.children.length);
			return /* @__PURE__ */ P.createElement(xM, {
				key: `split-${t.join("-")}-${n}`,
				...i,
				direction: a,
				boundingBox: r,
				splitIndex: n,
				splitPercentages: o,
				onChange: (e) => this.onResize(e, t, !0),
				onRelease: (e) => this.onResize(e, t, !1)
			});
		}
		return null;
	}
	onResize = (e, t, n) => {
		this.context.mosaicActions.updateTree([{
			path: t,
			spec: { splitPercentages: { $set: e } }
		}], { suppressOnRelease: n });
	};
};
function hN(e) {
	return e !== null;
}
//#endregion
//#region node_modules/react-mosaic-component/lib/MosaicZeroState.mjs
var gN = class extends P.PureComponent {
	static contextType = dM;
	render() {
		return /* @__PURE__ */ P.createElement("div", { className: (0, G.default)("mosaic-zero-state", YM.getClasses(this.context.blueprintNamespace, "NON_IDEAL_STATE")) }, /* @__PURE__ */ P.createElement("div", { className: YM.getClasses(this.context.blueprintNamespace, "NON_IDEAL_STATE_VISUAL") }, /* @__PURE__ */ P.createElement(YM.Icon, {
			className: "default-zero-state-icon",
			size: "large",
			icon: "APPLICATIONS"
		})), /* @__PURE__ */ P.createElement("h4", { className: YM.getClasses(this.context.blueprintNamespace, "HEADING") }, "No Windows Present"), /* @__PURE__ */ P.createElement("div", null, this.props.createNode && /* @__PURE__ */ P.createElement("button", {
			className: (0, G.default)(YM.getClasses(this.context.blueprintNamespace, "BUTTON"), YM.getIconClass(this.context.blueprintNamespace, "ADD")),
			onClick: this.replace
		}, "Add New Window")));
	}
	replace = () => Promise.resolve(this.props.createNode()).then((e) => this.context.mosaicActions.replaceWith([], e)).catch(XT);
}, _N = ({ path: e, position: t }) => {
	let { mosaicId: n } = P.useContext(dM), [{ isOver: r, draggedMosaicId: i }, a] = xC({
		accept: zM.WINDOW,
		drop: () => ({
			path: e,
			position: t
		}),
		collect: (e) => ({
			isOver: e.isOver(),
			draggedMosaicId: e.getItem()?.mosaicId
		})
	});
	return a(/* @__PURE__ */ P.createElement("div", { className: (0, G.default)("drop-target", t, { "drop-target-hover": r && i === n }) }));
}, vN = P.memo(() => {
	let [{ isDragging: e }] = xC({
		accept: zM.WINDOW,
		collect: (e) => ({ isDragging: e.getItem() !== null && e.getItemType() === zM.WINDOW })
	}), t = yN(e, 0);
	return /* @__PURE__ */ P.createElement("div", { className: (0, G.default)("drop-target-container", { "-dragging": t }) }, iM(BM).map((e) => /* @__PURE__ */ P.createElement(_N, {
		position: e,
		path: [],
		key: e
	})));
});
vN.displayName = "RootDropTargets";
function yN(e, t) {
	let n = P.useRef(e), [, r] = P.useState(0), i = (e) => {
		n.current = e, r((e) => e + 1);
	};
	return e || (n.current = !1), P.useEffect(() => {
		if (n.current === e || !e) return;
		let r = window.setTimeout(() => i(!0), t);
		return () => {
			window.clearTimeout(r);
		};
	}, [e]), n.current;
}
//#endregion
//#region node_modules/react-mosaic-component/lib/Mosaic.mjs
var bN = 70;
function xN(e) {
	return e.initialValue != null;
}
var SN = class extends P.PureComponent {
	static defaultProps = {
		onChange: () => void 0,
		zeroStateView: /* @__PURE__ */ P.createElement(gN, null),
		className: "mosaic-blueprint-theme",
		blueprintNamespace: "bp5"
	};
	static getDerivedStateFromProps(e, t) {
		return e.mosaicId && (t.mosaicId, e.mosaicId), xN(e) && e.initialValue !== t.lastInitialValue ? {
			lastInitialValue: PM(e.initialValue),
			currentNode: PM(e.initialValue)
		} : null;
	}
	state = {
		currentNode: null,
		lastInitialValue: null,
		mosaicId: this.props.mosaicId ?? h()
	};
	render() {
		let { className: e } = this.props;
		return /* @__PURE__ */ P.createElement(dM.Provider, { value: this.childContext }, /* @__PURE__ */ P.createElement(CN, { className: e }, this.renderTree(), /* @__PURE__ */ P.createElement(vN, null)));
	}
	getRoot() {
		return xN(this.props) ? this.state.currentNode : PM(this.props.value);
	}
	updateRoot = (e, t) => {
		t = {
			shouldNormalize: t?.shouldNormalize ?? !1,
			suppressOnRelease: t?.suppressOnRelease ?? !1,
			suppressOnChange: t?.suppressOnChange ?? !1
		};
		let n = this.getRoot() || {}, r = t.shouldNormalize ? FM(HM(n, e)) : HM(n, e);
		this.replaceRoot(r, t.suppressOnRelease, t.suppressOnChange);
	};
	replaceRoot = (e, t = !1, n = !1) => {
		n || this.props.onChange(e), !t && this.props.onRelease && this.props.onRelease(e), xN(this.props) && this.setState({ currentNode: e });
	};
	actions = {
		updateTree: this.updateRoot,
		remove: (e) => {
			e.length === 0 ? this.replaceRoot(null) : this.updateRoot([UM(this.getRoot(), e)], { shouldNormalize: !0 });
		},
		expand: (e, t = bN) => this.updateRoot([qM(e, t)]),
		getRoot: () => this.getRoot(),
		hide: (e, t = !1) => {
			this.updateRoot([KM(this.getRoot(), e)], {
				suppressOnChange: t,
				suppressOnRelease: !0
			});
		},
		show: (e, t = !1) => {
			let n = this.getRoot();
			if (!n || e.length === 0) return;
			let r = RM(n, e);
			if (!r) return;
			let { parent: i } = r;
			if (EM(i)) {
				let n = 100 / i.children.length, r = Array(i.children.length).fill(n);
				this.updateRoot([{
					path: e.slice(0, -1),
					spec: { splitPercentages: { $set: r } }
				}], {
					suppressOnChange: t,
					suppressOnRelease: !0
				});
			}
		},
		createNode: this.props.createNode,
		addTab: (e, ...t) => {
			let { createNode: n } = this.props;
			return n == null ? Promise.reject(/* @__PURE__ */ Error("addTab requires `createNode` to be defined on Mosaic")) : Promise.resolve(n(...t)).then((t) => {
				if (typeof t != "string" && typeof t != "number") {
					console.error("createNode() for addTab must return a MosaicKey (string or number).");
					return;
				}
				let n = this.getRoot();
				if (!n) return;
				let r = IM(n, e);
				if (r == null) {
					console.error("addTab called on an invalid path.");
					return;
				}
				if (DM(r)) {
					this.updateRoot([{
						path: e,
						spec: {
							tabs: { $push: [t] },
							activeTabIndex: { $set: r.tabs.length }
						}
					}], { shouldNormalize: !0 });
					return;
				}
				if (EM(r)) {
					console.error("addTab cannot target a split node; pick a leaf or a tabs node.");
					return;
				}
				this.actions.replaceWith(e, {
					type: "tabs",
					tabs: [r, t],
					activeTabIndex: 1
				});
			});
		},
		removeTab: (e, t) => {
			let n = this.getRoot();
			if (!n) return;
			let r = IM(n, e);
			if (!DM(r)) {
				console.error("removeTab called on a path that is not a tabs node.");
				return;
			}
			if (t < 0 || t >= r.tabs.length) {
				console.error(`removeTab index ${t} is out of range.`);
				return;
			}
			let i = r.tabs.filter((e, n) => n !== t), a = r.activeTabIndex;
			t === r.activeTabIndex ? a = Math.max(0, t - 1) : t < r.activeTabIndex && (a = r.activeTabIndex - 1), this.updateRoot([{
				path: e,
				spec: {
					tabs: { $set: i },
					activeTabIndex: { $set: a }
				}
			}], { shouldNormalize: !0 });
		},
		replaceWith: (e, t) => this.updateRoot([{
			path: e,
			spec: { $set: t }
		}])
	};
	childContext = {
		mosaicActions: this.actions,
		mosaicId: this.state.mosaicId,
		blueprintNamespace: this.props.blueprintNamespace
	};
	renderTree() {
		let e = this.getRoot();
		if (this.validateTree(e), e == null) return this.props.zeroStateView;
		{
			let { renderTile: t, resize: n } = this.props;
			return /* @__PURE__ */ P.createElement(mN, {
				root: e,
				renderTile: t,
				renderTabToolbar: this.props.renderTabToolbar,
				renderTabToolbarControls: this.props.renderTabToolbarControls,
				resize: n,
				renderTabTitle: this.props.renderTabTitle,
				renderTabButton: this.props.renderTabButton,
				canClose: this.props.canClose
			});
		}
	}
	validateTree(e) {}
};
function CN({ className: e, children: t }) {
	let [{ isDragging: n }] = xC({
		accept: zM.WINDOW,
		collect: (e) => ({ isDragging: e.getItem() !== null && e.getItemType() === zM.WINDOW })
	});
	return /* @__PURE__ */ P.createElement("div", { className: (0, G.default)(e, "mosaic mosaic-drop-target", { "-dragging": n }) }, t);
}
var wN = class extends P.PureComponent {
	render() {
		return /* @__PURE__ */ P.createElement(MS, {
			backend: VC,
			options: Fw,
			context: window,
			...this.props.dragAndDropManager && { manager: this.props.dragAndDropManager }
		}, /* @__PURE__ */ P.createElement(SN, { ...this.props }));
	}
}, TN = class extends P.PureComponent {
	render() {
		return /* @__PURE__ */ P.createElement("div", { className: "separator" });
	}
}, EN = class extends P.Component {
	static defaultProps = {
		additionalControlButtonText: "More",
		draggable: !0,
		renderPreview: ({ title: e }) => /* @__PURE__ */ P.createElement("div", { className: "mosaic-preview" }, /* @__PURE__ */ P.createElement("div", { className: "mosaic-window-toolbar" }, /* @__PURE__ */ P.createElement("div", { className: "mosaic-window-title" }, e)), /* @__PURE__ */ P.createElement("div", { className: "mosaic-window-body" }, /* @__PURE__ */ P.createElement("h4", null, e), /* @__PURE__ */ P.createElement(YM.Icon, {
			className: "default-preview-icon",
			size: "large",
			icon: "APPLICATION"
		}))),
		renderToolbar: null
	};
	static contextType = dM;
	state = { additionalControlsOpen: !1 };
	rootElement = En();
	render() {
		let { className: e, isOver: t, renderPreview: n, additionalControls: r, connectDropTarget: i, connectDragPreview: a, draggedMosaicId: o, disableAdditionalControlsOverlay: s } = this.props, c = DM(OM(this.context.mosaicActions.getRoot(), this.props.path));
		return /* @__PURE__ */ P.createElement(fM.Provider, { value: this.childContext }, /* @__PURE__ */ P.createElement("div", {
			className: (0, G.default)("mosaic-window", "mosaic-drop-target", e, {
				"drop-target-hover": t && o === this.context.mosaicId,
				"additional-controls-open": this.state.additionalControlsOpen
			}),
			ref: (e) => {
				this.rootElement.current = e, i(e);
			}
		}, this.renderToolbar(), /* @__PURE__ */ P.createElement("div", { className: "mosaic-window-body" }, this.props.children), !s && /* @__PURE__ */ P.createElement("div", {
			className: "mosaic-window-body-overlay",
			onClick: () => {
				this.setAdditionalControlsOpen(!1);
			}
		}), /* @__PURE__ */ P.createElement("div", { className: "mosaic-window-additional-actions-bar" }, r), a(n(this.props)), !c && /* @__PURE__ */ P.createElement("div", { className: (0, G.default)("drop-target-container", {}) }, iM(BM).map(this.renderDropTarget))));
	}
	getToolbarControls() {
		let { toolbarControls: e, createNode: t, path: n } = this.props;
		return e || (DM(OM(this.context.mosaicActions.getRoot(), n)) ? sN : t ? lN : uN);
	}
	renderToolbar() {
		let { title: e, draggable: t, additionalControls: n, additionalControlButtonText: r, path: i, renderToolbar: a } = this.props, { additionalControlsOpen: o } = this.state, s = this.getToolbarControls(), c = OM(this.context.mosaicActions.getRoot(), i), l = t && i.length > 0 && !DM(c), u = l ? this.props.connectDragSource : (e) => e;
		if (a) {
			let e = u(a(this.props, t));
			return /* @__PURE__ */ P.createElement("div", { className: (0, G.default)("mosaic-window-toolbar", { draggable: l }) }, e);
		}
		let d = u(/* @__PURE__ */ P.createElement("div", {
			title: e,
			className: "mosaic-window-title"
		}, e)), f = !!n;
		return /* @__PURE__ */ P.createElement("div", { className: (0, G.default)("mosaic-window-toolbar", { draggable: l }) }, d, /* @__PURE__ */ P.createElement("div", { className: (0, G.default)("mosaic-window-controls", YM.getClasses("BUTTON_GROUP")) }, f && /* @__PURE__ */ P.createElement("button", {
			onClick: () => this.setAdditionalControlsOpen(!o),
			className: (0, G.default)(YM.getClasses(this.context.blueprintNamespace, "BUTTON", "MINIMAL"), YM.getIconClass(this.context.blueprintNamespace, "MORE"), { [YM.getClasses(this.context.blueprintNamespace, "ACTIVE")]: o })
		}, /* @__PURE__ */ P.createElement("span", { className: "control-text" }, r)), f && /* @__PURE__ */ P.createElement(TN, null), s));
	}
	renderDropTarget = (e) => {
		let { path: t } = this.props;
		return /* @__PURE__ */ P.createElement(_N, {
			position: e,
			path: t,
			key: e
		});
	};
	checkCreateNode() {
		if (this.props.createNode == null) throw Error("Operation invalid unless `createNode` is defined");
	}
	split = (...e) => {
		this.checkCreateNode();
		let { path: t } = this.props, { mosaicActions: n } = this.context, r = n.getRoot();
		if (DM(OM(r, t))) return Promise.resolve();
		let i = this.rootElement.current && this.rootElement.current.offsetWidth > this.rootElement.current.offsetHeight ? "row" : "column", a = IM(r, t);
		if (!a) throw Error("Current node could not be found.");
		return Promise.resolve(n.createNode(...e)).then((e) => {
			let r = {
				type: "split",
				direction: i,
				children: [a, e],
				splitPercentages: [50, 50]
			};
			n.replaceWith(t, r);
		});
	};
	addTab = (...e) => {
		this.checkCreateNode();
		let { path: t } = this.props, { mosaicActions: n } = this.context, r = DM(OM(n.getRoot(), t)) ? t.slice(0, -1) : t;
		return n.addTab(r, ...e);
	};
	getRoot = () => {
		let { mosaicActions: e } = this.context;
		return e.getRoot();
	};
	swap = (...e) => {
		this.checkCreateNode();
		let { mosaicActions: t } = this.context, { path: n, createNode: r } = this.props;
		return Promise.resolve(r(...e)).then((e) => t.replaceWith(n, e));
	};
	setAdditionalControlsOpen = (e) => {
		let t = e === "toggle" ? !this.state.additionalControlsOpen : e;
		this.setState({ additionalControlsOpen: t }), this.props.onAdditionalControlsToggle?.(t);
	};
	getPath = () => this.props.path;
	connectDragSource = (e) => {
		let { connectDragSource: t } = this.props;
		return t(e);
	};
	childContext = {
		blueprintNamespace: this.context.blueprintNamespace,
		mosaicWindowActions: {
			split: this.split,
			addTab: this.addTab,
			getRoot: this.getRoot,
			replaceWithNew: this.swap,
			setAdditionalControlsOpen: this.setAdditionalControlsOpen,
			getPath: this.getPath,
			connectDragSource: this.connectDragSource
		}
	};
};
function DN(e) {
	let { mosaicActions: t, mosaicId: n } = Mn(dM), [, r, i] = pC({
		type: zM.WINDOW,
		item: () => {
			e.onDragStart && e.onDragStart();
			let r = eM(() => t.hide(e.path));
			return {
				mosaicId: n,
				hideTimer: r
			};
		},
		end: ({ hideTimer: n }, r) => {
			window.clearTimeout(n);
			let i = e.path, a = r.getDropResult() || {}, { position: o, path: s } = a, c = s != null, l = c && aM(s, i), u = c && (() => {
				let e = t.getRoot(), n = i.slice(0, -1), r = IM(e, n), a = IM(e, s);
				return DM(r) && DM(a) && aM(n, s);
			})(), d = c && s.length > i.length && aM(i, tM(s, s.length - i.length));
			if (c && !l && !d && !u) {
				let n = WM(t.getRoot(), i, s, a.tabReorderIndex === void 0 ? o === void 0 ? { type: "tab-container" } : {
					type: "split",
					position: o
				} : {
					type: "tab-reorder",
					insertIndex: a.tabReorderIndex
				});
				t.updateTree(n, { shouldNormalize: !0 }), e.onDragEnd && e.onDragEnd("drop");
			} else t.show(i, !0), e.onDragEnd && e.onDragEnd("reset");
		}
	}), [{ isOver: a, draggedMosaicId: o }, s] = xC({
		accept: zM.WINDOW,
		collect: (e) => ({
			isOver: e.isOver(),
			draggedMosaicId: e.getItem()?.mosaicId
		})
	});
	return /* @__PURE__ */ P.createElement(EN, {
		...e,
		connectDragPreview: i,
		connectDragSource: r,
		connectDropTarget: s,
		isOver: a,
		draggedMosaicId: o
	});
}
var ON = class extends P.PureComponent {
	render() {
		return /* @__PURE__ */ P.createElement(DN, { ...this.props });
	}
}, kN = /* @__PURE__ */ p(Lw(), 1), AN = M(/*#__PURE__*/ z("path", { d: "M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z" }), "MenuSharp"), jN = M(/*#__PURE__*/ z("path", { d: "M21 3H3v18h18zm-2 16H5V5h14z" }), "CropDinSharp");
//#endregion
//#region src/components/icons/ThumbnailNavigationBottomIcon.jsx
function MN(e) {
	return /* @__PURE__ */ z(jr, {
		...e,
		children: /* @__PURE__ */ B("svg", {
			xmlns: "http://www.w3.org/2000/svg",
			width: "24",
			height: "24",
			viewBox: "0 0 24 24",
			children: [/* @__PURE__ */ z("path", {
				d: "M3,3H21V5H3Z",
				transform: "translate(0 16)"
			}), /* @__PURE__ */ z("path", {
				d: "M21,5H3V19H21ZM19,17H5V7H19Z",
				transform: "translate(0 -2)"
			})]
		})
	});
}
//#endregion
//#region src/components/icons/ThumbnailNavigationRightIcon.jsx
function NN(e) {
	return /* @__PURE__ */ z(jr, {
		...e,
		children: /* @__PURE__ */ B("svg", {
			xmlns: "http://www.w3.org/2000/svg",
			width: "24",
			height: "24",
			viewBox: "0 0 24 24",
			children: [
				/* @__PURE__ */ z("path", {
					d: "M0,0H24V24H0Z",
					transform: "translate(24) rotate(90)",
					fill: "none"
				}),
				/* @__PURE__ */ z("path", {
					d: "M3,3H21V5H3Z",
					transform: "translate(24) rotate(90)"
				}),
				/* @__PURE__ */ z("path", {
					d: "M19,3H5V21H19ZM17,19H7V5H17Z",
					transform: "translate(-2)"
				})
			]
		})
	});
}
//#endregion
//#region src/components/WindowThumbnailSettings.jsx
var PN = H(Xn, {
	name: "WindowThumbnailSettings",
	slot: "option"
})(({ selected: e, theme: t }) => ({ "& .MuiFormControlLabel-label": {
	borderBottom: "2px solid transparent",
	...e && { borderBottomColor: t.palette.secondary.main },
	"&.Mui-selected": { backgroundColor: "transparent !important" },
	"&.Mui-selected.Mui-focusVisible": { backgroundColor: `${(t.vars || t).palette.action.focus} !important` },
	"&:focused": { backgroundColor: `${(t.vars || t).palette.action.focus} !important` },
	color: e ? t.palette.secondary.main : void 0,
	display: "inline-flex"
} })), FN = H(Yn, {
	name: "WindowViewSettings",
	slot: "option"
})(() => ({ display: "inline-flex" }));
function IN({ handleClose: e = () => {}, thumbnailNavigationPosition: t, direction: n, windowId: r, setWindowThumbnailPosition: i }) {
	let { t: a } = V(), o = (t) => {
		i(r, t), e();
	};
	return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(Or, {
		role: "presentation",
		disableSticky: !0,
		children: a("thumbnails")
	}), /* @__PURE__ */ B(FN, {
		role: "menubar",
		children: [
			/* @__PURE__ */ z(PN, {
				"aria-checked": t === "off",
				onClick: () => {
					o("off");
				},
				role: "menuitemradio",
				selected: t === "off",
				children: /* @__PURE__ */ z(Ar, {
					control: /* @__PURE__ */ z(jN, {
						color: t === "off" ? "secondary" : void 0,
						fill: "currentcolor"
					}),
					label: a("off"),
					labelPlacement: "bottom",
					value: "off"
				})
			}, "off"),
			/* @__PURE__ */ z(PN, {
				"aria-checked": t === "far-bottom",
				onClick: () => {
					o("far-bottom");
				},
				role: "menuitemradio",
				selected: t === "far-bottom",
				children: /* @__PURE__ */ z(Ar, {
					control: /* @__PURE__ */ z(MN, {
						color: t === "far-bottom" ? "secondary" : void 0,
						fill: "currentcolor"
					}),
					label: a("bottom"),
					labelPlacement: "bottom",
					value: "far-bottom"
				})
			}, "far-bottom"),
			/* @__PURE__ */ z(PN, {
				"aria-checked": t === "far-right",
				onClick: () => {
					o("far-right");
				},
				role: "menuitemradio",
				selected: t === "far-right",
				children: /* @__PURE__ */ z(Ar, {
					control: /* @__PURE__ */ z(NN, {
						color: t === "far-right" ? "secondary" : void 0,
						fill: "currentcolor",
						style: n === "rtl" ? { transform: "rotate(180deg)" } : {}
					}),
					label: a("right"),
					labelPlacement: "bottom",
					value: "far-right"
				})
			}, "far-right")
		]
	})] });
}
IN.propTypes = {
	direction: W.default.string.isRequired,
	handleClose: W.default.func,
	setWindowThumbnailPosition: W.default.func.isRequired,
	thumbnailNavigationPosition: W.default.string.isRequired,
	windowId: W.default.string.isRequired
};
var LN = n(w((e, { windowId: t }) => ({
	direction: gt(e),
	thumbnailNavigationPosition: _e(e, { windowId: t })
}), { setWindowThumbnailPosition: Gt }, null, { forwardRef: !0 }), m("WindowThumbnailSettings"))(IN), RN = M(/*#__PURE__*/ z("path", { d: "M21 3H3v18h18zm-2 16H5V5h14zm-5.04-6.71-2.75 3.54-1.96-2.36L6.5 17h11z" }), "CropOriginalSharp"), zN = M(/*#__PURE__*/ z("path", { d: "M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z" }), "ViewColumn");
//#endregion
//#region src/components/icons/BookViewIcon.jsx
function BN(e) {
	return /* @__PURE__ */ z(jr, {
		...e,
		children: /* @__PURE__ */ z("svg", {
			xmlns: "http://www.w3.org/2000/svg",
			width: "24",
			height: "24",
			viewBox: "0 0 24 24",
			children: /* @__PURE__ */ z("path", { d: "M1,4V21H22.853V4.1ZM3,19V6h8V19Zm18,0H13V6h8ZM14,9.5h6V11H14ZM14,12h6v1.5H14Zm0,2.5h6V16H14Z" })
		})
	});
}
//#endregion
//#region src/components/icons/GalleryViewIcon.jsx
function VN(e) {
	return /* @__PURE__ */ z(jr, {
		...e,
		children: /* @__PURE__ */ z("svg", {
			xmlns: "http://www.w3.org/2000/svg",
			width: "24",
			height: "24",
			viewBox: "0 0 24 24",
			children: /* @__PURE__ */ z("path", {
				d: "M19.974,2H2V19.974H19.974V2ZM7.392,18.177H3.8V14.582H7.392Zm0-5.392H3.8V9.19H7.392Zm0-5.392H3.8V3.8H7.392Zm5.392,10.785H9.19V14.582h3.595Zm0-5.392H9.19V9.19h3.595Zm0-5.392H9.19V3.8h3.595Zm5.392,10.785H14.582V14.582h3.595Zm0-5.392H14.582V9.19h3.595Zm0-5.392H14.582V3.8h3.595Z",
				transform: "translate(1 1)"
			})
		})
	});
}
//#endregion
//#region src/components/WindowViewSettings.jsx
var HN = H(Xn, {
	name: "WindowViewSettings",
	slot: "option"
})(({ selected: e, theme: t }) => ({ "& .MuiFormControlLabel-label": {
	borderBottom: "2px solid transparent",
	...e && { borderBottomColor: t.palette.secondary.main },
	"&.Mui-selected": { backgroundColor: "transparent !important" },
	"&.Mui-selected.Mui-focusVisible": { backgroundColor: `${(t.vars || t).palette.action.focus} !important` },
	"&:focused": { backgroundColor: `${(t.vars || t).palette.action.focus} !important` },
	color: e ? t.palette.secondary.main : void 0,
	display: "inline-block"
} })), UN = H(Yn, {
	name: "WindowViewSettings",
	slot: "option"
})(() => ({ display: "inline-flex" }));
function WN({ handleClose: e = () => {}, windowViewType: t, viewTypes: n = [], setWindowViewType: r, windowId: i }) {
	let { t: a } = V(), o = (e) => {
		r(i, e);
	}, s = {
		book: BN,
		gallery: VN,
		scroll: zN,
		single: RN
	}, c = ({ value: n, Icon: r }) => /* @__PURE__ */ z(HN, {
		"aria-checked": t === n,
		autoFocus: t === n,
		onClick: () => {
			o(n), e();
		},
		role: "menuitemradio",
		selected: t === n,
		children: /* @__PURE__ */ z(Ar, {
			value: n,
			control: /* @__PURE__ */ z(r, {
				fill: "currentcolor",
				color: t === n ? "secondary" : void 0
			}),
			label: a(n),
			labelPlacement: "bottom"
		})
	}, n);
	return n.length === 0 ? null : /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(Or, {
		role: "presentation",
		disableSticky: !0,
		children: a("view")
	}), /* @__PURE__ */ z(UN, {
		role: "menubar",
		children: n.map((e) => c({
			Icon: s[e],
			value: e
		}))
	})] });
}
WN.propTypes = {
	handleClose: W.default.func,
	setWindowViewType: W.default.func.isRequired,
	viewTypes: W.default.arrayOf(W.default.string),
	windowId: W.default.string.isRequired,
	windowViewType: W.default.string.isRequired
};
var GN = n(w((e, { windowId: t }) => ({
	viewTypes: Be(e, { windowId: t }),
	windowViewType: Ee(e, { windowId: t })
}), { setWindowViewType: Yt }, null, { forwardRef: !0 }), m("WindowViewSettings"))(WN);
//#endregion
//#region src/components/WindowTopMenu.jsx
function KN({ targetName: e, ...t }) {
	let { PluginComponents: n } = sn(e), { t: r } = V();
	return n?.length > 0 ? /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(Or, {
		role: "presentation",
		disableSticky: !0,
		tabIndex: -1,
		children: r("windowPluginButtons")
	}), /* @__PURE__ */ z(cn, {
		targetName: e,
		...t
	})] }) : null;
}
KN.propTypes = { targetName: W.default.string.isRequired };
function qN({ handleClose: e, showThumbnailNavigationSettings: t = !0, toggleDraggingEnabled: n, windowId: r, anchorEl: i = null, open: a = !1 }) {
	let o = Mn(gn), s = arguments[0];
	return /* @__PURE__ */ B(kr, {
		container: o?.current,
		anchorOrigin: {
			horizontal: "right",
			vertical: "bottom"
		},
		transformOrigin: {
			horizontal: "right",
			vertical: "top"
		},
		onClose: e,
		TransitionProps: {
			onEntering: n,
			onExit: n
		},
		orientation: "horizontal",
		anchorEl: i,
		open: a,
		role: "menu",
		children: [
			/* @__PURE__ */ z(GN, {
				windowId: r,
				handleClose: e
			}),
			t && /* @__PURE__ */ z(LN, {
				windowId: r,
				handleClose: e
			}),
			/* @__PURE__ */ z(KN, {
				targetName: "WindowTopMenu",
				...s
			})
		]
	});
}
qN.propTypes = {
	anchorEl: W.default.object,
	handleClose: W.default.func.isRequired,
	open: W.default.bool,
	showThumbnailNavigationSettings: W.default.bool,
	toggleDraggingEnabled: W.default.func.isRequired,
	windowId: W.default.string.isRequired
};
var JN = n(w((e) => ({ showThumbnailNavigationSettings: nt(e).thumbnailNavigation.displaySettings }), (e) => ({ toggleDraggingEnabled: () => e(na()) })), m("WindowTopMenu"))(qN);
//#endregion
//#region src/components/icons/WindowOptionsIcon.jsx
function YN(e) {
	return /* @__PURE__ */ z(jr, {
		...e,
		children: /* @__PURE__ */ B("svg", {
			xmlns: "http://www.w3.org/2000/svg",
			width: "24",
			height: "24",
			viewBox: "0 0 24 24",
			children: [
				/* @__PURE__ */ z("path", {
					d: "M0,0H24V24H0Z",
					fill: "none"
				}),
				/* @__PURE__ */ z("path", {
					d: "M24.852,17.981,3,18V15.945l21.852-.019Z",
					transform: "translate(-2 5)"
				}),
				/* @__PURE__ */ z("path", {
					d: "M1,4V21H22.853V4.1ZM3,19V6h8V19Zm18,0H13V6h8Z",
					transform: "translate(0 -2)"
				})
			]
		})
	});
}
//#endregion
//#region src/components/WindowTopMenuButton.jsx
function XN({ classes: e = {}, windowId: t }) {
	let { t: n } = V(), [r, i] = L(null), [a, o] = L(!1), s = Nn();
	return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(mn, {
		"aria-expanded": !!r,
		"aria-haspopup": "true",
		"aria-label": n("windowMenu"),
		"aria-owns": a ? s : void 0,
		className: a ? e.ctrlBtnSelected : void 0,
		selected: a,
		onClick: (e) => {
			i(e.currentTarget), o(!0);
		},
		children: /* @__PURE__ */ z(YN, {})
	}), /* @__PURE__ */ z(JN, {
		windowId: t,
		anchorEl: r,
		handleClose: () => {
			i(null), o(!1);
		},
		id: s,
		open: a
	})] });
}
XN.propTypes = {
	classes: W.default.objectOf(W.default.string),
	windowId: W.default.string.isRequired
};
var ZN = n(m("WindowTopMenuButton"))(XN);
//#endregion
//#region src/components/WindowTopBarPluginArea.jsx
function QN(e) {
	return /* @__PURE__ */ z(cn, {
		targetName: "WindowTopBarPluginArea",
		...e
	});
}
var $N = n(w(null, null), m("WindowTopBarPluginArea"))(QN), eP = M(/*#__PURE__*/ z("path", { d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }), "MoreVertSharp");
//#endregion
//#region src/components/WindowTopBarPluginMenu.jsx
function tP({ windowId: e, menuIcon: t = /* @__PURE__ */ z(eP, {}), pluginTarget: n = "WindowTopBarPluginMenu" }) {
	let { t: r } = V(), i = Mn(gn), a = arguments[0], [o, s] = L(null), [c, l] = L(!1), u = Nn(), { PluginComponents: d } = sn(n), f = (e) => {
		s(e.currentTarget), l(!0);
	}, p = () => {
		s(null), l(!1);
	};
	return !d || d.length === 0 ? null : /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(mn, {
		"aria-expanded": !!o,
		"aria-haspopup": "true",
		"aria-label": r("windowPluginMenu"),
		"aria-owns": c ? u : void 0,
		selected: c,
		onClick: f,
		children: t
	}), /* @__PURE__ */ z(Mr, {
		id: u,
		container: i?.current,
		anchorEl: o,
		anchorOrigin: {
			horizontal: "right",
			vertical: "bottom"
		},
		transformOrigin: {
			horizontal: "right",
			vertical: "top"
		},
		open: c,
		onClose: p,
		children: /* @__PURE__ */ z(cn, {
			targetName: n,
			handleClose: p,
			...a
		})
	})] });
}
tP.propTypes = {
	anchorEl: W.default.object,
	container: W.default.shape({ current: W.default.instanceOf(Element) }),
	menuIcon: W.default.element,
	open: W.default.bool,
	pluginTarget: W.default.string,
	windowId: W.default.string.isRequired
};
var nP = n(m("WindowTopBarPluginMenu"))(tP), rP = M(/*#__PURE__*/ z("path", { d: "M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8" }), "ErrorOutlineSharp"), iP = H(oP)(({ theme: e }) => ({
	...e.typography.h6,
	flexGrow: 1,
	paddingLeft: e.spacing(.5)
})), aP = H("div")(({ theme: e }) => ({
	...e.typography.h6,
	flexGrow: 1,
	paddingLeft: e.spacing(.5)
}));
function oP({ children: e, ...t }) {
	return /* @__PURE__ */ z(U, {
		variant: "h2",
		noWrap: !0,
		color: "inherit",
		...t,
		children: e
	});
}
oP.propTypes = { children: W.default.node.isRequired };
function sP({ error: e = null, hideWindowTitle: t = !1, isFetching: n = !1, manifestTitle: r = "" }) {
	let i;
	return i = n ? /* @__PURE__ */ z(iP, { children: /* @__PURE__ */ z(gr, { variant: "text" }) }) : e ? /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(rP, { color: "error" }), /* @__PURE__ */ z(iP, {
		color: "textSecondary",
		children: e
	})] }) : t ? /* @__PURE__ */ z(aP, {}) : /* @__PURE__ */ z(iP, { children: r }), i;
}
sP.propTypes = {
	error: W.default.string,
	hideWindowTitle: W.default.bool,
	isFetching: W.default.bool,
	manifestTitle: W.default.string
};
var cP = n(w((e, { windowId: t }) => ({
	error: Ge(e, { windowId: t }).error,
	hideWindowTitle: we(e, { windowId: t }).hideWindowTitle,
	isFetching: Ge(e, { windowId: t }).isFetching,
	manifestTitle: lt(e, { windowId: t })
}), null), m("WindowTopBarTitle"))(sP), lP = M(/*#__PURE__*/ z("path", { d: "M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z" }), "FullscreenSharp"), uP = M(/*#__PURE__*/ z("path", { d: "M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z" }), "FullscreenExitSharp");
//#endregion
//#region src/components/FullScreenButton.jsx
function dP({ className: e = void 0 }) {
	let { t } = V(), n = Mn(Iw), [r, i] = L(!1);
	return F(() => {
		let e = document.createElement("div");
		i(typeof e.requestFullscreen == "function");
	}, []), r ? n && n.active ? /* @__PURE__ */ z(mn, {
		className: e,
		"aria-label": t("exitFullScreen"),
		onClick: n.exit,
		children: /* @__PURE__ */ z(uP, {})
	}) : n ? /* @__PURE__ */ z(mn, {
		className: e,
		"aria-label": t("workspaceFullScreen"),
		onClick: n.enter,
		children: /* @__PURE__ */ z(lP, {})
	}) : null : null;
}
dP.propTypes = { className: W.default.string };
var fP = n(w((e) => ({}), {}), m("FullScreenButton"))(dP);
//#endregion
//#region src/components/icons/WindowMaxIcon.jsx
function pP(e) {
	return /* @__PURE__ */ z(jr, {
		...e,
		children: /* @__PURE__ */ B("svg", {
			xmlns: "http://www.w3.org/2000/svg",
			width: "24",
			height: "24",
			viewBox: "0 0 24 24",
			children: [/* @__PURE__ */ z("path", { d: "M7,14H5v5h5V17H7Zm7-9V7h3v3h2V5Z" }), /* @__PURE__ */ z("path", { d: "M22.517,1.524H1.736V22.37H22.517Zm-2,18.845H3.736V3.524H20.517Z" })]
		})
	});
}
//#endregion
//#region src/components/icons/WindowMinIcon.jsx
function mP(e) {
	return /* @__PURE__ */ z(jr, {
		...e,
		children: /* @__PURE__ */ B("svg", {
			xmlns: "http://www.w3.org/2000/svg",
			width: "24",
			height: "24",
			viewBox: "0 0 24 24",
			children: [/* @__PURE__ */ z("path", { d: "M5,16H8v3h2V14H5ZM16,8V5H14v5h5V8Z" }), /* @__PURE__ */ z("path", { d: "M22.517,1.524H1.736V22.37H22.517Zm-2,18.845H3.736V3.524H20.517Z" })]
		})
	});
}
//#endregion
//#region src/components/WindowTopBar.jsx
var hP = H(Dr, {
	name: "WindowTopBar",
	slot: "root"
})(() => ({ zIndex: 1100 })), gP = H(Qn, {
	name: "WindowTopBar",
	slot: "toolbar"
})(({ ownerState: e, theme: t }) => ({
	backgroundColor: t.palette.shades?.main,
	borderTop: "2px solid",
	borderTopColor: e?.focused ? t.palette.primary.main : "transparent",
	minHeight: 32,
	paddingLeft: t.spacing(.5),
	paddingRight: t.spacing(.5),
	...e?.windowDraggable && { cursor: "move" }
}));
function _P({ removeWindow: e, windowId: t, toggleWindowSideBar: n, maximizeWindow: r = () => {}, maximized: i = !1, minimizeWindow: a = () => {}, allowClose: o = !0, allowMaximize: s = !0, focusWindow: c = () => {}, allowFullscreen: l = !1, allowTopMenuButton: u = !0, allowWindowSideBar: d = !0, sideBarOpen: f = !1, component: p = "nav" }) {
	let { t: m } = V(), h = arguments[0];
	return /* @__PURE__ */ z(hP, {
		component: p,
		"aria-label": m("windowNavigation"),
		position: "relative",
		color: "default",
		enableColorOnDark: !0,
		children: /* @__PURE__ */ B(gP, {
			disableGutters: !0,
			onMouseDown: c,
			ownerState: h,
			className: (0, G.default)(j("window-top-bar")),
			variant: "dense",
			children: [
				d && /* @__PURE__ */ z(mn, {
					"aria-expanded": f,
					"aria-haspopup": !0,
					"aria-label": m(f ? "hideWindowSideBar" : "showWindowSideBar"),
					onClick: n,
					className: j("window-menu-btn"),
					children: /* @__PURE__ */ z(AN, {})
				}),
				/* @__PURE__ */ z(cP, { windowId: t }),
				u && /* @__PURE__ */ z(ZN, {
					windowId: t,
					className: j("window-menu-btn")
				}),
				/* @__PURE__ */ z($N, { windowId: t }),
				/* @__PURE__ */ z(nP, { windowId: t }),
				s && /* @__PURE__ */ z(mn, {
					"aria-label": m(i ? "minimizeWindow" : "maximizeWindow"),
					className: (0, G.default)(j("window-maximize"), j("window-menu-btn")),
					onClick: i ? a : r,
					children: z(i ? mP : pP, {})
				}),
				l && /* @__PURE__ */ z(fP, { className: j("window-menu-btn") }),
				o && /* @__PURE__ */ z(mn, {
					"aria-label": m("closeWindow"),
					className: (0, G.default)(j("window-close"), j("window-menu-btn")),
					onClick: e,
					children: /* @__PURE__ */ z(Ms, {})
				})
			]
		})
	});
}
_P.propTypes = {
	allowClose: W.default.bool,
	allowFullscreen: W.default.bool,
	allowMaximize: W.default.bool,
	allowTopMenuButton: W.default.bool,
	allowWindowSideBar: W.default.bool,
	component: W.default.elementType,
	focused: W.default.bool,
	focusWindow: W.default.func,
	maximized: W.default.bool,
	maximizeWindow: W.default.func,
	minimizeWindow: W.default.func,
	sideBarOpen: W.default.bool,
	removeWindow: W.default.func.isRequired,
	toggleWindowSideBar: W.default.func.isRequired,
	windowDraggable: W.default.bool,
	windowId: W.default.string.isRequired
};
var vP = n(w((e, { windowId: t }) => {
	let n = we(e, { windowId: t });
	return {
		allowClose: n.allowClose,
		allowFullscreen: n.allowFullscreen,
		allowMaximize: n.allowMaximize,
		allowTopMenuButton: n.allowTopMenuButton,
		allowWindowSideBar: n.allowWindowSideBar,
		focused: Ze(e, { windowId: t }),
		maximized: n.maximized,
		sideBarOpen: (s(e, { windowId: t }) || {}).sideBarOpen
	};
}, (e, { windowId: t }) => ({
	focusWindow: () => e(Xt(t)),
	maximizeWindow: () => e(Jt(t)),
	minimizeWindow: () => e(Wt(t)),
	removeWindow: () => e(Zt(t)),
	toggleWindowSideBar: () => e(Kt(t))
})), m("WindowTopBar"))(_P), yP = M(/*#__PURE__*/ z("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z" }), "InfoSharp"), bP = M(/*#__PURE__*/ z("path", { d: "M10.08 10.86c.05-.33.16-.62.3-.87s.34-.46.59-.62c.24-.15.54-.22.91-.23.23.01.44.05.63.13.2.09.38.21.52.36s.25.33.34.53.13.42.14.64h1.79c-.02-.47-.11-.9-.28-1.29s-.4-.73-.7-1.01-.66-.5-1.08-.66-.88-.23-1.39-.23c-.65 0-1.22.11-1.7.34s-.88.53-1.2.92-.56.84-.71 1.36S8 11.29 8 11.87v.27c0 .58.08 1.12.23 1.64s.39.97.71 1.35.72.69 1.2.91 1.05.34 1.7.34c.47 0 .91-.08 1.32-.23s.77-.36 1.08-.63.56-.58.74-.94.29-.74.3-1.15h-1.79c-.01.21-.06.4-.15.58s-.21.33-.36.46-.32.23-.52.3c-.19.07-.39.09-.6.1-.36-.01-.66-.08-.89-.23-.25-.16-.45-.37-.59-.62s-.25-.55-.3-.88-.08-.67-.08-1v-.27c0-.35.03-.68.08-1.01M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8" }), "CopyrightSharp"), xP = M(/*#__PURE__*/ z("path", { d: "m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27z" }), "LayersSharp");
//#endregion
//#region src/components/icons/CanvasIndexIcon.jsx
function SP(e) {
	return /* @__PURE__ */ z(jr, {
		...e,
		children: /* @__PURE__ */ z("svg", {
			xmlns: "http://www.w3.org/2000/svg",
			width: "24",
			height: "24",
			viewBox: "0 0 24 24",
			children: /* @__PURE__ */ z("path", { d: "M6.924,21H21V19H6.924ZM3,17H21V15H3Zm3.924-4H21V11H6.924Zm0-4H21V7H6.924ZM3,3V5H21V3Z" })
		})
	});
}
//#endregion
//#region src/components/WindowSideBarButtons.jsx
var CP = H(lr, {
	name: "WindowSideBarButtons",
	slot: "root"
})({
	"& .MuiTabs-flexContainer": { flexDirection: "column" },
	"&.MuiTabs-indicator": { display: "none" }
}), wP = H(ur, {
	name: "WindowSideBarButtons",
	slot: "button"
})(({ theme: e }) => ({
	"&.Mui-selected": {
		borderRight: "2px solid",
		borderRightColor: e.palette.primary.main
	},
	"&.MuiTab-root": {
		"&:active": { backgroundColor: e.palette.action.active },
		"&:focus": {
			"@media (hover: none)": { backgroundColor: "transparent" },
			backgroundColor: e.palette.action.hover,
			textDecoration: "none"
		},
		"&:hover": {
			"@media (hover: none)": { backgroundColor: "transparent" },
			backgroundColor: e.palette.action.hover,
			textDecoration: "none"
		},
		borderRight: "2px solid transparent",
		minWidth: "auto"
	},
	fill: "currentcolor"
}));
function TP({ value: e, ...t }) {
	let { t: n } = V();
	return /* @__PURE__ */ z(qn, {
		title: n("openCompanionWindow", { context: e }),
		children: /* @__PURE__ */ z(wP, {
			...t,
			value: e,
			"aria-label": n("openCompanionWindow", { context: e }),
			disableRipple: !0
		})
	});
}
TP.propTypes = { value: W.default.string.isRequired };
function EP({ addCompanionWindow: e, hasAnnotations: t = !1, hasAnyAnnotations: n = !1, hasAnyLayers: r = !1, hasCurrentLayers: i = !1, hasSearchResults: a = !1, hasSearchService: o = !1, panels: s = [], sideBarPanel: c = "closed" }) {
	let { t: l } = V(), { PluginComponents: u } = sn("WindowSideBarButtons");
	return /* @__PURE__ */ B(CP, {
		value: c !== "closed" && c,
		onChange: (t, n) => {
			e(n);
		},
		variant: "fullWidth",
		indicatorColor: "primary",
		textColor: "primary",
		orientation: "vertical",
		children: [
			s.info && /* @__PURE__ */ z(TP, {
				value: "info",
				icon: /* @__PURE__ */ z(yP, {})
			}),
			s.attribution && /* @__PURE__ */ z(TP, {
				value: "attribution",
				icon: /* @__PURE__ */ z(bP, {})
			}),
			s.canvas && /* @__PURE__ */ z(TP, {
				value: "canvas",
				icon: /* @__PURE__ */ z(SP, {})
			}),
			s.annotations && (t || n) && /* @__PURE__ */ z(TP, {
				value: "annotations",
				icon: /* @__PURE__ */ z(Gn, {
					overlap: "rectangular",
					color: "notification",
					invisible: !t,
					variant: "dot",
					children: /* @__PURE__ */ z(pn, {})
				})
			}),
			s.search && o && /* @__PURE__ */ z(TP, {
				value: "search",
				icon: /* @__PURE__ */ z(Gn, {
					overlap: "rectangular",
					color: "notification",
					invisible: !a,
					variant: "dot",
					children: /* @__PURE__ */ z(un, {})
				})
			}),
			s.layers && r && /* @__PURE__ */ z(TP, {
				value: "layers",
				icon: /* @__PURE__ */ z(Gn, {
					overlap: "rectangular",
					color: "notification",
					invisible: !i,
					variant: "dot",
					children: /* @__PURE__ */ z(xP, {})
				})
			}),
			u && u.map((e) => /* @__PURE__ */ z(TP, {
				value: e.value,
				icon: /* @__PURE__ */ z(e, {})
			}, e.value))
		]
	});
}
EP.propTypes = {
	addCompanionWindow: W.default.func.isRequired,
	hasAnnotations: W.default.bool,
	hasAnyAnnotations: W.default.bool,
	hasAnyLayers: W.default.bool,
	hasCurrentLayers: W.default.bool,
	hasSearchResults: W.default.bool,
	hasSearchService: W.default.bool,
	panels: W.default.objectOf(W.default.bool),
	sideBarPanel: W.default.string
};
//#endregion
//#region src/containers/WindowSideBarButtons.js
var DP = (e, { windowId: t }) => ({ addCompanionWindow: (n) => e(Pi(t, {
	content: n,
	position: "left"
})) });
function OP(e, t) {
	return e && e.some((e) => t(e).imageResources.length > 1);
}
function kP(e, t) {
	return e && e.some((e) => {
		let n = t(e);
		return n.annotationListUris.length > 0 || n.canvasAnnotationPages.length > 0;
	});
}
function AP(e, { windowId: t }) {
	let { suggestedSearches: n } = s(e, { windowId: t }), r = Qe(e, {
		position: "left",
		windowId: t
	})?.[0]?.id, i = Ft(e, {
		companionWindowId: r,
		windowId: t
	});
	return !!(n || i);
}
var jP = n(w((e, { windowId: t }) => ({
	hasAnnotations: Nt(e, { windowId: t }).length > 0,
	hasAnyAnnotations: kP(ut(e, { windowId: t }), fe(e)),
	hasAnyLayers: OP(ut(e, { windowId: t }), fe(e)),
	hasCurrentLayers: OP(Ie(e, { windowId: t }), fe(e)),
	hasSearchResults: AP(e, { windowId: t }),
	hasSearchService: Se(e, { windowId: t }) !== null,
	panels: we(e, { windowId: t }).panels,
	sideBarPanel: (Qe(e, {
		position: "left",
		windowId: t
	})[0] || {}).content
}), DP), m("WindowSideBarButtons"))(EP), MP = H(Nr, {
	name: "WindowSideBar",
	slot: "root"
})(({ theme: e }) => ({
	flexShrink: 0,
	order: -1e3,
	zIndex: e.zIndex.appBar - 1
})), NP = H("nav", {
	name: "WindowSideBar",
	slot: "nav"
})({
	position: "relative !important",
	width: 48
});
function PP({ classes: e = {}, direction: t, windowId: n, sideBarOpen: r = !1 }) {
	let { t: i } = V();
	return /* @__PURE__ */ z(MP, {
		variant: "persistent",
		className: e.drawer,
		anchor: t === "rtl" ? "right" : "left",
		PaperProps: {
			"aria-label": i("sidebarPanelsNavigation"),
			component: NP,
			variant: "outlined"
		},
		SlideProps: {
			direction: t === "rtl" ? "left" : "right",
			mountOnEnter: !0,
			unmountOnExit: !0
		},
		open: r,
		children: /* @__PURE__ */ z(jP, { windowId: n })
	});
}
PP.propTypes = {
	classes: W.default.objectOf(W.default.string),
	direction: W.default.string.isRequired,
	sideBarOpen: W.default.bool,
	windowId: W.default.string.isRequired
};
var FP = n(w((e, { windowId: t }) => ({
	direction: gt(e),
	sideBarOpen: (s(e, { windowId: t }) || {}).sideBarOpen,
	sideBarPanel: (s(e, { windowId: t }) || {}).sideBarPanel
}), null), m("WindowSideBar"))(PP), IP = M(/*#__PURE__*/ z("path", { d: "m14 7-5 5 5 5z" }), "ArrowLeftSharp"), LP = M(/*#__PURE__*/ z("path", { d: "m10 17 5-5-5-5z" }), "ArrowRightSharp"), RP = H("pre", {
	name: "ErrorContent",
	slot: "stacktrace"
})({ overflowY: "scroll" }), zP = H("pre", {
	name: "ErrorContent",
	slot: "metadata"
})({
	height: "100px",
	overflowY: "scroll"
}), BP = H(tr, {
	name: "ErrorContent",
	slot: "accordion"
})({
	backgroundColor: "inherit",
	color: "inherit",
	margin: 0
});
function VP({ error: e, metadata: t = null, showJsError: n = !0, ...r }) {
	let { t: i } = V();
	if (!n) return null;
	let a = {
		error: e,
		metadata: t,
		showJsError: n,
		t: i,
		...r
	};
	return /* @__PURE__ */ B(Ir, {
		elevation: 6,
		variant: "filled",
		severity: "error",
		children: [
			i("errorDialogTitle"),
			n && /* @__PURE__ */ B(BP, {
				elevation: 2,
				square: !0,
				children: [/* @__PURE__ */ z(rr, {
					sx: { marginInlineStart: "-1rem" },
					expandIcon: /* @__PURE__ */ z(vl, { sx: { color: "#fff" } }),
					children: i("jsError", {
						message: e.message,
						name: e.name
					})
				}), /* @__PURE__ */ z(nr, { children: /* @__PURE__ */ B(Fr, { children: [/* @__PURE__ */ z(RP, { children: i("jsStack", { stack: e.stack }) }), t && /* @__PURE__ */ z(zP, { children: JSON.stringify(t, null, 2) })] }) })]
			}),
			/* @__PURE__ */ z(cn, {
				targetName: "ErrorContent",
				...a
			})
		]
	});
}
VP.propTypes = {
	error: W.default.object.isRequired,
	metadata: W.default.object,
	showJsError: W.default.bool
};
var HP = n(w((e, { companionWindowId: t, windowId: n }) => ({
	metadata: {
		companionWindow: t && se(e, { companionWindowId: t }),
		manifest: b(e, { windowId: n }),
		viewer: g(e, { windowId: n }),
		window: s(e, { windowId: n })
	},
	showJsError: nt(e).window.showJsError
})), m("ErrorContent"))(VP);
//#endregion
//#region src/components/CompanionWindowFactory.jsx
function UP({ content: e = null, id: t, windowId: n }) {
	let { t: r } = V(), i = jn(({ error: e }) => /* @__PURE__ */ z(ml, {
		title: r("error"),
		windowId: n,
		id: t,
		children: /* @__PURE__ */ z(HP, {
			error: e,
			windowId: n,
			companionWindowId: t
		})
	}), [
		n,
		r,
		t
	]), a = Fb[e];
	return a ? /* @__PURE__ */ z(yn, {
		fallbackComponent: i,
		children: /* @__PURE__ */ z(a, {
			id: t,
			windowId: n
		})
	}) : null;
}
UP.propTypes = {
	content: W.default.string,
	id: W.default.string.isRequired,
	windowId: W.default.string.isRequired
};
var WP = n(w((e, { id: t }) => ({
	content: se(e, { companionWindowId: t }).content,
	id: t
})), m("CompanionWindowFactory"))(UP), GP = H("div", {
	name: "CompanionArea",
	slot: "root"
})(({ ownerState: e, theme: t }) => ({
	display: "flex",
	minHeight: 0,
	position: "relative",
	zIndex: t.zIndex.appBar - 2,
	...(e.position === "bottom" || e.position === "far-bottom") && {
		flexDirection: "column",
		width: "100%"
	}
})), KP = H("div", {
	name: "CompanionArea",
	slot: "container"
})(({ ownerState: e }) => ({
	display: e?.companionAreaOpen ? "flex" : "none",
	...(e?.position === "bottom" || e?.position === "far-bottom") && {
		flexDirection: "column",
		width: "100%"
	},
	...e?.position === "left" && e?.companionWindowIds && e.companionWindowIds.length > 0 && { minWidth: "235px" }
})), qP = H("div", {
	name: "CompanionArea",
	slot: "toggle"
})(({ theme: e }) => ({
	alignItems: "center",
	backgroundColor: e.palette.background.paper,
	border: `1px solid ${e.palette.shades?.dark}`,
	...e.applyStyles("dark", { borderColor: e.palette.divider }),
	borderInlineStart: 0,
	borderRadius: 0,
	display: "inline-flex",
	height: "48px",
	left: "100%",
	marginTop: "1rem",
	overflow: "hidden",
	padding: 2,
	position: "absolute",
	width: "23px",
	zIndex: e.zIndex.drawer
}));
function JP({ classes: e = {}, className: t = void 0, direction: n, companionWindowIds: r, companionAreaOpen: i, setCompanionAreaOpen: a = () => {}, position: o, sideBarOpen: s = !1, windowId: c }) {
	let { t: l } = V(), u = o === "bottom" || o === "far-bottom" ? e.horizontal : null, d = z(n === "rtl" ? i ? LP : IP : i ? IP : LP, {}), f = (() => {
		let e = n === "rtl" ? "left" : "right", t = n === "rtl" ? "right" : "left";
		switch (o) {
			case "right":
			case "far-right": return t;
			case "bottom":
			case "far-bottom": return "up";
			default: return e;
		}
	})(), p = (0, G.default)(u, j(`companion-area-${o}`), t), m = arguments[0];
	return /* @__PURE__ */ B(GP, {
		ownerState: m,
		className: p,
		children: [/* @__PURE__ */ z(Pr, {
			in: i,
			direction: f,
			children: /* @__PURE__ */ z(KP, {
				ownerState: m,
				className: `${j("companion-windows")}`,
				children: r.map((e) => /* @__PURE__ */ z(WP, {
					id: e,
					windowId: c
				}, e))
			})
		}), a && o === "left" && s && r.length > 0 && /* @__PURE__ */ z(qP, { children: /* @__PURE__ */ z(mn, {
			"aria-expanded": i,
			"aria-label": l(i ? "collapseSidePanel" : "expandSidePanel"),
			edge: "start",
			onClick: () => {
				a(c, !i);
			},
			TooltipProps: { placement: "right" },
			children: d
		}) })]
	});
}
JP.propTypes = {
	classes: W.default.objectOf(W.default.string),
	className: W.default.string,
	companionAreaOpen: W.default.bool.isRequired,
	companionWindowIds: W.default.arrayOf(W.default.string).isRequired,
	direction: W.default.string.isRequired,
	position: W.default.string.isRequired,
	setCompanionAreaOpen: W.default.func,
	sideBarOpen: W.default.bool,
	windowId: W.default.string.isRequired
};
var YP = n(w((e, { windowId: t, position: n }) => ({
	companionAreaOpen: De(e, {
		position: n,
		windowId: t
	}),
	companionWindowIds: ae(e, {
		position: n,
		windowId: t
	}),
	direction: gt(e),
	sideBarOpen: (s(e, { windowId: t }) || {}).sideBarOpen
}), { setCompanionAreaOpen: $t }), m("CompanionArea"))(JP), XP = (e) => {
	let t;
	return t = e < 1 ? 5.11916 * e ** 2 : 4.5 * Math.log(e + 1) + 2, (t / 100).toFixed(2);
}, ZP = H($r, {
	name: "ScrollIndicatedDialogContent",
	slot: "root"
})(({ ownerState: e, theme: t }) => {
	let n = t.palette.mode === "dark" ? { backgroundImage: `linear-gradient(${Rn("#fff", XP(e?.elevation || 24))}, ${Rn("#fff", XP(e?.elevation || 24))})` } : t.palette.background.paper;
	return {
		background: `linear-gradient(${n} 30%, rgba(255, 255, 255, 0)), linear-gradient(rgba(255, 255, 255, 0), ${n} 70%) 0 100%, radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)) 0 100%;`,
		backgroundAttachment: "local, local, scroll, scroll",
		backgroundRepeat: "no-repeat",
		backgroundSize: "100% 40px, 100% 40px, 100% 14px, 100% 14px",
		overflowY: "auto"
	};
});
function QP({ classes: e = {}, className: t = "", ...n }) {
	let r = [t, e.shadowScrollDialog].join(" ");
	return /* @__PURE__ */ z(ZP, {
		className: r,
		...n
	});
}
QP.propTypes = {
	classes: W.default.shape({ shadowScrollDialog: W.default.string }),
	className: W.default.string
};
//#endregion
//#region src/containers/ScrollIndicatedDialogContent.js
var $P = QP, eF = H($P)(() => ({ padding: (e) => e.spacing(1) })), tF = H("div")(() => ({
	"& .MuiPaper-root": { background: "transparent" },
	padding: (e) => e.spacing(2)
})), nF = H("div")(() => ({
	padding: (e) => e.spacing(2),
	paddingTop: 0
})), rF = ({ onClose: e, container: t }) => /* @__PURE__ */ B(Vr, {
	variant: "contained",
	onClose: e,
	open: !0,
	container: t,
	children: [/* @__PURE__ */ z(Gr, {
		id: "select-collection",
		children: /* @__PURE__ */ z(gr, { variant: "text" })
	}), /* @__PURE__ */ B($P, { children: [/* @__PURE__ */ z(gr, { variant: "text" }), /* @__PURE__ */ z(gr, { variant: "text" })] })]
});
rF.propTypes = {
	container: W.default.instanceOf(Element).isRequired,
	onClose: W.default.func.isRequired
};
function iF({ addWindow: e, collection: t = null, dialogCollectionPath: n = [], error: r = null, hideCollectionDialog: i, isMultipart: a = !1, manifest: o, manifestId: s, ready: c = !1, setWorkspaceAddVisibility: l, showCollectionDialog: u, updateWindow: d, windowId: f = null }) {
	let p = Mn(gn), { t: m } = V(), [h, g] = L(null), _ = () => {
		i(f);
	}, v = (e) => {
		u(e.id, [...n, s], f);
	}, y = () => {
		u(n[n.length - 1], n.slice(0, -1), f);
	}, b = (t) => {
		f ? d(f, {
			canvasId: null,
			collectionPath: [...n, s],
			manifestId: t.id
		}) : e({
			collectionPath: [...n, s],
			manifestId: t.id
		}), _(), l(!1);
	}, x = (p?.current || document.body).querySelector(`#${f}`);
	if (r || !x) return null;
	if (!c) return /* @__PURE__ */ z(rF, {
		container: x,
		onClose: _
	});
	let S = o && O(o.getProperty("rights") || o.getProperty("license")), C = o && O(o.getRequiredStatement()).filter((e) => e && e.getValue()).map((e) => ({
		label: null,
		values: e.getValues()
	})), w = o.getCollections(), T = h || (w.length > 0 ? "collections" : "manifests");
	return /* @__PURE__ */ B(Vr, {
		variant: "contained",
		onClose: _,
		container: x,
		open: !0,
		children: [
			/* @__PURE__ */ B(Gr, {
				id: "select-collection",
				children: [/* @__PURE__ */ z(Qr, {
					component: "div",
					variant: "overline",
					children: m(a ? "multipartCollection" : "collection")
				}), /* @__PURE__ */ z(Qr, {
					component: "div",
					variant: "h3",
					children: /* @__PURE__ */ z(ln, { resource: o })
				})]
			}),
			/* @__PURE__ */ B(eF, { children: [
				t && /* @__PURE__ */ z(Lr, {
					startIcon: /* @__PURE__ */ z(Af, {}),
					onClick: () => y(),
					children: /* @__PURE__ */ z(ln, { resource: t })
				}),
				/* @__PURE__ */ B(tF, { children: [/* @__PURE__ */ z(kl, { manifestId: o.id }), /* @__PURE__ */ B(bl, {
					id: "select-collection-rights",
					label: m("attributionTitle"),
					children: [C && /* @__PURE__ */ z(Sl, {
						labelValuePairs: C,
						defaultLabel: m("attribution")
					}), S && S.length > 0 && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(Qr, {
						variant: "subtitle2",
						component: "dt",
						children: m("rights")
					}), S.map((e) => /* @__PURE__ */ z(Qr, {
						variant: "body1",
						component: "dd",
						children: /* @__PURE__ */ z(Kr, {
							target: "_blank",
							rel: "noopener noreferrer",
							href: e,
							children: e
						})
					}, e))] })]
				})] }),
				/* @__PURE__ */ B(nF, { children: [o.getTotalCollections() > 0 && /* @__PURE__ */ z(Br, {
					clickable: !0,
					color: T === "collections" ? "primary" : "default",
					onClick: () => g("collections"),
					label: m("totalCollections", { count: o.getTotalCollections() })
				}), o.getTotalManifests() > 0 && /* @__PURE__ */ z(Br, {
					clickable: !0,
					color: T === "manifests" ? "primary" : "default",
					onClick: () => g("manifests"),
					label: m("totalManifests", { count: o.getTotalManifests() })
				})] }),
				T === "collections" && /* @__PURE__ */ z(Xr, { children: w.map((e) => /* @__PURE__ */ z(Yr, {
					onClick: () => {
						v(e);
					},
					variant: "multiline",
					children: /* @__PURE__ */ z(ln, { resource: e })
				}, e.id)) }),
				T === "manifests" && /* @__PURE__ */ z(Xr, { children: o.getManifests().map((e) => /* @__PURE__ */ z(Yr, {
					onClick: () => {
						b(e);
					},
					variant: "multiline",
					children: /* @__PURE__ */ z(ln, { resource: e })
				}, e.id)) })
			] }),
			/* @__PURE__ */ z(Hr, { children: /* @__PURE__ */ z(Lr, {
				onClick: _,
				children: m("close")
			}) })
		]
	});
}
iF.propTypes = {
	addWindow: W.default.func.isRequired,
	collection: W.default.object,
	dialogCollectionPath: W.default.arrayOf(W.default.string),
	error: W.default.string,
	hideCollectionDialog: W.default.func.isRequired,
	isMultipart: W.default.bool,
	manifest: W.default.object.isRequired,
	manifestId: W.default.string.isRequired,
	ready: W.default.bool,
	setWorkspaceAddVisibility: W.default.func.isRequired,
	showCollectionDialog: W.default.func.isRequired,
	updateWindow: W.default.func.isRequired,
	windowId: W.default.string
};
var aF = n(w((e, { windowId: t }) => {
	let { collectionManifestId: n, dialogCollectionPath: r } = s(e, { windowId: t }), i = b(e, { manifestId: n }), a = r && r[r.length - 1], o = a && b(e, { manifestId: a });
	return {
		collection: o && ze(e, { manifestId: o.id }),
		dialogCollectionPath: r,
		error: i && i.error,
		isMultipart: be(e, { manifestId: n }).includes("multi-part"),
		manifest: i && ze(e, { manifestId: n }),
		manifestId: n,
		open: e.workspace.collectionDialogOn,
		ready: i && !!i.json,
		windowId: t
	};
}, {
	addWindow: en,
	hideCollectionDialog: Qt,
	setWorkspaceAddVisibility: $i,
	showCollectionDialog: tn,
	updateWindow: qt
}), m("CollectionDialog"))(iF), oF = kn(() => import("./AudioViewer-BN6kHouu.js").then((e) => e.n)), sF = kn(() => import("./GalleryView-BtSE8_Gf.js").then((e) => e.n)), cF = kn(() => import("./SelectCollection-BK9ZDkK3.js").then((e) => e.n)), lF = kn(() => import("./WindowViewer-DaJEyDMY.js").then((e) => e.n)), uF = kn(() => import("./VideoViewer-Cmj4kJeg.js").then((e) => e.n)), dF = kn(() => import("./TextViewer-DOO2boDF.js").then((e) => e.n));
sF.displayName = "GalleryView", cF.displayName = "SelectCollection", lF.displayName = "WindowViewer";
var fF = H("div", {
	name: "PrimaryWindow",
	slot: "root"
})(() => ({
	display: "flex",
	flex: 1,
	position: "relative"
})), pF = ({ audioResources: e = [], isCollection: t = !1, isFetching: n = !1, textResources: r = [], videoResources: i = [], view: a = void 0, windowId: o }) => t ? /* @__PURE__ */ z(cF, { windowId: o }) : n === !1 ? a === "gallery" ? /* @__PURE__ */ z(sF, { windowId: o }) : i.length > 0 ? /* @__PURE__ */ z(uF, { windowId: o }) : e.length > 0 ? /* @__PURE__ */ z(oF, { windowId: o }) : r.length > 0 ? /* @__PURE__ */ z(dF, { windowId: o }) : /* @__PURE__ */ z(lF, { windowId: o }) : null;
pF.propTypes = {
	audioResources: W.default.arrayOf(W.default.object),
	isCollection: W.default.bool,
	isFetching: W.default.bool,
	textResources: W.default.arrayOf(W.default.object),
	videoResources: W.default.arrayOf(W.default.object),
	view: W.default.string,
	windowId: W.default.string.isRequired
};
function mF({ audioResources: e = void 0, children: t = null, className: n = void 0, isCollection: r = !1, isCollectionDialogVisible: i = !1, isFetching: a = !1, textResources: o = void 0, videoResources: s = void 0, view: c = void 0, windowId: l }) {
	let u = {
		audioResources: e,
		isCollection: r,
		isFetching: a,
		textResources: o,
		videoResources: s,
		view: c,
		windowId: l
	};
	return /* @__PURE__ */ B(fF, {
		"data-testid": "test-window",
		className: (0, G.default)(j("primary-window"), n),
		children: [
			/* @__PURE__ */ z(FP, { windowId: l }),
			/* @__PURE__ */ z(YP, {
				windowId: l,
				position: "left"
			}),
			i && /* @__PURE__ */ z(aF, { windowId: l }),
			/* @__PURE__ */ z(Sn, {
				fallback: /* @__PURE__ */ z("div", {}),
				children: t || /* @__PURE__ */ z(pF, { ...u })
			})
		]
	});
}
mF.propTypes = {
	audioResources: W.default.arrayOf(W.default.object),
	children: W.default.node,
	className: W.default.string,
	isCollection: W.default.bool,
	isCollectionDialogVisible: W.default.bool,
	isFetching: W.default.bool,
	textResources: W.default.arrayOf(W.default.object),
	videoResources: W.default.arrayOf(W.default.object),
	view: W.default.string,
	windowId: W.default.string.isRequired
};
var hF = n(w((e, { windowId: t }) => {
	let n = ze(e, { windowId: t });
	return {
		audioResources: Ue(e, { windowId: t }) || [],
		isCollection: n && n.isCollection(),
		isCollectionDialogVisible: s(e, { windowId: t }).collectionDialogOn,
		textResources: Je(e, { windowId: t }) || [],
		videoResources: Ke(e, { windowId: t }) || []
	};
}, null), m("PrimaryWindow"))(mF), gF = H(mn)(() => ({ marginLeft: "auto" }));
function _F({ allowClose: e = !0, allowWindowSideBar: t = !0, ariaLabel: n = !0, children: r = null, label: i = "", removeWindow: a = () => {}, windowId: o }) {
	let { t: s } = V();
	return /* @__PURE__ */ B(Ln, {
		component: "section",
		elevation: 1,
		id: o,
		className: (0, G.default)(j("placeholder-window")),
		sx: {
			backgroundColor: "shades.dark",
			borderRadius: 0,
			display: "flex",
			flexDirection: "column",
			height: "100%",
			minHeight: 0,
			overflow: "hidden",
			width: "100%"
		},
		"aria-label": i && n ? s("window", { label: i }) : null,
		children: [/* @__PURE__ */ z(Dr, {
			position: "relative",
			color: "default",
			enableColorOnDark: !0,
			children: /* @__PURE__ */ B(Qn, {
				disableGutters: !0,
				className: (0, G.default)(j("window-top-bar")),
				sx: {
					backgroundColor: "shades.main",
					borderTop: "2px solid transparent",
					minHeight: 32,
					paddingLeft: .5,
					paddingRight: .5
				},
				variant: "dense",
				children: [
					t && /* @__PURE__ */ z(mn, {
						"aria-label": s("toggleWindowSideBar"),
						disabled: !0,
						children: /* @__PURE__ */ z(AN, {})
					}),
					/* @__PURE__ */ z(U, {
						variant: "h2",
						noWrap: !0,
						color: "inherit",
						sx: {
							flexGrow: 1,
							paddingLeft: .5,
							typography: "h6"
						},
						children: i
					}),
					e && a && /* @__PURE__ */ z(gF, {
						"aria-label": s("closeWindow"),
						className: (0, G.default)(j("window-close")),
						onClick: a,
						TooltipProps: { tabIndex: n ? 0 : -1 },
						children: /* @__PURE__ */ z(Ms, {})
					})
				]
			})
		}), r]
	});
}
_F.propTypes = {
	allowClose: W.default.bool,
	allowWindowSideBar: W.default.bool,
	ariaLabel: W.default.bool,
	children: W.default.node,
	label: W.default.string,
	removeWindow: W.default.func,
	windowId: W.default.string.isRequired
};
var vF = n(w((e, { windowId: t }) => ({
	allowClose: we(e, { windowId: t }).allowClose,
	allowWindowSideBar: we(e, { windowId: t }).allowWindowSideBar
}), (e, { windowId: t }) => ({ removeWindow: () => e(Zt(t)) })), m("MinimalWindow"))(_F), yF = {
	"aria-hidden": !0,
	frameBorder: 0,
	height: 1,
	name: void 0,
	scrolling: void 0,
	style: { visibility: "hidden" },
	width: 1
};
function bF({ handleReceiveMessage: e = void 0, ...t }) {
	return F(() => {
		if (e) return window.addEventListener("message", e), () => window.removeEventListener("message", e, !1);
	}, [e]), /* @__PURE__ */ z("iframe", {
		...yF,
		...t
	});
}
bF.propTypes = {
	"aria-hidden": W.default.bool,
	frameBorder: W.default.oneOfType([W.default.string, W.default.number]),
	handleReceiveMessage: W.default.func,
	height: W.default.oneOfType([W.default.string, W.default.number]),
	name: W.default.string,
	scrolling: W.default.string,
	src: W.default.string.isRequired,
	style: W.default.shape({}),
	width: W.default.oneOfType([W.default.string, W.default.number])
};
//#endregion
//#region src/components/AccessTokenSender.jsx
function xF({ handleAccessTokenMessage: e, url: t = void 0 }) {
	let n = jn((n) => {
		n.data && n.data.messageId && n.data.messageId === t && e(n.data);
	}, [e, t]);
	if (!t) return null;
	let r = new URL(t);
	return r.searchParams.append("origin", window.origin), r.searchParams.append("messageId", t), /* @__PURE__ */ z(bF, {
		src: r.toString(),
		title: "AccessTokenSender",
		handleReceiveMessage: n
	});
}
xF.propTypes = {
	handleAccessTokenMessage: W.default.func.isRequired,
	url: W.default.string
};
//#endregion
//#region src/components/NewBrowserWindow.jsx
function SF({ depWindow: e = void 0, features: t = void 0, name: n = void 0, onClose: r, url: i }) {
	let a = I(!1);
	return F(() => {
		let o = (e || window).open(i, n, t), s = setInterval(() => {
			!a.current && (!o || o.closed) && (a.current = !0, clearInterval(s), r(i));
		}, 250);
		return () => {
			clearInterval(s), o.close();
		};
	}), null;
}
SF.propTypes = {
	depWindow: W.default.object,
	features: W.default.string,
	name: W.default.string,
	onClose: W.default.func.isRequired,
	url: W.default.string.isRequired
};
//#endregion
//#region node_modules/@mui/icons-material/esm/LockSharp.js
var CF = M(/*#__PURE__*/ z("path", { d: "M20 8h-3V6.21c0-2.61-1.91-4.94-4.51-5.19C9.51.74 7 3.08 7 6v2H4v14h16zm-8 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2M9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2z" }), "LockSharp"), wF = H("div")(({ theme: e }) => ({
	alignItems: "center",
	backgroundColor: e.palette.secondary.main,
	color: e.palette.secondary.contrastText,
	display: "flex",
	padding: e.spacing(1)
})), TF = H("span")(({ theme: e }) => ({ marginLeft: e.spacing(2.5) }));
function EF({ confirmButton: e = void 0, continueLabel: t = void 0, header: n = void 0, description: r = void 0, icon: i = void 0, label: a, ruleSet: o = "iiif", hasLogoutService: s = !0, status: c = void 0, ConfirmProps: l = {}, onConfirm: u }) {
	let { t: d } = V(), f = arguments[0], [p, m] = L(!1), h = () => {
		m(!1), u();
	};
	if (c === "ok" && !s) return null;
	let g = /* @__PURE__ */ z(sr, {
		onClick: h,
		color: "secondary",
		sx: (e) => ({
			backgroundColor: e.palette.secondary.contrastText,
			lineHeight: "1.5rem"
		}),
		...l,
		children: e || d("login")
	});
	return !r && !n ? /* @__PURE__ */ z(Ln, {
		square: !0,
		elevation: 4,
		color: "secondary",
		children: /* @__PURE__ */ B(wF, { children: [
			i || /* @__PURE__ */ z(CF, { sx: { marginInlineEnd: 5 } }),
			/* @__PURE__ */ z(U, {
				component: "h3",
				variant: "body1",
				color: "inherit",
				children: o ? /* @__PURE__ */ z(Es, {
					htmlString: a,
					ruleSet: o
				}) : a
			}),
			/* @__PURE__ */ z(cn, {
				targetName: "WindowAuthenticationBar",
				...f
			}),
			g
		] })
	}) : /* @__PURE__ */ B(Ln, {
		square: !0,
		elevation: 4,
		color: "secondary",
		children: [/* @__PURE__ */ B(sr, {
			fullWidth: !0,
			onClick: () => m(!0),
			component: "div",
			color: "inherit",
			sx: (e) => ({
				"&:hover": { backgroundColor: e.palette.secondary.main },
				backgroundColor: e.palette.secondary.main,
				borderRadius: 0,
				color: e.palette.secondary.contrastText,
				justifyContent: "start",
				textTransform: "none"
			}),
			children: [
				i || /* @__PURE__ */ z(CF, { sx: { marginInlineEnd: 1.5 } }),
				/* @__PURE__ */ z(U, {
					sx: {
						paddingBlockEnd: 1,
						paddingBlockStart: 1
					},
					component: "h3",
					variant: "body1",
					color: "inherit",
					children: o ? /* @__PURE__ */ z(Es, {
						htmlString: a,
						ruleSet: o
					}) : a
				}),
				/* @__PURE__ */ z(cn, {
					targetName: "WindowAuthenticationBar",
					...f
				}),
				/* @__PURE__ */ z(TF, { children: !p && /* @__PURE__ */ z(U, {
					variant: "button",
					color: "inherit",
					children: t || d("continue")
				}) })
			]
		}), /* @__PURE__ */ B(fr, {
			sx: (e) => ({
				backgroundColor: e.palette.secondary.main,
				color: e.palette.secondary.contrastText,
				paddingInlineEnd: e.spacing(1),
				paddingInlineStart: e.spacing(1)
			}),
			in: p,
			onClose: () => m(!1),
			children: [/* @__PURE__ */ B(U, {
				variant: "body1",
				color: "inherit",
				children: [
					o ? /* @__PURE__ */ z(Es, {
						htmlString: n,
						ruleSet: o
					}) : n,
					n && r ? ": " : "",
					o ? /* @__PURE__ */ z(Es, {
						htmlString: r,
						ruleSet: o
					}) : r
				]
			}), /* @__PURE__ */ B(ei, { children: [/* @__PURE__ */ z(sr, {
				onClick: () => m(!1),
				color: "inherit",
				children: d("cancel")
			}), g] })]
		})]
	});
}
EF.propTypes = {
	confirmButton: W.default.string,
	ConfirmProps: W.default.object,
	continueLabel: W.default.string,
	description: W.default.node,
	hasLogoutService: W.default.bool,
	header: W.default.node,
	icon: W.default.node,
	label: W.default.node.isRequired,
	onConfirm: W.default.func.isRequired,
	ruleSet: W.default.string,
	status: W.default.string
};
var DF = n(m("WindowAuthenticationBar"))(EF);
//#endregion
//#region src/components/IIIFAuthentication.jsx
function OF({ accessTokenServiceId: e = void 0, authServiceId: t = void 0, confirm: n = void 0, description: r = void 0, failureDescription: i = void 0, failureHeader: a = void 0, features: o = "centerscreen", handleAuthInteraction: s, header: c = void 0, isInteractive: l = !0, label: u = void 0, logoutConfirm: d = void 0, logoutServiceId: f = void 0, openWindow: p = window.open, resetAuthenticationState: m, resolveAccessTokenRequest: h, resolveAuthenticationRequest: g, status: _ = null, windowId: v }) {
	let { t: y } = V(), b = (n) => {
		h(t, e, n);
	}, x = () => ({
		authServiceId: t,
		hasLogoutService: !!f,
		status: _,
		windowId: v
	}), S = () => {
		p(f, void 0, o), m({
			authServiceId: t,
			tokenServiceId: e
		});
	}, C = () => !l && !f ? null : /* @__PURE__ */ z(DF, {
		confirmButton: d || y("logout"),
		onConfirm: S,
		...x()
	}), w = () => /* @__PURE__ */ z(DF, {
		header: a,
		description: i,
		confirmButton: y("retry"),
		onConfirm: () => s(v, t),
		...x()
	}), T = () => /* @__PURE__ */ B(R, { children: [D(), /* @__PURE__ */ z(SF, {
		name: "IiifLoginSender",
		url: `${t}?origin=${window.origin}`,
		features: o,
		onClose: () => g(t, e)
	})] }), E = () => /* @__PURE__ */ B(R, { children: [D(), /* @__PURE__ */ z(xF, {
		handleAccessTokenMessage: b,
		url: e
	})] }), D = () => l ? /* @__PURE__ */ z(DF, {
		header: c,
		description: r,
		label: u,
		confirmButton: n,
		onConfirm: () => s(v, t),
		...x()
	}) : null;
	return t ? _ === null ? D() : _ === "cookie" ? T() : _ === "token" ? E() : _ === "failed" ? w() : _ === "ok" ? C() : null : null;
}
OF.propTypes = {
	accessTokenServiceId: W.default.string,
	authServiceId: W.default.string,
	confirm: W.default.string,
	description: W.default.string,
	failureDescription: W.default.string,
	failureHeader: W.default.string,
	features: W.default.string,
	handleAuthInteraction: W.default.func.isRequired,
	header: W.default.string,
	isInteractive: W.default.bool,
	label: W.default.string,
	logoutConfirm: W.default.string,
	logoutServiceId: W.default.string,
	openWindow: W.default.func,
	resetAuthenticationState: W.default.func.isRequired,
	resolveAccessTokenRequest: W.default.func.isRequired,
	resolveAuthenticationRequest: W.default.func.isRequired,
	status: W.default.oneOf([
		"logout",
		"ok",
		"token",
		"cookie",
		"failed",
		null
	]),
	windowId: W.default.string.isRequired
};
var kF = n(w((e, { windowId: t }) => {
	let n = ji(e, { windowId: t })[0], r = n && (hi.Utils.getService(n, "http://iiif.io/api/auth/1/token") || hi.Utils.getService(n, "http://iiif.io/api/auth/0/token")), i = n && (hi.Utils.getService(n, "http://iiif.io/api/auth/1/logout") || hi.Utils.getService(n, "http://iiif.io/api/auth/0/logout")), a = Ai(e), o = n && a[n.id], s = ki(e), c = r && s[r.id], l = null;
	o ? o.isFetching ? o.windowId === t && (l = "cookie") : c && c.isFetching ? o.windowId === t && (l = "token") : o.ok ? l = "ok" : o.ok === !1 && (l = "failed") : l = null;
	let u = Oi(e), d = n && n.getProfile(), f = u.some((e) => e.profile === d && !(e.external || e.kiosk));
	return {
		accessTokenServiceId: r && r.id,
		authServiceId: n && n.id,
		confirm: n && n.getConfirmLabel(),
		description: n && n.getDescription(),
		failureDescription: n && n.getFailureDescription(),
		failureHeader: n && n.getFailureHeader(),
		header: n && n.getHeader(),
		isInteractive: f,
		label: n && n.getLabel()[0].value,
		logoutConfirm: i && i.getLabel()[0] && i.getLabel()[0].value,
		logoutServiceId: i && i.id,
		profile: d,
		status: l
	};
}, {
	handleAuthInteraction: ra,
	resetAuthenticationState: la,
	resolveAccessTokenRequest: ca,
	resolveAuthenticationRequest: ia
}), m("IIIFAuthentication"))(OF), AF = {
	display: "flex",
	flex: "1",
	flexDirection: "row",
	minHeight: 0
}, jF = {
	display: "flex",
	flex: "1",
	flexDirection: "column",
	minHeight: 0
}, MF = H(Ln, {
	name: "Window",
	slot: "root"
})(({ ownerState: e, theme: t }) => ({
	...jF,
	backgroundColor: t.palette.shades?.dark,
	borderRadius: 0,
	height: "100%",
	overflow: "hidden",
	width: "100%",
	...e?.maximized && {
		left: 0,
		position: "absolute",
		top: 0,
		zIndex: t.zIndex.modal - 1
	}
})), NF = H("div", {
	name: "Window",
	slot: "row"
})(() => ({ ...AF })), PF = H("div", {
	name: "Window",
	slot: "column"
})(() => ({ ...jF })), FF = H(hF, {
	name: "Window",
	slot: "primary"
})(() => ({
	...AF,
	height: "300px",
	position: "relative"
})), IF = H(YP, {
	name: "Window",
	slot: "bottom"
})(() => ({
	...AF,
	flex: "0",
	flexBasis: "auto"
})), LF = H("div", {
	name: "Window",
	slot: "right"
})(() => ({
	...AF,
	flex: "0 1 auto"
})), RF = ({ children: e, ...t }) => {
	let { mosaicWindowActions: n } = Mn(fM);
	return n.connectDragSource(/* @__PURE__ */ z("nav", {
		...t,
		children: e
	}));
};
function zF({ focusWindow: e = () => {}, label: t = null, isFetching: n = !1, sideBarOpen: r = !1, view: i = void 0, windowDraggable: a = null, windowId: o, workspaceType: s = null, manifestError: c = null }) {
	let { t: l } = V(), u = arguments[0], d = jn(({ error: e }) => /* @__PURE__ */ z(vF, {
		windowId: o,
		children: /* @__PURE__ */ z(HP, {
			error: e,
			windowId: o
		})
	}), [o]);
	return /* @__PURE__ */ z(yn, {
		FallbackComponent: d,
		children: /* @__PURE__ */ B(MF, {
			onFocus: e,
			ownerState: u,
			component: "section",
			elevation: 1,
			id: o,
			className: j("window"),
			"aria-label": l("window", { label: t }),
			children: [
				/* @__PURE__ */ z(vP, {
					component: s === "mosaic" && a ? RF : void 0,
					windowId: o,
					windowDraggable: a
				}),
				/* @__PURE__ */ z(kF, { windowId: o }),
				c && /* @__PURE__ */ z(HP, {
					error: { stack: c },
					windowId: o
				}),
				/* @__PURE__ */ B(NF, { children: [/* @__PURE__ */ B(PF, { children: [/* @__PURE__ */ z(FF, {
					view: i,
					windowId: o,
					isFetching: n,
					sideBarOpen: r
				}), /* @__PURE__ */ z(IF, {
					windowId: o,
					position: "bottom"
				})] }), /* @__PURE__ */ B(LF, { children: [/* @__PURE__ */ z(YP, {
					windowId: o,
					position: "right"
				}), /* @__PURE__ */ z(YP, {
					windowId: o,
					position: "far-right"
				})] })] }),
				/* @__PURE__ */ z(YP, {
					windowId: o,
					position: "far-bottom"
				}),
				/* @__PURE__ */ z(cn, {
					targetName: "Window",
					...u
				})
			]
		})
	});
}
zF.propTypes = {
	focusWindow: W.default.func,
	isFetching: W.default.bool,
	label: W.default.string,
	manifestError: W.default.string,
	maximized: W.default.bool,
	sideBarOpen: W.default.bool,
	view: W.default.string,
	windowDraggable: W.default.bool,
	windowId: W.default.string.isRequired,
	workspaceType: W.default.string
};
var BF = n(w((e, { windowId: t }) => ({
	isFetching: Ge(e, { windowId: t }).isFetching,
	label: lt(e, { windowId: t }),
	manifestError: Oe(e, { windowId: t }),
	maximized: (s(e, { windowId: t }) || {}).maximized,
	sideBarOpen: (s(e, { windowId: t }) || {}).sideBarOpen,
	thumbnailNavigationPosition: _e(e, { windowId: t }),
	view: Ee(e, { windowId: t }),
	windowDraggable: re(e, { windowId: t }),
	workspaceType: te(e)
}), (e, { windowId: t }) => ({ focusWindow: () => e(Xt(t)) })), m("Window"))(zF), VF = /* @__PURE__ */ p(zw(), 1), HF = H(rl, { shouldForwardProp: (e) => e !== "focused" })(({ focused: e, theme: t }) => ({ zIndex: e ? t.zIndex.modal - 1 : "auto" }));
function UF({ classes: e = {}, companionWindowDimensions: t = {
	height: 0,
	width: 0
}, focused: n = !1, focusWindow: r = () => {}, layout: i, workspace: a, updateElasticWindowLayout: o }) {
	let s = a.width / 2, c = a.height / 2;
	return /* @__PURE__ */ z(HF, {
		focused: n,
		className: n ? e.focused : void 0,
		size: {
			height: i.height + t.height,
			width: i.width + t.width
		},
		position: {
			x: i.x + s,
			y: i.y + c
		},
		bounds: "parent",
		onDragStop: (e, t) => {
			o(i.windowId, {
				x: t.x - s,
				y: t.y - c
			});
		},
		onDragStart: r,
		onResize: (e, n, r, a, l) => {
			o(i.windowId, {
				height: Number.parseInt(r.style.height, 10) - t.height,
				width: Number.parseInt(r.style.width, 10) - t.width,
				x: l.x - s,
				y: l.y - c
			});
		},
		dragHandleClassName: j("window-top-bar"),
		cancel: `.${j("window-menu-btn")}`,
		children: /* @__PURE__ */ z(BF, { windowId: i.windowId })
	}, `${i.windowId}-${a.id}`);
}
UF.propTypes = {
	classes: W.default.objectOf(W.default.string),
	companionWindowDimensions: W.default.shape({
		height: W.default.number,
		width: W.default.number
	}),
	focused: W.default.bool,
	focusWindow: W.default.func,
	layout: W.default.shape({
		height: W.default.number,
		id: W.default.string,
		width: W.default.number,
		windowId: W.default.string,
		x: W.default.number,
		y: W.default.number
	}).isRequired,
	updateElasticWindowLayout: W.default.func.isRequired,
	workspace: W.default.object.isRequired
};
var WF = n(w((e, { windowId: t }) => ({
	companionWindowDimensions: ye(e, { windowId: t }),
	focused: Ze(e, { windowId: t }),
	layout: oe(e)[t],
	workspace: _(e)
}), (e, t) => ({
	focusWindow: () => e(Xt(t.windowId)),
	updateElasticWindowLayout: (t, n) => {
		e(ua(t, n));
	}
})))(UF), GF = H("div", {
	name: "WorkspaceElastic",
	slot: "root"
})({
	height: "100%",
	position: "relative",
	width: "100%"
}), KF = H(rl)({
	boxSizing: "border-box",
	margin: 0,
	position: "absolute",
	transitionDuration: ".7s",
	"&.react-draggable-dragging": { transitionDuration: "unset" }
});
function qF({ workspace: e, elasticLayout: t, setWorkspaceViewportDimensions: n, setWorkspaceViewportPosition: r }) {
	let { viewportPosition: i } = e, a = e.width / 2, o = e.height / 2;
	return /* @__PURE__ */ B(GF, { children: [/* @__PURE__ */ z(VF.default, {
		onReflow: () => {},
		onResize: (e) => {
			n(e);
		}
	}), /* @__PURE__ */ z(KF, {
		size: {
			height: e.height,
			width: e.width
		},
		position: {
			x: -1 * i.x - a,
			y: -1 * i.y - o
		},
		enableResizing: {
			bottom: !1,
			bottomLeft: !1,
			bottomRight: !1,
			left: !1,
			right: !1,
			top: !1,
			topLeft: !1,
			topRight: !1
		},
		onDragStop: (e, t) => {
			r({
				x: -1 * t.x - a,
				y: -1 * t.y - o
			});
		},
		cancel: `.${j("window")}`,
		className: j("workspace"),
		disableDragging: !e.draggingEnabled,
		children: Object.keys(t).map((e) => /* @__PURE__ */ z(WF, { windowId: e }, e))
	})] });
}
qF.propTypes = {
	elasticLayout: W.default.object.isRequired,
	setWorkspaceViewportDimensions: W.default.func.isRequired,
	setWorkspaceViewportPosition: W.default.func.isRequired,
	workspace: W.default.object.isRequired
};
//#endregion
//#region src/components/BackgroundPluginArea.jsx
var JF = ({ ...e }) => /* @__PURE__ */ z("div", {
	className: j("background-plugin-area"),
	style: { display: "none" },
	children: /* @__PURE__ */ z(cn, {
		targetName: "BackgroundPluginArea",
		...e
	})
});
//#endregion
//#region src/components/icons/MiradorIcon.jsx
function YF(e) {
	return /* @__PURE__ */ B(jr, {
		viewBox: "0 0 60 55",
		...e,
		children: [
			/* @__PURE__ */ z("rect", {
				width: "18",
				height: "55"
			}),
			/* @__PURE__ */ z("rect", {
				width: "18",
				height: "55",
				transform: "translate(42)"
			}),
			/* @__PURE__ */ z("rect", {
				width: "18",
				height: "34",
				transform: "translate(21)"
			})
		]
	});
}
//#endregion
//#region src/components/Branding.jsx
function XF({ variant: e = "default", ...t }) {
	let { t: n } = V();
	return /* @__PURE__ */ B(Fr, {
		alignItems: "center",
		...t,
		children: [e === "wide" && /* @__PURE__ */ z("div", { children: /* @__PURE__ */ z(U, {
			align: "center",
			component: "p",
			variant: "h3",
			children: n("mirador")
		}) }), /* @__PURE__ */ z(U, {
			align: "center",
			children: /* @__PURE__ */ z(Kn, {
				component: "a",
				href: "https://projectmirador.org",
				target: "_blank",
				rel: "noopener",
				size: "large",
				children: /* @__PURE__ */ z(YF, {
					"aria-label": n("aboutMirador"),
					titleAccess: n("aboutMirador"),
					fontSize: "large"
				})
			})
		})]
	});
}
XF.propTypes = { variant: W.default.oneOf(["default", "wide"]) };
//#endregion
//#region node_modules/@mui/icons-material/esm/PaletteSharp.js
var ZF = M(/*#__PURE__*/ z("path", { d: "M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9m5.5 11c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m-3-4c-.83 0-1.5-.67-1.5-1.5S13.67 6 14.5 6s1.5.67 1.5 1.5S15.33 9 14.5 9M5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S7.33 13 6.5 13 5 12.33 5 11.5m6-4c0 .83-.67 1.5-1.5 1.5S8 8.33 8 7.5 8.67 6 9.5 6s1.5.67 1.5 1.5" }), "PaletteSharp"), QF = H(Vr, {
	name: "WorkspaceDialog",
	slot: "root"
})(({ theme: e, variant: t }) => ({
	"& .MuiDialogTitle-root": e.unstable_sx({ typography: "h2" }),
	...t === "menu" && { "& .MuiDialogContent-root": { padding: 0 } }
})), $F = H(ZF, {
	name: "ThemeIcon",
	slot: "icon"
})(({ theme: e }) => ({ color: "#BDBDBD" }));
function eI({ container: e = null, handleClose: t, open: n = !1, selectedTheme: r, setSelectedTheme: i, themeIds: a = [] }) {
	let { t: o } = V(), s = jn((e) => {
		i(e), t();
	}, [t, i]);
	return /* @__PURE__ */ B(QF, {
		container: e,
		onClose: t,
		open: n,
		variant: "menu",
		children: [/* @__PURE__ */ z(Gr, { children: o("changeTheme") }), /* @__PURE__ */ z(Ur, { children: /* @__PURE__ */ z(Xr, {
			autoFocusItem: !0,
			children: a.map((e) => /* @__PURE__ */ B(Yr, {
				className: "listitem",
				onClick: () => s(e),
				selected: e === r,
				value: e,
				children: [/* @__PURE__ */ z(qr, { children: /* @__PURE__ */ z($F, { ownerState: { value: e } }) }), /* @__PURE__ */ z(Jr, { children: o(e) })]
			}, e))
		}) })]
	});
}
eI.propTypes = {
	container: W.default.object,
	handleClose: W.default.func.isRequired,
	open: W.default.bool,
	selectedTheme: W.default.string.isRequired,
	setSelectedTheme: W.default.func.isRequired,
	themeIds: W.default.arrayOf(W.default.string)
};
//#endregion
//#region src/components/ErrorDialog.jsx
function tI({ error: e = null, removeError: t = () => {} }) {
	let { t: n } = V(), r = !(0, kN.default)(e);
	return e ? /* @__PURE__ */ B(ti, {
		"aria-labelledby": "error-dialog-title",
		id: "error-dialog",
		onClose: () => t(e.id),
		open: r,
		children: [/* @__PURE__ */ z(ni, {
			id: "error-dialog-title",
			children: n("errorDialogTitle")
		}), /* @__PURE__ */ B($r, { children: [/* @__PURE__ */ z(Wr, {
			variant: "body2",
			noWrap: !0,
			color: "inherit",
			children: `${e.message}`
		}), /* @__PURE__ */ z(Hr, { children: /* @__PURE__ */ z(sr, {
			onClick: () => t(e.id),
			variant: "contained",
			children: n("errorDialogConfirm")
		}) })] })]
	}) : null;
}
tI.propTypes = {
	error: W.default.shape({
		id: W.default.string,
		message: W.default.string
	}),
	removeError: W.default.func
};
//#endregion
//#region node_modules/@mui/icons-material/esm/InsertDriveFileSharp.js
var nI = M(/*#__PURE__*/ z("path", { d: "M4.01 2 4 22h16V8l-6-6zM13 9V3.5L18.5 9z" }), "InsertDriveFileSharp");
//#endregion
//#region src/lib/readImageMetadata.js
function rI(e) {
	return new Promise((t, n) => {
		let r = new FileReader();
		r.addEventListener("load", () => {
			let n = new Image();
			n.addEventListener("load", () => {
				t({
					height: n.height,
					name: e.name,
					type: e.type,
					url: r.result,
					width: n.width
				});
			}), n.src = r.result;
		}), r.readAsDataURL(e);
	});
}
//#endregion
//#region src/components/IIIFDropTarget.jsx
var iI = (e) => {
	try {
		return new URL(e);
	} catch {
		return console.warn("Invalid URL:", e), null;
	}
}, aI = (e, t, n) => {
	let { onDrop: r } = n;
	if (e.html) {
		let r = new DOMParser().parseFromString(e.html, "text/html").querySelector("a[href]");
		if (r) {
			let e = iI(r.href);
			if (e) return aI({ urls: [e.toString()] }, t, n);
		}
	}
	if (e.urls && e.urls.forEach((e) => {
		let i = iI(e);
		if (!i) return;
		let a = i.searchParams.get("manifest"), o = i.searchParams.get("canvas");
		a && r({
			canvasId: o,
			manifestId: a
		}, n, t);
	}), e.files) {
		let i = e.files.filter((e) => e.type === "application/json").map((e) => new Promise((i, a) => {
			let o = new FileReader();
			o.addEventListener("load", () => {
				let e = o.result, a = h();
				e && r({
					manifestId: a,
					manifestJson: e
				}, n, t), i();
			}), o.readAsText(e);
		})), a = e.files.filter(({ type: e }) => e.startsWith("image/")), o;
		if (a.length > 0) {
			let e = h(), i = a.map((e) => rI(e));
			o = Promise.all(i).then((i) => {
				let a = {
					"@context": "http://iiif.io/api/presentation/3/context.json",
					id: e,
					items: i.map(({ name: t, type: n, width: r, height: i, url: a }, o) => ({
						height: i,
						id: `${e}/canvas/${o}`,
						items: [{
							id: `${e}/canvas/${o}/1`,
							items: [{
								body: {
									format: n,
									id: a,
									type: "Image"
								},
								height: i,
								id: `${e}/canvas/${o}/1/image`,
								motivation: "painting",
								target: `${e}/canvas/${o}/1`,
								type: "Annotation",
								width: r
							}],
							type: "AnnotationPage"
						}],
						label: t,
						type: "Canvas",
						width: r
					})),
					label: i[0].name,
					type: "Manifest"
				}, o = h();
				a && r({
					manifestId: o,
					manifestJson: a
				}, n, t);
			});
		}
		return Promise.all([...i, o]);
	}
}, oI = (e) => {
	let { children: t, onDrop: n } = e, [{ canDrop: r, isOver: i }, a] = xC({
		accept: [
			QC,
			ZC,
			ew
		],
		collect: (e) => ({
			canDrop: e.canDrop(),
			isOver: e.isOver()
		}),
		drop(t, r) {
			n && aI(t, r, e);
		}
	});
	return /* @__PURE__ */ B("div", {
		ref: a,
		onDrop: (t) => {
			if (!(!window.safari || !n || !t.dataTransfer) && t.dataTransfer.types.includes("Files") && t.dataTransfer.types.includes("text/uri-list")) {
				let n = t.dataTransfer.getData("text/uri-list");
				if (!n) return;
				aI({ urls: [n] }, null, e);
			}
		},
		style: {
			height: "100%",
			width: "100%"
		},
		children: [t, /* @__PURE__ */ z(ri, {
			open: r && i,
			style: { zIndex: 9999 },
			children: /* @__PURE__ */ z(nI, { style: {
				color: ii[400],
				fontSize: 256
			} })
		})]
	});
};
oI.propTypes = {
	children: W.default.node.isRequired,
	onDrop: W.default.func.isRequired
};
//#endregion
//#region node_modules/@mui/icons-material/esm/CheckSharp.js
var sI = M(/*#__PURE__*/ z("path", { d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }), "CheckSharp");
//#endregion
//#region src/components/LanguageSettings.jsx
function cI({ handleClick: e, languages: t }) {
	return /* @__PURE__ */ z(R, { children: t.map((t) => /* @__PURE__ */ B(Xn, {
		"aria-selected": t.current,
		lang: t.locale,
		onClick: () => {
			e(t.locale);
		},
		children: [/* @__PURE__ */ z(Er, { children: t.current && /* @__PURE__ */ z(sI, {}) }), /* @__PURE__ */ z(Zn, {
			primaryTypographyProps: { variant: "body1" },
			children: t.label
		})]
	}, t.locale)) });
}
cI.propTypes = {
	handleClick: W.default.func.isRequired,
	languages: W.default.arrayOf(W.default.shape({
		current: W.default.bool.isRequired,
		label: W.default.string.isRequired,
		locale: W.default.string.isRequired
	})).isRequired
};
//#endregion
//#region src/components/ManifestForm.jsx
function lI({ addResourcesOpen: e, addResource: t, onSubmit: n = () => {}, onCancel: r = null }) {
	let { t: i } = V(), [a, o] = L("");
	return e ? /* @__PURE__ */ z("form", {
		onSubmit: (e) => {
			e.preventDefault(), t(a), n(), o("");
		},
		children: /* @__PURE__ */ B(ai, {
			container: !0,
			spacing: 2,
			columns: 12,
			sx: { mt: .5 },
			children: [
				/* @__PURE__ */ z(ai, {
					size: {
						sm: "grow",
						xs: 12
					},
					children: /* @__PURE__ */ z(yr, {
						autoFocus: !0,
						fullWidth: !0,
						value: a,
						id: "manifestURL",
						type: "text",
						onChange: (e) => {
							e.preventDefault(), o(e.target.value);
						},
						variant: "filled",
						label: i("addManifestUrl"),
						helperText: i("addManifestUrlHelp"),
						slotProps: {
							inputLabel: { shrink: !0 },
							inputProps: { style: { typography: "body1" } }
						}
					})
				}),
				r && /* @__PURE__ */ z(ai, {
					size: "auto",
					children: /* @__PURE__ */ z(sr, {
						onClick: () => {
							r(), o("");
						},
						children: i("cancel")
					})
				}),
				/* @__PURE__ */ z(ai, {
					size: "auto",
					children: /* @__PURE__ */ z(sr, {
						id: "fetchBtn",
						type: "submit",
						variant: "contained",
						color: "primary",
						children: i("fetchManifest")
					})
				})
			]
		})
	}) : null;
}
lI.propTypes = {
	addResource: W.default.func.isRequired,
	addResourcesOpen: W.default.bool.isRequired,
	onCancel: W.default.func,
	onSubmit: W.default.func
};
//#endregion
//#region src/components/ManifestListItemError.jsx
function uI({ manifestId: e, onDismissClick: t, onTryAgainClick: n }) {
	let { t: r } = V();
	return /* @__PURE__ */ B(ai, {
		container: !0,
		sx: {
			alignItems: "center",
			width: "100%"
		},
		children: [/* @__PURE__ */ B(ai, {
			container: !0,
			size: {
				sm: 5,
				xs: 12
			},
			sx: { alignItems: "center" },
			children: [
				/* @__PURE__ */ z(rP, { sx: {
					color: "error.main",
					height: "2rem",
					marginRight: "0.5rem",
					width: "2rem"
				} }),
				/* @__PURE__ */ z(U, { children: r("manifestError") }),
				/* @__PURE__ */ z(U, {
					sx: { wordBreak: "break-all" },
					children: e
				})
			]
		}), /* @__PURE__ */ B(ai, {
			container: !0,
			size: {
				sm: 7,
				xs: 12
			},
			children: [/* @__PURE__ */ z(sr, {
				onClick: () => {
					t(e);
				},
				children: r("dismiss")
			}), /* @__PURE__ */ z(sr, {
				onClick: () => {
					n(e);
				},
				children: r("tryAgain")
			})]
		})]
	});
}
uI.propTypes = {
	manifestId: W.default.string.isRequired,
	onDismissClick: W.default.func.isRequired,
	onTryAgainClick: W.default.func.isRequired
};
var dI = n(w(null, {
	onDismissClick: ya,
	onTryAgainClick: Ji
}), m("ManifestListItemError"))(uI), fI = H(Sr, {
	name: "ManifestListItem",
	slot: "root"
})(({ ownerState: e, theme: t }) => ({
	"&:hover,&:focus-within": {
		backgroundColor: t.palette.action.hover,
		borderLeftColor: e?.active ? t.palette.primary.main : t.palette.action.hover
	},
	borderLeft: "4px solid",
	borderLeftColor: e?.active ? t.palette.primary.main : "transparent",
	paddingLeft: t.spacing(2),
	paddingRight: t.spacing(2),
	[t.breakpoints.up("sm")]: {
		paddingLeft: t.spacing(3),
		paddingRight: t.spacing(3)
	}
})), pI = H(ff.Img, {
	name: "ManifestListItem",
	slot: "thumbnail"
})(({ theme: e }) => ({
	maxWidth: "100%",
	objectFit: "contain"
})), mI = H(ff.Img, {
	name: "ManifestListItem",
	slot: "logo"
})(({ theme: e }) => ({
	height: "2.5rem",
	maxWidth: "100%",
	objectFit: "contain",
	paddingRight: 1
})), hI = () => /* @__PURE__ */ B(ai, {
	container: !0,
	className: j("manifest-list-item"),
	children: [
		/* @__PURE__ */ z(ai, {
			size: {
				sm: 2,
				xs: 3
			},
			children: /* @__PURE__ */ z(gr, {
				sx: { bgcolor: "grey[300]" },
				variant: "rectangular",
				height: 80,
				width: 120
			})
		}),
		/* @__PURE__ */ z(ai, {
			size: {
				sm: 6,
				xs: 9
			},
			children: /* @__PURE__ */ z(gr, {
				sx: { bgcolor: "grey[300]" },
				variant: "text"
			})
		}),
		/* @__PURE__ */ B(ai, {
			size: {
				sm: 2,
				xs: 8
			},
			children: [/* @__PURE__ */ z(gr, {
				sx: { bgcolor: "grey[300]" },
				variant: "text"
			}), /* @__PURE__ */ z(gr, {
				sx: { bgcolor: "grey[300]" },
				variant: "text"
			})]
		}),
		/* @__PURE__ */ z(ai, {
			size: {
				sm: 2,
				xs: 4
			},
			children: /* @__PURE__ */ z(gr, {
				sx: { bgcolor: "grey[300]" },
				variant: "rectangular",
				height: 60,
				width: 60
			})
		})
	]
});
function gI({ fetchManifest: e, isFetching: t = !1, addWindow: n, handleClose: r = () => {}, active: i = !1, buttonRef: a = void 0, manifestId: o, ready: s = !1, title: c = null, thumbnail: l = null, manifestLogo: u = null, size: d = 0, provider: f = null, error: p = null, isCollection: m = !1, isMultipart: h = !1 }) {
	let { t: g } = V();
	F(() => {
		!s && !p && !t && f !== "file" && e(o);
	}, [
		o,
		f,
		e,
		s,
		p,
		t
	]);
	let _ = arguments[0];
	return p ? /* @__PURE__ */ z(fI, {
		ownerState: _,
		divider: !0,
		selected: i,
		className: i ? "active" : "",
		"data-manifestid": o,
		children: /* @__PURE__ */ z(dI, { manifestId: o })
	}) : /* @__PURE__ */ z(fI, {
		ownerState: _,
		divider: !0,
		selected: i,
		className: i ? "active" : "",
		"data-manifestid": o,
		"data-active": i,
		sx: { width: "100%" },
		children: s ? /* @__PURE__ */ B(ai, {
			container: !0,
			className: j("manifest-list-item"),
			sx: {
				alignItems: "center",
				width: "100%"
			},
			children: [
				/* @__PURE__ */ z(ai, {
					size: {
						sm: 5,
						xs: 12
					},
					children: /* @__PURE__ */ z(oi, {
						ref: a,
						className: j("manifest-list-item-title"),
						onClick: () => {
							n({ manifestId: o }), r();
						},
						sx: {
							alignItems: "center",
							justifyContent: "flex-start",
							width: "100%"
						},
						children: /* @__PURE__ */ B(ai, {
							container: !0,
							component: "div",
							sx: { width: "100%" },
							children: [/* @__PURE__ */ z(ai, {
								size: 3,
								sx: {
									alignItems: "center",
									display: "flex",
									justifyContent: "flex-start"
								},
								children: l ? /* @__PURE__ */ z(pI, {
									className: [j("manifest-list-item-thumb")],
									src: [l],
									alt: "",
									height: "80",
									unloader: /* @__PURE__ */ z(gr, {
										variant: "rectangular",
										animation: !1,
										sx: { bgcolor: "grey[300]" },
										height: 80,
										width: 120
									})
								}) : /* @__PURE__ */ z(gr, {
									sx: { bgcolor: "grey[300]" },
									variant: "rectangular",
									height: 80,
									width: 120
								})
							}), /* @__PURE__ */ B(ai, {
								size: 9,
								sx: {
									alignContent: "center",
									paddingLeft: 2
								},
								children: [m && /* @__PURE__ */ z(U, {
									component: "div",
									variant: "overline",
									sx: { textAlign: "left" },
									children: g(h ? "multipartCollection" : "collection")
								}), /* @__PURE__ */ z(U, {
									component: "div",
									variant: "h6",
									sx: { textAlign: "left" },
									children: c || o
								})]
							})]
						})
					})
				}),
				/* @__PURE__ */ B(ai, {
					size: {
						sm: 4,
						xs: 8
					},
					children: [/* @__PURE__ */ z(U, {
						className: j("manifest-list-item-provider"),
						children: f
					}), /* @__PURE__ */ z(U, { children: g("numItems", {
						count: d,
						number: d
					}) })]
				}),
				/* @__PURE__ */ z(ai, {
					size: {
						sm: 3,
						xs: 4
					},
					children: u && /* @__PURE__ */ z(mI, {
						src: [u],
						alt: "",
						role: "presentation",
						unloader: /* @__PURE__ */ z(gr, {
							variant: "rectangular",
							animation: !1,
							sx: { bgcolor: "grey[300]" },
							height: 60,
							width: 60
						})
					})
				})
			]
		}) : /* @__PURE__ */ z(hI, {})
	});
}
gI.propTypes = {
	active: W.default.bool,
	addWindow: W.default.func.isRequired,
	buttonRef: W.default.elementType,
	error: W.default.oneOfType([
		W.default.string,
		W.default.bool,
		W.default.oneOf([null])
	]),
	fetchManifest: W.default.func.isRequired,
	handleClose: W.default.func,
	isCollection: W.default.bool,
	isFetching: W.default.bool,
	isMultipart: W.default.bool,
	manifestId: W.default.string.isRequired,
	manifestLogo: W.default.string,
	provider: W.default.string,
	ready: W.default.bool,
	size: W.default.number,
	thumbnail: W.default.string,
	title: W.default.string
};
//#endregion
//#region src/components/MosaicRenderPreview.jsx
function _I({ title: e = "", windowId: t }) {
	let { t: n } = V();
	return /* @__PURE__ */ z(vF, {
		windowId: `${t}-preview`,
		label: n("previewWindowTitle", { title: e }),
		ariaLabel: !1
	});
}
_I.propTypes = {
	title: W.default.string,
	windowId: W.default.string.isRequired
};
//#endregion
//#region node_modules/@mui/icons-material/esm/ExpandLessSharp.js
var vI = M(/*#__PURE__*/ z("path", { d: "m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z" }), "ExpandLessSharp"), yI = M(/*#__PURE__*/ z("path", { d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" }), "ExpandMoreSharp");
//#endregion
//#region src/components/NestedMenu.jsx
function bI({ children: e, icon: t = null, label: n, ...r }) {
	let [i, a] = L(!1), o = jn(() => {
		a(!i);
	}, [i, a]);
	return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ B(Xn, {
		"aria-expanded": i,
		onClick: o,
		divider: i,
		...r,
		children: [
			t && /* @__PURE__ */ z(Er, { children: t }),
			/* @__PURE__ */ z(Zn, {
				primaryTypographyProps: { variant: "body1" },
				children: n
			}),
			z(i ? vI : yI, {})
		]
	}), i && e] });
}
bI.propTypes = {
	children: W.default.element.isRequired,
	icon: W.default.element,
	label: W.default.string.isRequired
};
//#endregion
//#region src/components/WindowList.jsx
function xI({ handleClose: e, windowIds: t, focusWindow: n, focusedWindowId: r = null, titles: i = {}, tReady: a = !1, ...o }) {
	let { t: s } = V(), c = Mn(gn);
	return /* @__PURE__ */ B(Mr, {
		anchorOrigin: {
			horizontal: "right",
			vertical: "top"
		},
		transformOrigin: {
			horizontal: "left",
			vertical: "top"
		},
		id: "window-list-menu",
		container: c?.current,
		onClose: e,
		...o,
		children: [/* @__PURE__ */ z(Or, {
			role: "presentation",
			selected: !1,
			disabled: !0,
			tabIndex: "-1",
			children: s("openWindows")
		}), t.map((t, a) => /* @__PURE__ */ z(Xn, {
			selected: t === r,
			onClick: (r) => {
				n(t, !0), e(r);
			},
			children: /* @__PURE__ */ z(Zn, {
				primaryTypographyProps: { variant: "body1" },
				children: i[t] || s("untitled")
			})
		}, t))]
	});
}
xI.propTypes = {
	container: W.default.shape({ current: W.default.instanceOf(Element) }),
	focusedWindowId: W.default.string,
	focusWindow: W.default.func.isRequired,
	handleClose: W.default.func.isRequired,
	titles: W.default.objectOf(W.default.string),
	tReady: W.default.bool,
	windowIds: W.default.arrayOf(W.default.string).isRequired
};
//#endregion
//#region node_modules/@mui/icons-material/esm/BookmarksSharp.js
var SI = M(/*#__PURE__*/ z("path", { d: "m19 18 2 1V1H7v2h12zM17 5H3v18l7-3 7 3z" }), "BookmarksSharp"), CI = n(w((e) => ({
	focusedWindowId: ie(e),
	titles: mt(e),
	windowIds: x(e)
}), { focusWindow: Xt }), m("WindowList"))(xI);
//#endregion
//#region src/components/WindowListButton.jsx
function wI({ disabled: e = !1, windowCount: t }) {
	let { t: n } = V(), [r, i] = L(null), a = Nn(), o = () => {
		i(null);
	}, s = (e) => {
		i(e.currentTarget);
	};
	return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(mn, {
		"aria-haspopup": "true",
		"aria-label": n("listAllOpenWindows"),
		"aria-owns": r ? a : null,
		selected: !!r,
		disabled: e,
		badge: !0,
		BadgeProps: {
			badgeContent: t,
			sx: { ".MuiBadge-badge": { paddingLeft: 1.5 } }
		},
		onClick: (e) => s(e),
		children: /* @__PURE__ */ z(SI, {})
	}), !!r && /* @__PURE__ */ z(CI, {
		anchorEl: r,
		id: a,
		open: !!r,
		handleClose: o
	})] });
}
wI.propTypes = {
	disabled: W.default.bool,
	windowCount: W.default.number.isRequired
};
//#endregion
//#region node_modules/lodash/difference.js
var TI = /* @__PURE__ */ D(((e, t) => {
	var n = Bt(), r = Ne(), i = zt(), a = Ut();
	t.exports = i(function(e, t) {
		return a(e) ? n(e, r(t, 1, a, !0)) : [];
	});
})), EI = /* @__PURE__ */ D(((e, t) => {
	var n = he();
	function r(e, t) {
		return n(e, t);
	}
	t.exports = r;
})), DI = /* @__PURE__ */ p(TI(), 1), OI = /* @__PURE__ */ p(EI(), 1), kI = n(w((e, { windowId: t }) => ({ title: lt(e, { windowId: t }) }), null), m("MosaicRenderPreview"))(_I), AI = /* @__PURE__ */ p((/* @__PURE__ */ D(((e, n) => {
	var r = Rw(), i = t();
	function a(e, t, n) {
		var a = e == null ? 0 : e.length;
		return a ? (t = n || t === void 0 ? 1 : i(t), t = a - t, r(e, 0, t < 0 ? 0 : t)) : [];
	}
	n.exports = a;
})))(), 1), jI = class {
	constructor(e) {
		this.layout = e;
	}
	pathToCorner(e = TM.TOP_RIGHT) {
		return MM(this.layout, e);
	}
	pathToParent(e) {
		return IM(this.layout, (0, AI.default)(e));
	}
	nodeAtPath(e) {
		return IM(this.layout, e);
	}
	addWindows(e) {
		e.forEach((t, n) => {
			let r = this.pathToCorner(), i = this.pathToParent(r), a = this.nodeAtPath(r), o = i ? jM(i.direction) : "row", s;
			s = o === "row" ? [a, e[n]] : [e[n], a];
			let c = {
				path: r,
				spec: { $set: {
					type: "split",
					direction: o,
					children: s
				} }
			};
			this.layout = HM(this.layout, [c]);
		});
	}
	removeWindows(e, t) {
		let n = e.map((e) => UM(this.layout, t[e]));
		this.layout = HM(this.layout, n);
	}
}, MI = {
	".mosaic": {
		height: "100%",
		width: "100%"
	},
	".mosaic, .mosaic > *": { boxSizing: "border-box" },
	".mosaic .mosaic-zero-state": {
		position: "absolute",
		top: 6,
		right: 6,
		bottom: 6,
		left: 6,
		width: "auto",
		height: "auto",
		zIndex: "1"
	},
	".mosaic-root": {
		position: "absolute",
		top: 3,
		right: 3,
		bottom: 3,
		left: 3
	},
	".mosaic-split": {
		position: "absolute",
		zIndex: "1",
		touchAction: "none"
	},
	".mosaic-split:hover": { background: "black" },
	".mosaic-split .mosaic-split-line": { position: "absolute" },
	".mosaic-split.-row": {
		marginLeft: -3,
		width: 6,
		cursor: "ew-resize"
	},
	".mosaic-split.-row .mosaic-split-line": {
		top: "0",
		bottom: "0",
		left: 3,
		right: 3
	},
	".mosaic-split.-column": {
		marginTop: -3,
		height: 6,
		cursor: "ns-resize"
	},
	".mosaic-split.-column .mosaic-split-line": {
		top: 3,
		bottom: 3,
		left: "0",
		right: "0"
	},
	".mosaic-tile": {
		position: "absolute",
		margin: 3
	},
	".mosaic-tile > *": {
		height: "100%",
		width: "100%"
	},
	".mosaic-drop-target": { position: "relative" },
	".mosaic-drop-target.drop-target-hover .drop-target-container": { display: "block" },
	".mosaic-drop-target.mosaic > .drop-target-container .drop-target.left": { right: "calc(100% -  10px )" },
	".mosaic-drop-target.mosaic > .drop-target-container .drop-target.right": { left: "calc(100% -  10px )" },
	".mosaic-drop-target.mosaic > .drop-target-container .drop-target.bottom": { top: "calc(100% -  10px )" },
	".mosaic-drop-target.mosaic > .drop-target-container .drop-target.top": { bottom: "calc(100% -  10px )" },
	".mosaic-drop-target .drop-target-container": {
		position: "absolute",
		top: "0",
		right: "0",
		bottom: "0",
		left: "0",
		display: "none"
	},
	".mosaic-drop-target .drop-target-container.-dragging": { display: "block" },
	".mosaic-drop-target .drop-target-container .drop-target": {
		position: "absolute",
		top: "0",
		right: "0",
		bottom: "0",
		left: "0",
		background: "rgba(0, 0, 0, 0.2)",
		border: "2px solid black",
		opacity: "0",
		zIndex: "5"
	},
	".mosaic-drop-target .drop-target-container .drop-target.left": { right: "calc(100% -  30% )" },
	".mosaic-drop-target .drop-target-container .drop-target.right": { left: "calc(100% -  30% )" },
	".mosaic-drop-target .drop-target-container .drop-target.bottom": { top: "calc(100% -  30% )" },
	".mosaic-drop-target .drop-target-container .drop-target.top": { bottom: "calc(100% -  30% )" },
	".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover": { opacity: "1" },
	".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.left": { right: "calc(100% -  50% )" },
	".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.right": { left: "calc(100% -  50% )" },
	".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.bottom": { top: "calc(100% -  50% )" },
	".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.top": { bottom: "calc(100% -  50% )" },
	".mosaic-window, .mosaic-preview": {
		position: "relative",
		display: "flex",
		fallbacks: [{ display: "-webkit-box" }],
		webkitBoxOrient: "vertical",
		webkitBoxDirection: "normal",
		flexDirection: "column",
		overflow: "hidden",
		boxShadow: "0 0 1px rgba(0, 0, 0, 0.2)"
	},
	".mosaic-window .mosaic-window-toolbar, .mosaic-preview .mosaic-window-toolbar": {
		zIndex: "4",
		display: "flex",
		fallbacks: [{ display: "-webkit-box" }],
		webkitBoxPack: "justify",
		justifyContent: "space-between",
		webkitBoxAlign: "center",
		alignItems: "center",
		flexShrink: "0",
		height: 30,
		background: "white",
		boxShadow: "0 1px 1px rgba(0, 0, 0, 0.2)"
	},
	".mosaic-window .mosaic-window-toolbar.draggable, .mosaic-preview .mosaic-window-toolbar.draggable": { cursor: "move" },
	".mosaic-window .mosaic-window-title, .mosaic-preview .mosaic-window-title": {
		paddingLeft: 15,
		webkitBoxFlex: "1",
		flex: "1",
		textOverflow: "ellipsis",
		whiteSpace: "nowrap",
		overflow: "hidden",
		minHeight: 18
	},
	".mosaic-window .mosaic-window-controls, .mosaic-preview .mosaic-window-controls": {
		display: "flex",
		fallbacks: [{ display: "-webkit-box" }],
		height: "100%"
	},
	".mosaic-window .mosaic-window-controls .separator, .mosaic-preview .mosaic-window-controls .separator": {
		height: 20,
		borderLeft: "1px solid black",
		margin: "5px 4px"
	},
	".mosaic-window .mosaic-window-body, .mosaic-preview .mosaic-window-body": {
		position: "relative",
		webkitBoxFlex: "1",
		flex: "1",
		height: "0",
		background: "white",
		zIndex: "1",
		overflow: "hidden"
	},
	".mosaic-window .mosaic-window-additional-actions-bar, .mosaic-preview .mosaic-window-additional-actions-bar": {
		position: "absolute",
		top: 30,
		right: "0",
		bottom: "initial",
		left: "0",
		height: "0",
		overflow: "hidden",
		background: "white",
		webkitBoxPack: "end",
		justifyContent: "flex-end",
		display: "flex",
		fallbacks: [{ display: "-webkit-box" }],
		zIndex: "3"
	},
	".mosaic-window .mosaic-window-additional-actions-bar .bp3-button, .mosaic-preview .mosaic-window-additional-actions-bar .bp3-button": { margin: "0" },
	".mosaic-window .mosaic-window-additional-actions-bar .bp3-button:after, .mosaic-preview .mosaic-window-additional-actions-bar .bp3-button:after": { display: "none" },
	".mosaic-window .mosaic-window-body-overlay, .mosaic-preview .mosaic-window-body-overlay": {
		position: "absolute",
		top: "0",
		right: "0",
		bottom: "0",
		left: "0",
		opacity: "0",
		background: "white",
		display: "none",
		zIndex: "2"
	},
	".mosaic-window.additional-controls-open .mosaic-window-additional-actions-bar, .mosaic-preview.additional-controls-open .mosaic-window-additional-actions-bar": { height: 30 },
	".mosaic-window.additional-controls-open .mosaic-window-body-overlay, .mosaic-preview.additional-controls-open .mosaic-window-body-overlay": { display: "block" },
	".mosaic-window .mosaic-preview, .mosaic-preview .mosaic-preview": {
		height: "100%",
		width: "100%",
		position: "absolute",
		zIndex: "0",
		border: "1px solid black",
		maxHeight: 400
	},
	".mosaic-window .mosaic-preview .mosaic-window-body, .mosaic-preview .mosaic-preview .mosaic-window-body": {
		display: "flex",
		fallbacks: [{ display: "-webkit-box" }],
		webkitBoxOrient: "vertical",
		webkitBoxDirection: "normal",
		flexDirection: "column",
		webkitBoxAlign: "center",
		alignItems: "center",
		webkitBoxPack: "center",
		justifyContent: "center"
	},
	".mosaic-window .mosaic-preview h4, .mosaic-preview .mosaic-preview h4": { marginBottom: 10 },
	".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.close-button:before": { content: "'Close'" },
	".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.split-button:before": { content: "'Split'" },
	".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.replace-button:before": { content: "'Replace'" },
	".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.expand-button:before": { content: "'Expand'" }
}, NI = H(wN)({
	"& .mosaic-preview": { boxShadow: "none" },
	"& .mosaic-tile": { boxShadow: "0 1px 3px 0 rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .2), 0 2px 1px -1px rgba(0, 0, 0, .2)" },
	"& .mosaic-window": { boxShadow: "none" },
	"& .mosaic-window-toolbar": { display: "none !important" }
}), PI = ({ windowId: e }) => /* @__PURE__ */ z("div", {
	className: "mosaic-preview",
	"aria-hidden": !0,
	children: /* @__PURE__ */ z(kI, { windowId: e })
});
PI.propTypes = { windowId: W.default.string.isRequired };
var FI = () => /* @__PURE__ */ z("div", {}), II = (e, t, n = {}) => {
	let r = NM(e), i = new jI(e), a = (0, DI.default)(t, r);
	a.length > 0 && i.addWindows(a);
	let o = (0, DI.default)(r, t);
	if (o.every((e) => n[e])) i.removeWindows(o, n);
	else return AM(t);
	return i.layout;
};
function LI({ layout: e = void 0, updateWorkspaceMosaicLayout: t, windowIds: n = [], workspaceId: r }) {
	let i = I({}), a = Mn(Ib), o = e && PM(e);
	F(() => {
		let e = NM(o);
		if (!o || n.length === 0 || e.length < 2) {
			t(AM(n));
			return;
		}
		if (n.every((t) => e.includes(t)) && e.every((e) => n.includes(e))) return;
		let r = II(o, n, i.current);
		(0, OI.default)(r, o) || t(r);
	}, [
		o,
		n,
		i,
		t
	]);
	let s = [], c = (e, t) => n.includes(e) ? (i.current[e] = t, /* @__PURE__ */ z(ON, {
		toolbarControls: s,
		path: t,
		windowId: e,
		renderPreview: PI,
		children: /* @__PURE__ */ z(BF, { windowId: e }, `${e}-${r}`)
	})) : null, l = (e) => {
		t(e);
	};
	return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(si, { styles: { ...MI } }), /* @__PURE__ */ z(NI, {
		dragAndDropManager: a.dragDropManager,
		renderTile: c,
		initialValue: o || AM(n),
		onChange: l,
		className: (0, G.default)("mirador-mosaic"),
		zeroStateView: /* @__PURE__ */ z(FI, {})
	})] });
}
LI.propTypes = {
	layout: W.default.oneOfType([W.default.object, W.default.string]),
	updateWorkspaceMosaicLayout: W.default.func.isRequired,
	windowIds: W.default.arrayOf(W.default.string),
	workspaceId: W.default.string.isRequired
};
var RI = n(w((e) => ({
	layout: _(e).layout,
	windowIds: _(e).windowIds,
	workspaceId: _(e).id
}), { updateWorkspaceMosaicLayout: Qi }), m("WorkspaceMosaic"))(LI), zI = n(w((e) => ({
	elasticLayout: oe(e),
	workspace: _(e)
}), (e, t) => ({
	setWorkspaceViewportDimensions: (t) => {
		e(ta(t));
	},
	setWorkspaceViewportPosition: (t) => {
		e(ea(t));
	},
	updateElasticWindowLayout: (t, n) => {
		e(ua(t, n));
	}
})), m("WorkspaceElastic"))(qF), BI = H("div", {
	name: "Workspace",
	slot: "root"
})(() => ({
	height: "100%",
	position: "relative",
	width: "100%"
})), VI = () => {
	let { t: e } = V();
	return /* @__PURE__ */ z(BI, { children: /* @__PURE__ */ z(ai, {
		alignItems: "center",
		container: !0,
		style: {
			height: "100%",
			justifyContent: "center"
		},
		children: /* @__PURE__ */ z(ai, {
			size: 12,
			children: /* @__PURE__ */ z(U, {
				variant: "h1",
				component: "div",
				align: "center",
				children: e("welcome")
			})
		})
	}) });
};
VI.propTypes = {};
function HI({ addWindow: e = () => {}, allowNewWindows: t = !0, maximizedWindowIds: n = [], windowIds: r = [], workspaceId: i, workspaceType: a }) {
	let { t: o } = V();
	return /* @__PURE__ */ z(oI, {
		onDrop: ({ canvasId: n, manifestId: r, manifestJson: i }, a, o) => {
			t && e({
				canvasId: n,
				manifest: i,
				manifestId: r
			});
		},
		children: /* @__PURE__ */ B(BI, {
			ownerState: {
				allowNewWindows: t,
				maximizedWindowIds: n,
				windowIds: r,
				workspaceId: i,
				workspaceType: a
			},
			className: (0, G.default)(j("workspace-viewport")),
			children: [/* @__PURE__ */ z(U, {
				style: vn,
				component: "h1",
				children: o("miradorViewer")
			}), (() => {
				if (n.length > 0 && n.length > 0) return n.map((e) => /* @__PURE__ */ z(BF, {
					windowId: e,
					className: (0, G.default)(j("workspace-maximized-window"))
				}, `${e}-${i}`));
				if (r.length === 0) return /* @__PURE__ */ z(VI, {});
				switch (a) {
					case "elastic": return /* @__PURE__ */ z(zI, {});
					case "mosaic": return /* @__PURE__ */ z(RI, {});
					default: return r.map((e) => /* @__PURE__ */ z(BF, { windowId: e }, `${e}-${i}`));
				}
			})()]
		})
	});
}
HI.propTypes = {
	addWindow: W.default.func,
	allowNewWindows: W.default.bool,
	maximizedWindowIds: W.default.arrayOf(W.default.string),
	windowIds: W.default.arrayOf(W.default.string),
	workspaceId: W.default.string.isRequired,
	workspaceType: W.default.string.isRequired
};
//#endregion
//#region node_modules/@mui/icons-material/esm/AddSharp.js
var UI = M(/*#__PURE__*/ z("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z" }), "AddSharp"), WI = n(w(null, { addResource: va }), m("ManifestForm"))(lI), GI = n(w((e, { manifestId: t, provider: n }) => {
	let r = b(e, { manifestId: t }) || {}, i = ze(e, { manifestId: t }), a = (i || { isCollection: () => !1 }).isCollection(), o = a ? i.getTotalItems() : ut(e, { manifestId: t }).length;
	return {
		active: C(e).includes(t),
		error: r.error || !i && !!r.json,
		isCollection: a,
		isFetching: r.isFetching,
		isMultipart: a && be(e, { manifestId: t }).includes("multi-part"),
		manifestLogo: me(e, { manifestId: t }),
		provider: n || pe(e, { manifestId: t }),
		ready: !!r.json,
		size: o,
		thumbnail: it(e, { manifestId: t }),
		title: lt(e, { manifestId: t })
	};
}, {
	addWindow: en,
	fetchManifest: Ji
}), m("ManifestListItem"))(gI), KI = H("div")(() => ({
	boxSizing: "border-box",
	height: "100%",
	overflowX: "hidden",
	overflowY: "auto"
})), qI = H(mn)(() => ({
	marginLeft: -12,
	marginRight: 20
}));
function JI({ addResource: e = () => {}, catalog: t = [], setWorkspaceAddVisibility: n, ...r }) {
	let { t: i } = V(), [a, o] = L(!1), s = I(), [c, l] = L("100%"), u = () => {
		s.current && l(s.current.offsetWidth);
	}, d = ({ manifestId: t, manifestJson: n }, r, i) => {
		n ? e(t, n, { provider: "file" }) : e(t), p();
	}, f = () => {
		o(!1), p();
	}, p = () => {
		s.current && s.current.scrollTo({
			behavior: "smooth",
			left: 0,
			top: 0
		});
	}, m = t.map((e, t) => /* @__PURE__ */ Tn(GI, {
		...t === 0 && { buttonRef: (e) => e && e.focus() },
		key: e.manifestId,
		manifestId: e.manifestId,
		provider: e.provider,
		handleClose: () => n(!1)
	})), h = {
		addResource: e,
		catalog: t,
		setWorkspaceAddVisibility: n,
		t: i,
		...r
	};
	return F(() => (window.addEventListener("resize", u), u(), () => {
		window.removeEventListener("resize", u);
	}), []), /* @__PURE__ */ z(oI, {
		onDrop: d,
		children: /* @__PURE__ */ B(KI, {
			className: (0, G.default)(j("workspace-add")),
			ref: s,
			children: [
				t.length < 1 ? /* @__PURE__ */ z(ai, {
					alignItems: "center",
					container: !0,
					style: { height: "100%" },
					children: /* @__PURE__ */ z(ai, {
						size: 12,
						children: /* @__PURE__ */ z(U, {
							variant: "h1",
							component: "div",
							align: "center",
							children: i("emptyResourceList")
						})
					})
				}) : /* @__PURE__ */ B(Ln, {
					sx: { margin: 2 },
					children: [
						/* @__PURE__ */ z(U, {
							style: vn,
							component: "h1",
							children: i("miradorResources")
						}),
						/* @__PURE__ */ z(cn, {
							targetName: "WorkspaceAdd",
							...h
						}),
						/* @__PURE__ */ z(xr, {
							disablePadding: !0,
							children: m
						})
					]
				}),
				/* @__PURE__ */ B(ci, {
					variant: "extended",
					disabled: a,
					sx: (e) => ({
						bottom: e.spacing(2),
						position: "absolute",
						right: e.spacing(2)
					}),
					className: (0, G.default)(j("add-resource-button")),
					"aria-label": i("addResource"),
					color: "primary",
					onClick: () => o(!0),
					children: [/* @__PURE__ */ z(UI, {}), i("addResource")]
				}),
				/* @__PURE__ */ z(Nr, {
					sx: (e) => ({
						".MuiDrawer-paper": {
							borderTop: "0",
							left: "unset",
							width: c
						},
						...!a && { display: "none" }
					}),
					variant: "persistent",
					anchor: "bottom",
					open: a,
					ModalProps: {
						disablePortal: !0,
						hideBackdrop: !0,
						style: { position: "absolute" }
					},
					children: /* @__PURE__ */ B(Ln, {
						sx: {
							left: "0",
							marginTop: 6,
							paddingBottom: 2,
							paddingLeft: {
								sm: 3,
								xs: 2
							},
							paddingRight: {
								sm: 3,
								xs: 2
							},
							paddingTop: 2,
							right: "0"
						},
						children: [/* @__PURE__ */ z(Dr, {
							position: "absolute",
							color: "primary",
							enableColorOnDark: !0,
							onClick: () => o(!1),
							children: /* @__PURE__ */ B(Qn, {
								variant: "dense",
								children: [/* @__PURE__ */ z(qI, {
									"aria-label": i("closeAddResourceForm"),
									color: "inherit",
									children: /* @__PURE__ */ z(yI, {})
								}), /* @__PURE__ */ z(U, {
									variant: "h2",
									noWrap: !0,
									color: "inherit",
									sx: { flexGrow: 1 },
									children: i("addResource")
								})]
							})
						}), /* @__PURE__ */ z(WI, {
							addResourcesOpen: a,
							onSubmit: f,
							onCancel: () => o(!1)
						})]
					})
				})
			]
		})
	});
}
JI.propTypes = {
	addResource: W.default.func,
	catalog: W.default.arrayOf(W.default.shape({
		manifestId: W.default.string.isRequired,
		provider: W.default.string
	})),
	setWorkspaceAddVisibility: W.default.func.isRequired
};
//#endregion
//#region src/components/WorkspaceAddButton.jsx
function YI() {
	let e = Hn();
	return [...e.breakpoints.keys].reverse().reduce((t, n) => {
		let r = li(e.breakpoints.up(n));
		return !t && r ? n : t;
	}, null) || "xs";
}
var XI = H(ci, {
	name: "WorkspaceAddButton",
	slot: "root"
})(({ theme: e }) => ({
	marginBottom: e.spacing(1),
	"&:hover, &.Mui-focusVisible": { backgroundColor: (e.vars || e).palette.primary.dark },
	...e.applyStyles("dark", { "&:hover, &.Mui-focusVisible": { backgroundColor: (e.vars || e).palette.primary.light } })
}));
function ZI({ setWorkspaceAddVisibility: e, isWorkspaceAddVisible: t = !1, useExtendedFab: n }) {
	let r = YI(), { t: i } = V();
	return /* @__PURE__ */ z(qn, {
		title: i(t ? "closeAddResourceMenu" : "addResource"),
		children: /* @__PURE__ */ B(XI, {
			size: "medium",
			color: "primary",
			id: "addBtn",
			focusRipple: !1,
			"aria-label": t ? i("closeAddResourceMenu") : n && r !== "xs" && i("startHere") || i("addResource"),
			variant: n && r !== "xs" ? "extended" : "circular",
			onClick: () => {
				e(!t);
			},
			children: [z(t ? Ms : UI, {}), n && r !== "xs" && i("startHere")]
		})
	});
}
ZI.propTypes = {
	isWorkspaceAddVisible: W.default.bool,
	setWorkspaceAddVisibility: W.default.func.isRequired,
	useExtendedFab: W.default.bool.isRequired
};
var QI = n(w((e) => ({ error: $e(e) }), { removeError: Wi }), m("ErrorDialog"))(tI), $I = n(w((e, { width: t }) => {
	let { isWorkspaceAddVisible: n } = _(e);
	return {
		isWorkspaceAddVisible: n,
		useExtendedFab: !n && x(e).length === 0
	};
}, { setWorkspaceAddVisibility: $i }), m("WorkspaceAddButton"))(ZI), eL = M(/*#__PURE__*/ z("path", { d: "m19.44 12.99-.01.02c.04-.33.08-.67.08-1.01s-.03-.66-.07-.99l.01.02 2.44-1.92-2.43-4.22-2.87 1.16.01.01c-.52-.4-1.09-.74-1.71-1h.01L14.44 2H9.57l-.44 3.07h.01c-.62.26-1.19.6-1.71 1l.01-.01-2.88-1.17-2.44 4.22 2.44 1.92.01-.02c-.04.33-.07.65-.07.99s.03.68.08 1.01l-.01-.02-2.1 1.65-.33.26 2.43 4.2 2.88-1.15-.02-.04c.53.41 1.1.75 1.73 1.01h-.03L9.58 22h4.85s.03-.18.06-.42l.38-2.65h-.01c.62-.26 1.2-.6 1.73-1.01l-.02.04 2.88 1.15 2.43-4.2s-.14-.12-.33-.26zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5" }), "SettingsSharp"), tL = n(w((e) => ({ languages: Le(e) }), (e, { afterSelect: t }) => ({ handleClick: (n) => {
	e(Vi({ language: n })), t && t();
} })), m("LanguageSettings"))(cI);
//#endregion
//#region src/components/icons/WorkspaceTypeElasticIcon.jsx
function nL(e) {
	return /* @__PURE__ */ z(jr, {
		...e,
		children: /* @__PURE__ */ B("svg", {
			xmlns: "http://www.w3.org/2000/svg",
			width: "120",
			height: "90",
			viewBox: "0 0 300 225",
			children: [/* @__PURE__ */ B("defs", { children: [
				/* @__PURE__ */ B("linearGradient", {
					id: "linear-gradient",
					x1: "0.5",
					y1: "1",
					x2: "0.5",
					gradientUnits: "objectBoundingBox",
					children: [
						/* @__PURE__ */ z("stop", { offset: "0" }),
						/* @__PURE__ */ z("stop", {
							offset: "0.14",
							stopOpacity: "0.631"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "1",
							stopOpacity: "0"
						})
					]
				}),
				/* @__PURE__ */ B("linearGradient", {
					id: "linear-gradient-2",
					x1: "0.5",
					y1: "1",
					x2: "0.5",
					gradientUnits: "objectBoundingBox",
					children: [
						/* @__PURE__ */ z("stop", {
							offset: "0",
							stopColor: "#fff",
							stopOpacity: "0"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.23",
							stopColor: "#fff",
							stopOpacity: "0.012"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.36",
							stopColor: "#fff",
							stopOpacity: "0.039"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.47",
							stopColor: "#fff",
							stopOpacity: "0.102"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.57",
							stopColor: "#fff",
							stopOpacity: "0.18"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.67",
							stopColor: "#fff",
							stopOpacity: "0.278"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.75",
							stopColor: "#fff",
							stopOpacity: "0.412"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.83",
							stopColor: "#fff",
							stopOpacity: "0.561"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.91",
							stopColor: "#fff",
							stopOpacity: "0.741"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.98",
							stopColor: "#fff",
							stopOpacity: "0.929"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "1",
							stopColor: "#fff"
						})
					]
				}),
				/* @__PURE__ */ z("clipPath", {
					id: "clip-elastic_icon",
					children: /* @__PURE__ */ z("rect", {
						width: "300",
						height: "225"
					})
				})
			] }), /* @__PURE__ */ B("g", {
				id: "elastic_icon",
				"data-name": "elastic icon",
				clipPath: "url(#clip-elastic_icon)",
				children: [
					/* @__PURE__ */ z("rect", {
						width: "300",
						height: "225",
						fill: "#fff"
					}),
					/* @__PURE__ */ B("g", {
						id: "Rectangle_278",
						"data-name": "Rectangle 278",
						transform: "translate(232 159)",
						fill: "#88c6c3",
						stroke: "#707070",
						strokeWidth: "1",
						opacity: "0.747",
						children: [/* @__PURE__ */ z("rect", {
							width: "54",
							height: "54",
							stroke: "none"
						}), /* @__PURE__ */ z("rect", {
							x: "0.5",
							y: "0.5",
							width: "53",
							height: "53",
							fill: "none"
						})]
					}),
					/* @__PURE__ */ B("g", {
						id: "Rectangle_8",
						"data-name": "Rectangle 8",
						transform: "translate(7 148)",
						fill: "#88c6c3",
						stroke: "#707070",
						strokeWidth: "1",
						opacity: "0.747",
						children: [/* @__PURE__ */ z("rect", {
							width: "70",
							height: "70",
							stroke: "none"
						}), /* @__PURE__ */ z("rect", {
							x: "0.5",
							y: "0.5",
							width: "69",
							height: "69",
							fill: "none"
						})]
					}),
					/* @__PURE__ */ B("g", {
						id: "Rectangle_258",
						"data-name": "Rectangle 258",
						transform: "translate(224 6)",
						fill: "#88c6c3",
						stroke: "#707070",
						strokeWidth: "1",
						opacity: "0.747",
						children: [/* @__PURE__ */ z("rect", {
							width: "70",
							height: "100",
							stroke: "none"
						}), /* @__PURE__ */ z("rect", {
							x: "0.5",
							y: "0.5",
							width: "69",
							height: "99",
							fill: "none"
						})]
					}),
					/* @__PURE__ */ B("g", {
						id: "Rectangle_259",
						"data-name": "Rectangle 259",
						transform: "translate(71 64)",
						fill: "#88c6c3",
						stroke: "#707070",
						strokeWidth: "1",
						opacity: "0.747",
						children: [/* @__PURE__ */ z("rect", {
							width: "115",
							height: "75",
							stroke: "none"
						}), /* @__PURE__ */ z("rect", {
							x: "0.5",
							y: "0.5",
							width: "114",
							height: "74",
							fill: "none"
						})]
					}),
					/* @__PURE__ */ B("g", {
						id: "Rectangle_260",
						"data-name": "Rectangle 260",
						transform: "translate(99 87)",
						fill: "#88c6c3",
						stroke: "#707070",
						strokeWidth: "1",
						opacity: "0.747",
						children: [/* @__PURE__ */ z("rect", {
							width: "115",
							height: "75",
							stroke: "none"
						}), /* @__PURE__ */ z("rect", {
							x: "0.5",
							y: "0.5",
							width: "114",
							height: "74",
							fill: "none"
						})]
					}),
					/* @__PURE__ */ B("g", {
						id: "Group_689",
						"data-name": "Group 689",
						children: [
							/* @__PURE__ */ B("g", {
								id: "Group_687",
								"data-name": "Group 687",
								transform: "translate(0 3)",
								children: [/* @__PURE__ */ z("path", {
									id: "checkbox",
									d: "M258.766,37.316v146.5H39.053V37.316Zm40.07-39.254h-300v225h300Z",
									transform: "translate(1.164 -1.063)",
									fill: "#010101",
									fillRule: "evenodd",
									opacity: "0.246"
								}), /* @__PURE__ */ B("g", {
									id: "Path_821",
									"data-name": "Path 821",
									transform: "translate(40 36)",
									fill: "none",
									children: [/* @__PURE__ */ z("path", {
										d: "M0,0H220V147H0Z",
										stroke: "none"
									}), /* @__PURE__ */ z("path", {
										d: "M 2 2 L 2 145 L 218 145 L 218 2 L 172.9869689941406 2 L 2 2 M 0 0 L 172.9869689941406 0 L 220 0 L 220 147 L 0 147 L 0 0 Z",
										stroke: "none",
										fill: "#01579b"
									})]
								})]
							}),
							/* @__PURE__ */ B("g", {
								id: "Rectangle_257",
								"data-name": "Rectangle 257",
								transform: "translate(40 39)",
								fill: "#fff",
								stroke: "#01579b",
								strokeWidth: "2",
								children: [/* @__PURE__ */ z("rect", {
									width: "20",
									height: "147",
									stroke: "none"
								}), /* @__PURE__ */ z("rect", {
									x: "1",
									y: "1",
									width: "18",
									height: "145",
									fill: "none"
								})]
							}),
							/* @__PURE__ */ B("g", {
								id: "Group_688",
								"data-name": "Group 688",
								transform: "translate(-27.5 -126)",
								children: [/* @__PURE__ */ z("circle", {
									id: "teal_circle",
									"data-name": "teal circle",
									cx: "7.5",
									cy: "7.5",
									r: "7.5",
									transform: "translate(70 171)",
									fill: "#009688"
								}), /* @__PURE__ */ B("g", {
									id: "Group_333",
									"data-name": "Group 333",
									transform: "translate(70 171)",
									opacity: "0.12",
									children: [/* @__PURE__ */ z("path", {
										id: "gradient_border_2",
										"data-name": "gradient border 2",
										d: "M3408,959.089A4.911,4.911,0,1,1,3403.09,964a4.911,4.911,0,0,1,4.911-4.911m0-.089a5,5,0,1,0,5,5,5,5,0,0,0-5-5Z",
										transform: "translate(-3403 -959)",
										fill: "url(#linear-gradient)"
									}), /* @__PURE__ */ z("path", {
										id: "gradient_border_1",
										"data-name": "gradient border 1",
										d: "M3408,959.089A4.911,4.911,0,1,1,3403.09,964a4.911,4.911,0,0,1,4.911-4.911m0-.089a5,5,0,1,0,5,5,5,5,0,0,0-5-5Z",
										transform: "translate(-3403 -959)",
										fill: "url(#linear-gradient-2)"
									})]
								})]
							})
						]
					})
				]
			})]
		})
	});
}
//#endregion
//#region src/components/icons/WorkspaceTypeMosaicIcon.jsx
function rL(e) {
	return /* @__PURE__ */ z(jr, {
		...e,
		children: /* @__PURE__ */ B("svg", {
			xmlns: "http://www.w3.org/2000/svg",
			width: "120",
			height: "90",
			viewBox: "0 0 300 225",
			children: [/* @__PURE__ */ B("defs", { children: [
				/* @__PURE__ */ B("linearGradient", {
					id: "linear-gradient",
					x1: "0.5",
					y1: "1",
					x2: "0.5",
					gradientUnits: "objectBoundingBox",
					children: [
						/* @__PURE__ */ z("stop", { offset: "0" }),
						/* @__PURE__ */ z("stop", {
							offset: "0.14",
							stopOpacity: "0.631"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "1",
							stopOpacity: "0"
						})
					]
				}),
				/* @__PURE__ */ B("linearGradient", {
					id: "linear-gradient-2",
					x1: "0.5",
					y1: "1",
					x2: "0.5",
					gradientUnits: "objectBoundingBox",
					children: [
						/* @__PURE__ */ z("stop", {
							offset: "0",
							stopColor: "#fff",
							stopOpacity: "0"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.23",
							stopColor: "#fff",
							stopOpacity: "0.012"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.36",
							stopColor: "#fff",
							stopOpacity: "0.039"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.47",
							stopColor: "#fff",
							stopOpacity: "0.102"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.57",
							stopColor: "#fff",
							stopOpacity: "0.18"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.67",
							stopColor: "#fff",
							stopOpacity: "0.278"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.75",
							stopColor: "#fff",
							stopOpacity: "0.412"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.83",
							stopColor: "#fff",
							stopOpacity: "0.561"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.91",
							stopColor: "#fff",
							stopOpacity: "0.741"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "0.98",
							stopColor: "#fff",
							stopOpacity: "0.929"
						}),
						/* @__PURE__ */ z("stop", {
							offset: "1",
							stopColor: "#fff"
						})
					]
				}),
				/* @__PURE__ */ z("clipPath", {
					id: "clip-mosaic_icon",
					children: /* @__PURE__ */ z("rect", {
						width: "300",
						height: "225"
					})
				})
			] }), /* @__PURE__ */ B("g", {
				id: "mosaic_icon",
				"data-name": "mosaic icon",
				clipPath: "url(#clip-mosaic_icon)",
				children: [
					/* @__PURE__ */ z("rect", {
						width: "300",
						height: "225",
						fill: "#fff"
					}),
					/* @__PURE__ */ z("path", {
						id: "checkbox",
						d: "M258.766,37.316v146.5H39.053V37.316Zm40.07-39.254h-300v225h300Z",
						transform: "translate(1.163 1.938)",
						fill: "#010101",
						fillRule: "evenodd",
						opacity: "0.5"
					}),
					/* @__PURE__ */ z("path", {
						id: "checkbox-2",
						"data-name": "checkbox",
						d: "M258.766,37.316v146.5H39.053V37.316Zm40.07-39.254h-300v225h300Z",
						transform: "translate(1.164 1.938)",
						fill: "#010101",
						fillRule: "evenodd",
						opacity: "0.246"
					}),
					/* @__PURE__ */ B("g", {
						id: "Path_821",
						"data-name": "Path 821",
						transform: "translate(40 39)",
						fill: "none",
						children: [/* @__PURE__ */ z("path", {
							d: "M0,0H220V147H0Z",
							stroke: "none"
						}), /* @__PURE__ */ z("path", {
							d: "M 2 2 L 2 145 L 218 145 L 218 2 L 172.9869689941406 2 L 2 2 M 0 0 L 172.9869689941406 0 L 220 0 L 220 147 L 0 147 L 0 0 Z",
							stroke: "none",
							fill: "#01579b"
						})]
					}),
					/* @__PURE__ */ B("g", {
						id: "Rectangle_257",
						"data-name": "Rectangle 257",
						transform: "translate(40 39)",
						fill: "#fff",
						stroke: "#01579b",
						strokeWidth: "2",
						children: [/* @__PURE__ */ z("rect", {
							width: "20",
							height: "147",
							stroke: "none"
						}), /* @__PURE__ */ z("rect", {
							x: "1",
							y: "1",
							width: "18",
							height: "145",
							fill: "none"
						})]
					}),
					/* @__PURE__ */ B("g", {
						id: "Group_688",
						"data-name": "Group 688",
						transform: "translate(-27.5 -126)",
						children: [/* @__PURE__ */ z("circle", {
							id: "teal_circle",
							"data-name": "teal circle",
							cx: "7.5",
							cy: "7.5",
							r: "7.5",
							transform: "translate(70 171)",
							fill: "#009688"
						}), /* @__PURE__ */ B("g", {
							id: "Group_333",
							"data-name": "Group 333",
							transform: "translate(70 171)",
							opacity: "0.12",
							children: [/* @__PURE__ */ z("path", {
								id: "gradient_border_2",
								"data-name": "gradient border 2",
								d: "M3408,959.089A4.911,4.911,0,1,1,3403.09,964a4.911,4.911,0,0,1,4.911-4.911m0-.089a5,5,0,1,0,5,5,5,5,0,0,0-5-5Z",
								transform: "translate(-3403 -959)",
								fill: "url(#linear-gradient)"
							}), /* @__PURE__ */ z("path", {
								id: "gradient_border_1",
								"data-name": "gradient border 1",
								d: "M3408,959.089A4.911,4.911,0,1,1,3403.09,964a4.911,4.911,0,0,1,4.911-4.911m0-.089a5,5,0,1,0,5,5,5,5,0,0,0-5-5Z",
								transform: "translate(-3403 -959)",
								fill: "url(#linear-gradient-2)"
							})]
						})]
					}),
					/* @__PURE__ */ B("g", {
						id: "Rectangle_270",
						"data-name": "Rectangle 270",
						transform: "translate(60 40.647)",
						fill: "#88c6c3",
						stroke: "#707070",
						strokeWidth: "1",
						opacity: "0.747",
						children: [/* @__PURE__ */ z("rect", {
							width: "99",
							height: "72",
							stroke: "none"
						}), /* @__PURE__ */ z("rect", {
							x: "0.5",
							y: "0.5",
							width: "98",
							height: "71",
							fill: "none"
						})]
					}),
					/* @__PURE__ */ B("g", {
						id: "Rectangle_271",
						"data-name": "Rectangle 271",
						transform: "translate(159 40.647)",
						fill: "#88c6c3",
						stroke: "#707070",
						strokeWidth: "1",
						opacity: "0.747",
						children: [/* @__PURE__ */ z("rect", {
							width: "99",
							height: "72",
							stroke: "none"
						}), /* @__PURE__ */ z("rect", {
							x: "0.5",
							y: "0.5",
							width: "98",
							height: "71",
							fill: "none"
						})]
					}),
					/* @__PURE__ */ B("g", {
						id: "Rectangle_272",
						"data-name": "Rectangle 272",
						transform: "translate(192 112.647)",
						fill: "#88c6c3",
						stroke: "#707070",
						strokeWidth: "1",
						opacity: "0.747",
						children: [/* @__PURE__ */ z("rect", {
							width: "66",
							height: "71.45",
							stroke: "none"
						}), /* @__PURE__ */ z("rect", {
							x: "0.5",
							y: "0.5",
							width: "65",
							height: "70.45",
							fill: "none"
						})]
					}),
					/* @__PURE__ */ B("g", {
						id: "Rectangle_284",
						"data-name": "Rectangle 284",
						transform: "translate(60 112.647)",
						fill: "#88c6c3",
						stroke: "#707070",
						strokeWidth: "1",
						opacity: "0.747",
						children: [/* @__PURE__ */ z("rect", {
							width: "66",
							height: "71.45",
							stroke: "none"
						}), /* @__PURE__ */ z("rect", {
							x: "0.5",
							y: "0.5",
							width: "65",
							height: "70.45",
							fill: "none"
						})]
					}),
					/* @__PURE__ */ B("g", {
						id: "Rectangle_285",
						"data-name": "Rectangle 285",
						transform: "translate(126 112.647)",
						fill: "#88c6c3",
						stroke: "#707070",
						strokeWidth: "1",
						opacity: "0.747",
						children: [/* @__PURE__ */ z("rect", {
							width: "66",
							height: "71.45",
							stroke: "none"
						}), /* @__PURE__ */ z("rect", {
							x: "0.5",
							y: "0.5",
							width: "65",
							height: "70.45",
							fill: "none"
						})]
					})
				]
			})]
		})
	});
}
//#endregion
//#region src/components/WorkspaceSelectionDialog.jsx
var iL = H("div")(() => ({
	display: "flex",
	flexDirection: "column"
}));
function aL({ container: e = null, handleClose: t, open: n = !1, children: r = null, updateWorkspace: i, workspaceType: a }) {
	let { t: o } = V(), s = Nn(), c = (e) => {
		i({ type: e }), t();
	};
	return /* @__PURE__ */ B(QF, {
		"aria-labelledby": s,
		container: e,
		onClose: t,
		open: n,
		children: [/* @__PURE__ */ z(ni, {
			id: s,
			children: o("workspaceSelectionTitle")
		}), /* @__PURE__ */ B($P, { children: [r, /* @__PURE__ */ B(Xr, {
			sx: {
				"&active": { outline: "none" },
				"&focus": { outline: "none" },
				outline: "none"
			},
			selected: a,
			autoFocusItem: !0,
			children: [/* @__PURE__ */ z(Yr, {
				sx: {
					height: "auto",
					overflow: "auto",
					whiteSpace: "inherit"
				},
				onClick: () => c("elastic"),
				selected: a === "elastic",
				value: "elastic",
				children: /* @__PURE__ */ B(Rr, {
					sx: {
						backgroundColor: "transparent",
						borderRadius: "0",
						boxShadow: "0 0 transparent",
						display: "flex"
					},
					children: [/* @__PURE__ */ z(nL, {
						sx: {
							flexShrink: 0,
							height: "90px",
							width: "120px"
						},
						viewBox: "0 0 120 90"
					}), /* @__PURE__ */ z(iL, { children: /* @__PURE__ */ B(zr, {
						sx: {
							"&.MuiCardContent-root": {
								"&:last-child": { paddingBottom: "12px" },
								paddingBottom: 0,
								paddingTop: 0,
								textAlign: "left"
							},
							flex: "1 0 auto"
						},
						children: [/* @__PURE__ */ z(Qr, {
							sx: { paddingBottom: "6px" },
							component: "p",
							variant: "h3",
							children: o("elastic")
						}), /* @__PURE__ */ z(Qr, {
							variant: "body1",
							children: o("elasticDescription")
						})]
					}) })]
				})
			}), /* @__PURE__ */ z(Yr, {
				sx: {
					height: "auto",
					overflow: "auto",
					whiteSpace: "inherit"
				},
				onClick: () => c("mosaic"),
				selected: a === "mosaic",
				value: "mosaic",
				children: /* @__PURE__ */ B(Rr, {
					sx: {
						backgroundColor: "transparent",
						borderRadius: "0",
						boxShadow: "0 0 transparent",
						display: "flex"
					},
					children: [/* @__PURE__ */ z(rL, {
						sx: {
							flexShrink: 0,
							height: "90px",
							width: "120px"
						},
						viewBox: "0 0 120 90"
					}), /* @__PURE__ */ z(iL, { children: /* @__PURE__ */ B(zr, {
						sx: {
							"&.MuiCardContent-root": {
								"&:last-child": { paddingBottom: "12px" },
								paddingBottom: 0,
								paddingTop: 0,
								textAlign: "left"
							},
							flex: "1 0 auto"
						},
						children: [/* @__PURE__ */ z(Qr, {
							sx: { paddingBottom: "6px" },
							component: "p",
							variant: "h3",
							children: o("mosaic")
						}), /* @__PURE__ */ z(Qr, {
							variant: "body1",
							children: o("mosaicDescription")
						})]
					}) })]
				})
			})]
		})] })]
	});
}
aL.propTypes = {
	children: W.default.node,
	container: W.default.object,
	handleClose: W.default.func.isRequired,
	open: W.default.bool,
	updateWorkspace: W.default.func.isRequired,
	workspaceType: W.default.string.isRequired
};
var oL = n(w((e) => ({ workspaceType: te(e) }), { updateWorkspace: Xi }), m("WorkspaceSelectionDialog"))(aL), sL = n(w((e) => ({
	selectedTheme: nt(e).selectedTheme,
	themeIds: Te(e)
}), (e, { windowId: t }) => ({ setSelectedTheme: (t) => e(Vi({ selectedTheme: t })) })), m("ChangeThemeDialog"))(eI);
//#endregion
//#region src/components/WorkspaceMenu.jsx
function cL({ handleClose: e, showThemePicker: t = !1, isWorkspaceAddVisible: n = !1, tReady: r = !1, toggleZoomControls: i = () => {}, showZoomControls: a = !1, ...o }) {
	let { t: s } = V(), c = Mn(gn), [l, u] = L(null), d = arguments[0], f = (t, n) => {
		u(t), e(n);
	}, p = () => {
		u(null);
	}, m = (t) => {
		i(!a), e(t);
	};
	return /* @__PURE__ */ B(R, { children: [
		/* @__PURE__ */ B(Mr, {
			container: c?.current,
			anchorOrigin: {
				horizontal: "right",
				vertical: "top"
			},
			transformOrigin: {
				horizontal: "left",
				vertical: "top"
			},
			onClose: e,
			...o,
			children: [
				/* @__PURE__ */ z(Xn, {
					"aria-haspopup": "true",
					"aria-expanded": l === "workspaceSelection",
					disabled: n,
					onClick: (e) => {
						m(e);
					},
					"aria-owns": l === "toggleZoom" ? "toggle-zoom-menu" : void 0,
					children: /* @__PURE__ */ z(U, {
						variant: "body1",
						children: s(a ? "hideZoomControls" : "showZoomControls")
					})
				}),
				/* @__PURE__ */ z(Xn, {
					"aria-haspopup": "true",
					onClick: (e) => {
						f("workspaceSelection", e);
					},
					"aria-owns": l === "workspaceSelection" ? "workspace-selection" : void 0,
					children: /* @__PURE__ */ z(U, {
						variant: "body1",
						children: s("selectWorkspaceMenu")
					})
				}),
				/* @__PURE__ */ z(bI, {
					label: s("language"),
					children: /* @__PURE__ */ z(tL, { afterSelect: e })
				}),
				t && /* @__PURE__ */ z(Xn, {
					"aria-haspopup": "true",
					onClick: (e) => {
						f("changeTheme", e);
					},
					"aria-owns": l === "changeTheme" ? "change-theme" : void 0,
					children: /* @__PURE__ */ z(U, {
						variant: "body1",
						children: s("changeTheme")
					})
				}),
				/* @__PURE__ */ z(cn, {
					targetName: "WorkspaceMenu",
					...d
				})
			]
		}),
		l === "changeTheme" && /* @__PURE__ */ z(sL, {
			container: c?.current,
			handleClose: p,
			open: l === "changeTheme"
		}),
		l === "workspaceSelection" && /* @__PURE__ */ z(oL, {
			open: l === "workspaceSelection",
			container: c?.current,
			handleClose: p
		})
	] });
}
cL.propTypes = {
	handleClose: W.default.func.isRequired,
	isWorkspaceAddVisible: W.default.bool,
	showThemePicker: W.default.bool,
	showZoomControls: W.default.bool,
	toggleZoomControls: W.default.func,
	tReady: W.default.bool
};
var lL = n(w((e) => ({
	isWorkspaceAddVisible: _(e).isWorkspaceAddVisible,
	showThemePicker: Te(e).length > 0,
	showZoomControls: vt(e)
}), { toggleZoomControls: Zi }), m("WorkspaceMenu"))(cL);
//#endregion
//#region src/components/WorkspaceMenuButton.jsx
function uL() {
	let { t: e } = V(), [t, n] = L(null), [r, i] = L(!1), a = Nn();
	return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(mn, {
		"aria-haspopup": "true",
		"aria-label": e("workspaceMenu"),
		"aria-owns": r ? a : void 0,
		selected: r,
		id: "menuBtn",
		onClick: (e) => {
			n(e.currentTarget), i(!0);
		},
		children: /* @__PURE__ */ z(eL, {})
	}), /* @__PURE__ */ z(lL, {
		anchorEl: t,
		id: a,
		handleClose: () => {
			n(null), i(!1);
		},
		open: r
	})] });
}
var dL = n(m("WorkspaceMenuButton"))(uL), fL = M(/*#__PURE__*/ z("path", { d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }), "MoreHorizSharp"), pL = M(/*#__PURE__*/ z("path", { d: "M21 3.01H3c-1.1 0-2 .9-2 2V9h2V4.99h18v14.03H3V15H1v4.01c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98v-14c0-1.11-.9-2-2-2M11 16l4-4-4-4v3H1v2h10z" }), "Input"), mL = M(/*#__PURE__*/ z("path", { d: "M19 12v7H5v-7H3v9h18v-9zm-6 .67 2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z" }), "SaveAltSharp"), hL = M(/*#__PURE__*/ z("path", { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }), "Close"), gL = /* @__PURE__ */ D(((e, t) => {
	t.exports = function() {
		var e = document.getSelection();
		if (!e.rangeCount) return function() {};
		for (var t = document.activeElement, n = [], r = 0; r < e.rangeCount; r++) n.push(e.getRangeAt(r));
		switch (t.tagName.toUpperCase()) {
			case "INPUT":
			case "TEXTAREA":
				t.blur();
				break;
			default: t = null;
		}
		return e.removeAllRanges(), function() {
			e.type === "Caret" && e.removeAllRanges(), e.rangeCount || n.forEach(function(t) {
				e.addRange(t);
			}), t && t.focus();
		};
	};
})), _L = /* @__PURE__ */ p((/* @__PURE__ */ D(((e, t) => {
	var n = gL(), r = {
		"text/plain": "Text",
		"text/html": "Url",
		default: "Text"
	}, i = "Copy to clipboard: #{key}, Enter";
	function a(e) {
		var t = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
		return e.replace(/#{\s*key\s*}/g, t);
	}
	function o(e, t) {
		var o, s, c, l, u, d, f = !1;
		t ||= {}, o = t.debug || !1;
		try {
			if (c = n(), l = document.createRange(), u = document.getSelection(), d = document.createElement("span"), d.textContent = e, d.ariaHidden = "true", d.style.all = "unset", d.style.position = "fixed", d.style.top = 0, d.style.clip = "rect(0, 0, 0, 0)", d.style.whiteSpace = "pre", d.style.webkitUserSelect = "text", d.style.MozUserSelect = "text", d.style.msUserSelect = "text", d.style.userSelect = "text", d.addEventListener("copy", function(n) {
				if (n.stopPropagation(), t.format) {
					if (n.preventDefault(), n.clipboardData === void 0) {
						o && console.warn("unable to use e.clipboardData"), o && console.warn("trying IE specific stuff"), window.clipboardData.clearData();
						var i = r[t.format] || r.default;
						window.clipboardData.setData(i, e);
					} else n.clipboardData.clearData(), n.clipboardData.setData(t.format, e);
				}
				t.onCopy && (n.preventDefault(), t.onCopy(n.clipboardData));
			}), document.body.appendChild(d), l.selectNodeContents(d), u.addRange(l), !document.execCommand("copy")) throw Error("copy command was unsuccessful");
			f = !0;
		} catch (n) {
			o && console.error("unable to copy using execCommand: ", n), o && console.warn("trying IE specific stuff");
			try {
				window.clipboardData.setData(t.format || "text", e), t.onCopy && t.onCopy(window.clipboardData), f = !0;
			} catch (n) {
				o && console.error("unable to copy using clipboardData: ", n), o && console.error("falling back to prompt"), s = a("message" in t ? t.message : i), window.prompt(s, e);
			}
		} finally {
			u && (typeof u.removeRange == "function" ? u.removeRange(l) : u.removeAllRanges()), d && document.body.removeChild(d), c();
		}
		return f;
	}
	t.exports = o;
})))(), 1);
function vL({ children: e = null, container: t = null, id: n = void 0, open: r = !1, handleClose: i, exportableState: a }) {
	let { t: o } = V(), [s, c] = L(!1), l = Nn(), u = In(() => JSON.stringify(a, null, 2), [a]), d = jn(() => {
		(0, _L.default)(u), c(!0);
	}, [u, c]);
	return s ? /* @__PURE__ */ z(ui, {
		anchorOrigin: {
			horizontal: "center",
			vertical: "top"
		},
		open: !0,
		autoHideDuration: 6e3,
		onClose: i,
		message: o("exportCopied"),
		action: /* @__PURE__ */ z(Kn, {
			size: "small",
			"aria-label": o("dismiss"),
			color: "inherit",
			onClick: i,
			children: /* @__PURE__ */ z(hL, { fontSize: "small" })
		})
	}) : /* @__PURE__ */ B(QF, {
		"aria-labelledby": l,
		id: n,
		container: t,
		open: r,
		onClose: i,
		scroll: "paper",
		fullWidth: !0,
		maxWidth: "sm",
		children: [
			/* @__PURE__ */ z(ni, {
				id: l,
				children: o("downloadExport")
			}),
			/* @__PURE__ */ z($r, { children: /* @__PURE__ */ B(tr, {
				slotProps: { heading: { component: "h4" } },
				elevation: 2,
				children: [/* @__PURE__ */ z(rr, {
					expandIcon: /* @__PURE__ */ z(vl, {}),
					children: /* @__PURE__ */ z(U, { children: o("viewWorkspaceConfiguration") })
				}), /* @__PURE__ */ B(nr, {
					sx: { overflow: "scroll" },
					children: [e, /* @__PURE__ */ z("pre", { children: u })]
				})]
			}) }),
			/* @__PURE__ */ B(ei, { children: [/* @__PURE__ */ z(sr, {
				onClick: i,
				children: o("cancel")
			}), /* @__PURE__ */ z(sr, {
				onClick: d,
				variant: "contained",
				color: "primary",
				children: o("copy")
			})] })
		]
	});
}
vL.propTypes = {
	children: W.default.node,
	container: W.default.object,
	exportableState: W.default.object.isRequired,
	handleClose: W.default.func.isRequired,
	id: W.default.string,
	open: W.default.bool
};
var yL = n(w((e) => ({ exportableState: qe(e) }), {}), m("WorkspaceExport"))(vL);
//#endregion
//#region src/components/WorkspaceImport.jsx
function bL({ addError: e, container: t = null, id: n = void 0, importConfig: r, classes: i = {}, handleClose: a, open: o = !1 }) {
	let { t: s } = V(), [c, l] = L(""), u = Nn();
	return /* @__PURE__ */ B(QF, {
		"aria-labelledby": u,
		container: t,
		id: n,
		onClose: a,
		open: o,
		fullWidth: !0,
		maxWidth: "sm",
		children: [
			/* @__PURE__ */ z(ni, {
				id: u,
				children: s("importWorkspace")
			}),
			/* @__PURE__ */ z($P, { children: /* @__PURE__ */ z(Zr, {
				className: i.textField,
				id: "workspace-import-input",
				multiline: !0,
				onChange: (e) => {
					e.preventDefault(), l(e.target.value);
				},
				minRows: 15,
				variant: "filled",
				sx: {
					"& .MuiInputBase-input": { fontFamily: "monospace" },
					width: "100%"
				},
				inputProps: { autoFocus: "autofocus" },
				helperText: s("importWorkspaceHint")
			}) }),
			/* @__PURE__ */ B(Hr, { children: [/* @__PURE__ */ z(sr, {
				onClick: a,
				children: s("cancel")
			}), /* @__PURE__ */ z(sr, {
				color: "primary",
				onClick: (t) => {
					try {
						r(JSON.parse(c)), a();
					} catch (t) {
						e(t.toString());
					}
				},
				variant: "contained",
				children: s("import")
			})] })
		]
	});
}
bL.propTypes = {
	addError: W.default.func.isRequired,
	classes: W.default.objectOf(W.default.string),
	container: W.default.object,
	handleClose: W.default.func.isRequired,
	id: W.default.string,
	importConfig: W.default.func.isRequired,
	open: W.default.bool
};
var xL = n(w(null, {
	addError: Ui,
	importConfig: Hi
}), m("WorkspaceImport"))(bL);
//#endregion
//#region src/components/WorkspaceOptionsMenu.jsx
function SL({ anchorEl: e = null, handleClose: t, open: n = !1, ...r }) {
	let { t: i } = V(), a = Mn(gn), [o, s] = L(null), c = Nn(), l = Nn(), u = {
		anchorEl: e,
		container: a,
		handleClose: t,
		open: n,
		t: i,
		...r
	}, d = (e) => {
		s(e), t();
	}, f = () => {
		s(null);
	};
	return /* @__PURE__ */ B(R, { children: [
		/* @__PURE__ */ B(Mr, {
			id: "workspace-options-menu",
			container: a?.current,
			anchorEl: e,
			anchorOrigin: {
				horizontal: "right",
				vertical: "top"
			},
			transformOrigin: {
				horizontal: "left",
				vertical: "top"
			},
			open: n,
			onClose: t,
			children: [
				/* @__PURE__ */ B(Xn, {
					"aria-haspopup": "true",
					onClick: () => {
						d("exportWorkspace");
					},
					"aria-owns": o === "exportWorkspace" ? c : void 0,
					children: [/* @__PURE__ */ z(Er, { children: /* @__PURE__ */ z(mL, {}) }), /* @__PURE__ */ z(U, {
						variant: "body1",
						children: i("downloadExportWorkspace")
					})]
				}),
				/* @__PURE__ */ B(Xn, {
					"aria-haspopup": "true",
					onClick: () => {
						d("importWorkspace");
					},
					"aria-owns": o === "importWorkspace" ? l : void 0,
					children: [/* @__PURE__ */ z(Er, { children: /* @__PURE__ */ z(pL, {}) }), /* @__PURE__ */ z(U, {
						variant: "body1",
						children: i("importWorkspace")
					})]
				}),
				/* @__PURE__ */ z(cn, {
					targetName: "WorkspaceOptionsMenu",
					...u
				})
			]
		}),
		o === "exportWorkspace" && /* @__PURE__ */ z(yL, {
			id: c,
			open: o === "exportWorkspace",
			container: a?.current,
			handleClose: f
		}),
		o === "importWorkspace" && /* @__PURE__ */ z(xL, {
			id: l,
			open: o === "importWorkspace",
			container: a?.current,
			handleClose: f
		})
	] });
}
SL.propTypes = {
	anchorEl: W.default.object,
	handleClose: W.default.func.isRequired,
	open: W.default.bool
};
//#endregion
//#region src/containers/WorkspaceOptionsMenu.js
var CL = SL;
//#endregion
//#region src/components/WorkspaceOptionsButton.jsx
function wL() {
	let { t: e } = V(), [t, n] = L(null), [r, i] = L(!1);
	return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(mn, {
		"aria-label": e("workspaceOptions"),
		onClick: (e) => {
			n(e.currentTarget), i(!0);
		},
		selected: r,
		children: /* @__PURE__ */ z(fL, {})
	}), /* @__PURE__ */ z(CL, {
		anchorEl: t,
		handleClose: () => {
			n(null), i(!1);
		},
		open: r
	})] });
}
var TL = n(m("WorkspaceOptionsButton"))(wL), EL = n(w((e) => ({
	disabled: _(e).isWorkspaceAddVisible,
	windowCount: x(e).length
}), null), m("WindowListButton"))(wI);
//#endregion
//#region src/components/WorkspaceControlPanelButtons.jsx
function DL({ ...e }) {
	return /* @__PURE__ */ B(R, { children: [
		/* @__PURE__ */ z(EL, {}),
		/* @__PURE__ */ z(dL, {}),
		/* @__PURE__ */ z(TL, {}),
		/* @__PURE__ */ z(fP, {}),
		/* @__PURE__ */ z(cn, {
			targetName: "WorkspaceControlPanelButtons",
			...e
		})
	] });
}
var OL = n(m("WorkspaceControlPanelButtons"))(DL), kL = m("Branding")(XF), AL = H(Dr, {
	name: "WorkspaceControlPanel",
	slot: "root"
})(({ ownerState: e, theme: t }) => ({
	display: "flex",
	height: 64,
	padding: t.spacing(1),
	paddingBottom: 0,
	position: "relative",
	[t.breakpoints.up("sm")]: {
		height: "auto",
		width: e.variant === "wide" ? "auto" : 64
	},
	...e.variant === "wide" && { width: "auto" }
})), jL = H(Qn, {
	name: "WorkspaceControlPanel",
	slot: "toolbar"
})(({ theme: e }) => ({
	display: "flex",
	flexGrow: 1,
	justifyContent: "space-between",
	[e.breakpoints.up("sm")]: {
		flexDirection: "column",
		justifyContent: "flex-start",
		minHeight: 0
	}
})), ML = H("div", {
	name: "WorkspaceControlPanel",
	slot: "buttonArea"
})(({ theme: e }) => ({ [e.breakpoints.up("sm")]: {
	display: "flex",
	flexDirection: "column",
	gap: e.spacing(2),
	marginBottom: e.spacing(1),
	marginTop: e.spacing(1)
} })), NL = H(kL, {
	name: "WorkspaceControlPanel",
	slot: "branding"
})(({ theme: e }) => ({
	[e.breakpoints.up("xs")]: { display: "none" },
	[e.breakpoints.up("sm")]: { display: "flex" }
}));
function PL({ variant: e = "default", ...t }) {
	let { t: n } = V();
	return /* @__PURE__ */ B(AL, {
		ownerState: {
			t: n,
			variant: e,
			...t
		},
		className: (0, G.default)(j("workspace-control-panel")),
		color: "default",
		enableColorOnDark: !0,
		position: "absolute",
		component: "nav",
		"aria-label": n("workspaceNavigation"),
		children: [/* @__PURE__ */ B(jL, {
			disableGutters: !0,
			children: [/* @__PURE__ */ z($I, {}), /* @__PURE__ */ z(ML, { children: /* @__PURE__ */ z(OL, {}) })]
		}), /* @__PURE__ */ z(NL, { variant: e })]
	});
}
PL.propTypes = { variant: W.default.oneOf(["default", "wide"]) };
var FL = n(m("WorkspaceControlPanel"))(PL), IL = n(w((e) => ({
	allowNewWindows: nt(e).workspace.allowNewWindows,
	maximizedWindowIds: ht(e),
	windowIds: x(e),
	workspaceId: _(e).id,
	workspaceType: te(e)
}), { addWindow: en }), m("Workspace"))(HI), LL = n(w((e) => ({ catalog: T(e) }), {
	addResource: va,
	setWorkspaceAddVisibility: $i
}), m("WorkspaceAdd"))(JI), RL = m("BackgroundPluginArea")(JF), zL = H("div", {
	name: "WorkspaceArea",
	slot: "root"
})(({ theme: e }) => ({
	background: zn(e.palette.shades.light, .1),
	...e.applyStyles("dark", { background: Bn(e.palette.shades.light, .1) }),
	bottom: 0,
	display: "flex",
	flexDirection: "column",
	left: 0,
	position: "absolute",
	right: 0,
	top: 0,
	[e.breakpoints.up("sm")]: { flexDirection: "row" }
})), BL = H("main", {
	name: "WorkspaceArea",
	slot: "viewer"
})(() => ({
	flexGrow: 1,
	position: "relative"
}));
function VL({ areaRef: e = null, controlPanelVariant: t = void 0, isWorkspaceAddVisible: n = !1, isWorkspaceControlPanelVisible: r, lang: i = void 0 }) {
	let { t: a } = V(), o = arguments[0];
	return /* @__PURE__ */ B(zL, {
		ownerState: o,
		children: [r && /* @__PURE__ */ z(FL, { variant: t }), /* @__PURE__ */ B(BL, {
			className: j("viewer"),
			lang: i,
			"aria-label": a("workspace"),
			...e ? { ref: e } : {},
			children: [
				z(n ? LL : IL, {}),
				/* @__PURE__ */ z(QI, {}),
				/* @__PURE__ */ z(RL, {})
			]
		})]
	});
}
VL.propTypes = {
	areaRef: W.default.shape({ current: W.default.instanceOf(Element) }),
	controlPanelVariant: W.default.string,
	isWorkspaceAddVisible: W.default.bool,
	isWorkspaceControlPanelVisible: W.default.bool.isRequired,
	lang: W.default.string
};
//#endregion
//#region src/containers/WorkspaceArea.js
var HL = /* @__PURE__ */ d({ default: () => UL }), UL = n(w((e) => ({
	controlPanelVariant: _(e).isWorkspaceAddVisible || x(e).length > 0 ? void 0 : "wide",
	isWorkspaceAddVisible: _(e).isWorkspaceAddVisible,
	isWorkspaceControlPanelVisible: nt(e).workspaceControlPanel.enabled,
	lang: nt(e).language
})), m("WorkspaceArea"))(VL);
//#endregion
export { oI as $, Fl as $n, Qi as $r, YN as $t, tL as A, Wf as An, va as Ar, WP as At, LI as B, af as Bn, ra as Br, _P as Bt, lL as C, Ci, Db as Cn, Cs as Cr, mF as Ct, aL as D, Jf as Dn, Ja as Dr, QP as Dt, oL as E, fi as Ei, Yf as En, Ya as Er, $P as Et, GI as F, Tf as Fn, pa as Fr, PP as Ft, xI as G, Jl as Gn, ca as Gr, cP as Gt, kI as H, tf as Hn, sa as Hr, pP as Ht, WI as I, wf as In, ma as Ir, jP as It, gI as J, Ul as Jn, ta as Jr, tP as Jt, bI as K, ql as Kn, ia as Kr, sP as Kt, HI as L, gf as Ln, da as Lr, EP as Lt, QI as M, zf as Mn, _a as Mr, HP as Mt, ZI as N, kf as Nn, ha as Nr, VP as Nt, rL as O, qf as On, qa as Or, YP as Ot, JI as P, Of as Pn, fa as Pr, FP as Pt, cI as Q, Il as Qn, Xi as Qr, XN as Qt, zI as R, hf as Rn, ga as Rr, SP as Rt, uL as S, wi as Si, Ob as Sn, Ts as Sr, hF as St, sL as T, bi as Ti, Tb as Tn, Qa as Tr, iF as Tt, wI as U, xu as Un, aa as Ur, fP as Ut, jI as V, nf as Vn, oa as Vr, mP as Vt, CI as W, q as Wn, la as Wr, dP as Wt, uI as X, Vl as Xn, na as Xr, QN as Xt, dI as Y, Hl as Yn, ea as Yr, $N as Yt, lI as Z, Ll as Zn, Zi as Zr, ZN as Zt, xL as _, ki as _i, Fb as _n, pl as _r, SF as _t, LL as a, Ui as ai, BN as an, Dl as ar, XF as at, vL as b, ji as bi, Ab as bn, ks as br, vF as bt, PL as c, Hi as ci, NN as cn, Cl as cr, qF as ct, DL as d, Ni as di, Lw as dn, bl as dr, BF as dt, Ji as ei, JN as en, Pl as er, aI as et, EL as f, Pi as fi, Iw as fn, yl as fr, zF as ft, SL as g, Fi as gi, Ib as gn, ml as gr, EF as gt, CL as h, Li as hi, MS as hn, hl as hr, DF as ht, RL as i, Gi as ii, VN as in, Ol as ir, QF as it, $I as j, Uf as jn, ya as jr, UP as jt, nL as k, Kf as kn, Ka as kr, JP as kt, kL as l, Bi as li, MN as ln, Sl as lr, WF as lt, wL as m, Ii as mi, VC as mn, gl as mr, OF as mt, HL as n, qi as ni, GN as nn, jl as nr, tI as nt, IL as o, Wi as oi, LN as on, El as or, YF as ot, TL as p, Ri as pi, Fw as pn, _l as pr, kF as pt, _I as q, Wl as qn, $i as qr, nP as qt, VL as r, Yi as ri, WN as rn, kl as rr, eI as rt, FL as s, zi as si, IN as sn, wl as sr, JF as st, UL as t, Ki as ti, qN as tn, Ml as tr, rI as tt, OL as u, Vi as ui, Rw as un, xl as ur, UF as ut, bL as v, Ai as vi, Pb as vn, js as vr, xF as vt, cL as w, Ti as wi, Eb as wn, $a as wr, aF as wt, dL as x, Ei as xi, kb as xn, Es as xr, _F as xt, yL as y, Oi as yi, Nb as yn, As as yr, bF as yt, RI as z, of as zn, ua as zr, vP as zt };

//# sourceMappingURL=WorkspaceArea-CfrM6r51.js.map