From 8ca2d15691eda9d9c0e8c2e6e7948a4c05e51236 Mon Sep 17 00:00:00 2001 From: JP Cen Date: Sat, 20 Apr 2024 03:05:35 -0400 Subject: [PATCH] 0.9.14 --- main.js | 3558 +++++++++++++++++++++++++++---------------------- manifest.json | 2 +- styles.css | 31 +- 3 files changed, 1996 insertions(+), 1595 deletions(-) diff --git a/main.js b/main.js index 167d71c..100f4a7 100644 --- a/main.js +++ b/main.js @@ -28581,7 +28581,7 @@ function iterateTreeInSelection(selection2, state, iterateFns) { } // src/adapters/obsidian/ui/editors/markdownView/flowEditor/flowEditor.tsx -var import_react170 = __toESM(require_react()); +var import_react172 = __toESM(require_react()); // src/adapters/obsidian/ui/editors/markdownView/flowEditor/flowStateFields.ts var import_state2 = require("@codemirror/state"); @@ -28989,6 +28989,10 @@ var T = class { }, properties: { defaultField: "Name", + audio: { + label: "Audio", + description: "Audio" + }, text: { label: "Text", description: "Text field" @@ -29080,6 +29084,7 @@ var T = class { spaceContext: "Context", spaceLists: "Lists", spaceActions: "Actions", + spaceTemplates: "Templates", smartSearch: "Smart Search", filesAndFolders: "Files and Folders" }, @@ -29227,7 +29232,8 @@ var T = class { duplicatePropertyName: "Duplicate Property Name", newSpaceName: "Enter a name for your space", duplicateSpaceName: "Space name already exists", - cantConvertNoteToSpace: "The view is not a note" + cantConvertNoteToSpace: "The view is not a note", + templateSaved: "Template saved to space: " }, settings: { layoutVertical: "Vertical", @@ -31614,7 +31620,7 @@ var parseMDBValue = (type, value) => { return parseFloat(value); } else if (type == "boolean") { return value == "true"; - } else if (type.includes("multi")) { + } else if (type.includes("-multi")) { return parseMultiString(value).map( (f2) => parseMDBValue(type.replace("-multi", ""), f2) ); @@ -31641,14 +31647,14 @@ var propertyIsObjectType = (property) => { }; // src/utils/serializers.ts -var serializeMultiDisplayString = (value) => value.join(", "); -var serializeMultiString = (value) => value.join(","); +var serializeMultiDisplayString = (value) => value.map((f2) => f2.replace(",", "\\,")).join(", "); +var serializeMultiString = (value) => value.map((f2) => f2.replace(",", "\\,")).join(", "); var serializeSQLValues = (value) => value.join(", "); var serializeSQLStatements = (value) => value.join("; "); var serializeSQLFieldNames = (value) => value.join(","); // src/utils/parsers.ts -var parseMultiString = (str) => str?.match(/(\\.|[^,])+/g) ?? []; +var parseMultiString = (str) => (str?.replace("\\,", ",").match(/(\\.|[^,])+/g) ?? []).map((f2) => f2.trim()); var parseProperty = (field, value) => { const YAMLtype = detectPropertyType(value, field); switch (YAMLtype) { @@ -31742,6 +31748,11 @@ var parseLinkString = (string3) => { }; // src/core/utils/strings.ts +var defaultString = (value, string3) => { + if (!value || value.length == 0) + return string3; + return value; +}; function ensureArray(value) { if (Array.isArray(value)) { return value; @@ -31808,7 +31819,7 @@ var removeQuotes = (s4) => { return s4.replace(/\\"/g, '"'); } }; -var initiateString = (s4, defaultString) => !s4 || s4.length == 0 ? defaultString : s4; +var initiateString = (s4, defaultString2) => !s4 || s4.length == 0 ? defaultString2 : s4; var removeLeadingSlash = (path) => path.charAt(0) == "/" ? path.substring(1) : path; var pathToParentPath = (path) => removeLeadingSlash(path.substring(0, path.lastIndexOf("/"))) || path; @@ -32040,6 +32051,14 @@ var SpaceManager = class { if (this.superstate.spacesIndex.has(source)) return source + path.slice(1); return source.slice(0, source.lastIndexOf("/")) + path.slice(1); + } else if (path.indexOf("../") == 0 && source) { + const sourceParts = source.split("/"); + const pathParts = path.split("/"); + while (pathParts[0] === "..") { + sourceParts.pop(); + pathParts.shift(); + } + return [...sourceParts, ...pathParts].join("/"); } if (this.superstate.spacesIndex.has(path)) return path; @@ -32091,6 +32110,9 @@ var SpaceManager = class { async tablesForSpace(path) { return this.primarySpaceAdapter.tablesForSpace(path); } + spaceInitiated(path) { + return this.primarySpaceAdapter.spaceInitiated(path); + } readTable(path, schema) { return this.primarySpaceAdapter.readTable(path, schema); } @@ -32253,6 +32275,15 @@ var SpaceManager = class { this.superstate.dispatchEvent("superstateUpdated", null); return this.primarySpaceAdapter.saveWaypoints(waypoints); } + readTemplates(path) { + return this.primarySpaceAdapter.readTemplates(path); + } + saveTemplate(path, space2) { + return this.primarySpaceAdapter.saveTemplate(path, space2).then((f2) => this.superstate.reloadSpace(this.spaceInfoForPath(space2), null, true)); + } + deleteTemplate(path, space2) { + return this.primarySpaceAdapter.deleteTemplate(path, space2).then((f2) => this.superstate.reloadSpace(this.spaceInfoForPath(space2), null, true)); + } }; // src/core/react/components/UI/Modals/InputModal.tsx @@ -37653,6 +37684,8 @@ var UIManager2 = class { return this.mainFrame.allStickers(); } getUIPath(path) { + if (!path) + return null; return this.mainFrame.getUIPath(path); } dragStarted(e4, paths) { @@ -42898,9 +42931,10 @@ var generateCodeForProp = (value, isClosure) => { return func; }; var buildExecutable = (root) => { - const treeNode = { ...root, execActions: {}, execProps: {}, execStyles: {}, execPropsOptions: [] }; + const treeNode = { ...root, execActions: {}, execProps: {}, execStyles: {}, execPropsOptions: {} }; const { sortedKeys, dependencies: dependencies314 } = sortKeysByDependencies(treeNode.node.props, `${treeNode.id}.props`); - treeNode.execPropsOptions = sortedKeys.map((f2) => { + const { sortedKeys: _17, dependencies: styleDependencies } = sortKeysByDependencies(treeNode.node.styles, `${treeNode.id}.styles`); + treeNode.execPropsOptions.props = sortedKeys.map((f2) => { return { name: f2, isConst: stringIsConst(treeNode.node.props[f2]), @@ -42913,8 +42947,15 @@ var buildExecutable = (root) => { treeNode.children = treeNode.children.map( (child) => buildExecutable(child) ); + treeNode.execPropsOptions.children = [...treeNode.children.flatMap((f2) => f2.execPropsOptions.children), ...treeNode.children.map((f2) => f2.id)]; + const nodeDependencies = [ + ...treeNode.children.flatMap((f2) => f2.execPropsOptions.deps), + ...treeNode.execPropsOptions.props.flatMap((f2) => f2.deps), + ...[...styleDependencies.values()].flat() + ]; + treeNode.execPropsOptions.deps = nodeDependencies.filter((f2) => f2[0] != treeNode.id); if (treeNode.node.type == "list") { - treeNode.template = treeNode.children; + treeNode.execPropsOptions.template = treeNode.children; } return treeNode; }; @@ -45011,6 +45052,27 @@ var imageNode = { } } }; +var audioNode = { + def: { + id: "text", + icon: "ui//audio" + }, + node: { + icon: "ui//audio", + schemaId: "audio", + parentId: "", + name: i18n_default.properties.audio.label, + rank: 0, + id: "audio", + type: "audio", + props: { + value: "" + }, + types: { + value: "audio" + } + } +}; var textNode = { def: { id: "text", @@ -45834,6 +45896,13 @@ var toggleWaypoint = (superstate, spacePath, remove, rank) => { } superstate.saveSettings(); }; +var saveSpaceTemplate = async (superstate, path, space2) => { + const spaceCache = superstate.spacesIndex.get(space2); + if (!spaceCache) + return; + await superstate.spaceManager.saveTemplate(path, spaceCache.path); + superstate.ui.notify(i18n_default.notice.templateSaved + spaceCache.name); +}; var removePathsFromSpace = async (superstate, spacePath, paths) => { const space2 = superstate.spacesIndex.get(spacePath); if (!space2) @@ -45850,6 +45919,11 @@ var removePathsFromSpace = async (superstate, spacePath, paths) => { await saveSpaceMetadataValue(superstate, space2.path, "links", space2.metadata.links.filter((f2) => !paths.some((g) => g == f2))); } }; +var newTemplateInSpace = async (superstate, space2, name317) => { + const newPath = await superstate.spaceManager.copyPath(`${space2.path}/.space/templates/${name317}`, space2.path); + if (newPath) + superstate.ui.openPath(newPath, false); +}; var newPathInSpace = async (superstate, space2, type, name317, dontOpen, content3) => { let newPath; if (space2.type == "tag") { @@ -46172,6 +46246,7 @@ function hexToRgb(hex) { } var colors = [ ["Red", "var(--mk-color-red)"], + ["Pink", "var(--mk-color-pink)"], ["Orange", "var(--mk-color-orange)"], ["Yellow", "var(--mk-color-yellow)"], ["Green", "var(--mk-color-green)"], @@ -46179,7 +46254,9 @@ var colors = [ ["Teal", "var(--mk-color-teal)"], ["Blue", "var(--mk-color-blue)"], ["Purple", "var(--mk-color-purple)"], - ["Charcoal", "var(--mk-color-charcoal)"] + ["Brown", "var(--mk-color-brown)"], + ["Charcoal", "var(--mk-color-charcoal)"], + ["Gray", "var(--mk-color-gray)"] ]; var colorsBase = [ ["Base 0", "var(--mk-color-base-0)"], @@ -46540,6 +46617,13 @@ var showPathContextMenu = (superstate, path, space2, rect, anchor, triggerRename convertPathToSpace(superstate, path, false); } }); + menuOptions.push({ + name: "Save as Template", + icon: "ui//clipboard-add", + onClick: (e4) => { + saveSpaceTemplate(superstate, path, space2); + } + }); if (space2 && space2 != cache2.parent) { const spaceCache = superstate.spacesIndex.get(space2); if (spaceCache) { @@ -84804,9 +84888,9 @@ var prop = (args, math, scope) => { const type = scope.get("$properties")?.[res[0]]?.type; if (type == "file" || type == "link" || type == "context") { if (type.includes("multi")) { - value = parseMultiString(value).map((f2) => scope.get("$paths").get(f2)); + value = parseMultiString(value).map((f2) => scope.get("$paths").get(f2) ?? f2); } else { - value = scope.get("$paths").get(value); + value = scope.get("$paths").get(value) ?? value; } } return value ?? ""; @@ -84824,7 +84908,7 @@ var ifs = (args, math, scope) => { return args[args.length - 1].compile().evaluate(scope); }; ifs.rawArgs = true; -var format5 = (args, math, scope) => { +var formatDateString = (args, math, scope) => { if (args.length < 1 || args.length > 2) { return ""; } @@ -84838,10 +84922,26 @@ var format5 = (args, math, scope) => { } return format(date, scope.get("$settings")?.dateFormat ?? "yyyy-MM-dd"); }; -format5.rawArgs = true; +formatDateString.rawArgs = true; +var format5 = (arg) => { + if (typeof arg === "string" || arg instanceof String) { + return arg; + } + if (arg instanceof Date) { + return format(arg, "yyyy-MM-dd"); + } + if (typeof arg === "number") { + return arg.toFixed(2); + } + if (arg.path) { + return arg.path; + } + return ""; +}; var formulas = { "prop": prop, "slice": (str, start, end) => { + str = format5(str); return str.slice(start, end); }, "if": (condition, ifTrue, ifFalse) => { @@ -84856,44 +84956,47 @@ var formulas = { }, "length": (arg) => arg.length, "substring": (str, start, end) => { + str = format5(str); if (!end) { return str.substring(start); } return str.substring(start, end); }, "contains": (str, subStr) => { + str = format5(str); + subStr = format5(subStr); return str.includes(subStr); }, "test": (str, regex) => { + str = format5(str); return new RegExp(regex).test(str); }, "match": (str, regex) => { + str = format5(str); return str.match(new RegExp(regex)); }, "replace": (str, search2, replace) => { + str = format5(str); return str.replace(new RegExp(search2), replace); }, "replaceAll": (str, search2, replace) => { + str = format5(str); + search2 = format5(search2); + replace = format5(replace); return str.replace(new RegExp(search2, "g"), replace); }, "lower": (str) => { + str = format5(str); return str.toLowerCase(); }, "upper": (str) => { + str = format5(str); return str.toUpperCase(); }, "repeat": (str, times) => { return str.repeat(times); }, - "format": (arg) => { - if (arg instanceof Date) { - return format(arg, "yyyy-MM-dd"); - } - if (typeof arg === "number") { - return arg.toFixed(2); - } - return arg; - }, + "format": format5, "toNumber": (arg) => { if (arg instanceof Date) { return arg.getTime(); @@ -84990,10 +85093,13 @@ var formulas = { return Math.round(diffMs / msPerDay); } }, + "style": (str, style) => { + return str; + }, "timeStamp": (date) => { return date.getTime(); }, - "formatDate": format5, + "formatDate": formatDateString, "parseDate": (str) => { if (str?.length > 0) return new Date(str) ?? ""; @@ -85072,7 +85178,21 @@ var API = class { } }; this.properties = { - sticker: (property) => stickerForField(property) + color: (property, value) => { + if (property?.type?.includes("option")) { + const fields = parseFieldValue(property.value, property.type); + const option = fields.options?.find((f2) => f2.value == value); + if (option?.color.length > 0) + return option.color; + } + return "var(--mk-ui-background-contrast)"; + }, + sticker: (property) => stickerForField(property), + value: (type, value) => { + if (!type) + return value; + return parseMDBValue(type, value); + } }; this.path = { label: (path) => { @@ -85326,13 +85446,15 @@ var waypointsSpace = { name: i18n_default.menu.waypoints, path: "spaces://$waypoints", space: null, - type: "default" + type: "default", + templates: [] }; var tagsSpace = { name: i18n_default.menu.tags, path: "spaces://$tags", space: null, - type: "default" + type: "default", + templates: [] }; var waypointsPath = { name: i18n_default.menu.waypoints, @@ -85871,72 +85993,133 @@ var fieldNode = { props: { type: "", value: "", - sticker: "" + sticker: "", + property: "" }, types: { value: "text", type: "text", - sticker: "text" + sticker: "text", + property: "object" }, styles: { - "--font-text-size": `'14px'` + "--font-text-size": `'14px'`, + fontSize: `'14px'`, + hidden: `$root.props.value?.length == 0` } }, - children: [frameRootWithProps({ ...groupNode, children: [ - frameRootWithProps(iconNode, { - value: `$root.props.sticker` - }, { - width: `'18px'`, - height: `'18px'`, - color: `'var(--mk-ui-text-tertiary)'` + children: [ + frameRootWithProps({ ...groupNode, children: [ + frameRootWithProps( + textNode, + { + value: `$root.props.value` + }, + { + padding: `'4px 8px'`, + borderRadius: `'4px'`, + background: `$api.properties.color($root.props.property, $root.props.value)`, + hidden: `$root.props.type != 'option'` + } + ), + frameRootWithProps( + textNode, + { + value: `$root.props.value` + }, + { + hidden: `$root.props.type == 'text' || $root.props.type != 'number' && $root.props.type != 'fileprop'` + } + ), + frameRootWithProps( + { ...groupNode, children: [ + frameRootWithProps(iconNode, { value: `'ui//check'` }, { background: `'var(--mk-ui-active)'`, "width": `'16px'`, height: `'16px'` }), + frameRootWithProps(textNode, { value: `$root.props.property?.name` }) + ] }, + {}, + { + layout: `'row'`, + gap: `'4px'`, + layoutAlign: `'w'`, + height: `'auto'`, + hidden: `$root.props.type != 'boolean'` + } + ), + frameRootWithProps( + imageNode, + { + value: `$root.props.value` + }, + { + width: `'50px'`, + height: `'50px'`, + hidden: `$root.props.type != 'image'` + } + ), + frameRootWithProps( + iconNode, + { + value: `$root.props.value` + }, + { + hidden: `$root.props.type != 'icon'` + } + ), + frameRootWithProps( + flowNode, + { + value: `$root.props.value` + }, + { + hidden: `$root.props.type != 'link' && $root.props.type != 'file' && $root.props.type != 'context'`, + padding: `'0px'` + } + ) + ] }, {}, { + layout: `'row'`, + layoutAlign: `'w'`, + height: `'auto'`, + gap: `'8px'`, + minHeight: `'24px'`, + hidden: `!($root.props.value?.length > 0) || $root.props.type?.contains('multi')` }), frameRootWithProps( - textNode, - { - value: `$root.props.value` - }, - { - hidden: `$root.props.type != 'text' && $root.props.type != 'date' && !$root.props.type?.includes('option')` - } - ), - frameRootWithProps( - imageNode, - { - value: `$root.props.value` - }, - { - width: `'50px'`, - height: `'50px'`, - hidden: `$root.props.type != 'image'` - } - ), - frameRootWithProps( - iconNode, - { - value: `$root.props.value` - }, - { - hidden: `$root.props.type != 'icon'` - } - ), - frameRootWithProps( - flowNode, - { - value: `$root.props.value` - }, + { ...listNode, children: [ + frameRootWithProps({ ...listItemNode, children: [ + frameRootWithProps( + textNode, + { + value: `listItem.props.value` + }, + { + padding: `'4px 8px'`, + borderRadius: `'4px'`, + background: `$api.properties.color($root.props.property, listItem.props.value)`, + hidden: `$root.props.type != 'option-multi' && $root.props.type != 'tags'` + } + ), + frameRootWithProps( + flowNode, + { + value: `listItem.props.value` + }, + { + hidden: `$root.props.type != 'link-multi' && $root.props.type != 'context-multi'`, + padding: `'0px'` + } + ) + ] }, {}) + ] }, + { value: `$api.properties.value($root.props.type, $root.props.value)` }, { - hidden: `$root.props.type != 'file' && $root.props.type != 'context'`, - padding: `'0px'` + layout: `'row'`, + columnGap: `'8px'`, + flexWrap: `'wrap'`, + rowGap: `'4px'`, + hidden: `!$root.props.type?.includes('multi')` } ) - ] }, {}, { - layout: `'row'`, - layoutAlign: `'w'`, - height: `'auto'`, - gap: `'8px'`, - minHeight: `'24px'`, - hidden: `!($root.props.value?.length > 0)` - })] + ] }; var previewNode = { id: "preview", @@ -86201,7 +86384,8 @@ var toggleNode = { }, styles: { width: `'16px'`, - height: `'16px'` + height: `'16px'`, + transform: `'rotate(0deg)'` }, actions: { onClick: `$saveState({ toggle: {props: { value: !toggle.props.value }} })` @@ -86452,8 +86636,9 @@ var dateGroup = { layout: `'column'`, background: `'var(--mk-ui-background-variant)'`, padding: `'6px'`, - height: `'200px'`, - overflowY: `'scroll'` + height: `'150px'`, + overflow: `'hidden'`, + width: `'100%'` }, id: "$root", schemaId: "$root", @@ -86468,7 +86653,7 @@ var dateGroup = { value: `$api.date.component($api.date.parse($root.props['_groupValue']), 'day')` }, { - padding: `'8px'`, + padding: `'4px'`, "--font-text-weight": `'bold'` } ), @@ -86639,11 +86824,13 @@ var fieldsView = { kitWithProps(fieldNode, { sticker: `$api.properties.sticker(listItem.props.value)`, type: "listItem.props.value.type", - value: "$contexts[listItem.props.value.table.length > 0 ? listItem.props.value.table : $contexts.$context._path]?.[listItem.props.value.name]" + value: "$contexts[listItem.props.value.table.length > 0 ? listItem.props.value.table : $contexts.$context._path]?.[listItem.props.value.name]", + property: "listItem.props.value" }) ] }, {}, { layout: `'row'`, - gap: `'8px'` + gap: `'8px'`, + hidden: "!($contexts[listItem.props.value.table.length > 0 ? listItem.props.value.table : $contexts.$context._path]?.[listItem.props.value.name].length > 0)" }) ] }, { value: `$contexts.$context._properties.filter(f => f.primary != 'true')` @@ -86856,19 +87043,30 @@ var cardsListItem = { } ), frameRootWithProps( - iconNode, - { - value: `$api.path.label($contexts.$context['_keyValue'])?.sticker` - }, + { ...groupNode, children: [ + frameRootWithProps( + iconNode, + { + value: `$api.path.label($contexts.$context['_keyValue'])?.sticker` + }, + { + width: `'32px'`, + height: `'32px'`, + padding: `'4px'`, + "--icon-size": `'24px'`, + borderRadius: `'4px'`, + background: `$api.path.label($contexts.$context['_keyValue'])?.color` + } + ) + ] }, + {}, { width: `'32px'`, height: `'32px'`, - "--icon-size": `'24px'`, - borderRadius: `$root.props.radius`, - background: `$api.path.label($contexts.$context['_keyValue'])?.color`, - padding: `'4px'`, marginTop: `'-16px'`, - marginLeft: `'4px'` + marginLeft: `'4px'`, + borderRadius: `'4px'`, + background: `'var(--mk-ui-background-contrast)'` } ), { @@ -87650,10 +87848,32 @@ var runActionTree = async (superstate, actionTree, instance) => { // src/core/utils/frames/runner.ts var executeTreeNode = async (_treeNode, store, executionContext) => { const treeNode = _treeNode; + if (store.prevState[treeNode.id] && treeNode.node.type != "content") { + let skipped = false; + if (treeNode.node.type == "slides" || treeNode.node.type == "slide" || treeNode.node.type == "delta") { + skipped = false; + } else { + const childDepCheck = (treeNode.execPropsOptions.children ?? []).some((f2) => Object.keys(store.newState).includes(f2)); + const sameProps = Object.keys(store.newState[treeNode.id]?.props ?? {}).every((f2) => store.newState[treeNode.id]?.props[f2] == store.prevState[treeNode.id]?.props[f2]); + const sameStyles = Object.keys(store.newState[treeNode.id]?.styles ?? {}).every((f2) => store.newState[treeNode.id]?.styles[f2] == store.prevState[treeNode.id]?.styles[f2]); + const sameDepValues = treeNode.execPropsOptions.deps.every((f2) => { + if (f2[0] == "$api") + return true; + if (store.newState[f2[0]]?.[f2[1]]?.[f2[2]] === void 0) + return true; + return store.newState[f2[0]]?.[f2[1]]?.[f2[2]] === store.prevState[f2[0]]?.[f2[1]]?.[f2[2]]; + }); + if (sameProps && sameStyles && sameDepValues && !childDepCheck) { + skipped = true; + } + } + if (skipped) + return { id: executionContext.runID, root: executionContext.root, exec: treeNode, state: store.state, slides: store.slides, newState: store.newState, prevState: store.prevState }; + } let execState = await executeNode(treeNode, store, executionContext.contexts, executionContext.api); if (treeNode.node.type == "list") { let uid = 0; - treeNode.children = ensureArray(execState.state[treeNode.id].props.value).flatMap((f2, i3) => treeNode.template.map((n3) => { + treeNode.children = ensureArray(execState.state[treeNode.id].props.value).flatMap((f2, i3) => treeNode.execPropsOptions.template.map((n3) => { const [tree, m4] = linkTreeNodes({ ...n3, node: { ...n3.node, props: { ...n3.node.props, value: `${treeNode.id}.props.value[${i3}]` } } }, uid); uid = m4; return buildExecutable(tree); @@ -87665,7 +87885,7 @@ var executeTreeNode = async (_treeNode, store, executionContext) => { null, execState, (s4) => { - executionContext.saveState(s4, { state: execState.state, slides: execState.slides, root: executionContext.root, id: executionContext.runID }); + executionContext.saveState(s4, { state: execState.state, slides: execState.slides, root: executionContext.root, exec: executionContext.exec, id: executionContext.runID }); }, executionContext.api ); @@ -87675,7 +87895,7 @@ var executeTreeNode = async (_treeNode, store, executionContext) => { ...treeNode.children.filter((b2) => b2.node.type != "slides") ]; for (let i3 = 0; i3 < treeNode.children.length; i3++) { - const [newState, newNode2] = await executeTreeNode(treeNode.children[i3], execState, executionContext).then((f2) => [{ state: f2.state, newState: f2.newState, slides: f2.slides }, f2.root]); + const [newState, newNode2] = await executeTreeNode(treeNode.children[i3], execState, executionContext).then((f2) => [{ state: f2.state, newState: f2.newState, slides: f2.slides, prevState: f2.prevState }, f2.exec]); execState = newState; treeNode.children[i3] = newNode2; if (newNode2.node.type == "slides") { @@ -87690,23 +87910,23 @@ var executeTreeNode = async (_treeNode, store, executionContext) => { } if (currentSlide) { currentSlide.children.forEach((f2) => { - if (!execState.slides[f2.node.ref]) { - execState.slides[f2.node.ref] = { props: {}, styles: {}, actions: {} }; + if (!execState.newState[f2.node.ref]) { + execState.newState[f2.node.ref] = { props: {}, styles: {}, actions: {} }; + } + if (f2.node.ref == treeNode.id) { + execState.state[f2.node.ref].props = { ...execState.state[f2.node.ref].props, ...execState.state[f2.node.id].props }; + execState.state[f2.node.ref].styles = { ...execState.state[f2.node.ref].styles, ...execState.state[f2.node.id].styles }; + execState.state[f2.node.ref].actions = { ...execState.state[f2.node.ref].actions, ...execState.state[f2.node.id].actions }; + } else { + execState.newState[f2.node.ref].props = { ...execState.newState[f2.node.ref].props, ...execState.state[f2.node.id].props }; + execState.newState[f2.node.ref].styles = { ...execState.newState[f2.node.ref].styles, ...execState.state[f2.node.id].styles }; + execState.newState[f2.node.ref].actions = { ...execState.newState[f2.node.ref].actions, ...execState.state[f2.node.id].actions }; } - execState.slides[f2.node.ref].props = { ...execState.slides[f2.node.ref].props, ...execState.state[f2.node.id].props }; - execState.slides[f2.node.ref].styles = { ...execState.slides[f2.node.ref].styles, ...execState.state[f2.node.id].styles }; - execState.slides[f2.node.ref].actions = { ...execState.slides[f2.node.ref].actions, ...execState.state[f2.node.id].actions }; }); } } } - if (execState.slides[treeNode.id]) { - execState.state[treeNode.id].props = { ...execState.state[treeNode.id].props, ...execState.slides[treeNode.id]?.props ?? {} }; - execState.state[treeNode.id].styles = { ...execState.state[treeNode.id].styles, ...execState.slides[treeNode.id]?.styles ?? {} }; - execState.state[treeNode.id].actions = { ...execState.state[treeNode.id].actions, ...execState.slides[treeNode.id]?.actions ?? {} }; - delete execState.slides[treeNode.id]; - } - return { id: executionContext.runID, root: treeNode, state: execState.state, slides: execState.slides, newState: execState.newState }; + return { id: executionContext.runID, root: executionContext.root, exec: treeNode, state: execState.state, slides: execState.slides, newState: execState.newState, prevState: execState.prevState }; }; var executeNode = async (executable, results, contexts, api) => { const propResults = await executePropsCodeBlocks(executable, results, contexts, api); @@ -87729,7 +87949,7 @@ var executePropsCodeBlocks = async (executable, results, contexts, api) => { styles: results.state[id3]?.styles ?? {} }; environment.$contexts = contexts, environment.$api = api; - for (const { name: key2, isConst } of executable.execPropsOptions) { + for (const { name: key2, isConst } of executable.execPropsOptions.props) { try { let result; if (key2 in (results.newState?.[id3]?.["props"] || {}) && isConst) { @@ -87758,16 +87978,22 @@ var executePropsCodeBlocks = async (executable, results, contexts, api) => { return results; }; function executeCodeBlocks(node, type, codeBlockStore, results) { + const { id: id3 } = node; for (const key2 of Object.keys(codeBlockStore)) { + let result; try { - const result = codeBlockStore[key2].call(results.state); - if (result) { + if (key2 in (results.newState?.[id3]?.[type] || {})) { + result = results.newState[id3][type][key2]; + } else { + result = codeBlockStore[key2]?.call(results.state); + } + if (result !== null) { results.state[node.id][type][key2] = result; } else { delete results.state[node.id][type][key2]; } } catch (error) { - console.log(error); + console.log(error, key2); } } return results; @@ -88003,36 +88229,36 @@ function inlineWorker(scriptText, name317) { // src/core/superstate/workers/indexer.worker.ts function Worker2() { - return inlineWorker(`"use strict";var rx=Object.create;var kh=Object.defineProperty;var nx=Object.getOwnPropertyDescriptor;var ix=Object.getOwnPropertyNames;var ax=Object.getPrototypeOf,sx=Object.prototype.hasOwnProperty;var Ch=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var ox=(e,r,a,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of ix(r))!sx.call(e,l)&&l!==a&&kh(e,l,{get:()=>r[l],enumerable:!(u=nx(r,l))||u.enumerable});return e};var yf=(e,r,a)=>(a=e!=null?rx(ax(e)):{},ox(r||!e||!e.__esModule?kh(a,"default",{value:e,enumerable:!0}):a,e));var xf=Ch((ra,es)=>{(function(){var e,r="4.17.21",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",p="Invalid \`variable\` option passed into \`_.template\`",v="__lodash_hash_undefined__",C=500,T="__lodash_placeholder__",A=1,R=2,V=4,Z=1,ne=2,N=1,we=2,Ne=4,K=8,Xe=16,Re=32,it=64,tt=128,Te=256,Je=512,Ge=30,pr="...",jt=800,me=16,at=1,mt=2,Rt=3,Me=1/0,ze=9007199254740991,Wt=17976931348623157e292,xt=0/0,Pt=4294967295,mi=Pt-1,fa=Pt>>>1,hn=[["ary",tt],["bind",N],["bindKey",we],["curry",K],["curryRight",Xe],["flip",Je],["partial",Re],["partialRight",it],["rearg",Te]],H="[object Arguments]",gi="[object Array]",Ko="[object AsyncFunction]",Er="[object Boolean]",pn="[object Date]",Zo="[object DOMException]",yi="[object Error]",xi="[object Function]",hs="[object GeneratorFunction]",Yt="[object Map]",Yn="[object Number]",Xo="[object Null]",dr="[object Object]",ps="[object Promise]",Jo="[object Proxy]",mr="[object RegExp]",Ee="[object Set]",st="[object String]",dn="[object Symbol]",ds="[object Undefined]",Ve="[object WeakMap]",eu="[object WeakSet]",Dr="[object ArrayBuffer]",rt="[object DataView]",re="[object Float32Array]",Ir="[object Float64Array]",mn="[object Int8Array]",vi="[object Int16Array]",ca="[object Int32Array]",ha="[object Uint8Array]",wi="[object Uint8ClampedArray]",ct="[object Uint16Array]",_i="[object Uint32Array]",pa=/\\b__p \\+= '';/g,Si=/\\b(__p \\+=) '' \\+/g,Ae=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g,da=/&(?:amp|lt|gt|quot|#39);/g,ma=/[&<>"']/g,bi=RegExp(da.source),ga=RegExp(ma.source),ki=/<%-([\\s\\S]+?)%>/g,gn=/<%([\\s\\S]+?)%>/g,Bn=/<%=([\\s\\S]+?)%>/g,tu=/\\.|\\[(?:[^[\\]]*|(["'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,Ci=/^\\w*$/,ru=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,qr=/[\\\\^$.*+?()[\\]{}|]/g,Ti=RegExp(qr.source),Y=/^\\s+/,nu=/\\s/,iu=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,vt=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,ya=/,? & /,ke=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,Vn=/[()=,{}\\[\\]\\/\\s]/,au=/\\\\(\\\\)?/g,ot=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,Qt=/\\w*$/,Kt=/^[-+]0x[0-9a-f]+$/i,$e=/^0b[01]+$/i,Bt=/^\\[object .+?Constructor\\]$/,gr=/^0o[0-7]+$/i,Gr=/^(?:0|[1-9]\\d*)$/,su=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,Pi=/($^)/,ou=/['\\n\\r\\u2028\\u2029\\\\]/g,Le="\\\\ud800-\\\\udfff",Ei="\\\\u0300-\\\\u036f",uu="\\\\ufe20-\\\\ufe2f",ms="\\\\u20d0-\\\\u20ff",xa=Ei+uu+ms,gs="\\\\u2700-\\\\u27bf",ys="a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff",lu="\\\\xac\\\\xb1\\\\xd7\\\\xf7",fu="\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf",cu="\\\\u2000-\\\\u206f",hu=" \\\\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",va="A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde",wa="\\\\ufe0e\\\\ufe0f",xs=lu+fu+cu+hu,_a="['\\u2019]",pu="["+Le+"]",Sa="["+xs+"]",Mr="["+xa+"]",ba="\\\\d+",du="["+gs+"]",vs="["+ys+"]",yn="[^"+Le+xs+ba+gs+ys+va+"]",xn="\\\\ud83c[\\\\udffb-\\\\udfff]",ws="(?:"+Mr+"|"+xn+")",vn="[^"+Le+"]",Vt="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",ka="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",wn="["+va+"]",_s="\\\\u200d",Ss="(?:"+vs+"|"+yn+")",mu="(?:"+wn+"|"+yn+")",bs="(?:"+_a+"(?:d|ll|m|re|s|t|ve))?",ks="(?:"+_a+"(?:D|LL|M|RE|S|T|VE))?",Cs=ws+"?",Di="["+wa+"]?",gu="(?:"+_s+"(?:"+[vn,Vt,ka].join("|")+")"+Di+Cs+")*",Ts="\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])",yu="\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])",Ps=Di+Cs+gu,xu="(?:"+[du,Vt,ka].join("|")+")"+Ps,vu="(?:"+[vn+Mr+"?",Mr,Vt,ka,pu].join("|")+")",wu=RegExp(_a,"g"),_u=RegExp(Mr,"g"),Ca=RegExp(xn+"(?="+xn+")|"+vu+Ps,"g"),Su=RegExp([wn+"?"+vs+"+"+bs+"(?="+[Sa,wn,"$"].join("|")+")",mu+"+"+ks+"(?="+[Sa,wn+Ss,"$"].join("|")+")",wn+"?"+Ss+"+"+bs,wn+"+"+ks,yu,Ts,ba,xu].join("|"),"g"),bu=RegExp("["+_s+Le+xa+wa+"]"),ku=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Cu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Tu=-1,Oe={};Oe[re]=Oe[Ir]=Oe[mn]=Oe[vi]=Oe[ca]=Oe[ha]=Oe[wi]=Oe[ct]=Oe[_i]=!0,Oe[H]=Oe[gi]=Oe[Dr]=Oe[Er]=Oe[rt]=Oe[pn]=Oe[yi]=Oe[xi]=Oe[Yt]=Oe[Yn]=Oe[dr]=Oe[mr]=Oe[Ee]=Oe[st]=Oe[Ve]=!1;var De={};De[H]=De[gi]=De[Dr]=De[rt]=De[Er]=De[pn]=De[re]=De[Ir]=De[mn]=De[vi]=De[ca]=De[Yt]=De[Yn]=De[dr]=De[mr]=De[Ee]=De[st]=De[dn]=De[ha]=De[wi]=De[ct]=De[_i]=!0,De[yi]=De[xi]=De[Ve]=!1;var Pu={\\u00C0:"A",\\u00C1:"A",\\u00C2:"A",\\u00C3:"A",\\u00C4:"A",\\u00C5:"A",\\u00E0:"a",\\u00E1:"a",\\u00E2:"a",\\u00E3:"a",\\u00E4:"a",\\u00E5:"a",\\u00C7:"C",\\u00E7:"c",\\u00D0:"D",\\u00F0:"d",\\u00C8:"E",\\u00C9:"E",\\u00CA:"E",\\u00CB:"E",\\u00E8:"e",\\u00E9:"e",\\u00EA:"e",\\u00EB:"e",\\u00CC:"I",\\u00CD:"I",\\u00CE:"I",\\u00CF:"I",\\u00EC:"i",\\u00ED:"i",\\u00EE:"i",\\u00EF:"i",\\u00D1:"N",\\u00F1:"n",\\u00D2:"O",\\u00D3:"O",\\u00D4:"O",\\u00D5:"O",\\u00D6:"O",\\u00D8:"O",\\u00F2:"o",\\u00F3:"o",\\u00F4:"o",\\u00F5:"o",\\u00F6:"o",\\u00F8:"o",\\u00D9:"U",\\u00DA:"U",\\u00DB:"U",\\u00DC:"U",\\u00F9:"u",\\u00FA:"u",\\u00FB:"u",\\u00FC:"u",\\u00DD:"Y",\\u00FD:"y",\\u00FF:"y",\\u00C6:"Ae",\\u00E6:"ae",\\u00DE:"Th",\\u00FE:"th",\\u00DF:"ss",\\u0100:"A",\\u0102:"A",\\u0104:"A",\\u0101:"a",\\u0103:"a",\\u0105:"a",\\u0106:"C",\\u0108:"C",\\u010A:"C",\\u010C:"C",\\u0107:"c",\\u0109:"c",\\u010B:"c",\\u010D:"c",\\u010E:"D",\\u0110:"D",\\u010F:"d",\\u0111:"d",\\u0112:"E",\\u0114:"E",\\u0116:"E",\\u0118:"E",\\u011A:"E",\\u0113:"e",\\u0115:"e",\\u0117:"e",\\u0119:"e",\\u011B:"e",\\u011C:"G",\\u011E:"G",\\u0120:"G",\\u0122:"G",\\u011D:"g",\\u011F:"g",\\u0121:"g",\\u0123:"g",\\u0124:"H",\\u0126:"H",\\u0125:"h",\\u0127:"h",\\u0128:"I",\\u012A:"I",\\u012C:"I",\\u012E:"I",\\u0130:"I",\\u0129:"i",\\u012B:"i",\\u012D:"i",\\u012F:"i",\\u0131:"i",\\u0134:"J",\\u0135:"j",\\u0136:"K",\\u0137:"k",\\u0138:"k",\\u0139:"L",\\u013B:"L",\\u013D:"L",\\u013F:"L",\\u0141:"L",\\u013A:"l",\\u013C:"l",\\u013E:"l",\\u0140:"l",\\u0142:"l",\\u0143:"N",\\u0145:"N",\\u0147:"N",\\u014A:"N",\\u0144:"n",\\u0146:"n",\\u0148:"n",\\u014B:"n",\\u014C:"O",\\u014E:"O",\\u0150:"O",\\u014D:"o",\\u014F:"o",\\u0151:"o",\\u0154:"R",\\u0156:"R",\\u0158:"R",\\u0155:"r",\\u0157:"r",\\u0159:"r",\\u015A:"S",\\u015C:"S",\\u015E:"S",\\u0160:"S",\\u015B:"s",\\u015D:"s",\\u015F:"s",\\u0161:"s",\\u0162:"T",\\u0164:"T",\\u0166:"T",\\u0163:"t",\\u0165:"t",\\u0167:"t",\\u0168:"U",\\u016A:"U",\\u016C:"U",\\u016E:"U",\\u0170:"U",\\u0172:"U",\\u0169:"u",\\u016B:"u",\\u016D:"u",\\u016F:"u",\\u0171:"u",\\u0173:"u",\\u0174:"W",\\u0175:"w",\\u0176:"Y",\\u0177:"y",\\u0178:"Y",\\u0179:"Z",\\u017B:"Z",\\u017D:"Z",\\u017A:"z",\\u017C:"z",\\u017E:"z",\\u0132:"IJ",\\u0133:"ij",\\u0152:"Oe",\\u0153:"oe",\\u0149:"'n",\\u017F:"s"},Ta={"&":"&","<":"<",">":">",'"':""","'":"'"},Pa={"&":"&","<":"<",">":">",""":'"',"'":"'"},Eu={"\\\\":"\\\\","'":"'","\\n":"n","\\r":"r","\\u2028":"u2028","\\u2029":"u2029"},Es=parseFloat,Ds=parseInt,Is=typeof global=="object"&&global&&global.Object===Object&&global,Du=typeof self=="object"&&self&&self.Object===Object&&self,et=Is||Du||Function("return this")(),Ea=typeof ra=="object"&&ra&&!ra.nodeType&&ra,Ar=Ea&&typeof es=="object"&&es&&!es.nodeType&&es,Fe=Ar&&Ar.exports===Ea,zr=Fe&&Is.process,ut=function(){try{var b=Ar&&Ar.require&&Ar.require("util").types;return b||zr&&zr.binding&&zr.binding("util")}catch{}}(),Ms=ut&&ut.isArrayBuffer,Da=ut&&ut.isDate,As=ut&&ut.isMap,Os=ut&&ut.isRegExp,Un=ut&&ut.isSet,yr=ut&&ut.isTypedArray;function ht(b,D,P){switch(P.length){case 0:return b.call(D);case 1:return b.call(D,P[0]);case 2:return b.call(D,P[0],P[1]);case 3:return b.call(D,P[0],P[1],P[2])}return b.apply(D,P)}function Iu(b,D,P,B){for(var X=-1,ye=b==null?0:b.length;++X-1}function Ia(b,D,P){for(var B=-1,X=b==null?0:b.length;++B-1;);return P}function Bs(b,D){for(var P=b.length;P--&&_n(D,b[P],0)>-1;);return P}function Lu(b,D){for(var P=b.length,B=0;P--;)b[P]===D&&++B;return B}var Vs=Hn(Pu),Ru=Hn(Ta);function Wu(b){return"\\\\"+Eu[b]}function Yu(b,D){return b==null?e:b[D]}function Xt(b){return bu.test(b)}function Bu(b){return ku.test(b)}function Vu(b){for(var D,P=[];!(D=b.next()).done;)P.push(D.value);return P}function Wa(b){var D=-1,P=Array(b.size);return b.forEach(function(B,X){P[++D]=[X,B]}),P}function qn(b,D){return function(P){return b(D(P))}}function Ut(b,D){for(var P=-1,B=b.length,X=0,ye=[];++P-1}function ro(t,n){var s=this.__data__,f=It(s,t);return f<0?(++this.size,s.push([t,n])):s[f][1]=n,this}wr.prototype.clear=ml,wr.prototype.delete=to,wr.prototype.get=gl,wr.prototype.has=yl,wr.prototype.set=ro;function _r(t){var n=-1,s=t==null?0:t.length;for(this.clear();++n=n?t:n)),t}function _t(t,n,s,f,d,x){var w,S=n&A,k=n&R,I=n&V;if(s&&(w=d?s(t,f,d,x):s(t)),w!==e)return w;if(!Be(t))return t;var M=te(t);if(M){if(w=Md(t),!S)return Mt(t,w)}else{var O=yt(t),W=O==xi||O==hs;if(An(t))return mc(t,S);if(O==dr||O==H||W&&!d){if(w=k||W?{}:Fc(t),!S)return k?wd(t,Tl(w,t)):vd(t,Ua(w,t))}else{if(!De[O])return d?t:{};w=Ad(t,O,S)}}x||(x=new Ht);var q=x.get(t);if(q)return q;x.set(t,w),lh(t)?t.forEach(function(Q){w.add(_t(Q,n,s,Q,t,x))}):oh(t)&&t.forEach(function(Q,le){w.set(le,_t(Q,n,s,le,t,x))});var j=I?k?$l:zl:k?Ot:lt,se=M?e:j(t);return Ue(se||t,function(Q,le){se&&(le=Q,Q=t[le]),ei(w,le,_t(Q,n,s,le,t,x))}),w}function Ha(t){var n=lt(t);return function(s){return oo(s,t,n)}}function oo(t,n,s){var f=s.length;if(t==null)return!f;for(t=oe(t);f--;){var d=s[f],x=n[d],w=t[d];if(w===e&&!(d in t)||!x(w))return!1}return!0}function uo(t,n,s){if(typeof t!="function")throw new Et(l);return Xa(function(){t.apply(e,s)},n)}function St(t,n,s,f){var d=-1,x=Mi,w=!0,S=t.length,k=[],I=n.length;if(!S)return k;s&&(n=Pe(n,gt(s))),f?(x=Ia,w=!1):n.length>=a&&(x=Sn,w=!1,n=new Kr(n));e:for(;++dd?0:d+s),f=f===e||f>d?d:ie(f),f<0&&(f+=d),f=s>f?0:ch(f);s0&&s(S)?n>1?nt(S,n-1,s,f,d):Zt(d,S):f||(d[d.length]=S)}return d}var qa=_c(),co=_c(!0);function Jt(t,n){return t&&qa(t,n,lt)}function Ga(t,n){return t&&co(t,n,lt)}function er(t,n){return Or(n,function(s){return rn(t[s])})}function Xr(t,n){n=In(n,t);for(var s=0,f=n.length;t!=null&&sn}function Dl(t,n){return t!=null&&Se.call(t,n)}function Il(t,n){return t!=null&&n in oe(t)}function Ml(t,n,s){return t>=Ye(n,s)&&t=120&&M.length>=120)?new Kr(w&&M):e}M=t[0];var O=-1,W=S[0];e:for(;++O-1;)S!==t&&jr.call(S,k,1),jr.call(t,k,1);return t}function oc(t,n){for(var s=t?n.length:0,f=s-1;s--;){var d=n[s];if(s==f||d!==x){var x=d;tn(d)?jr.call(t,d,1):Yl(t,d)}}return t}function Ll(t,n){return t+jn(Js()*(n-t+1))}function ud(t,n,s,f){for(var d=-1,x=He(Bi((n-t)/(s||1)),0),w=P(x);x--;)w[f?x:++d]=t,t+=s;return w}function Rl(t,n){var s="";if(!t||n<1||n>ze)return s;do n%2&&(s+=t),n=jn(n/2),n&&(t+=t);while(n);return s}function ue(t,n){return ef(Rc(t,n,Ft),t+"")}function ld(t){return so(ta(t))}function fd(t,n){var s=ta(t);return ko(s,Zr(n,0,s.length))}function Qa(t,n,s,f){if(!Be(t))return t;n=In(n,t);for(var d=-1,x=n.length,w=x-1,S=t;S!=null&&++dd?0:d+n),s=s>d?d:s,s<0&&(s+=d),d=n>s?0:s-n>>>0,n>>>=0;for(var x=P(d);++f>>1,w=t[x];w!==null&&!Gt(w)&&(s?w<=n:w=a){var I=n?null:kd(t);if(I)return bn(I);w=!1,d=Sn,k=new Kr}else k=n?[]:S;e:for(;++f=f?t:nr(t,n,s)}var dc=Ju||function(t){return et.clearTimeout(t)};function mc(t,n){if(n)return t.slice();var s=t.length,f=zs?zs(s):new t.constructor(s);return t.copy(f),f}function Hl(t){var n=new t.constructor(t.byteLength);return new Ri(n).set(new Ri(t)),n}function md(t,n){var s=n?Hl(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.byteLength)}function gd(t){var n=new t.constructor(t.source,Qt.exec(t));return n.lastIndex=t.lastIndex,n}function yd(t){return Jn?oe(Jn.call(t)):{}}function gc(t,n){var s=n?Hl(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.length)}function yc(t,n){if(t!==n){var s=t!==e,f=t===null,d=t===t,x=Gt(t),w=n!==e,S=n===null,k=n===n,I=Gt(n);if(!S&&!I&&!x&&t>n||x&&w&&k&&!S&&!I||f&&w&&k||!s&&k||!d)return 1;if(!f&&!x&&!I&&t=S)return k;var I=s[f];return k*(I=="desc"?-1:1)}}return t.index-n.index}function xc(t,n,s,f){for(var d=-1,x=t.length,w=s.length,S=-1,k=n.length,I=He(x-w,0),M=P(k+I),O=!f;++S1?s[d-1]:e,w=d>2?s[2]:e;for(x=t.length>3&&typeof x=="function"?(d--,x):e,w&&bt(s[0],s[1],w)&&(x=d<3?e:x,d=1),n=oe(n);++f-1?d[x?n[w]:w]:e}}function kc(t){return en(function(n){var s=n.length,f=s,d=Dt.prototype.thru;for(t&&n.reverse();f--;){var x=n[f];if(typeof x!="function")throw new Et(l);if(d&&!w&&So(x)=="wrapper")var w=new Dt([],!0)}for(f=w?f:s;++f1&&pe.reverse(),M&&kS))return!1;var I=x.get(t),M=x.get(n);if(I&&M)return I==n&&M==t;var O=-1,W=!0,q=s&ne?new Kr:e;for(x.set(t,n),x.set(n,t);++O1?"& ":"")+n[f],n=n.join(s>2?", ":" "),t.replace(iu,\`{ + return inlineWorker(`"use strict";var rx=Object.create;var kh=Object.defineProperty;var nx=Object.getOwnPropertyDescriptor;var ix=Object.getOwnPropertyNames;var ax=Object.getPrototypeOf,sx=Object.prototype.hasOwnProperty;var Ch=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var ox=(e,r,a,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of ix(r))!sx.call(e,l)&&l!==a&&kh(e,l,{get:()=>r[l],enumerable:!(u=nx(r,l))||u.enumerable});return e};var yf=(e,r,a)=>(a=e!=null?rx(ax(e)):{},ox(r||!e||!e.__esModule?kh(a,"default",{value:e,enumerable:!0}):a,e));var xf=Ch((ra,es)=>{(function(){var e,r="4.17.21",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",p="Invalid \`variable\` option passed into \`_.template\`",v="__lodash_hash_undefined__",C=500,T="__lodash_placeholder__",A=1,R=2,V=4,K=1,re=2,N=1,_e=2,Le=4,ye=8,de=16,We=32,ze=64,$e=128,Pe=256,tt=512,je=30,pr="...",jt=800,me=16,at=1,mt=2,Rt=3,Oe=1/0,Qe=9007199254740991,Wt=17976931348623157e292,xt=0/0,Pt=4294967295,mi=Pt-1,fa=Pt>>>1,hn=[["ary",$e],["bind",N],["bindKey",_e],["curry",ye],["curryRight",de],["flip",tt],["partial",We],["partialRight",ze],["rearg",Pe]],H="[object Arguments]",gi="[object Array]",Ko="[object AsyncFunction]",Er="[object Boolean]",pn="[object Date]",Zo="[object DOMException]",yi="[object Error]",xi="[object Function]",hs="[object GeneratorFunction]",Yt="[object Map]",Yn="[object Number]",Xo="[object Null]",dr="[object Object]",ps="[object Promise]",Jo="[object Proxy]",mr="[object RegExp]",De="[object Set]",st="[object String]",dn="[object Symbol]",ds="[object Undefined]",Ue="[object WeakMap]",eu="[object WeakSet]",Dr="[object ArrayBuffer]",nt="[object DataView]",te="[object Float32Array]",Ir="[object Float64Array]",mn="[object Int8Array]",vi="[object Int16Array]",ca="[object Int32Array]",ha="[object Uint8Array]",wi="[object Uint8ClampedArray]",ct="[object Uint16Array]",Si="[object Uint32Array]",pa=/\\b__p \\+= '';/g,_i=/\\b(__p \\+=) '' \\+/g,Ae=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g,da=/&(?:amp|lt|gt|quot|#39);/g,ma=/[&<>"']/g,bi=RegExp(da.source),ga=RegExp(ma.source),ki=/<%-([\\s\\S]+?)%>/g,gn=/<%([\\s\\S]+?)%>/g,Bn=/<%=([\\s\\S]+?)%>/g,tu=/\\.|\\[(?:[^[\\]]*|(["'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,Ci=/^\\w*$/,ru=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,qr=/[\\\\^$.*+?()[\\]{}|]/g,Ti=RegExp(qr.source),Y=/^\\s+/,nu=/\\s/,iu=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,vt=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,ya=/,? & /,Ce=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,Vn=/[()=,{}\\[\\]\\/\\s]/,au=/\\\\(\\\\)?/g,ot=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,Qt=/\\w*$/,Kt=/^[-+]0x[0-9a-f]+$/i,Ke=/^0b[01]+$/i,Bt=/^\\[object .+?Constructor\\]$/,gr=/^0o[0-7]+$/i,Gr=/^(?:0|[1-9]\\d*)$/,su=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,Pi=/($^)/,ou=/['\\n\\r\\u2028\\u2029\\\\]/g,Re="\\\\ud800-\\\\udfff",Ei="\\\\u0300-\\\\u036f",uu="\\\\ufe20-\\\\ufe2f",ms="\\\\u20d0-\\\\u20ff",xa=Ei+uu+ms,gs="\\\\u2700-\\\\u27bf",ys="a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff",lu="\\\\xac\\\\xb1\\\\xd7\\\\xf7",fu="\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf",cu="\\\\u2000-\\\\u206f",hu=" \\\\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",va="A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde",wa="\\\\ufe0e\\\\ufe0f",xs=lu+fu+cu+hu,Sa="['\\u2019]",pu="["+Re+"]",_a="["+xs+"]",Mr="["+xa+"]",ba="\\\\d+",du="["+gs+"]",vs="["+ys+"]",yn="[^"+Re+xs+ba+gs+ys+va+"]",xn="\\\\ud83c[\\\\udffb-\\\\udfff]",ws="(?:"+Mr+"|"+xn+")",vn="[^"+Re+"]",Vt="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",ka="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",wn="["+va+"]",Ss="\\\\u200d",_s="(?:"+vs+"|"+yn+")",mu="(?:"+wn+"|"+yn+")",bs="(?:"+Sa+"(?:d|ll|m|re|s|t|ve))?",ks="(?:"+Sa+"(?:D|LL|M|RE|S|T|VE))?",Cs=ws+"?",Di="["+wa+"]?",gu="(?:"+Ss+"(?:"+[vn,Vt,ka].join("|")+")"+Di+Cs+")*",Ts="\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])",yu="\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])",Ps=Di+Cs+gu,xu="(?:"+[du,Vt,ka].join("|")+")"+Ps,vu="(?:"+[vn+Mr+"?",Mr,Vt,ka,pu].join("|")+")",wu=RegExp(Sa,"g"),Su=RegExp(Mr,"g"),Ca=RegExp(xn+"(?="+xn+")|"+vu+Ps,"g"),_u=RegExp([wn+"?"+vs+"+"+bs+"(?="+[_a,wn,"$"].join("|")+")",mu+"+"+ks+"(?="+[_a,wn+_s,"$"].join("|")+")",wn+"?"+_s+"+"+bs,wn+"+"+ks,yu,Ts,ba,xu].join("|"),"g"),bu=RegExp("["+Ss+Re+xa+wa+"]"),ku=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Cu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Tu=-1,Fe={};Fe[te]=Fe[Ir]=Fe[mn]=Fe[vi]=Fe[ca]=Fe[ha]=Fe[wi]=Fe[ct]=Fe[Si]=!0,Fe[H]=Fe[gi]=Fe[Dr]=Fe[Er]=Fe[nt]=Fe[pn]=Fe[yi]=Fe[xi]=Fe[Yt]=Fe[Yn]=Fe[dr]=Fe[mr]=Fe[De]=Fe[st]=Fe[Ue]=!1;var Ie={};Ie[H]=Ie[gi]=Ie[Dr]=Ie[nt]=Ie[Er]=Ie[pn]=Ie[te]=Ie[Ir]=Ie[mn]=Ie[vi]=Ie[ca]=Ie[Yt]=Ie[Yn]=Ie[dr]=Ie[mr]=Ie[De]=Ie[st]=Ie[dn]=Ie[ha]=Ie[wi]=Ie[ct]=Ie[Si]=!0,Ie[yi]=Ie[xi]=Ie[Ue]=!1;var Pu={\\u00C0:"A",\\u00C1:"A",\\u00C2:"A",\\u00C3:"A",\\u00C4:"A",\\u00C5:"A",\\u00E0:"a",\\u00E1:"a",\\u00E2:"a",\\u00E3:"a",\\u00E4:"a",\\u00E5:"a",\\u00C7:"C",\\u00E7:"c",\\u00D0:"D",\\u00F0:"d",\\u00C8:"E",\\u00C9:"E",\\u00CA:"E",\\u00CB:"E",\\u00E8:"e",\\u00E9:"e",\\u00EA:"e",\\u00EB:"e",\\u00CC:"I",\\u00CD:"I",\\u00CE:"I",\\u00CF:"I",\\u00EC:"i",\\u00ED:"i",\\u00EE:"i",\\u00EF:"i",\\u00D1:"N",\\u00F1:"n",\\u00D2:"O",\\u00D3:"O",\\u00D4:"O",\\u00D5:"O",\\u00D6:"O",\\u00D8:"O",\\u00F2:"o",\\u00F3:"o",\\u00F4:"o",\\u00F5:"o",\\u00F6:"o",\\u00F8:"o",\\u00D9:"U",\\u00DA:"U",\\u00DB:"U",\\u00DC:"U",\\u00F9:"u",\\u00FA:"u",\\u00FB:"u",\\u00FC:"u",\\u00DD:"Y",\\u00FD:"y",\\u00FF:"y",\\u00C6:"Ae",\\u00E6:"ae",\\u00DE:"Th",\\u00FE:"th",\\u00DF:"ss",\\u0100:"A",\\u0102:"A",\\u0104:"A",\\u0101:"a",\\u0103:"a",\\u0105:"a",\\u0106:"C",\\u0108:"C",\\u010A:"C",\\u010C:"C",\\u0107:"c",\\u0109:"c",\\u010B:"c",\\u010D:"c",\\u010E:"D",\\u0110:"D",\\u010F:"d",\\u0111:"d",\\u0112:"E",\\u0114:"E",\\u0116:"E",\\u0118:"E",\\u011A:"E",\\u0113:"e",\\u0115:"e",\\u0117:"e",\\u0119:"e",\\u011B:"e",\\u011C:"G",\\u011E:"G",\\u0120:"G",\\u0122:"G",\\u011D:"g",\\u011F:"g",\\u0121:"g",\\u0123:"g",\\u0124:"H",\\u0126:"H",\\u0125:"h",\\u0127:"h",\\u0128:"I",\\u012A:"I",\\u012C:"I",\\u012E:"I",\\u0130:"I",\\u0129:"i",\\u012B:"i",\\u012D:"i",\\u012F:"i",\\u0131:"i",\\u0134:"J",\\u0135:"j",\\u0136:"K",\\u0137:"k",\\u0138:"k",\\u0139:"L",\\u013B:"L",\\u013D:"L",\\u013F:"L",\\u0141:"L",\\u013A:"l",\\u013C:"l",\\u013E:"l",\\u0140:"l",\\u0142:"l",\\u0143:"N",\\u0145:"N",\\u0147:"N",\\u014A:"N",\\u0144:"n",\\u0146:"n",\\u0148:"n",\\u014B:"n",\\u014C:"O",\\u014E:"O",\\u0150:"O",\\u014D:"o",\\u014F:"o",\\u0151:"o",\\u0154:"R",\\u0156:"R",\\u0158:"R",\\u0155:"r",\\u0157:"r",\\u0159:"r",\\u015A:"S",\\u015C:"S",\\u015E:"S",\\u0160:"S",\\u015B:"s",\\u015D:"s",\\u015F:"s",\\u0161:"s",\\u0162:"T",\\u0164:"T",\\u0166:"T",\\u0163:"t",\\u0165:"t",\\u0167:"t",\\u0168:"U",\\u016A:"U",\\u016C:"U",\\u016E:"U",\\u0170:"U",\\u0172:"U",\\u0169:"u",\\u016B:"u",\\u016D:"u",\\u016F:"u",\\u0171:"u",\\u0173:"u",\\u0174:"W",\\u0175:"w",\\u0176:"Y",\\u0177:"y",\\u0178:"Y",\\u0179:"Z",\\u017B:"Z",\\u017D:"Z",\\u017A:"z",\\u017C:"z",\\u017E:"z",\\u0132:"IJ",\\u0133:"ij",\\u0152:"Oe",\\u0153:"oe",\\u0149:"'n",\\u017F:"s"},Ta={"&":"&","<":"<",">":">",'"':""","'":"'"},Pa={"&":"&","<":"<",">":">",""":'"',"'":"'"},Eu={"\\\\":"\\\\","'":"'","\\n":"n","\\r":"r","\\u2028":"u2028","\\u2029":"u2029"},Es=parseFloat,Ds=parseInt,Is=typeof global=="object"&&global&&global.Object===Object&&global,Du=typeof self=="object"&&self&&self.Object===Object&&self,rt=Is||Du||Function("return this")(),Ea=typeof ra=="object"&&ra&&!ra.nodeType&&ra,Or=Ea&&typeof es=="object"&&es&&!es.nodeType&&es,Ne=Or&&Or.exports===Ea,zr=Ne&&Is.process,ut=function(){try{var b=Or&&Or.require&&Or.require("util").types;return b||zr&&zr.binding&&zr.binding("util")}catch{}}(),Ms=ut&&ut.isArrayBuffer,Da=ut&&ut.isDate,Os=ut&&ut.isMap,As=ut&&ut.isRegExp,Un=ut&&ut.isSet,yr=ut&&ut.isTypedArray;function ht(b,D,P){switch(P.length){case 0:return b.call(D);case 1:return b.call(D,P[0]);case 2:return b.call(D,P[0],P[1]);case 3:return b.call(D,P[0],P[1],P[2])}return b.apply(D,P)}function Iu(b,D,P,B){for(var Z=-1,xe=b==null?0:b.length;++Z-1}function Ia(b,D,P){for(var B=-1,Z=b==null?0:b.length;++B-1;);return P}function Bs(b,D){for(var P=b.length;P--&&Sn(D,b[P],0)>-1;);return P}function Lu(b,D){for(var P=b.length,B=0;P--;)b[P]===D&&++B;return B}var Vs=Hn(Pu),Ru=Hn(Ta);function Wu(b){return"\\\\"+Eu[b]}function Yu(b,D){return b==null?e:b[D]}function Xt(b){return bu.test(b)}function Bu(b){return ku.test(b)}function Vu(b){for(var D,P=[];!(D=b.next()).done;)P.push(D.value);return P}function Wa(b){var D=-1,P=Array(b.size);return b.forEach(function(B,Z){P[++D]=[Z,B]}),P}function qn(b,D){return function(P){return b(D(P))}}function Ut(b,D){for(var P=-1,B=b.length,Z=0,xe=[];++P-1}function ro(t,n){var s=this.__data__,f=It(s,t);return f<0?(++this.size,s.push([t,n])):s[f][1]=n,this}wr.prototype.clear=ml,wr.prototype.delete=to,wr.prototype.get=gl,wr.prototype.has=yl,wr.prototype.set=ro;function Sr(t){var n=-1,s=t==null?0:t.length;for(this.clear();++n=n?t:n)),t}function St(t,n,s,f,d,x){var w,_=n&A,k=n&R,I=n&V;if(s&&(w=d?s(t,f,d,x):s(t)),w!==e)return w;if(!Ve(t))return t;var M=ee(t);if(M){if(w=Md(t),!_)return Mt(t,w)}else{var O=yt(t),W=O==xi||O==hs;if(On(t))return mc(t,_);if(O==dr||O==H||W&&!d){if(w=k||W?{}:Fc(t),!_)return k?wd(t,Tl(w,t)):vd(t,Ua(w,t))}else{if(!Ie[O])return d?t:{};w=Od(t,O,_)}}x||(x=new Ht);var q=x.get(t);if(q)return q;x.set(t,w),lh(t)?t.forEach(function(Q){w.add(St(Q,n,s,Q,t,x))}):oh(t)&&t.forEach(function(Q,ue){w.set(ue,St(Q,n,s,ue,t,x))});var j=I?k?$l:zl:k?At:lt,ae=M?e:j(t);return He(ae||t,function(Q,ue){ae&&(ue=Q,Q=t[ue]),ei(w,ue,St(Q,n,s,ue,t,x))}),w}function Ha(t){var n=lt(t);return function(s){return oo(s,t,n)}}function oo(t,n,s){var f=s.length;if(t==null)return!f;for(t=se(t);f--;){var d=s[f],x=n[d],w=t[d];if(w===e&&!(d in t)||!x(w))return!1}return!0}function uo(t,n,s){if(typeof t!="function")throw new Et(l);return Xa(function(){t.apply(e,s)},n)}function _t(t,n,s,f){var d=-1,x=Mi,w=!0,_=t.length,k=[],I=n.length;if(!_)return k;s&&(n=Ee(n,gt(s))),f?(x=Ia,w=!1):n.length>=a&&(x=_n,w=!1,n=new Kr(n));e:for(;++d<_;){var M=t[d],O=s==null?M:s(M);if(M=f||M!==0?M:0,w&&O===O){for(var W=I;W--;)if(n[W]===O)continue e;k.push(M)}else x(n,O,f)||k.push(M)}return k}var Wr=wc(Jt),lo=wc(Ga,!0);function Pl(t,n){var s=!0;return Wr(t,function(f,d,x){return s=!!n(f,d,x),s}),s}function Ki(t,n,s){for(var f=-1,d=t.length;++fd?0:d+s),f=f===e||f>d?d:ne(f),f<0&&(f+=d),f=s>f?0:ch(f);s0&&s(_)?n>1?it(_,n-1,s,f,d):Zt(d,_):f||(d[d.length]=_)}return d}var qa=Sc(),co=Sc(!0);function Jt(t,n){return t&&qa(t,n,lt)}function Ga(t,n){return t&&co(t,n,lt)}function er(t,n){return Ar(n,function(s){return rn(t[s])})}function Xr(t,n){n=In(n,t);for(var s=0,f=n.length;t!=null&&sn}function Dl(t,n){return t!=null&&be.call(t,n)}function Il(t,n){return t!=null&&n in se(t)}function Ml(t,n,s){return t>=Be(n,s)&&t=120&&M.length>=120)?new Kr(w&&M):e}M=t[0];var O=-1,W=_[0];e:for(;++O-1;)_!==t&&jr.call(_,k,1),jr.call(t,k,1);return t}function oc(t,n){for(var s=t?n.length:0,f=s-1;s--;){var d=n[s];if(s==f||d!==x){var x=d;tn(d)?jr.call(t,d,1):Yl(t,d)}}return t}function Ll(t,n){return t+jn(Js()*(n-t+1))}function ud(t,n,s,f){for(var d=-1,x=qe(Bi((n-t)/(s||1)),0),w=P(x);x--;)w[f?x:++d]=t,t+=s;return w}function Rl(t,n){var s="";if(!t||n<1||n>Qe)return s;do n%2&&(s+=t),n=jn(n/2),n&&(t+=t);while(n);return s}function oe(t,n){return ef(Rc(t,n,Ft),t+"")}function ld(t){return so(ta(t))}function fd(t,n){var s=ta(t);return ko(s,Zr(n,0,s.length))}function Qa(t,n,s,f){if(!Ve(t))return t;n=In(n,t);for(var d=-1,x=n.length,w=x-1,_=t;_!=null&&++dd?0:d+n),s=s>d?d:s,s<0&&(s+=d),d=n>s?0:s-n>>>0,n>>>=0;for(var x=P(d);++f>>1,w=t[x];w!==null&&!Gt(w)&&(s?w<=n:w=a){var I=n?null:kd(t);if(I)return bn(I);w=!1,d=_n,k=new Kr}else k=n?[]:_;e:for(;++f=f?t:nr(t,n,s)}var dc=Ju||function(t){return rt.clearTimeout(t)};function mc(t,n){if(n)return t.slice();var s=t.length,f=zs?zs(s):new t.constructor(s);return t.copy(f),f}function Hl(t){var n=new t.constructor(t.byteLength);return new Ri(n).set(new Ri(t)),n}function md(t,n){var s=n?Hl(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.byteLength)}function gd(t){var n=new t.constructor(t.source,Qt.exec(t));return n.lastIndex=t.lastIndex,n}function yd(t){return Jn?se(Jn.call(t)):{}}function gc(t,n){var s=n?Hl(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.length)}function yc(t,n){if(t!==n){var s=t!==e,f=t===null,d=t===t,x=Gt(t),w=n!==e,_=n===null,k=n===n,I=Gt(n);if(!_&&!I&&!x&&t>n||x&&w&&k&&!_&&!I||f&&w&&k||!s&&k||!d)return 1;if(!f&&!x&&!I&&t=_)return k;var I=s[f];return k*(I=="desc"?-1:1)}}return t.index-n.index}function xc(t,n,s,f){for(var d=-1,x=t.length,w=s.length,_=-1,k=n.length,I=qe(x-w,0),M=P(k+I),O=!f;++_1?s[d-1]:e,w=d>2?s[2]:e;for(x=t.length>3&&typeof x=="function"?(d--,x):e,w&&bt(s[0],s[1],w)&&(x=d<3?e:x,d=1),n=se(n);++f-1?d[x?n[w]:w]:e}}function kc(t){return en(function(n){var s=n.length,f=s,d=Dt.prototype.thru;for(t&&n.reverse();f--;){var x=n[f];if(typeof x!="function")throw new Et(l);if(d&&!w&&_o(x)=="wrapper")var w=new Dt([],!0)}for(f=w?f:s;++f1&&he.reverse(),M&&k_))return!1;var I=x.get(t),M=x.get(n);if(I&&M)return I==n&&M==t;var O=-1,W=!0,q=s&re?new Kr:e;for(x.set(t,n),x.set(n,t);++O<_;){var j=t[O],ae=n[O];if(f)var Q=w?f(ae,j,O,n,t,x):f(j,ae,O,t,n,x);if(Q!==e){if(Q)continue;W=!1;break}if(q){if(!Oa(n,function(ue,he){if(!_n(q,he)&&(j===ue||d(j,ue,s,f,x)))return q.push(he)})){W=!1;break}}else if(!(j===ae||d(j,ae,s,f,x))){W=!1;break}}return x.delete(t),x.delete(n),W}function Td(t,n,s,f,d,x,w){switch(s){case nt:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case Dr:return!(t.byteLength!=n.byteLength||!x(new Ri(t),new Ri(n)));case Er:case pn:case Yn:return Cr(+t,+n);case yi:return t.name==n.name&&t.message==n.message;case mr:case st:return t==n+"";case Yt:var _=Wa;case De:var k=f&K;if(_||(_=bn),t.size!=n.size&&!k)return!1;var I=w.get(t);if(I)return I==n;f|=re,w.set(t,n);var M=Mc(_(t),_(n),f,d,x,w);return w.delete(t),M;case dn:if(Jn)return Jn.call(t)==Jn.call(n)}return!1}function Pd(t,n,s,f,d,x){var w=s&K,_=zl(t),k=_.length,I=zl(n),M=I.length;if(k!=M&&!w)return!1;for(var O=k;O--;){var W=_[O];if(!(w?W in n:be.call(n,W)))return!1}var q=x.get(t),j=x.get(n);if(q&&j)return q==n&&j==t;var ae=!0;x.set(t,n),x.set(n,t);for(var Q=w;++O1?"& ":"")+n[f],n=n.join(s>2?", ":" "),t.replace(iu,\`{ /* [wrapped with \`+n+\`] */ -\`)}function Fd(t){return te(t)||ai(t)||!!(Qs&&t&&t[Qs])}function tn(t,n){var s=typeof t;return n=n??ze,!!n&&(s=="number"||s!="symbol"&&Gr.test(t))&&t>-1&&t%1==0&&t0){if(++n>=jt)return arguments[0]}else n=0;return t.apply(e,arguments)}}function ko(t,n){var s=-1,f=t.length,d=f-1;for(n=n===e?f:n;++s1?t[n-1]:e;return s=typeof s=="function"?(t.pop(),s):e,Qc(t,s)});function Kc(t){var n=g(t);return n.__chain__=!0,n}function Gm(t,n){return n(t),t}function Co(t,n){return n(t)}var zm=en(function(t){var n=t.length,s=n?t[0]:0,f=this.__wrapped__,d=function(x){return Qi(x,t)};return n>1||this.__actions__.length||!(f instanceof ae)||!tn(s)?this.thru(d):(f=f.slice(s,+s+(n?1:0)),f.__actions__.push({func:Co,args:[d],thisArg:e}),new Dt(f,this.__chain__).thru(function(x){return n&&!x.length&&x.push(e),x}))});function $m(){return Kc(this)}function jm(){return new Dt(this.value(),this.__chain__)}function Qm(){this.__values__===e&&(this.__values__=fh(this.value()));var t=this.__index__>=this.__values__.length,n=t?e:this.__values__[this.__index__++];return{done:t,value:n}}function Km(){return this}function Zm(t){for(var n,s=this;s instanceof Gi;){var f=Hc(s);f.__index__=0,f.__values__=e,n?d.__wrapped__=f:n=f;var d=f;s=s.__wrapped__}return d.__wrapped__=t,n}function Xm(){var t=this.__wrapped__;if(t instanceof ae){var n=t;return this.__actions__.length&&(n=new ae(this)),n=n.reverse(),n.__actions__.push({func:Co,args:[tf],thisArg:e}),new Dt(n,this.__chain__)}return this.thru(tf)}function Jm(){return hc(this.__wrapped__,this.__actions__)}var eg=yo(function(t,n,s){Se.call(t,s)?++t[s]:Sr(t,s,1)});function tg(t,n,s){var f=te(t)?Ii:Pl;return s&&bt(t,n,s)&&(n=e),f(t,$(n,3))}function rg(t,n){var s=te(t)?Or:fo;return s(t,$(n,3))}var ng=bc(qc),ig=bc(Gc);function ag(t,n){return nt(To(t,n),1)}function sg(t,n){return nt(To(t,n),Me)}function og(t,n,s){return s=s===e?1:ie(s),nt(To(t,n),s)}function Zc(t,n){var s=te(t)?Ue:Wr;return s(t,$(n,3))}function Xc(t,n){var s=te(t)?Mu:lo;return s(t,$(n,3))}var ug=yo(function(t,n,s){Se.call(t,s)?t[s].push(n):Sr(t,s,[n])});function lg(t,n,s,f){t=At(t)?t:ta(t),s=s&&!f?ie(s):0;var d=t.length;return s<0&&(s=He(d+s,0)),Mo(t)?s<=d&&t.indexOf(n,s)>-1:!!d&&_n(t,n,s)>-1}var fg=ue(function(t,n,s){var f=-1,d=typeof n=="function",x=At(t)?P(t.length):[];return Wr(t,function(w){x[++f]=d?ht(n,w,s):tr(w,n,s)}),x}),cg=yo(function(t,n,s){Sr(t,s,n)});function To(t,n){var s=te(t)?Pe:E;return s(t,$(n,3))}function hg(t,n,s,f){return t==null?[]:(te(n)||(n=n==null?[]:[n]),s=f?e:s,te(s)||(s=s==null?[]:[s]),kr(t,n,s))}var pg=yo(function(t,n,s){t[s?0:1].push(n)},function(){return[[],[]]});function dg(t,n,s){var f=te(t)?Ma:Ws,d=arguments.length<3;return f(t,$(n,4),s,d,Wr)}function mg(t,n,s){var f=te(t)?Au:Ws,d=arguments.length<3;return f(t,$(n,4),s,d,lo)}function gg(t,n){var s=te(t)?Or:fo;return s(t,Do($(n,3)))}function yg(t){var n=te(t)?so:ld;return n(t)}function xg(t,n,s){(s?bt(t,n,s):n===e)?n=1:n=ie(n);var f=te(t)?bl:fd;return f(t,n)}function vg(t){var n=te(t)?kl:hd;return n(t)}function wg(t){if(t==null)return 0;if(At(t))return Mo(t)?Fr(t):t.length;var n=yt(t);return n==Yt||n==Ee?t.size:h(t).length}function _g(t,n,s){var f=te(t)?Aa:pd;return s&&bt(t,n,s)&&(n=e),f(t,$(n,3))}var Sg=ue(function(t,n){if(t==null)return[];var s=n.length;return s>1&&bt(t,n[0],n[1])?n=[]:s>2&&bt(n[0],n[1],n[2])&&(n=[n[0]]),kr(t,nt(n,1),[])}),Po=el||function(){return et.Date.now()};function bg(t,n){if(typeof n!="function")throw new Et(l);return t=ie(t),function(){if(--t<1)return n.apply(this,arguments)}}function Jc(t,n,s){return n=s?e:n,n=t&&n==null?t.length:n,Jr(t,tt,e,e,e,e,n)}function eh(t,n){var s;if(typeof n!="function")throw new Et(l);return t=ie(t),function(){return--t>0&&(s=n.apply(this,arguments)),t<=1&&(n=e),s}}var nf=ue(function(t,n,s){var f=N;if(s.length){var d=Ut(s,Ji(nf));f|=Re}return Jr(t,f,n,s,d)}),th=ue(function(t,n,s){var f=N|we;if(s.length){var d=Ut(s,Ji(th));f|=Re}return Jr(n,f,t,s,d)});function rh(t,n,s){n=s?e:n;var f=Jr(t,K,e,e,e,e,e,n);return f.placeholder=rh.placeholder,f}function nh(t,n,s){n=s?e:n;var f=Jr(t,Xe,e,e,e,e,e,n);return f.placeholder=nh.placeholder,f}function ih(t,n,s){var f,d,x,w,S,k,I=0,M=!1,O=!1,W=!0;if(typeof t!="function")throw new Et(l);n=ar(n)||0,Be(s)&&(M=!!s.leading,O="maxWait"in s,x=O?He(ar(s.maxWait)||0,n):x,W="trailing"in s?!!s.trailing:W);function q(Ke){var Tr=f,an=d;return f=d=e,I=Ke,w=t.apply(an,Tr),w}function j(Ke){return I=Ke,S=Xa(le,n),M?q(Ke):w}function se(Ke){var Tr=Ke-k,an=Ke-I,bh=n-Tr;return O?Ye(bh,x-an):bh}function Q(Ke){var Tr=Ke-k,an=Ke-I;return k===e||Tr>=n||Tr<0||O&&an>=x}function le(){var Ke=Po();if(Q(Ke))return pe(Ke);S=Xa(le,se(Ke))}function pe(Ke){return S=e,W&&f?q(Ke):(f=d=e,w)}function zt(){S!==e&&dc(S),I=0,f=k=d=S=e}function kt(){return S===e?w:pe(Po())}function $t(){var Ke=Po(),Tr=Q(Ke);if(f=arguments,d=this,k=Ke,Tr){if(S===e)return j(k);if(O)return dc(S),S=Xa(le,n),q(k)}return S===e&&(S=Xa(le,n)),w}return $t.cancel=zt,$t.flush=kt,$t}var kg=ue(function(t,n){return uo(t,1,n)}),Cg=ue(function(t,n,s){return uo(t,ar(n)||0,s)});function Tg(t){return Jr(t,Je)}function Eo(t,n){if(typeof t!="function"||n!=null&&typeof n!="function")throw new Et(l);var s=function(){var f=arguments,d=n?n.apply(this,f):f[0],x=s.cache;if(x.has(d))return x.get(d);var w=t.apply(this,f);return s.cache=x.set(d,w)||x,w};return s.cache=new(Eo.Cache||_r),s}Eo.Cache=_r;function Do(t){if(typeof t!="function")throw new Et(l);return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}function Pg(t){return eh(2,t)}var Eg=dd(function(t,n){n=n.length==1&&te(n[0])?Pe(n[0],gt($())):Pe(nt(n,1),gt($()));var s=n.length;return ue(function(f){for(var d=-1,x=Ye(f.length,s);++d=n}),ai=po(function(){return arguments}())?po:function(t){return qe(t)&&Se.call(t,"callee")&&!js.call(t,"callee")},te=P.isArray,Hg=Ms?gt(Ms):Al;function At(t){return t!=null&&Io(t.length)&&!rn(t)}function Qe(t){return qe(t)&&At(t)}function qg(t){return t===!0||t===!1||qe(t)&&pt(t)==Er}var An=Ks||gf,Gg=Da?gt(Da):Ol;function zg(t){return qe(t)&&t.nodeType===1&&!Ja(t)}function $g(t){if(t==null)return!0;if(At(t)&&(te(t)||typeof t=="string"||typeof t.splice=="function"||An(t)||ea(t)||ai(t)))return!t.length;var n=yt(t);if(n==Yt||n==Ee)return!t.size;if(Za(t))return!h(t).length;for(var s in t)if(Se.call(t,s))return!1;return!0}function jg(t,n){return ti(t,n)}function Qg(t,n,s){s=typeof s=="function"?s:e;var f=s?s(t,n):e;return f===e?ti(t,n,e,s):!!f}function sf(t){if(!qe(t))return!1;var n=pt(t);return n==yi||n==Zo||typeof t.message=="string"&&typeof t.name=="string"&&!Ja(t)}function Kg(t){return typeof t=="number"&&Qn(t)}function rn(t){if(!Be(t))return!1;var n=pt(t);return n==xi||n==hs||n==Ko||n==Jo}function sh(t){return typeof t=="number"&&t==ie(t)}function Io(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ze}function Be(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}function qe(t){return t!=null&&typeof t=="object"}var oh=As?gt(As):ja;function Zg(t,n){return t===n||Yr(t,n,Ql(n))}function Xg(t,n,s){return s=typeof s=="function"?s:e,Yr(t,n,Ql(n),s)}function Jg(t){return uh(t)&&t!=+t}function e0(t){if(Rd(t))throw new X(u);return ri(t)}function t0(t){return t===null}function r0(t){return t==null}function uh(t){return typeof t=="number"||qe(t)&&pt(t)==Yn}function Ja(t){if(!qe(t)||pt(t)!=dr)return!1;var n=Wi(t);if(n===null)return!0;var s=Se.call(n,"constructor")&&n.constructor;return typeof s=="function"&&s instanceof s&&zn.call(s)==Ku}var of=Os?gt(Os):fe;function n0(t){return sh(t)&&t>=-ze&&t<=ze}var lh=Un?gt(Un):i;function Mo(t){return typeof t=="string"||!te(t)&&qe(t)&&pt(t)==st}function Gt(t){return typeof t=="symbol"||qe(t)&&pt(t)==dn}var ea=yr?gt(yr):o;function i0(t){return t===e}function a0(t){return qe(t)&&yt(t)==Ve}function s0(t){return qe(t)&&pt(t)==eu}var o0=_o(_),u0=_o(function(t,n){return t<=n});function fh(t){if(!t)return[];if(At(t))return Mo(t)?wt(t):Mt(t);if($n&&t[$n])return Vu(t[$n]());var n=yt(t),s=n==Yt?Wa:n==Ee?bn:ta;return s(t)}function nn(t){if(!t)return t===0?t:0;if(t=ar(t),t===Me||t===-Me){var n=t<0?-1:1;return n*Wt}return t===t?t:0}function ie(t){var n=nn(t),s=n%1;return n===n?s?n-s:n:0}function ch(t){return t?Zr(ie(t),0,Pt):0}function ar(t){if(typeof t=="number")return t;if(Gt(t))return xt;if(Be(t)){var n=typeof t.valueOf=="function"?t.valueOf():t;t=Be(n)?n+"":n}if(typeof t!="string")return t===0?t:+t;t=Ys(t);var s=$e.test(t);return s||gr.test(t)?Ds(t.slice(2),s?2:8):Kt.test(t)?xt:+t}function hh(t){return Br(t,Ot(t))}function l0(t){return t?Zr(ie(t),-ze,ze):t===0?t:0}function Ce(t){return t==null?"":qt(t)}var f0=Zi(function(t,n){if(Za(n)||At(n)){Br(n,lt(n),t);return}for(var s in n)Se.call(n,s)&&ei(t,s,n[s])}),ph=Zi(function(t,n){Br(n,Ot(n),t)}),Ao=Zi(function(t,n,s,f){Br(n,Ot(n),t,f)}),c0=Zi(function(t,n,s,f){Br(n,lt(n),t,f)}),h0=en(Qi);function p0(t,n){var s=En(t);return n==null?s:Ua(s,n)}var d0=ue(function(t,n){t=oe(t);var s=-1,f=n.length,d=f>2?n[2]:e;for(d&&bt(n[0],n[1],d)&&(f=1);++s1),x}),Br(t,$l(t),s),f&&(s=_t(s,A|R|V,Cd));for(var d=n.length;d--;)Yl(s,n[d]);return s});function A0(t,n){return mh(t,Do($(n)))}var O0=en(function(t,n){return t==null?{}:sd(t,n)});function mh(t,n){if(t==null)return{};var s=Pe($l(t),function(f){return[f]});return n=$(n),sc(t,s,function(f,d){return n(f,d[0])})}function F0(t,n,s){n=In(n,t);var f=-1,d=n.length;for(d||(d=1,t=e);++fn){var f=t;t=n,n=f}if(s||t%1||n%1){var d=Js();return Ye(t+d*(n-t+Es("1e-"+((d+"").length-1))),n)}return Ll(t,n)}var G0=Xi(function(t,n,s){return n=n.toLowerCase(),t+(s?xh(n):n)});function xh(t){return ff(Ce(t).toLowerCase())}function vh(t){return t=Ce(t),t&&t.replace(su,Vs).replace(_u,"")}function z0(t,n,s){t=Ce(t),n=qt(n);var f=t.length;s=s===e?f:Zr(ie(s),0,f);var d=s;return s-=n.length,s>=0&&t.slice(s,d)==n}function $0(t){return t=Ce(t),t&&ga.test(t)?t.replace(ma,Ru):t}function j0(t){return t=Ce(t),t&&Ti.test(t)?t.replace(qr,"\\\\$&"):t}var Q0=Xi(function(t,n,s){return t+(s?"-":"")+n.toLowerCase()}),K0=Xi(function(t,n,s){return t+(s?" ":"")+n.toLowerCase()}),Z0=Sc("toLowerCase");function X0(t,n,s){t=Ce(t),n=ie(n);var f=n?Fr(t):0;if(!n||f>=n)return t;var d=(n-f)/2;return wo(jn(d),s)+t+wo(Bi(d),s)}function J0(t,n,s){t=Ce(t),n=ie(n);var f=n?Fr(t):0;return n&&f>>0,s?(t=Ce(t),t&&(typeof n=="string"||n!=null&&!of(n))&&(n=qt(n),!n&&Xt(t))?Mn(wt(t),0,s):t.split(n,s)):[]}var sy=Xi(function(t,n,s){return t+(s?" ":"")+ff(n)});function oy(t,n,s){return t=Ce(t),s=s==null?0:Zr(ie(s),0,t.length),n=qt(n),t.slice(s,s+n.length)==n}function uy(t,n,s){var f=g.templateSettings;s&&bt(t,n,s)&&(n=e),t=Ce(t),n=Ao({},n,f,Dc);var d=Ao({},n.imports,f.imports,Dc),x=lt(d),w=Ra(d,x),S,k,I=0,M=n.interpolate||Pi,O="__p += '",W=xr((n.escape||Pi).source+"|"+M.source+"|"+(M===Bn?ot:Pi).source+"|"+(n.evaluate||Pi).source+"|$","g"),q="//# sourceURL="+(Se.call(n,"sourceURL")?(n.sourceURL+"").replace(/\\s/g," "):"lodash.templateSources["+ ++Tu+"]")+\` -\`;t.replace(W,function(Q,le,pe,zt,kt,$t){return pe||(pe=zt),O+=t.slice(I,$t).replace(ou,Wu),le&&(S=!0,O+=\`' + -__e(\`+le+\`) + +\`)}function Fd(t){return ee(t)||ai(t)||!!(Qs&&t&&t[Qs])}function tn(t,n){var s=typeof t;return n=n??Qe,!!n&&(s=="number"||s!="symbol"&&Gr.test(t))&&t>-1&&t%1==0&&t0){if(++n>=jt)return arguments[0]}else n=0;return t.apply(e,arguments)}}function ko(t,n){var s=-1,f=t.length,d=f-1;for(n=n===e?f:n;++s1?t[n-1]:e;return s=typeof s=="function"?(t.pop(),s):e,Qc(t,s)});function Kc(t){var n=g(t);return n.__chain__=!0,n}function Gm(t,n){return n(t),t}function Co(t,n){return n(t)}var zm=en(function(t){var n=t.length,s=n?t[0]:0,f=this.__wrapped__,d=function(x){return Qi(x,t)};return n>1||this.__actions__.length||!(f instanceof ie)||!tn(s)?this.thru(d):(f=f.slice(s,+s+(n?1:0)),f.__actions__.push({func:Co,args:[d],thisArg:e}),new Dt(f,this.__chain__).thru(function(x){return n&&!x.length&&x.push(e),x}))});function $m(){return Kc(this)}function jm(){return new Dt(this.value(),this.__chain__)}function Qm(){this.__values__===e&&(this.__values__=fh(this.value()));var t=this.__index__>=this.__values__.length,n=t?e:this.__values__[this.__index__++];return{done:t,value:n}}function Km(){return this}function Zm(t){for(var n,s=this;s instanceof Gi;){var f=Hc(s);f.__index__=0,f.__values__=e,n?d.__wrapped__=f:n=f;var d=f;s=s.__wrapped__}return d.__wrapped__=t,n}function Xm(){var t=this.__wrapped__;if(t instanceof ie){var n=t;return this.__actions__.length&&(n=new ie(this)),n=n.reverse(),n.__actions__.push({func:Co,args:[tf],thisArg:e}),new Dt(n,this.__chain__)}return this.thru(tf)}function Jm(){return hc(this.__wrapped__,this.__actions__)}var eg=yo(function(t,n,s){be.call(t,s)?++t[s]:_r(t,s,1)});function tg(t,n,s){var f=ee(t)?Ii:Pl;return s&&bt(t,n,s)&&(n=e),f(t,$(n,3))}function rg(t,n){var s=ee(t)?Ar:fo;return s(t,$(n,3))}var ng=bc(qc),ig=bc(Gc);function ag(t,n){return it(To(t,n),1)}function sg(t,n){return it(To(t,n),Oe)}function og(t,n,s){return s=s===e?1:ne(s),it(To(t,n),s)}function Zc(t,n){var s=ee(t)?He:Wr;return s(t,$(n,3))}function Xc(t,n){var s=ee(t)?Mu:lo;return s(t,$(n,3))}var ug=yo(function(t,n,s){be.call(t,s)?t[s].push(n):_r(t,s,[n])});function lg(t,n,s,f){t=Ot(t)?t:ta(t),s=s&&!f?ne(s):0;var d=t.length;return s<0&&(s=qe(d+s,0)),Mo(t)?s<=d&&t.indexOf(n,s)>-1:!!d&&Sn(t,n,s)>-1}var fg=oe(function(t,n,s){var f=-1,d=typeof n=="function",x=Ot(t)?P(t.length):[];return Wr(t,function(w){x[++f]=d?ht(n,w,s):tr(w,n,s)}),x}),cg=yo(function(t,n,s){_r(t,s,n)});function To(t,n){var s=ee(t)?Ee:E;return s(t,$(n,3))}function hg(t,n,s,f){return t==null?[]:(ee(n)||(n=n==null?[]:[n]),s=f?e:s,ee(s)||(s=s==null?[]:[s]),kr(t,n,s))}var pg=yo(function(t,n,s){t[s?0:1].push(n)},function(){return[[],[]]});function dg(t,n,s){var f=ee(t)?Ma:Ws,d=arguments.length<3;return f(t,$(n,4),s,d,Wr)}function mg(t,n,s){var f=ee(t)?Ou:Ws,d=arguments.length<3;return f(t,$(n,4),s,d,lo)}function gg(t,n){var s=ee(t)?Ar:fo;return s(t,Do($(n,3)))}function yg(t){var n=ee(t)?so:ld;return n(t)}function xg(t,n,s){(s?bt(t,n,s):n===e)?n=1:n=ne(n);var f=ee(t)?bl:fd;return f(t,n)}function vg(t){var n=ee(t)?kl:hd;return n(t)}function wg(t){if(t==null)return 0;if(Ot(t))return Mo(t)?Fr(t):t.length;var n=yt(t);return n==Yt||n==De?t.size:h(t).length}function Sg(t,n,s){var f=ee(t)?Oa:pd;return s&&bt(t,n,s)&&(n=e),f(t,$(n,3))}var _g=oe(function(t,n){if(t==null)return[];var s=n.length;return s>1&&bt(t,n[0],n[1])?n=[]:s>2&&bt(n[0],n[1],n[2])&&(n=[n[0]]),kr(t,it(n,1),[])}),Po=el||function(){return rt.Date.now()};function bg(t,n){if(typeof n!="function")throw new Et(l);return t=ne(t),function(){if(--t<1)return n.apply(this,arguments)}}function Jc(t,n,s){return n=s?e:n,n=t&&n==null?t.length:n,Jr(t,$e,e,e,e,e,n)}function eh(t,n){var s;if(typeof n!="function")throw new Et(l);return t=ne(t),function(){return--t>0&&(s=n.apply(this,arguments)),t<=1&&(n=e),s}}var nf=oe(function(t,n,s){var f=N;if(s.length){var d=Ut(s,Ji(nf));f|=We}return Jr(t,f,n,s,d)}),th=oe(function(t,n,s){var f=N|_e;if(s.length){var d=Ut(s,Ji(th));f|=We}return Jr(n,f,t,s,d)});function rh(t,n,s){n=s?e:n;var f=Jr(t,ye,e,e,e,e,e,n);return f.placeholder=rh.placeholder,f}function nh(t,n,s){n=s?e:n;var f=Jr(t,de,e,e,e,e,e,n);return f.placeholder=nh.placeholder,f}function ih(t,n,s){var f,d,x,w,_,k,I=0,M=!1,O=!1,W=!0;if(typeof t!="function")throw new Et(l);n=ar(n)||0,Ve(s)&&(M=!!s.leading,O="maxWait"in s,x=O?qe(ar(s.maxWait)||0,n):x,W="trailing"in s?!!s.trailing:W);function q(Je){var Tr=f,an=d;return f=d=e,I=Je,w=t.apply(an,Tr),w}function j(Je){return I=Je,_=Xa(ue,n),M?q(Je):w}function ae(Je){var Tr=Je-k,an=Je-I,bh=n-Tr;return O?Be(bh,x-an):bh}function Q(Je){var Tr=Je-k,an=Je-I;return k===e||Tr>=n||Tr<0||O&&an>=x}function ue(){var Je=Po();if(Q(Je))return he(Je);_=Xa(ue,ae(Je))}function he(Je){return _=e,W&&f?q(Je):(f=d=e,w)}function zt(){_!==e&&dc(_),I=0,f=k=d=_=e}function kt(){return _===e?w:he(Po())}function $t(){var Je=Po(),Tr=Q(Je);if(f=arguments,d=this,k=Je,Tr){if(_===e)return j(k);if(O)return dc(_),_=Xa(ue,n),q(k)}return _===e&&(_=Xa(ue,n)),w}return $t.cancel=zt,$t.flush=kt,$t}var kg=oe(function(t,n){return uo(t,1,n)}),Cg=oe(function(t,n,s){return uo(t,ar(n)||0,s)});function Tg(t){return Jr(t,tt)}function Eo(t,n){if(typeof t!="function"||n!=null&&typeof n!="function")throw new Et(l);var s=function(){var f=arguments,d=n?n.apply(this,f):f[0],x=s.cache;if(x.has(d))return x.get(d);var w=t.apply(this,f);return s.cache=x.set(d,w)||x,w};return s.cache=new(Eo.Cache||Sr),s}Eo.Cache=Sr;function Do(t){if(typeof t!="function")throw new Et(l);return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}function Pg(t){return eh(2,t)}var Eg=dd(function(t,n){n=n.length==1&&ee(n[0])?Ee(n[0],gt($())):Ee(it(n,1),gt($()));var s=n.length;return oe(function(f){for(var d=-1,x=Be(f.length,s);++d=n}),ai=po(function(){return arguments}())?po:function(t){return Ge(t)&&be.call(t,"callee")&&!js.call(t,"callee")},ee=P.isArray,Hg=Ms?gt(Ms):Ol;function Ot(t){return t!=null&&Io(t.length)&&!rn(t)}function Xe(t){return Ge(t)&&Ot(t)}function qg(t){return t===!0||t===!1||Ge(t)&&pt(t)==Er}var On=Ks||gf,Gg=Da?gt(Da):Al;function zg(t){return Ge(t)&&t.nodeType===1&&!Ja(t)}function $g(t){if(t==null)return!0;if(Ot(t)&&(ee(t)||typeof t=="string"||typeof t.splice=="function"||On(t)||ea(t)||ai(t)))return!t.length;var n=yt(t);if(n==Yt||n==De)return!t.size;if(Za(t))return!h(t).length;for(var s in t)if(be.call(t,s))return!1;return!0}function jg(t,n){return ti(t,n)}function Qg(t,n,s){s=typeof s=="function"?s:e;var f=s?s(t,n):e;return f===e?ti(t,n,e,s):!!f}function sf(t){if(!Ge(t))return!1;var n=pt(t);return n==yi||n==Zo||typeof t.message=="string"&&typeof t.name=="string"&&!Ja(t)}function Kg(t){return typeof t=="number"&&Qn(t)}function rn(t){if(!Ve(t))return!1;var n=pt(t);return n==xi||n==hs||n==Ko||n==Jo}function sh(t){return typeof t=="number"&&t==ne(t)}function Io(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Qe}function Ve(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}function Ge(t){return t!=null&&typeof t=="object"}var oh=Os?gt(Os):ja;function Zg(t,n){return t===n||Yr(t,n,Ql(n))}function Xg(t,n,s){return s=typeof s=="function"?s:e,Yr(t,n,Ql(n),s)}function Jg(t){return uh(t)&&t!=+t}function e0(t){if(Rd(t))throw new Z(u);return ri(t)}function t0(t){return t===null}function r0(t){return t==null}function uh(t){return typeof t=="number"||Ge(t)&&pt(t)==Yn}function Ja(t){if(!Ge(t)||pt(t)!=dr)return!1;var n=Wi(t);if(n===null)return!0;var s=be.call(n,"constructor")&&n.constructor;return typeof s=="function"&&s instanceof s&&zn.call(s)==Ku}var of=As?gt(As):le;function n0(t){return sh(t)&&t>=-Qe&&t<=Qe}var lh=Un?gt(Un):i;function Mo(t){return typeof t=="string"||!ee(t)&&Ge(t)&&pt(t)==st}function Gt(t){return typeof t=="symbol"||Ge(t)&&pt(t)==dn}var ea=yr?gt(yr):o;function i0(t){return t===e}function a0(t){return Ge(t)&&yt(t)==Ue}function s0(t){return Ge(t)&&pt(t)==eu}var o0=So(S),u0=So(function(t,n){return t<=n});function fh(t){if(!t)return[];if(Ot(t))return Mo(t)?wt(t):Mt(t);if($n&&t[$n])return Vu(t[$n]());var n=yt(t),s=n==Yt?Wa:n==De?bn:ta;return s(t)}function nn(t){if(!t)return t===0?t:0;if(t=ar(t),t===Oe||t===-Oe){var n=t<0?-1:1;return n*Wt}return t===t?t:0}function ne(t){var n=nn(t),s=n%1;return n===n?s?n-s:n:0}function ch(t){return t?Zr(ne(t),0,Pt):0}function ar(t){if(typeof t=="number")return t;if(Gt(t))return xt;if(Ve(t)){var n=typeof t.valueOf=="function"?t.valueOf():t;t=Ve(n)?n+"":n}if(typeof t!="string")return t===0?t:+t;t=Ys(t);var s=Ke.test(t);return s||gr.test(t)?Ds(t.slice(2),s?2:8):Kt.test(t)?xt:+t}function hh(t){return Br(t,At(t))}function l0(t){return t?Zr(ne(t),-Qe,Qe):t===0?t:0}function Te(t){return t==null?"":qt(t)}var f0=Zi(function(t,n){if(Za(n)||Ot(n)){Br(n,lt(n),t);return}for(var s in n)be.call(n,s)&&ei(t,s,n[s])}),ph=Zi(function(t,n){Br(n,At(n),t)}),Oo=Zi(function(t,n,s,f){Br(n,At(n),t,f)}),c0=Zi(function(t,n,s,f){Br(n,lt(n),t,f)}),h0=en(Qi);function p0(t,n){var s=En(t);return n==null?s:Ua(s,n)}var d0=oe(function(t,n){t=se(t);var s=-1,f=n.length,d=f>2?n[2]:e;for(d&&bt(n[0],n[1],d)&&(f=1);++s1),x}),Br(t,$l(t),s),f&&(s=St(s,A|R|V,Cd));for(var d=n.length;d--;)Yl(s,n[d]);return s});function O0(t,n){return mh(t,Do($(n)))}var A0=en(function(t,n){return t==null?{}:sd(t,n)});function mh(t,n){if(t==null)return{};var s=Ee($l(t),function(f){return[f]});return n=$(n),sc(t,s,function(f,d){return n(f,d[0])})}function F0(t,n,s){n=In(n,t);var f=-1,d=n.length;for(d||(d=1,t=e);++fn){var f=t;t=n,n=f}if(s||t%1||n%1){var d=Js();return Be(t+d*(n-t+Es("1e-"+((d+"").length-1))),n)}return Ll(t,n)}var G0=Xi(function(t,n,s){return n=n.toLowerCase(),t+(s?xh(n):n)});function xh(t){return ff(Te(t).toLowerCase())}function vh(t){return t=Te(t),t&&t.replace(su,Vs).replace(Su,"")}function z0(t,n,s){t=Te(t),n=qt(n);var f=t.length;s=s===e?f:Zr(ne(s),0,f);var d=s;return s-=n.length,s>=0&&t.slice(s,d)==n}function $0(t){return t=Te(t),t&&ga.test(t)?t.replace(ma,Ru):t}function j0(t){return t=Te(t),t&&Ti.test(t)?t.replace(qr,"\\\\$&"):t}var Q0=Xi(function(t,n,s){return t+(s?"-":"")+n.toLowerCase()}),K0=Xi(function(t,n,s){return t+(s?" ":"")+n.toLowerCase()}),Z0=_c("toLowerCase");function X0(t,n,s){t=Te(t),n=ne(n);var f=n?Fr(t):0;if(!n||f>=n)return t;var d=(n-f)/2;return wo(jn(d),s)+t+wo(Bi(d),s)}function J0(t,n,s){t=Te(t),n=ne(n);var f=n?Fr(t):0;return n&&f>>0,s?(t=Te(t),t&&(typeof n=="string"||n!=null&&!of(n))&&(n=qt(n),!n&&Xt(t))?Mn(wt(t),0,s):t.split(n,s)):[]}var sy=Xi(function(t,n,s){return t+(s?" ":"")+ff(n)});function oy(t,n,s){return t=Te(t),s=s==null?0:Zr(ne(s),0,t.length),n=qt(n),t.slice(s,s+n.length)==n}function uy(t,n,s){var f=g.templateSettings;s&&bt(t,n,s)&&(n=e),t=Te(t),n=Oo({},n,f,Dc);var d=Oo({},n.imports,f.imports,Dc),x=lt(d),w=Ra(d,x),_,k,I=0,M=n.interpolate||Pi,O="__p += '",W=xr((n.escape||Pi).source+"|"+M.source+"|"+(M===Bn?ot:Pi).source+"|"+(n.evaluate||Pi).source+"|$","g"),q="//# sourceURL="+(be.call(n,"sourceURL")?(n.sourceURL+"").replace(/\\s/g," "):"lodash.templateSources["+ ++Tu+"]")+\` +\`;t.replace(W,function(Q,ue,he,zt,kt,$t){return he||(he=zt),O+=t.slice(I,$t).replace(ou,Wu),ue&&(_=!0,O+=\`' + +__e(\`+ue+\`) + '\`),kt&&(k=!0,O+=\`'; \`+kt+\`; -__p += '\`),pe&&(O+=\`' + -((__t = (\`+pe+\`)) == null ? '' : __t) + +__p += '\`),he&&(O+=\`' + +((__t = (\`+he+\`)) == null ? '' : __t) + '\`),I=$t+Q.length,Q}),O+=\`'; -\`;var j=Se.call(n,"variable")&&n.variable;if(!j)O=\`with (obj) { +\`;var j=be.call(n,"variable")&&n.variable;if(!j)O=\`with (obj) { \`+O+\` } -\`;else if(Vn.test(j))throw new X(p);O=(k?O.replace(pa,""):O).replace(Si,"$1").replace(Ae,"$1;"),O="function("+(j||"obj")+\`) { +\`;else if(Vn.test(j))throw new Z(p);O=(k?O.replace(pa,""):O).replace(_i,"$1").replace(Ae,"$1;"),O="function("+(j||"obj")+\`) { \`+(j?"":\`obj || (obj = {}); -\`)+"var __t, __p = ''"+(S?", __e = _.escape":"")+(k?\`, __j = Array.prototype.join; +\`)+"var __t, __p = ''"+(_?", __e = _.escape":"")+(k?\`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } \`:\`; \`)+O+\`return __p -}\`;var se=_h(function(){return ye(x,q+"return "+O).apply(e,w)});if(se.source=O,sf(se))throw se;return se}function ly(t){return Ce(t).toLowerCase()}function fy(t){return Ce(t).toUpperCase()}function cy(t,n,s){if(t=Ce(t),t&&(s||n===e))return Ys(t);if(!t||!(n=qt(n)))return t;var f=wt(t),d=wt(n),x=Ie(f,d),w=Bs(f,d)+1;return Mn(f,x,w).join("")}function hy(t,n,s){if(t=Ce(t),t&&(s||n===e))return t.slice(0,Oi(t)+1);if(!t||!(n=qt(n)))return t;var f=wt(t),d=Bs(f,wt(n))+1;return Mn(f,0,d).join("")}function py(t,n,s){if(t=Ce(t),t&&(s||n===e))return t.replace(Y,"");if(!t||!(n=qt(n)))return t;var f=wt(t),d=Ie(f,wt(n));return Mn(f,d).join("")}function dy(t,n){var s=Ge,f=pr;if(Be(n)){var d="separator"in n?n.separator:d;s="length"in n?ie(n.length):s,f="omission"in n?qt(n.omission):f}t=Ce(t);var x=t.length;if(Xt(t)){var w=wt(t);x=w.length}if(s>=x)return t;var S=s-Fr(f);if(S<1)return f;var k=w?Mn(w,0,S).join(""):t.slice(0,S);if(d===e)return k+f;if(w&&(S+=k.length-S),of(d)){if(t.slice(S).search(d)){var I,M=k;for(d.global||(d=xr(d.source,Ce(Qt.exec(d))+"g")),d.lastIndex=0;I=d.exec(M);)var O=I.index;k=k.slice(0,O===e?S:O)}}else if(t.indexOf(qt(d),S)!=S){var W=k.lastIndexOf(d);W>-1&&(k=k.slice(0,W))}return k+f}function my(t){return t=Ce(t),t&&bi.test(t)?t.replace(da,qu):t}var gy=Xi(function(t,n,s){return t+(s?" ":"")+n.toUpperCase()}),ff=Sc("toUpperCase");function wh(t,n,s){return t=Ce(t),n=s?e:n,n===e?Bu(t)?$u(t):Fu(t):t.match(n)||[]}var _h=ue(function(t,n){try{return ht(t,e,n)}catch(s){return sf(s)?s:new X(s)}}),yy=en(function(t,n){return Ue(n,function(s){s=Vr(s),Sr(t,s,nf(t[s],t))}),t});function xy(t){var n=t==null?0:t.length,s=$();return t=n?Pe(t,function(f){if(typeof f[1]!="function")throw new Et(l);return[s(f[0]),f[1]]}):[],ue(function(f){for(var d=-1;++dze)return[];var s=Pt,f=Ye(t,Pt);n=$(n),t-=Pt;for(var d=La(f,n);++s0||n<0)?new ae(s):(t<0?s=s.takeRight(-t):t&&(s=s.drop(t)),n!==e&&(n=ie(n),s=n<0?s.dropRight(-n):s.take(n-t)),s)},ae.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},ae.prototype.toArray=function(){return this.take(Pt)},Jt(ae.prototype,function(t,n){var s=/^(?:filter|find|map|reject)|While$/.test(n),f=/^(?:head|last)$/.test(n),d=g[f?"take"+(n=="last"?"Right":""):n],x=f||/^find/.test(n);!d||(g.prototype[n]=function(){var w=this.__wrapped__,S=f?[1]:arguments,k=w instanceof ae,I=S[0],M=k||te(w),O=function(le){var pe=d.apply(g,Zt([le],S));return f&&W?pe[0]:pe};M&&s&&typeof I=="function"&&I.length!=1&&(k=M=!1);var W=this.__chain__,q=!!this.__actions__.length,j=x&&!W,se=k&&!q;if(!x&&M){w=se?w:new ae(this);var Q=t.apply(w,S);return Q.__actions__.push({func:Co,args:[O],thisArg:e}),new Dt(Q,W)}return j&&se?t.apply(this,S):(Q=this.thru(O),j?f?Q.value()[0]:Q.value():Q)})}),Ue(["pop","push","shift","sort","splice","unshift"],function(t){var n=Gn[t],s=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",f=/^(?:pop|shift)$/.test(t);g.prototype[t]=function(){var d=arguments;if(f&&!this.__chain__){var x=this.value();return n.apply(te(x)?x:[],d)}return this[s](function(w){return n.apply(te(w)?w:[],d)})}}),Jt(ae.prototype,function(t,n){var s=g[n];if(s){var f=s.name+"";Se.call(Pn,f)||(Pn[f]=[]),Pn[f].push({name:n,func:s})}}),Pn[xo(e,we).name]=[{name:"wrapper",func:e}],ae.prototype.clone=ul,ae.prototype.reverse=ll,ae.prototype.value=fl,g.prototype.at=zm,g.prototype.chain=$m,g.prototype.commit=jm,g.prototype.next=Qm,g.prototype.plant=Zm,g.prototype.reverse=Xm,g.prototype.toJSON=g.prototype.valueOf=g.prototype.value=Jm,g.prototype.first=g.prototype.head,$n&&(g.prototype[$n]=Km),g},Nr=ju();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(et._=Nr,define(function(){return Nr})):Ar?((Ar.exports=Nr)._=Nr,Ea._=Nr):et._=Nr}).call(ra)});var Jh=Ch((Bf,ia)=>{(function(e,r){typeof Bf=="object"&&typeof ia<"u"?ia.exports=r():typeof define=="function"&&define.amd?define(r):e.moment=r()})(Bf,function(){"use strict";var e;function r(){return e.apply(null,arguments)}function a(i){e=i}function u(i){return i instanceof Array||Object.prototype.toString.call(i)==="[object Array]"}function l(i){return i!=null&&Object.prototype.toString.call(i)==="[object Object]"}function p(i,o){return Object.prototype.hasOwnProperty.call(i,o)}function v(i){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(i).length===0;var o;for(o in i)if(p(i,o))return!1;return!0}function C(i){return i===void 0}function T(i){return typeof i=="number"||Object.prototype.toString.call(i)==="[object Number]"}function A(i){return i instanceof Date||Object.prototype.toString.call(i)==="[object Date]"}function R(i,o){var c=[],h,m=i.length;for(h=0;h>>0,h;for(h=0;h0)for(c=0;c<_;c++)h=Xe[c],m=o[h],C(m)||(i[h]=m);return i}function tt(i){it(this,i),this._d=new Date(i._d!=null?i._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Re===!1&&(Re=!0,r.updateOffset(this),Re=!1)}function Te(i){return i instanceof tt||i!=null&&i._isAMomentObject!=null}function Je(i){r.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+i)}function Ge(i,o){var c=!0;return V(function(){if(r.deprecationHandler!=null&&r.deprecationHandler(null,i),c){var h=[],m,_,E,G=arguments.length;for(_=0;_=x)return t;var _=s-Fr(f);if(_<1)return f;var k=w?Mn(w,0,_).join(""):t.slice(0,_);if(d===e)return k+f;if(w&&(_+=k.length-_),of(d)){if(t.slice(_).search(d)){var I,M=k;for(d.global||(d=xr(d.source,Te(Qt.exec(d))+"g")),d.lastIndex=0;I=d.exec(M);)var O=I.index;k=k.slice(0,O===e?_:O)}}else if(t.indexOf(qt(d),_)!=_){var W=k.lastIndexOf(d);W>-1&&(k=k.slice(0,W))}return k+f}function my(t){return t=Te(t),t&&bi.test(t)?t.replace(da,qu):t}var gy=Xi(function(t,n,s){return t+(s?" ":"")+n.toUpperCase()}),ff=_c("toUpperCase");function wh(t,n,s){return t=Te(t),n=s?e:n,n===e?Bu(t)?$u(t):Fu(t):t.match(n)||[]}var Sh=oe(function(t,n){try{return ht(t,e,n)}catch(s){return sf(s)?s:new Z(s)}}),yy=en(function(t,n){return He(n,function(s){s=Vr(s),_r(t,s,nf(t[s],t))}),t});function xy(t){var n=t==null?0:t.length,s=$();return t=n?Ee(t,function(f){if(typeof f[1]!="function")throw new Et(l);return[s(f[0]),f[1]]}):[],oe(function(f){for(var d=-1;++dQe)return[];var s=Pt,f=Be(t,Pt);n=$(n),t-=Pt;for(var d=La(f,n);++s0||n<0)?new ie(s):(t<0?s=s.takeRight(-t):t&&(s=s.drop(t)),n!==e&&(n=ne(n),s=n<0?s.dropRight(-n):s.take(n-t)),s)},ie.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},ie.prototype.toArray=function(){return this.take(Pt)},Jt(ie.prototype,function(t,n){var s=/^(?:filter|find|map|reject)|While$/.test(n),f=/^(?:head|last)$/.test(n),d=g[f?"take"+(n=="last"?"Right":""):n],x=f||/^find/.test(n);!d||(g.prototype[n]=function(){var w=this.__wrapped__,_=f?[1]:arguments,k=w instanceof ie,I=_[0],M=k||ee(w),O=function(ue){var he=d.apply(g,Zt([ue],_));return f&&W?he[0]:he};M&&s&&typeof I=="function"&&I.length!=1&&(k=M=!1);var W=this.__chain__,q=!!this.__actions__.length,j=x&&!W,ae=k&&!q;if(!x&&M){w=ae?w:new ie(this);var Q=t.apply(w,_);return Q.__actions__.push({func:Co,args:[O],thisArg:e}),new Dt(Q,W)}return j&&ae?t.apply(this,_):(Q=this.thru(O),j?f?Q.value()[0]:Q.value():Q)})}),He(["pop","push","shift","sort","splice","unshift"],function(t){var n=Gn[t],s=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",f=/^(?:pop|shift)$/.test(t);g.prototype[t]=function(){var d=arguments;if(f&&!this.__chain__){var x=this.value();return n.apply(ee(x)?x:[],d)}return this[s](function(w){return n.apply(ee(w)?w:[],d)})}}),Jt(ie.prototype,function(t,n){var s=g[n];if(s){var f=s.name+"";be.call(Pn,f)||(Pn[f]=[]),Pn[f].push({name:n,func:s})}}),Pn[xo(e,_e).name]=[{name:"wrapper",func:e}],ie.prototype.clone=ul,ie.prototype.reverse=ll,ie.prototype.value=fl,g.prototype.at=zm,g.prototype.chain=$m,g.prototype.commit=jm,g.prototype.next=Qm,g.prototype.plant=Zm,g.prototype.reverse=Xm,g.prototype.toJSON=g.prototype.valueOf=g.prototype.value=Jm,g.prototype.first=g.prototype.head,$n&&(g.prototype[$n]=Km),g},Nr=ju();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(rt._=Nr,define(function(){return Nr})):Or?((Or.exports=Nr)._=Nr,Ea._=Nr):rt._=Nr}).call(ra)});var Jh=Ch((Bf,ia)=>{(function(e,r){typeof Bf=="object"&&typeof ia<"u"?ia.exports=r():typeof define=="function"&&define.amd?define(r):e.moment=r()})(Bf,function(){"use strict";var e;function r(){return e.apply(null,arguments)}function a(i){e=i}function u(i){return i instanceof Array||Object.prototype.toString.call(i)==="[object Array]"}function l(i){return i!=null&&Object.prototype.toString.call(i)==="[object Object]"}function p(i,o){return Object.prototype.hasOwnProperty.call(i,o)}function v(i){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(i).length===0;var o;for(o in i)if(p(i,o))return!1;return!0}function C(i){return i===void 0}function T(i){return typeof i=="number"||Object.prototype.toString.call(i)==="[object Number]"}function A(i){return i instanceof Date||Object.prototype.toString.call(i)==="[object Date]"}function R(i,o){var c=[],h,m=i.length;for(h=0;h>>0,h;for(h=0;h0)for(c=0;c=0;return(_?c?"+":"":"-")+Math.pow(10,Math.max(0,m)).toString().substr(1)+h}var Pt=/(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,mi=/(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,fa={},hn={};function H(i,o,c,h){var m=h;typeof h=="string"&&(m=function(){return this[h]()}),i&&(hn[i]=m),o&&(hn[o[0]]=function(){return xt(m.apply(this,arguments),o[1],o[2])}),c&&(hn[c]=function(){return this.localeData().ordinal(m.apply(this,arguments),i)})}function gi(i){return i.match(/\\[[\\s\\S]/)?i.replace(/^\\[|\\]$/g,""):i.replace(/\\\\/g,"")}function Ko(i){var o=i.match(Pt),c,h;for(c=0,h=o.length;c=0&&mi.test(i);)i=i.replace(mi,h),mi.lastIndex=0,c-=1;return i}var Zo={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function yi(i){var o=this._longDateFormat[i],c=this._longDateFormat[i.toUpperCase()];return o||!c?o:(this._longDateFormat[i]=c.match(Pt).map(function(h){return h==="MMMM"||h==="MM"||h==="DD"||h==="dddd"?h.slice(1):h}).join(""),this._longDateFormat[i])}var xi="Invalid date";function hs(){return this._invalidDate}var Yt="%d",Yn=/\\d{1,2}/;function Xo(i){return this._ordinal.replace("%d",i)}var dr={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ps(i,o,c,h){var m=this._relativeTime[c];return me(m)?m(i,o,c,h):m.replace(/%d/i,i)}function Jo(i,o){var c=this._relativeTime[i>0?"future":"past"];return me(c)?c(o):c.replace(/%s/i,o)}var mr={};function Ee(i,o){var c=i.toLowerCase();mr[c]=mr[c+"s"]=mr[o]=i}function st(i){return typeof i=="string"?mr[i]||mr[i.toLowerCase()]:void 0}function dn(i){var o={},c,h;for(h in i)p(i,h)&&(c=st(h),c&&(o[c]=i[h]));return o}var ds={};function Ve(i,o){ds[i]=o}function eu(i){var o=[],c;for(c in i)p(i,c)&&o.push({unit:c,priority:ds[c]});return o.sort(function(h,m){return h.priority-m.priority}),o}function Dr(i){return i%4===0&&i%100!==0||i%400===0}function rt(i){return i<0?Math.ceil(i)||0:Math.floor(i)}function re(i){var o=+i,c=0;return o!==0&&isFinite(o)&&(c=rt(o)),c}function Ir(i,o){return function(c){return c!=null?(vi(this,i,c),r.updateOffset(this,o),this):mn(this,i)}}function mn(i,o){return i.isValid()?i._d["get"+(i._isUTC?"UTC":"")+o]():NaN}function vi(i,o,c){i.isValid()&&!isNaN(c)&&(o==="FullYear"&&Dr(i.year())&&i.month()===1&&i.date()===29?(c=re(c),i._d["set"+(i._isUTC?"UTC":"")+o](c,i.month(),Ei(c,i.month()))):i._d["set"+(i._isUTC?"UTC":"")+o](c))}function ca(i){return i=st(i),me(this[i])?this[i]():this}function ha(i,o){if(typeof i=="object"){i=dn(i);var c=eu(i),h,m=c.length;for(h=0;h68?1900:2e3)};var ba=Ir("FullYear",!0);function du(){return Dr(this.year())}function vs(i,o,c,h,m,_,E){var G;return i<100&&i>=0?(G=new Date(i+400,o,c,h,m,_,E),isFinite(G.getFullYear())&&G.setFullYear(i)):G=new Date(i,o,c,h,m,_,E),G}function yn(i){var o,c;return i<100&&i>=0?(c=Array.prototype.slice.call(arguments),c[0]=i+400,o=new Date(Date.UTC.apply(null,c)),isFinite(o.getUTCFullYear())&&o.setUTCFullYear(i)):o=new Date(Date.UTC.apply(null,arguments)),o}function xn(i,o,c){var h=7+o-c,m=(7+yn(i,0,h).getUTCDay()-o)%7;return-m+h-1}function ws(i,o,c,h,m){var _=(7+c-h)%7,E=xn(i,h,m),G=1+7*(o-1)+_+E,ee,xe;return G<=0?(ee=i-1,xe=Mr(ee)+G):G>Mr(i)?(ee=i+1,xe=G-Mr(i)):(ee=i,xe=G),{year:ee,dayOfYear:xe}}function vn(i,o,c){var h=xn(i.year(),o,c),m=Math.floor((i.dayOfYear()-h-1)/7)+1,_,E;return m<1?(E=i.year()-1,_=m+Vt(E,o,c)):m>Vt(i.year(),o,c)?(_=m-Vt(i.year(),o,c),E=i.year()+1):(E=i.year(),_=m),{week:_,year:E}}function Vt(i,o,c){var h=xn(i,o,c),m=xn(i+1,o,c);return(Mr(i)-h+m)/7}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),Ee("week","w"),Ee("isoWeek","W"),Ve("week",5),Ve("isoWeek",5),Y("w",Ae),Y("ww",Ae,ct),Y("W",Ae),Y("WW",Ae,ct),Vn(["w","ww","W","WW"],function(i,o,c,h){o[h.substr(0,1)]=re(i)});function ka(i){return vn(i,this._week.dow,this._week.doy).week}var wn={dow:0,doy:6};function _s(){return this._week.dow}function Ss(){return this._week.doy}function mu(i){var o=this.localeData().week(this);return i==null?o:this.add((i-o)*7,"d")}function bs(i){var o=vn(this,1,4).week;return i==null?o:this.add((i-o)*7,"d")}H("d",0,"do","day"),H("dd",0,0,function(i){return this.localeData().weekdaysMin(this,i)}),H("ddd",0,0,function(i){return this.localeData().weekdaysShort(this,i)}),H("dddd",0,0,function(i){return this.localeData().weekdays(this,i)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),Ee("day","d"),Ee("weekday","e"),Ee("isoWeekday","E"),Ve("day",11),Ve("weekday",11),Ve("isoWeekday",11),Y("d",Ae),Y("e",Ae),Y("E",Ae),Y("dd",function(i,o){return o.weekdaysMinRegex(i)}),Y("ddd",function(i,o){return o.weekdaysShortRegex(i)}),Y("dddd",function(i,o){return o.weekdaysRegex(i)}),Vn(["dd","ddd","dddd"],function(i,o,c,h){var m=c._locale.weekdaysParse(i,h,c._strict);m!=null?o.d=m:N(c).invalidWeekday=i}),Vn(["d","e","E"],function(i,o,c,h){o[h]=re(i)});function ks(i,o){return typeof i!="string"?i:isNaN(i)?(i=o.weekdaysParse(i),typeof i=="number"?i:null):parseInt(i,10)}function Cs(i,o){return typeof i=="string"?o.weekdaysParse(i)%7||7:isNaN(i)?null:i}function Di(i,o){return i.slice(o,7).concat(i.slice(0,o))}var gu="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ts="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),yu="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ps=qr,xu=qr,vu=qr;function wu(i,o){var c=u(this._weekdays)?this._weekdays:this._weekdays[i&&i!==!0&&this._weekdays.isFormat.test(o)?"format":"standalone"];return i===!0?Di(c,this._week.dow):i?c[i.day()]:c}function _u(i){return i===!0?Di(this._weekdaysShort,this._week.dow):i?this._weekdaysShort[i.day()]:this._weekdaysShort}function Ca(i){return i===!0?Di(this._weekdaysMin,this._week.dow):i?this._weekdaysMin[i.day()]:this._weekdaysMin}function Su(i,o,c){var h,m,_,E=i.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],h=0;h<7;++h)_=Z([2e3,1]).day(h),this._minWeekdaysParse[h]=this.weekdaysMin(_,"").toLocaleLowerCase(),this._shortWeekdaysParse[h]=this.weekdaysShort(_,"").toLocaleLowerCase(),this._weekdaysParse[h]=this.weekdays(_,"").toLocaleLowerCase();return c?o==="dddd"?(m=Le.call(this._weekdaysParse,E),m!==-1?m:null):o==="ddd"?(m=Le.call(this._shortWeekdaysParse,E),m!==-1?m:null):(m=Le.call(this._minWeekdaysParse,E),m!==-1?m:null):o==="dddd"?(m=Le.call(this._weekdaysParse,E),m!==-1||(m=Le.call(this._shortWeekdaysParse,E),m!==-1)?m:(m=Le.call(this._minWeekdaysParse,E),m!==-1?m:null)):o==="ddd"?(m=Le.call(this._shortWeekdaysParse,E),m!==-1||(m=Le.call(this._weekdaysParse,E),m!==-1)?m:(m=Le.call(this._minWeekdaysParse,E),m!==-1?m:null)):(m=Le.call(this._minWeekdaysParse,E),m!==-1||(m=Le.call(this._weekdaysParse,E),m!==-1)?m:(m=Le.call(this._shortWeekdaysParse,E),m!==-1?m:null))}function bu(i,o,c){var h,m,_;if(this._weekdaysParseExact)return Su.call(this,i,o,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),h=0;h<7;h++){if(m=Z([2e3,1]).day(h),c&&!this._fullWeekdaysParse[h]&&(this._fullWeekdaysParse[h]=new RegExp("^"+this.weekdays(m,"").replace(".","\\\\.?")+"$","i"),this._shortWeekdaysParse[h]=new RegExp("^"+this.weekdaysShort(m,"").replace(".","\\\\.?")+"$","i"),this._minWeekdaysParse[h]=new RegExp("^"+this.weekdaysMin(m,"").replace(".","\\\\.?")+"$","i")),this._weekdaysParse[h]||(_="^"+this.weekdays(m,"")+"|^"+this.weekdaysShort(m,"")+"|^"+this.weekdaysMin(m,""),this._weekdaysParse[h]=new RegExp(_.replace(".",""),"i")),c&&o==="dddd"&&this._fullWeekdaysParse[h].test(i))return h;if(c&&o==="ddd"&&this._shortWeekdaysParse[h].test(i))return h;if(c&&o==="dd"&&this._minWeekdaysParse[h].test(i))return h;if(!c&&this._weekdaysParse[h].test(i))return h}}function ku(i){if(!this.isValid())return i!=null?this:NaN;var o=this._isUTC?this._d.getUTCDay():this._d.getDay();return i!=null?(i=ks(i,this.localeData()),this.add(i-o,"d")):o}function Cu(i){if(!this.isValid())return i!=null?this:NaN;var o=(this.day()+7-this.localeData()._week.dow)%7;return i==null?o:this.add(i-o,"d")}function Tu(i){if(!this.isValid())return i!=null?this:NaN;if(i!=null){var o=Cs(i,this.localeData());return this.day(this.day()%7?o:o-7)}else return this.day()||7}function Oe(i){return this._weekdaysParseExact?(p(this,"_weekdaysRegex")||Ta.call(this),i?this._weekdaysStrictRegex:this._weekdaysRegex):(p(this,"_weekdaysRegex")||(this._weekdaysRegex=Ps),this._weekdaysStrictRegex&&i?this._weekdaysStrictRegex:this._weekdaysRegex)}function De(i){return this._weekdaysParseExact?(p(this,"_weekdaysRegex")||Ta.call(this),i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(p(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=xu),this._weekdaysShortStrictRegex&&i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Pu(i){return this._weekdaysParseExact?(p(this,"_weekdaysRegex")||Ta.call(this),i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(p(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=vu),this._weekdaysMinStrictRegex&&i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ta(){function i(dt,rr){return rr.length-dt.length}var o=[],c=[],h=[],m=[],_,E,G,ee,xe;for(_=0;_<7;_++)E=Z([2e3,1]).day(_),G=vt(this.weekdaysMin(E,"")),ee=vt(this.weekdaysShort(E,"")),xe=vt(this.weekdays(E,"")),o.push(G),c.push(ee),h.push(xe),m.push(G),m.push(ee),m.push(xe);o.sort(i),c.sort(i),h.sort(i),m.sort(i),this._weekdaysRegex=new RegExp("^("+m.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Pa(){return this.hours()%12||12}function Eu(){return this.hours()||24}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Pa),H("k",["kk",2],0,Eu),H("hmm",0,0,function(){return""+Pa.apply(this)+xt(this.minutes(),2)}),H("hmmss",0,0,function(){return""+Pa.apply(this)+xt(this.minutes(),2)+xt(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+xt(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+xt(this.minutes(),2)+xt(this.seconds(),2)});function Es(i,o){H(i,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),o)})}Es("a",!0),Es("A",!1),Ee("hour","h"),Ve("hour",13);function Ds(i,o){return o._meridiemParse}Y("a",Ds),Y("A",Ds),Y("H",Ae),Y("h",Ae),Y("k",Ae),Y("HH",Ae,ct),Y("hh",Ae,ct),Y("kk",Ae,ct),Y("hmm",da),Y("hmmss",ma),Y("Hmm",da),Y("Hmmss",ma),ke(["H","HH"],$e),ke(["k","kk"],function(i,o,c){var h=re(i);o[$e]=h===24?0:h}),ke(["a","A"],function(i,o,c){c._isPm=c._locale.isPM(i),c._meridiem=i}),ke(["h","hh"],function(i,o,c){o[$e]=re(i),N(c).bigHour=!0}),ke("hmm",function(i,o,c){var h=i.length-2;o[$e]=re(i.substr(0,h)),o[Bt]=re(i.substr(h)),N(c).bigHour=!0}),ke("hmmss",function(i,o,c){var h=i.length-4,m=i.length-2;o[$e]=re(i.substr(0,h)),o[Bt]=re(i.substr(h,2)),o[gr]=re(i.substr(m)),N(c).bigHour=!0}),ke("Hmm",function(i,o,c){var h=i.length-2;o[$e]=re(i.substr(0,h)),o[Bt]=re(i.substr(h))}),ke("Hmmss",function(i,o,c){var h=i.length-4,m=i.length-2;o[$e]=re(i.substr(0,h)),o[Bt]=re(i.substr(h,2)),o[gr]=re(i.substr(m))});function Is(i){return(i+"").toLowerCase().charAt(0)==="p"}var Du=/[ap]\\.?m?\\.?/i,et=Ir("Hours",!0);function Ea(i,o,c){return i>11?c?"pm":"PM":c?"am":"AM"}var Ar={calendar:ze,longDateFormat:Zo,invalidDate:xi,ordinal:Yt,dayOfMonthOrdinalParse:Yn,relativeTime:dr,months:uu,monthsShort:ms,week:wn,weekdays:gu,weekdaysMin:yu,weekdaysShort:Ts,meridiemParse:Du},Fe={},zr={},ut;function Ms(i,o){var c,h=Math.min(i.length,o.length);for(c=0;c0;){if(m=Un(_.slice(0,c).join("-")),m)return m;if(h&&h.length>=c&&Ms(_,h)>=c-1)break;c--}o++}return ut}function Os(i){return i.match("^[^/\\\\\\\\]*$")!=null}function Un(i){var o=null,c;if(Fe[i]===void 0&&typeof ia<"u"&&ia&&ia.exports&&Os(i))try{o=ut._abbr,c=require,c("./locale/"+i),yr(o)}catch{Fe[i]=null}return Fe[i]}function yr(i,o){var c;return i&&(C(o)?c=Ue(i):c=ht(i,o),c?ut=c:typeof console<"u"&&console.warn&&console.warn("Locale "+i+" not found. Did you forget to load it?")),ut._abbr}function ht(i,o){if(o!==null){var c,h=Ar;if(o.abbr=i,Fe[i]!=null)jt("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),h=Fe[i]._config;else if(o.parentLocale!=null)if(Fe[o.parentLocale]!=null)h=Fe[o.parentLocale]._config;else if(c=Un(o.parentLocale),c!=null)h=c._config;else return zr[o.parentLocale]||(zr[o.parentLocale]=[]),zr[o.parentLocale].push({name:i,config:o}),null;return Fe[i]=new Rt(mt(h,o)),zr[i]&&zr[i].forEach(function(m){ht(m.name,m.config)}),yr(i),Fe[i]}else return delete Fe[i],null}function Iu(i,o){if(o!=null){var c,h,m=Ar;Fe[i]!=null&&Fe[i].parentLocale!=null?Fe[i].set(mt(Fe[i]._config,o)):(h=Un(i),h!=null&&(m=h._config),o=mt(m,o),h==null&&(o.abbr=i),c=new Rt(o),c.parentLocale=Fe[i],Fe[i]=c),yr(i)}else Fe[i]!=null&&(Fe[i].parentLocale!=null?(Fe[i]=Fe[i].parentLocale,i===yr()&&yr(i)):Fe[i]!=null&&delete Fe[i]);return Fe[i]}function Ue(i){var o;if(i&&i._locale&&i._locale._abbr&&(i=i._locale._abbr),!i)return ut;if(!u(i)){if(o=Un(i),o)return o;i=[i]}return As(i)}function Mu(){return Me(Fe)}function Ii(i){var o,c=i._a;return c&&N(i).overflow===-2&&(o=c[Qt]<0||c[Qt]>11?Qt:c[Kt]<1||c[Kt]>Ei(c[ot],c[Qt])?Kt:c[$e]<0||c[$e]>24||c[$e]===24&&(c[Bt]!==0||c[gr]!==0||c[Gr]!==0)?$e:c[Bt]<0||c[Bt]>59?Bt:c[gr]<0||c[gr]>59?gr:c[Gr]<0||c[Gr]>999?Gr:-1,N(i)._overflowDayOfYear&&(oKt)&&(o=Kt),N(i)._overflowWeeks&&o===-1&&(o=su),N(i)._overflowWeekday&&o===-1&&(o=Pi),N(i).overflow=o),i}var Or=/^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,Mi=/^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,Ia=/Z|[+-]\\d\\d(?::?\\d\\d)?/,Pe=[["YYYYYY-MM-DD",/[+-]\\d{6}-\\d\\d-\\d\\d/],["YYYY-MM-DD",/\\d{4}-\\d\\d-\\d\\d/],["GGGG-[W]WW-E",/\\d{4}-W\\d\\d-\\d/],["GGGG-[W]WW",/\\d{4}-W\\d\\d/,!1],["YYYY-DDD",/\\d{4}-\\d{3}/],["YYYY-MM",/\\d{4}-\\d\\d/,!1],["YYYYYYMMDD",/[+-]\\d{10}/],["YYYYMMDD",/\\d{8}/],["GGGG[W]WWE",/\\d{4}W\\d{3}/],["GGGG[W]WW",/\\d{4}W\\d{2}/,!1],["YYYYDDD",/\\d{7}/],["YYYYMM",/\\d{6}/,!1],["YYYY",/\\d{4}/,!1]],Zt=[["HH:mm:ss.SSSS",/\\d\\d:\\d\\d:\\d\\d\\.\\d+/],["HH:mm:ss,SSSS",/\\d\\d:\\d\\d:\\d\\d,\\d+/],["HH:mm:ss",/\\d\\d:\\d\\d:\\d\\d/],["HH:mm",/\\d\\d:\\d\\d/],["HHmmss.SSSS",/\\d\\d\\d\\d\\d\\d\\.\\d+/],["HHmmss,SSSS",/\\d\\d\\d\\d\\d\\d,\\d+/],["HHmmss",/\\d\\d\\d\\d\\d\\d/],["HHmm",/\\d\\d\\d\\d/],["HH",/\\d\\d/]],Ma=/^\\/?Date\\((-?\\d+)/i,Au=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,Aa={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Fs(i){var o,c,h=i._i,m=Or.exec(h)||Mi.exec(h),_,E,G,ee,xe=Pe.length,dt=Zt.length;if(m){for(N(i).iso=!0,o=0,c=xe;oMr(E)||i._dayOfYear===0)&&(N(i)._overflowDayOfYear=!0),c=yn(E,0,i._dayOfYear),i._a[Qt]=c.getUTCMonth(),i._a[Kt]=c.getUTCDate()),o=0;o<3&&i._a[o]==null;++o)i._a[o]=h[o]=m[o];for(;o<7;o++)i._a[o]=h[o]=i._a[o]==null?o===2?1:0:i._a[o];i._a[$e]===24&&i._a[Bt]===0&&i._a[gr]===0&&i._a[Gr]===0&&(i._nextDay=!0,i._a[$e]=0),i._d=(i._useUTC?yn:vs).apply(null,h),_=i._useUTC?i._d.getUTCDay():i._d.getDay(),i._tzm!=null&&i._d.setUTCMinutes(i._d.getUTCMinutes()-i._tzm),i._nextDay&&(i._a[$e]=24),i._w&&typeof i._w.d<"u"&&i._w.d!==_&&(N(i).weekdayMismatch=!0)}}function Ws(i){var o,c,h,m,_,E,G,ee,xe;o=i._w,o.GG!=null||o.W!=null||o.E!=null?(_=1,E=4,c=$r(o.GG,i._a[ot],vn(Ie(),1,4).year),h=$r(o.W,1),m=$r(o.E,1),(m<1||m>7)&&(ee=!0)):(_=i._locale._week.dow,E=i._locale._week.doy,xe=vn(Ie(),_,E),c=$r(o.gg,i._a[ot],xe.year),h=$r(o.w,xe.week),o.d!=null?(m=o.d,(m<0||m>6)&&(ee=!0)):o.e!=null?(m=o.e+_,(o.e<0||o.e>6)&&(ee=!0)):m=_),h<1||h>Vt(c,_,E)?N(i)._overflowWeeks=!0:ee!=null?N(i)._overflowWeekday=!0:(G=ws(c,h,m,_,E),i._a[ot]=G.year,i._dayOfYear=G.dayOfYear)}r.ISO_8601=function(){},r.RFC_2822=function(){};function Fa(i){if(i._f===r.ISO_8601){Fs(i);return}if(i._f===r.RFC_2822){Ls(i);return}i._a=[],N(i).empty=!0;var o=""+i._i,c,h,m,_,E,G=o.length,ee=0,xe,dt;for(m=pn(i._f,i._locale).match(Pt)||[],dt=m.length,c=0;c0&&N(i).unusedInput.push(E),o=o.slice(o.indexOf(h)+h.length),ee+=h.length),hn[_]?(h?N(i).empty=!1:N(i).unusedTokens.push(_),au(_,h,i)):i._strict&&!h&&N(i).unusedTokens.push(_);N(i).charsLeftOver=G-ee,o.length>0&&N(i).unusedInput.push(o),i._a[$e]<=12&&N(i).bigHour===!0&&i._a[$e]>0&&(N(i).bigHour=void 0),N(i).parsedDateParts=i._a.slice(0),N(i).meridiem=i._meridiem,i._a[$e]=Na(i._locale,i._a[$e],i._meridiem),xe=N(i).era,xe!==null&&(i._a[ot]=i._locale.erasConvertYear(xe,i._a[ot])),Hn(i),Ii(i)}function Na(i,o,c){var h;return c==null?o:i.meridiemHour!=null?i.meridiemHour(o,c):(i.isPM!=null&&(h=i.isPM(c),h&&o<12&&(o+=12),!h&&o===12&&(o=0)),o)}function La(i){var o,c,h,m,_,E,G=!1,ee=i._f.length;if(ee===0){N(i).invalidFormat=!0,i._d=new Date(NaN);return}for(m=0;mthis?this:i:K()});function Vs(i,o){var c,h;if(o.length===1&&u(o[0])&&(o=o[0]),!o.length)return Ie();for(c=o[0],h=1;hthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function D(){if(!C(this._isDSTShifted))return this._isDSTShifted;var i={},o;return it(i,this),i=gt(i),i._a?(o=i._isUTC?Z(i._a):Ie(i._a),this._isDSTShifted=this.isValid()&&Uu(i._a,o.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function P(){return this.isValid()?!this._isUTC:!1}function B(){return this.isValid()?this._isUTC:!1}function X(){return this.isValid()?this._isUTC&&this._offset===0:!1}var ye=/^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,je=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function oe(i,o){var c=i,h=null,m,_,E;return Ut(i)?c={ms:i._milliseconds,d:i._days,M:i._months}:T(i)||!isNaN(+i)?(c={},o?c[o]=+i:c.milliseconds=+i):(h=ye.exec(i))?(m=h[1]==="-"?-1:1,c={y:0,d:re(h[Kt])*m,h:re(h[$e])*m,m:re(h[Bt])*m,s:re(h[gr])*m,ms:re(bn(h[Gr]*1e3))*m}):(h=je.exec(i))?(m=h[1]==="-"?-1:1,c={y:xr(h[2],m),M:xr(h[3],m),w:xr(h[4],m),d:xr(h[5],m),h:xr(h[6],m),m:xr(h[7],m),s:xr(h[8],m)}):c==null?c={}:typeof c=="object"&&("from"in c||"to"in c)&&(E=Et(Ie(c.from),Ie(c.to)),c={},c.ms=E.milliseconds,c.M=E.months),_=new qn(c),Ut(i)&&p(i,"_locale")&&(_._locale=i._locale),Ut(i)&&p(i,"_isValid")&&(_._isValid=i._isValid),_}oe.fn=qn.prototype,oe.invalid=Wa;function xr(i,o){var c=i&&parseFloat(i.replace(",","."));return(isNaN(c)?0:c)*o}function Hs(i,o){var c={};return c.months=o.month()-i.month()+(o.year()-i.year())*12,i.clone().add(c.months,"M").isAfter(o)&&--c.months,c.milliseconds=+o-+i.clone().add(c.months,"M"),c}function Et(i,o){var c;return i.isValid()&&o.isValid()?(o=wt(o,i),i.isBefore(o)?c=Hs(i,o):(c=Hs(o,i),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function Gn(i,o){return function(c,h){var m,_;return h!==null&&!isNaN(+h)&&(jt(o,"moment()."+o+"(period, number) is deprecated. Please use moment()."+o+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),_=c,c=h,h=_),m=oe(c,h),qs(this,m,i),this}}function qs(i,o,c,h){var m=o._milliseconds,_=bn(o._days),E=bn(o._months);!i.isValid()||(h=h??!0,E&&va(i,mn(i,"Month")+E*c),_&&vi(i,"Date",mn(i,"Date")+_*c),m&&i._d.setTime(i._d.valueOf()+m*c),h&&r.updateOffset(i,_||E))}var kn=Gn(1,"add"),Fi=Gn(-1,"subtract");function zn(i){return typeof i=="string"||i instanceof String}function Se(i){return Te(i)||A(i)||zn(i)||T(i)||Gs(i)||Qu(i)||i===null||i===void 0}function Qu(i){var o=l(i)&&!v(i),c=!1,h=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],m,_,E=h.length;for(m=0;mc.valueOf():c.valueOf()9999?Er(c,o?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):me(Date.prototype.toISOString)?o?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Er(c,"Z")):Er(c,o?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Qr(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var i="moment",o="",c,h,m,_;return this.isLocal()||(i=this.utcOffset()===0?"moment.utc":"moment.parseZone",o="Z"),c="["+i+'("]',h=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",m="-MM-DD[T]HH:mm:ss.SSS",_=o+'[")]',this.format(c+h+m+_)}function Yi(i){i||(i=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var o=Er(this,i);return this.localeData().postformat(o)}function Ju(i,o){return this.isValid()&&(Te(i)&&i.isValid()||Ie(i).isValid())?oe({to:this,from:i}).locale(this.locale()).humanize(!o):this.localeData().invalidDate()}function el(i){return this.from(Ie(),i)}function tl(i,o){return this.isValid()&&(Te(i)&&i.isValid()||Ie(i).isValid())?oe({from:this,to:i}).locale(this.locale()).humanize(!o):this.localeData().invalidDate()}function Bi(i){return this.to(Ie(),i)}function jn(i){var o;return i===void 0?this._locale._abbr:(o=Ue(i),o!=null&&(this._locale=o),this)}var Vi=Ge("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(i){return i===void 0?this.localeData():this.locale(i)});function Ks(){return this._locale}var Qn=1e3,Cn=60*Qn,Ui=60*Cn,He=(365*400+97)*24*Ui;function Ye(i,o){return(i%o+o)%o}function Zs(i,o,c){return i<100&&i>=0?new Date(i+400,o,c)-He:new Date(i,o,c).valueOf()}function Xs(i,o,c){return i<100&&i>=0?Date.UTC(i+400,o,c)-He:Date.UTC(i,o,c)}function Js(i){var o,c;if(i=st(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(c=this._isUTC?Xs:Zs,i){case"year":o=c(this.year(),0,1);break;case"quarter":o=c(this.year(),this.month()-this.month()%3,1);break;case"month":o=c(this.year(),this.month(),1);break;case"week":o=c(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":o=c(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":o=c(this.year(),this.month(),this.date());break;case"hour":o=this._d.valueOf(),o-=Ye(o+(this._isUTC?0:this.utcOffset()*Cn),Ui);break;case"minute":o=this._d.valueOf(),o-=Ye(o,Cn);break;case"second":o=this._d.valueOf(),o-=Ye(o,Qn);break}return this._d.setTime(o),r.updateOffset(this,!0),this}function rl(i){var o,c;if(i=st(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(c=this._isUTC?Xs:Zs,i){case"year":o=c(this.year()+1,0,1)-1;break;case"quarter":o=c(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":o=c(this.year(),this.month()+1,1)-1;break;case"week":o=c(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":o=c(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":o=c(this.year(),this.month(),this.date()+1)-1;break;case"hour":o=this._d.valueOf(),o+=Ui-Ye(o+(this._isUTC?0:this.utcOffset()*Cn),Ui)-1;break;case"minute":o=this._d.valueOf(),o+=Cn-Ye(o,Cn)-1;break;case"second":o=this._d.valueOf(),o+=Qn-Ye(o,Qn)-1;break}return this._d.setTime(o),r.updateOffset(this,!0),this}function Ya(){return this._d.valueOf()-(this._offset||0)*6e4}function Kn(){return Math.floor(this.valueOf()/1e3)}function Ba(){return new Date(this.valueOf())}function Tn(){var i=this;return[i.year(),i.month(),i.date(),i.hour(),i.minute(),i.second(),i.millisecond()]}function Zn(){var i=this;return{years:i.year(),months:i.month(),date:i.date(),hours:i.hours(),minutes:i.minutes(),seconds:i.seconds(),milliseconds:i.milliseconds()}}function Xn(){return this.isValid()?this.toISOString():null}function Hi(){return Ne(this)}function Pn(){return V({},N(this))}function nl(){return N(this).overflow}function il(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),Y("N",ae),Y("NN",ae),Y("NNN",ae),Y("NNNN",ul),Y("NNNNN",ll),ke(["N","NN","NNN","NNNN","NNNNN"],function(i,o,c,h){var m=c._locale.erasParse(i,h,c._strict);m?N(c).era=m:N(c).invalidEra=i}),Y("y",gn),Y("yy",gn),Y("yyy",gn),Y("yyyy",gn),Y("yo",fl),ke(["y","yy","yyy","yyyy"],ot),ke(["yo"],function(i,o,c,h){var m;c._locale._eraYearOrdinalRegex&&(m=i.match(c._locale._eraYearOrdinalRegex)),c._locale.eraYearOrdinalParse?o[ot]=c._locale.eraYearOrdinalParse(i,m):o[ot]=parseInt(i,10)});function al(i,o){var c,h,m,_=this._eras||Ue("en")._eras;for(c=0,h=_.length;c=0)return _[h]}function ol(i,o){var c=i.since<=i.until?1:-1;return o===void 0?r(i.since).year():r(i.since).year()+(o-i.offset)*c}function qi(){var i,o,c,h=this.localeData().eras();for(i=0,o=h.length;i_&&(o=_),gl.call(this,i,o,c,h,m))}function gl(i,o,c,h,m){var _=ws(i,o,c,h,m),E=yn(_.year,0,_.dayOfYear);return this.year(E.getUTCFullYear()),this.month(E.getUTCMonth()),this.date(E.getUTCDate()),this}H("Q",0,"Qo","quarter"),Ee("quarter","Q"),Ve("quarter",7),Y("Q",wi),ke("Q",function(i,o){o[Qt]=(re(i)-1)*3});function yl(i){return i==null?Math.ceil((this.month()+1)/3):this.month((i-1)*3+this.month()%3)}H("D",["DD",2],"Do","date"),Ee("date","D"),Ve("date",9),Y("D",Ae),Y("DD",Ae,ct),Y("Do",function(i,o){return i?o._dayOfMonthOrdinalParse||o._ordinalParse:o._dayOfMonthOrdinalParseLenient}),ke(["D","DD"],Kt),ke("Do",function(i,o){o[Kt]=re(i.match(Ae)[0])});var ro=Ir("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),Ee("dayOfYear","DDD"),Ve("dayOfYear",4),Y("DDD",bi),Y("DDDD",_i),ke(["DDD","DDDD"],function(i,o,c){c._dayOfYear=re(i)});function _r(i){var o=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return i==null?o:this.add(i-o,"d")}H("m",["mm",2],0,"minute"),Ee("minute","m"),Ve("minute",14),Y("m",Ae),Y("mm",Ae,ct),ke(["m","mm"],Bt);var xl=Ir("Minutes",!1);H("s",["ss",2],0,"second"),Ee("second","s"),Ve("second",15),Y("s",Ae),Y("ss",Ae,ct),ke(["s","ss"],gr);var vl=Ir("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return this.millisecond()*10}),H(0,["SSSSS",5],0,function(){return this.millisecond()*100}),H(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),H(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),H(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),H(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Ee("millisecond","ms"),Ve("millisecond",16),Y("S",bi,wi),Y("SS",bi,ct),Y("SSS",bi,_i);var Rr,no;for(Rr="SSSS";Rr.length<=9;Rr+="S")Y(Rr,gn);function wl(i,o){o[Gr]=re(("0."+i)*1e3)}for(Rr="S";Rr.length<=9;Rr+="S")ke(Rr,wl);no=Ir("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");function Kr(){return this._isUTC?"UTC":""}function _l(){return this._isUTC?"Coordinated Universal Time":""}var F=tt.prototype;F.add=kn,F.calendar=Zu,F.clone=Xu,F.diff=js,F.endOf=rl,F.format=Yi,F.from=Ju,F.fromNow=el,F.to=tl,F.toNow=Bi,F.get=ca,F.invalidAt=nl,F.isAfter=Li,F.isBefore=Lr,F.isBetween=Ri,F.isSame=zs,F.isSameOrAfter=Wi,F.isSameOrBefore=$s,F.isValid=Hi,F.lang=Vi,F.locale=jn,F.localeData=Ks,F.max=Lu,F.min=Bs,F.parsingFlags=Pn,F.set=ha,F.startOf=Js,F.subtract=Fi,F.toArray=Tn,F.toObject=Zn,F.toDate=Ba,F.toISOString=$n,F.inspect=Qr,typeof Symbol<"u"&&Symbol.for!=null&&(F[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),F.toJSON=Xn,F.toString=Qs,F.unix=Kn,F.valueOf=Ya,F.creationData=il,F.eraName=qi,F.eraNarrow=Jn,F.eraAbbr=eo,F.eraYear=g,F.year=ba,F.isLeapYear=du,F.weekYear=cl,F.isoWeekYear=hl,F.quarter=F.quarters=yl,F.month=wa,F.daysInMonth=xs,F.week=F.weeks=mu,F.isoWeek=F.isoWeeks=bs,F.weeksInYear=wr,F.weeksInWeekYear=ml,F.isoWeeksInYear=pl,F.isoWeeksInISOWeekYear=dl,F.date=ro,F.day=F.days=ku,F.weekday=Cu,F.isoWeekday=Tu,F.dayOfYear=_r,F.hour=F.hours=et,F.minute=F.minutes=xl,F.second=F.seconds=vl,F.millisecond=F.milliseconds=no,F.utcOffset=qu,F.utc=zu,F.local=$u,F.parseZone=ju,F.hasAlignedHourOffset=Nr,F.isDST=b,F.isLocal=P,F.isUtcOffset=B,F.isUtc=X,F.isUTC=X,F.zoneAbbr=Kr,F.zoneName=_l,F.dates=Ge("dates accessor is deprecated. Use date instead.",ro),F.months=Ge("months accessor is deprecated. Use month instead",wa),F.years=Ge("years accessor is deprecated. Use year instead",ba),F.zone=Ge("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Gu),F.isDSTShifted=Ge("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",D);function Ht(i){return Ie(i*1e3)}function Sl(){return Ie.apply(null,arguments).parseZone()}function io(i){return i}var ge=Rt.prototype;ge.calendar=Wt,ge.longDateFormat=yi,ge.invalidDate=hs,ge.ordinal=Xo,ge.preparse=io,ge.postformat=io,ge.relativeTime=ps,ge.pastFuture=Jo,ge.set=at,ge.eras=al,ge.erasParse=sl,ge.erasConvertYear=ol,ge.erasAbbrRegex=Gi,ge.erasNameRegex=En,ge.erasNarrowRegex=Dt,ge.months=lu,ge.monthsShort=fu,ge.monthsParse=hu,ge.monthsRegex=pu,ge.monthsShortRegex=_a,ge.week=ka,ge.firstDayOfYear=Ss,ge.firstDayOfWeek=_s,ge.weekdays=wu,ge.weekdaysMin=Ca,ge.weekdaysShort=_u,ge.weekdaysParse=bu,ge.weekdaysRegex=Oe,ge.weekdaysShortRegex=De,ge.weekdaysMinRegex=Pu,ge.isPM=Is,ge.meridiem=Ea;function $i(i,o,c,h){var m=Ue(),_=Z().set(h,o);return m[c](_,i)}function ao(i,o,c){if(T(i)&&(o=i,i=void 0),i=i||"",o!=null)return $i(i,o,c,"month");var h,m=[];for(h=0;h<12;h++)m[h]=$i(i,h,c,"month");return m}function ji(i,o,c,h){typeof i=="boolean"?(T(o)&&(c=o,o=void 0),o=o||""):(o=i,c=o,i=!1,T(o)&&(c=o,o=void 0),o=o||"");var m=Ue(),_=i?m._week.dow:0,E,G=[];if(c!=null)return $i(o,(c+_)%7,h,"day");for(E=0;E<7;E++)G[E]=$i(o,(E+_)%7,h,"day");return G}function so(i,o){return ao(i,o,"months")}function bl(i,o){return ao(i,o,"monthsShort")}function kl(i,o,c){return ji(i,o,c,"weekdays")}function Va(i,o,c){return ji(i,o,c,"weekdaysShort")}function ei(i,o,c){return ji(i,o,c,"weekdaysMin")}yr("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\\d{1,2}(th|st|nd|rd)/,ordinal:function(i){var o=i%10,c=re(i%100/10)===1?"th":o===1?"st":o===2?"nd":o===3?"rd":"th";return i+c}}),r.lang=Ge("moment.lang is deprecated. Use moment.locale instead.",yr),r.langData=Ge("moment.langData is deprecated. Use moment.localeData instead.",Ue);var It=Math.abs;function Cl(){var i=this._data;return this._milliseconds=It(this._milliseconds),this._days=It(this._days),this._months=It(this._months),i.milliseconds=It(i.milliseconds),i.seconds=It(i.seconds),i.minutes=It(i.minutes),i.hours=It(i.hours),i.months=It(i.months),i.years=It(i.years),this}function Ua(i,o,c,h){var m=oe(o,c);return i._milliseconds+=h*m._milliseconds,i._days+=h*m._days,i._months+=h*m._months,i._bubble()}function Tl(i,o){return Ua(this,i,o,1)}function Sr(i,o){return Ua(this,i,o,-1)}function Qi(i){return i<0?Math.floor(i):Math.ceil(i)}function Zr(){var i=this._milliseconds,o=this._days,c=this._months,h=this._data,m,_,E,G,ee;return i>=0&&o>=0&&c>=0||i<=0&&o<=0&&c<=0||(i+=Qi(Ha(c)+o)*864e5,o=0,c=0),h.milliseconds=i%1e3,m=rt(i/1e3),h.seconds=m%60,_=rt(m/60),h.minutes=_%60,E=rt(_/60),h.hours=E%24,o+=rt(E/24),ee=rt(_t(o)),c+=ee,o-=Qi(Ha(ee)),G=rt(c/12),c%=12,h.days=o,h.months=c,h.years=G,this}function _t(i){return i*4800/146097}function Ha(i){return i*146097/4800}function oo(i){if(!this.isValid())return NaN;var o,c,h=this._milliseconds;if(i=st(i),i==="month"||i==="quarter"||i==="year")switch(o=this._days+h/864e5,c=this._months+_t(o),i){case"month":return c;case"quarter":return c/3;case"year":return c/12}else switch(o=this._days+Math.round(Ha(this._months)),i){case"week":return o/7+h/6048e5;case"day":return o+h/864e5;case"hour":return o*24+h/36e5;case"minute":return o*1440+h/6e4;case"second":return o*86400+h/1e3;case"millisecond":return Math.floor(o*864e5)+h;default:throw new Error("Unknown unit "+i)}}function uo(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+re(this._months/12)*31536e6:NaN}function St(i){return function(){return this.as(i)}}var Wr=St("ms"),lo=St("s"),Pl=St("m"),Ki=St("h"),El=St("d"),fo=St("w"),nt=St("M"),qa=St("Q"),co=St("y");function Jt(){return oe(this)}function Ga(i){return i=st(i),this.isValid()?this[i+"s"]():NaN}function er(i){return function(){return this.isValid()?this._data[i]:NaN}}var Xr=er("milliseconds"),ho=er("seconds"),pt=er("minutes"),za=er("hours"),Dl=er("days"),Il=er("months"),Ml=er("years");function $a(){return rt(this.days()/7)}var br=Math.round,tr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function po(i,o,c,h,m){return m.relativeTime(o||1,!!c,i,h)}function Al(i,o,c,h){var m=oe(i).abs(),_=br(m.as("s")),E=br(m.as("m")),G=br(m.as("h")),ee=br(m.as("d")),xe=br(m.as("M")),dt=br(m.as("w")),rr=br(m.as("y")),kr=_<=c.ss&&["s",_]||_0,kr[4]=h,po.apply(null,kr)}function Ol(i){return i===void 0?br:typeof i=="function"?(br=i,!0):!1}function ti(i,o){return tr[i]===void 0?!1:o===void 0?tr[i]:(tr[i]=o,i==="s"&&(tr.ss=o-1),!0)}function Fl(i,o){if(!this.isValid())return this.localeData().invalidDate();var c=!1,h=tr,m,_;return typeof i=="object"&&(o=i,i=!1),typeof i=="boolean"&&(c=i),typeof o=="object"&&(h=Object.assign({},tr,o),o.s!=null&&o.ss==null&&(h.ss=o.s-1)),m=this.localeData(),_=Al(this,!c,h,m),c&&(_=m.pastFuture(+this,_)),m.postformat(_)}var ja=Math.abs;function Yr(i){return(i>0)-(i<0)||+i}function ri(){if(!this.isValid())return this.localeData().invalidDate();var i=ja(this._milliseconds)/1e3,o=ja(this._days),c=ja(this._months),h,m,_,E,G=this.asSeconds(),ee,xe,dt,rr;return G?(h=rt(i/60),m=rt(h/60),i%=60,h%=60,_=rt(c/12),c%=12,E=i?i.toFixed(3).replace(/\\.?0+$/,""):"",ee=G<0?"-":"",xe=Yr(this._months)!==Yr(G)?"-":"",dt=Yr(this._days)!==Yr(G)?"-":"",rr=Yr(this._milliseconds)!==Yr(G)?"-":"",ee+"P"+(_?xe+_+"Y":"")+(c?xe+c+"M":"")+(o?dt+o+"D":"")+(m||h||i?"T":"")+(m?rr+m+"H":"")+(h?rr+h+"M":"")+(i?rr+E+"S":"")):"P0D"}var fe=qn.prototype;fe.isValid=Vu,fe.abs=Cl,fe.add=Tl,fe.subtract=Sr,fe.as=oo,fe.asMilliseconds=Wr,fe.asSeconds=lo,fe.asMinutes=Pl,fe.asHours=Ki,fe.asDays=El,fe.asWeeks=fo,fe.asMonths=nt,fe.asQuarters=qa,fe.asYears=co,fe.valueOf=uo,fe._bubble=Zr,fe.clone=Jt,fe.get=Ga,fe.milliseconds=Xr,fe.seconds=ho,fe.minutes=pt,fe.hours=za,fe.days=Dl,fe.weeks=$a,fe.months=Il,fe.years=Ml,fe.humanize=Fl,fe.toISOString=ri,fe.toString=ri,fe.toJSON=ri,fe.locale=jn,fe.localeData=Ks,fe.toIsoString=Ge("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ri),fe.lang=Vi,H("X",0,0,"unix"),H("x",0,0,"valueOf"),Y("x",Bn),Y("X",ru),ke("X",function(i,o,c){c._d=new Date(parseFloat(i)*1e3)}),ke("x",function(i,o,c){c._d=new Date(re(i))});return r.version="2.29.4",a(Ie),r.fn=F,r.min=Ru,r.max=Wu,r.now=Yu,r.utc=Z,r.unix=Ht,r.months=so,r.isDate=A,r.locale=yr,r.invalid=K,r.duration=oe,r.isMoment=Te,r.weekdays=kl,r.parseZone=Sl,r.localeData=Ue,r.isDuration=Ut,r.monthsShort=bl,r.weekdaysMin=ei,r.defineLocale=ht,r.updateLocale=Iu,r.locales=Mu,r.weekdaysShort=Va,r.normalizeUnits=st,r.relativeTimeRounding=Ol,r.relativeTimeThreshold=ti,r.calendarFormat=Ku,r.prototype=F,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r})});var Yo=yf(xf());var sn=e=>[...new Set(e)];var Th=(e,r)=>e.sort(function(a,u){let l=r.indexOf(a),p=r.indexOf(u);return l>p?l!=-1&&p==-1?-1:1:p!=-1&&l==-1?1:-1});var on="File";var Oo=e=>e.lastIndexOf("/")!=-1?e.lastIndexOf(".")!=-1?Ph(e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("."))):e.substring(e.lastIndexOf("/")+1):e.lastIndexOf(".")!=-1?e.substring(0,e.lastIndexOf(".")):e;function vf(e){return Array.isArray(e)?e:typeof e=="string"?[e]:[]}var Eh=(e,r)=>r.indexOf(e)>0?r.indexOf(e):r.length;var Fo=e=>"spaces://"+e;var Ph=e=>e.charAt(0)=="/"?e.substring(1):e;function si(e){return si=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},si(e)}function Nt(e){if(e===null||e===!0||e===!1)return NaN;var r=Number(e);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}function be(e,r){if(r.length1?"s":"")+" required, but only "+r.length+" present")}function Ze(e){be(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||si(e)==="object"&&r==="[object Date]"?new Date(e.getTime()):typeof e=="number"||r==="[object Number]"?new Date(e):((typeof e=="string"||r==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use \`parseISO\` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function wf(e,r){be(2,arguments);var a=Ze(e).getTime(),u=Nt(r);return new Date(a+u)}var ux={};function On(){return ux}function _f(e){var r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),e.getTime()-r.getTime()}function Sf(e){return be(1,arguments),e instanceof Date||si(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function bf(e){if(be(1,arguments),!Sf(e)&&typeof e!="number")return!1;var r=Ze(e);return!isNaN(Number(r))}function kf(e,r){be(2,arguments);var a=Nt(r);return wf(e,-a)}var lx=864e5;function Cf(e){be(1,arguments);var r=Ze(e),a=r.getTime();r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0);var u=r.getTime(),l=a-u;return Math.floor(l/lx)+1}function Fn(e){be(1,arguments);var r=1,a=Ze(e),u=a.getUTCDay(),l=(u=l.getTime()?a+1:r.getTime()>=v.getTime()?a:a-1}function Tf(e){be(1,arguments);var r=ts(e),a=new Date(0);a.setUTCFullYear(r,0,4),a.setUTCHours(0,0,0,0);var u=Fn(a);return u}var fx=6048e5;function Pf(e){be(1,arguments);var r=Ze(e),a=Fn(r).getTime()-Tf(r).getTime();return Math.round(a/fx)+1}function Nn(e,r){var a,u,l,p,v,C,T,A;be(1,arguments);var R=On(),V=Nt((a=(u=(l=(p=r?.weekStartsOn)!==null&&p!==void 0?p:r==null||(v=r.locale)===null||v===void 0||(C=v.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&l!==void 0?l:R.weekStartsOn)!==null&&u!==void 0?u:(T=R.locale)===null||T===void 0||(A=T.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&a!==void 0?a:0);if(!(V>=0&&V<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var Z=Ze(e),ne=Z.getUTCDay(),N=(ne=1&&ne<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=new Date(0);N.setUTCFullYear(V+1,0,ne),N.setUTCHours(0,0,0,0);var we=Nn(N,r),Ne=new Date(0);Ne.setUTCFullYear(V,0,ne),Ne.setUTCHours(0,0,0,0);var K=Nn(Ne,r);return R.getTime()>=we.getTime()?V+1:R.getTime()>=K.getTime()?V:V-1}function Ef(e,r){var a,u,l,p,v,C,T,A;be(1,arguments);var R=On(),V=Nt((a=(u=(l=(p=r?.firstWeekContainsDate)!==null&&p!==void 0?p:r==null||(v=r.locale)===null||v===void 0||(C=v.options)===null||C===void 0?void 0:C.firstWeekContainsDate)!==null&&l!==void 0?l:R.firstWeekContainsDate)!==null&&u!==void 0?u:(T=R.locale)===null||T===void 0||(A=T.options)===null||A===void 0?void 0:A.firstWeekContainsDate)!==null&&a!==void 0?a:1),Z=rs(e,r),ne=new Date(0);ne.setUTCFullYear(Z,0,V),ne.setUTCHours(0,0,0,0);var N=Nn(ne,r);return N}var cx=6048e5;function Df(e,r){be(1,arguments);var a=Ze(e),u=Nn(a,r).getTime()-Ef(a,r).getTime();return Math.round(u/cx)+1}function _e(e,r){for(var a=e<0?"-":"",u=Math.abs(e).toString();u.length0?u:1-u;return _e(a==="yy"?l%100:l,a.length)},M:function(r,a){var u=r.getUTCMonth();return a==="M"?String(u+1):_e(u+1,2)},d:function(r,a){return _e(r.getUTCDate(),a.length)},a:function(r,a){var u=r.getUTCHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return u.toUpperCase();case"aaa":return u;case"aaaaa":return u[0];case"aaaa":default:return u==="am"?"a.m.":"p.m."}},h:function(r,a){return _e(r.getUTCHours()%12||12,a.length)},H:function(r,a){return _e(r.getUTCHours(),a.length)},m:function(r,a){return _e(r.getUTCMinutes(),a.length)},s:function(r,a){return _e(r.getUTCSeconds(),a.length)},S:function(r,a){var u=a.length,l=r.getUTCMilliseconds(),p=Math.floor(l*Math.pow(10,u-3));return _e(p,a.length)}},un=hx;var na={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},px={G:function(r,a,u){var l=r.getUTCFullYear()>0?1:0;switch(a){case"G":case"GG":case"GGG":return u.era(l,{width:"abbreviated"});case"GGGGG":return u.era(l,{width:"narrow"});case"GGGG":default:return u.era(l,{width:"wide"})}},y:function(r,a,u){if(a==="yo"){var l=r.getUTCFullYear(),p=l>0?l:1-l;return u.ordinalNumber(p,{unit:"year"})}return un.y(r,a)},Y:function(r,a,u,l){var p=rs(r,l),v=p>0?p:1-p;if(a==="YY"){var C=v%100;return _e(C,2)}return a==="Yo"?u.ordinalNumber(v,{unit:"year"}):_e(v,a.length)},R:function(r,a){var u=ts(r);return _e(u,a.length)},u:function(r,a){var u=r.getUTCFullYear();return _e(u,a.length)},Q:function(r,a,u){var l=Math.ceil((r.getUTCMonth()+1)/3);switch(a){case"Q":return String(l);case"QQ":return _e(l,2);case"Qo":return u.ordinalNumber(l,{unit:"quarter"});case"QQQ":return u.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return u.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return u.quarter(l,{width:"wide",context:"formatting"})}},q:function(r,a,u){var l=Math.ceil((r.getUTCMonth()+1)/3);switch(a){case"q":return String(l);case"qq":return _e(l,2);case"qo":return u.ordinalNumber(l,{unit:"quarter"});case"qqq":return u.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return u.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return u.quarter(l,{width:"wide",context:"standalone"})}},M:function(r,a,u){var l=r.getUTCMonth();switch(a){case"M":case"MM":return un.M(r,a);case"Mo":return u.ordinalNumber(l+1,{unit:"month"});case"MMM":return u.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return u.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return u.month(l,{width:"wide",context:"formatting"})}},L:function(r,a,u){var l=r.getUTCMonth();switch(a){case"L":return String(l+1);case"LL":return _e(l+1,2);case"Lo":return u.ordinalNumber(l+1,{unit:"month"});case"LLL":return u.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return u.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return u.month(l,{width:"wide",context:"standalone"})}},w:function(r,a,u,l){var p=Df(r,l);return a==="wo"?u.ordinalNumber(p,{unit:"week"}):_e(p,a.length)},I:function(r,a,u){var l=Pf(r);return a==="Io"?u.ordinalNumber(l,{unit:"week"}):_e(l,a.length)},d:function(r,a,u){return a==="do"?u.ordinalNumber(r.getUTCDate(),{unit:"date"}):un.d(r,a)},D:function(r,a,u){var l=Cf(r);return a==="Do"?u.ordinalNumber(l,{unit:"dayOfYear"}):_e(l,a.length)},E:function(r,a,u){var l=r.getUTCDay();switch(a){case"E":case"EE":case"EEE":return u.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return u.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return u.day(l,{width:"short",context:"formatting"});case"EEEE":default:return u.day(l,{width:"wide",context:"formatting"})}},e:function(r,a,u,l){var p=r.getUTCDay(),v=(p-l.weekStartsOn+8)%7||7;switch(a){case"e":return String(v);case"ee":return _e(v,2);case"eo":return u.ordinalNumber(v,{unit:"day"});case"eee":return u.day(p,{width:"abbreviated",context:"formatting"});case"eeeee":return u.day(p,{width:"narrow",context:"formatting"});case"eeeeee":return u.day(p,{width:"short",context:"formatting"});case"eeee":default:return u.day(p,{width:"wide",context:"formatting"})}},c:function(r,a,u,l){var p=r.getUTCDay(),v=(p-l.weekStartsOn+8)%7||7;switch(a){case"c":return String(v);case"cc":return _e(v,a.length);case"co":return u.ordinalNumber(v,{unit:"day"});case"ccc":return u.day(p,{width:"abbreviated",context:"standalone"});case"ccccc":return u.day(p,{width:"narrow",context:"standalone"});case"cccccc":return u.day(p,{width:"short",context:"standalone"});case"cccc":default:return u.day(p,{width:"wide",context:"standalone"})}},i:function(r,a,u){var l=r.getUTCDay(),p=l===0?7:l;switch(a){case"i":return String(p);case"ii":return _e(p,a.length);case"io":return u.ordinalNumber(p,{unit:"day"});case"iii":return u.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return u.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return u.day(l,{width:"short",context:"formatting"});case"iiii":default:return u.day(l,{width:"wide",context:"formatting"})}},a:function(r,a,u){var l=r.getUTCHours(),p=l/12>=1?"pm":"am";switch(a){case"a":case"aa":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"});case"aaa":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return u.dayPeriod(p,{width:"narrow",context:"formatting"});case"aaaa":default:return u.dayPeriod(p,{width:"wide",context:"formatting"})}},b:function(r,a,u){var l=r.getUTCHours(),p;switch(l===12?p=na.noon:l===0?p=na.midnight:p=l/12>=1?"pm":"am",a){case"b":case"bb":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"});case"bbb":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return u.dayPeriod(p,{width:"narrow",context:"formatting"});case"bbbb":default:return u.dayPeriod(p,{width:"wide",context:"formatting"})}},B:function(r,a,u){var l=r.getUTCHours(),p;switch(l>=17?p=na.evening:l>=12?p=na.afternoon:l>=4?p=na.morning:p=na.night,a){case"B":case"BB":case"BBB":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"});case"BBBBB":return u.dayPeriod(p,{width:"narrow",context:"formatting"});case"BBBB":default:return u.dayPeriod(p,{width:"wide",context:"formatting"})}},h:function(r,a,u){if(a==="ho"){var l=r.getUTCHours()%12;return l===0&&(l=12),u.ordinalNumber(l,{unit:"hour"})}return un.h(r,a)},H:function(r,a,u){return a==="Ho"?u.ordinalNumber(r.getUTCHours(),{unit:"hour"}):un.H(r,a)},K:function(r,a,u){var l=r.getUTCHours()%12;return a==="Ko"?u.ordinalNumber(l,{unit:"hour"}):_e(l,a.length)},k:function(r,a,u){var l=r.getUTCHours();return l===0&&(l=24),a==="ko"?u.ordinalNumber(l,{unit:"hour"}):_e(l,a.length)},m:function(r,a,u){return a==="mo"?u.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):un.m(r,a)},s:function(r,a,u){return a==="so"?u.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):un.s(r,a)},S:function(r,a){return un.S(r,a)},X:function(r,a,u,l){var p=l._originalDate||r,v=p.getTimezoneOffset();if(v===0)return"Z";switch(a){case"X":return Mh(v);case"XXXX":case"XX":return oi(v);case"XXXXX":case"XXX":default:return oi(v,":")}},x:function(r,a,u,l){var p=l._originalDate||r,v=p.getTimezoneOffset();switch(a){case"x":return Mh(v);case"xxxx":case"xx":return oi(v);case"xxxxx":case"xxx":default:return oi(v,":")}},O:function(r,a,u,l){var p=l._originalDate||r,v=p.getTimezoneOffset();switch(a){case"O":case"OO":case"OOO":return"GMT"+Ih(v,":");case"OOOO":default:return"GMT"+oi(v,":")}},z:function(r,a,u,l){var p=l._originalDate||r,v=p.getTimezoneOffset();switch(a){case"z":case"zz":case"zzz":return"GMT"+Ih(v,":");case"zzzz":default:return"GMT"+oi(v,":")}},t:function(r,a,u,l){var p=l._originalDate||r,v=Math.floor(p.getTime()/1e3);return _e(v,a.length)},T:function(r,a,u,l){var p=l._originalDate||r,v=p.getTime();return _e(v,a.length)}};function Ih(e,r){var a=e>0?"-":"+",u=Math.abs(e),l=Math.floor(u/60),p=u%60;if(p===0)return a+String(l);var v=r||"";return a+String(l)+v+_e(p,2)}function Mh(e,r){if(e%60===0){var a=e>0?"-":"+";return a+_e(Math.abs(e)/60,2)}return oi(e,r)}function oi(e,r){var a=r||"",u=e>0?"-":"+",l=Math.abs(e),p=_e(Math.floor(l/60),2),v=_e(l%60,2);return u+p+a+v}var Ah=px;var Oh=function(r,a){switch(r){case"P":return a.date({width:"short"});case"PP":return a.date({width:"medium"});case"PPP":return a.date({width:"long"});case"PPPP":default:return a.date({width:"full"})}},Fh=function(r,a){switch(r){case"p":return a.time({width:"short"});case"pp":return a.time({width:"medium"});case"ppp":return a.time({width:"long"});case"pppp":default:return a.time({width:"full"})}},dx=function(r,a){var u=r.match(/(P+)(p+)?/)||[],l=u[1],p=u[2];if(!p)return Oh(r,a);var v;switch(l){case"P":v=a.dateTime({width:"short"});break;case"PP":v=a.dateTime({width:"medium"});break;case"PPP":v=a.dateTime({width:"long"});break;case"PPPP":default:v=a.dateTime({width:"full"});break}return v.replace("{{date}}",Oh(l,a)).replace("{{time}}",Fh(p,a))},mx={p:Fh,P:dx},Nh=mx;var gx=["D","DD"],yx=["YY","YYYY"];function Lh(e){return gx.indexOf(e)!==-1}function Rh(e){return yx.indexOf(e)!==-1}function If(e,r,a){if(e==="YYYY")throw new RangeError("Use \`yyyy\` instead of \`YYYY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(a,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use \`yy\` instead of \`YY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(a,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use \`d\` instead of \`D\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(a,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use \`dd\` instead of \`DD\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(a,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var xx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},vx=function(r,a,u){var l,p=xx[r];return typeof p=="string"?l=p:a===1?l=p.one:l=p.other.replace("{{count}}",a.toString()),u!=null&&u.addSuffix?u.comparison&&u.comparison>0?"in "+l:l+" ago":l},Wh=vx;function ns(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=r.width?String(r.width):e.defaultWidth,u=e.formats[a]||e.formats[e.defaultWidth];return u}}var wx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},_x={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Sx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},bx={date:ns({formats:wx,defaultWidth:"full"}),time:ns({formats:_x,defaultWidth:"full"}),dateTime:ns({formats:Sx,defaultWidth:"full"})},Yh=bx;var kx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Cx=function(r,a,u,l){return kx[r]},Bh=Cx;function ui(e){return function(r,a){var u=a!=null&&a.context?String(a.context):"standalone",l;if(u==="formatting"&&e.formattingValues){var p=e.defaultFormattingWidth||e.defaultWidth,v=a!=null&&a.width?String(a.width):p;l=e.formattingValues[v]||e.formattingValues[p]}else{var C=e.defaultWidth,T=a!=null&&a.width?String(a.width):e.defaultWidth;l=e.values[T]||e.values[C]}var A=e.argumentCallback?e.argumentCallback(r):r;return l[A]}}var Tx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Px={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ex={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Dx={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ix={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ax=function(r,a){var u=Number(r),l=u%100;if(l>20||l<10)switch(l%10){case 1:return u+"st";case 2:return u+"nd";case 3:return u+"rd"}return u+"th"},Ox={ordinalNumber:Ax,era:ui({values:Tx,defaultWidth:"wide"}),quarter:ui({values:Px,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:ui({values:Ex,defaultWidth:"wide"}),day:ui({values:Dx,defaultWidth:"wide"}),dayPeriod:ui({values:Ix,defaultWidth:"wide",formattingValues:Mx,defaultFormattingWidth:"wide"})},Vh=Ox;function li(e){return function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=a.width,l=u&&e.matchPatterns[u]||e.matchPatterns[e.defaultMatchWidth],p=r.match(l);if(!p)return null;var v=p[0],C=u&&e.parsePatterns[u]||e.parsePatterns[e.defaultParseWidth],T=Array.isArray(C)?Nx(C,function(V){return V.test(v)}):Fx(C,function(V){return V.test(v)}),A;A=e.valueCallback?e.valueCallback(T):T,A=a.valueCallback?a.valueCallback(A):A;var R=r.slice(v.length);return{value:A,rest:R}}}function Fx(e,r){for(var a in e)if(e.hasOwnProperty(a)&&r(e[a]))return a}function Nx(e,r){for(var a=0;a1&&arguments[1]!==void 0?arguments[1]:{},u=r.match(e.matchPattern);if(!u)return null;var l=u[0],p=r.match(e.parsePattern);if(!p)return null;var v=e.valueCallback?e.valueCallback(p[0]):p[0];v=a.valueCallback?a.valueCallback(v):v;var C=r.slice(l.length);return{value:v,rest:C}}}var Lx=/^(\\d+)(th|st|nd|rd)?/i,Rx=/\\d+/i,Wx={narrow:/^(b|a)/i,abbreviated:/^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Yx={any:[/^b/i,/^(a|c)/i]},Bx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vx={any:[/1/i,/2/i,/3/i,/4/i]},Ux={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Hx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},qx={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Gx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},zx={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},$x={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},jx={ordinalNumber:Mf({matchPattern:Lx,parsePattern:Rx,valueCallback:function(r){return parseInt(r,10)}}),era:li({matchPatterns:Wx,defaultMatchWidth:"wide",parsePatterns:Yx,defaultParseWidth:"any"}),quarter:li({matchPatterns:Bx,defaultMatchWidth:"wide",parsePatterns:Vx,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:li({matchPatterns:Ux,defaultMatchWidth:"wide",parsePatterns:Hx,defaultParseWidth:"any"}),day:li({matchPatterns:qx,defaultMatchWidth:"wide",parsePatterns:Gx,defaultParseWidth:"any"}),dayPeriod:li({matchPatterns:zx,defaultMatchWidth:"any",parsePatterns:$x,defaultParseWidth:"any"})},Uh=jx;var Qx={code:"en-US",formatDistance:Wh,formatLong:Yh,formatRelative:Bh,localize:Vh,match:Uh,options:{weekStartsOn:0,firstWeekContainsDate:1}},Hh=Qx;var qh=Hh;var Kx=/[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g,Zx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xx=/^'([^]*?)'?$/,Jx=/''/g,ev=/[a-zA-Z]/;function fi(e,r,a){var u,l,p,v,C,T,A,R,V,Z,ne,N,we,Ne,K,Xe,Re,it;be(2,arguments);var tt=String(r),Te=On(),Je=(u=(l=a?.locale)!==null&&l!==void 0?l:Te.locale)!==null&&u!==void 0?u:qh,Ge=Nt((p=(v=(C=(T=a?.firstWeekContainsDate)!==null&&T!==void 0?T:a==null||(A=a.locale)===null||A===void 0||(R=A.options)===null||R===void 0?void 0:R.firstWeekContainsDate)!==null&&C!==void 0?C:Te.firstWeekContainsDate)!==null&&v!==void 0?v:(V=Te.locale)===null||V===void 0||(Z=V.options)===null||Z===void 0?void 0:Z.firstWeekContainsDate)!==null&&p!==void 0?p:1);if(!(Ge>=1&&Ge<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var pr=Nt((ne=(N=(we=(Ne=a?.weekStartsOn)!==null&&Ne!==void 0?Ne:a==null||(K=a.locale)===null||K===void 0||(Xe=K.options)===null||Xe===void 0?void 0:Xe.weekStartsOn)!==null&&we!==void 0?we:Te.weekStartsOn)!==null&&N!==void 0?N:(Re=Te.locale)===null||Re===void 0||(it=Re.options)===null||it===void 0?void 0:it.weekStartsOn)!==null&&ne!==void 0?ne:0);if(!(pr>=0&&pr<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!Je.localize)throw new RangeError("locale must contain localize property");if(!Je.formatLong)throw new RangeError("locale must contain formatLong property");var jt=Ze(e);if(!bf(jt))throw new RangeError("Invalid time value");var me=_f(jt),at=kf(jt,me),mt={firstWeekContainsDate:Ge,weekStartsOn:pr,locale:Je,_originalDate:jt},Rt=tt.match(Zx).map(function(Me){var ze=Me[0];if(ze==="p"||ze==="P"){var Wt=Nh[ze];return Wt(Me,Je.formatLong)}return Me}).join("").match(Kx).map(function(Me){if(Me==="''")return"'";var ze=Me[0];if(ze==="'")return tv(Me);var Wt=Ah[ze];if(Wt)return!(a!=null&&a.useAdditionalWeekYearTokens)&&Rh(Me)&&If(Me,r,String(e)),!(a!=null&&a.useAdditionalDayOfYearTokens)&&Lh(Me)&&If(Me,r,String(e)),Wt(at,Me,Je.localize,mt);if(ze.match(ev))throw new RangeError("Format string contains an unescaped latin alphabet character \`"+ze+"\`");return Me}).join("");return Rt}function tv(e){var r=e.match(Xx);return r?r[1].replace(Jx,"'"):e}var Af=(e,r)=>{if(e instanceof Date)return"date";if(typeof e=="string"){if(/\\/\\/(\\S+?(?:jpe?g|png|gif|svg))/gi.test(e)||e.includes("unsplash"))return"image";if(/^\\d{4}-\\d{2}-\\d{2}$/.test(e))return"date";if(r=="tag"||r=="tags")return"tag";if(/\\[\\[.*?\\]\\]/.test(e))return"link"}else{if(typeof e=="number")return"number";if(typeof e=="boolean")return"boolean";if(e)if(Array.isArray(e)||typeof e=="string"&&e.indexOf(",")>-1){let a=Array.isArray(e)?e:[];if(typeof e=="string"&&e.indexOf(",")>-1&&(a=sr(e)),r=="tag"||r=="tags")return"tag-multi";if(a.length==1&&Array.isArray(a[0])&&a[0].length==1&&typeof a[0][0]=="string")return"link";let u=sn(a.map(l=>Af(l,r)));return u.length==1&&u[0]=="link"?"link-multi":u.some(l=>l=="object")?"object-multi":"option-multi"}else{if(e.isLuxonDateTime)return"date";if(e.isLuxonDuration)return"duration";if(e.type=="file")return"link";if(typeof e=="object"&&!Array.isArray(e)&&e!==null)return"object"}else return"unknown"}return"text"};var Gh=e=>e.join(", "),ci=e=>e.join(",");var sr=e=>e?.match(/(\\\\.|[^,])+/g)??[],Of=(e,r)=>{switch(Af(r,e)){case"object":return JSON.stringify(r);case"number":return r.toString();case"boolean":return r?"true":"false";case"date":{if(r instanceof Date){let u=fi(new Date(r),"yyyy-MM-dd");if(typeof u=="string")return u}return typeof r!="string"?"":r}break;case"duration":return Gh(Object.keys(r.values).reduce((u,l)=>[...u,...r.values[l]>0?[r.values[l]+" "+l]:[]],[]));case"option-multi":case"link-multi":return typeof r=="string"?is(r):ci(r.map(u=>u?typeof u=="string"?is(u):u.path?u.path:Array.isArray(r)&&u.length==1&&Array.isArray(u[0])&&u[0].length==1&&typeof u[0][0]=="string"?u[0][0]:JSON.stringify(u):""));case"link":return Array.isArray(r)&&r.length==1&&Array.isArray(r[0])&&r[0].length==1&&typeof r[0][0]=="string"?r[0][0]:typeof r=="string"?is(r):r.path;case"text":case"tag":case"image":return r}return""};var is=e=>{if(!e)return"";let r=/\\[\\[(.*?)\\]\\]/g.exec(e),a=r?.length>1?r[1].substring(0,Eh("|",r[1])):e;return a||e};var No=(e,r)=>e==r,Ff=(e,r)=>(e??"").length==0,Nf=(e,r)=>(e??"").toLowerCase().includes((r??"").toLowerCase()),Lf=(e,r)=>parseFloat(e)>parseFloat(r),Rf=(e,r)=>parseInt(e)>parseInt(r),zh=(e,r)=>{let a=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),u=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return a.valueOf()>u.valueOf()},$h=(e,r)=>{let a=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),u=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return a.valueOf(){let a=e?sr(e):[];return(r?sr(r):[]).some(l=>a.some(p=>p==l))},jh=(e,r)=>{if(!e)return!1;let a=new Date(\`\${e.toString().replace(".",":")}\`),u=new Date(\`\${r}\`);return a.getMonth()===u.getMonth()&&a.getDate()===u.getDate()},Qh=e=>{if(!e)return!1;let r=new Date(\`\${e.toString()}T00:00\`),a=new Date;return r.getMonth()===a.getMonth()&&r.getDate()===a.getDate()};var as={isNotEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>!Ff(e,""),valueType:"none"},isEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>Ff(e,""),valueType:"none"},include:{fn:(e,r)=>Nf(e,r),type:["text","file","link","link-multi","fileprop","image"],valueType:"text"},notInclude:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>!Nf(e,r),valueType:"text"},is:{type:["text","file","link","context","fileprop"],fn:(e,r)=>No(e,r),valueType:"text"},isNot:{type:["text","file","link","context","fileprop"],fn:(e,r)=>!No(e,r),valueType:"text"},equal:{type:["number"],fn:(e,r)=>No(e,r),valueType:"number"},isGreatThan:{type:["number"],fn:(e,r)=>Lf(e,r),valueType:"number"},isLessThan:{type:["number"],fn:(e,r)=>Rf(e,r),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(e,r)=>!Lf(e,r),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(e,r)=>!Rf(e,r),valueType:"number"},dateBefore:{type:["date","fileprop"],fn:(e,r)=>$h(e,r),valueType:"date"},dateAfter:{type:["date","fileprop"],fn:(e,r)=>zh(e,r),valueType:"date"},isSameDate:{type:["date"],fn:(e,r)=>jh(e,r),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(e,r)=>Qh(e,r),valueType:"none"},isAnyInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(e,r)=>Wf(e,r),valueType:"list"},isNoneInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(e,r)=>!Wf(e,r),valueType:"list"},isTrue:{type:["boolean"],fn:(e,r)=>e=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(e,r)=>e!="true",valueType:"none"}};var rv=(e,r)=>r.reduce((u,l)=>{let[p,v]=u,C=l.type=="path"?Zh(v,l):l.type=="frontmatter"?Kh(v,l):Xh(v,l),T=v.filter(A=>!C.includes(A));return[[...p,...C],T]},[[],e])[0],nv=(e,r)=>r.reduce((a,u)=>u.type=="path"?Zh(a,u):u.type=="frontmatter"?Kh(a,u):Xh(a,u),e),Kh=(e,r)=>e.filter(a=>{let u=a.metadata?.property;if(!u||!u[r.field])return!1;let l=as[r.fn],p=!0;return l&&(p=l.fn(Of(r.field,u[r.field]),r.value)),p}),Zh=(e,r)=>e.filter(a=>{let u="";r.field=="outlinks"?u=ci(a.outlinks??[]):r.field=="inlinks"?u=ci(a.inlinks??[]):r.field=="tags"&&(u=ci(a.tags??[]));let l=as[r.fn],p=!0;return l&&(p=l.fn(u,r.value)),p}),Xh=(e,r)=>e.filter(a=>{let u=as[r.fn],l=!0;return u&&(l=u.fn(a.metadata?.[r.type]?.[r.field],r.value)),l}),Yf=(e,r)=>e.reduce((u,l)=>!u||l.filters.length==0?!1:l.type=="any"?rv([r],l.filters).length>0:nv([r],l.filters).length>0,!0);var ep=yf(Jh()),Vf=class{constructor(){this.lang="en";this.all={en:{hintText:{dragDropModifierKeys:"Hold \${1} to Pin and \${2} to Copy",createListItem:"Select/Create List Item Frame",dragDropProperties:"Drag and drop properties to link them into the list",newItem:"+ New",selectNote:"Select Note...",newFrame:"New"},defaults:{spaceNote:"Current Note",spaceContext:"Current Space"},commands:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",columns:"Columns",button:"Button",label:"Label",column:"Column",idea:"New",group:"Group",paragraph:"Text",card:"Card",progress:"Progress",rating:"Rating",circularProgress:"Circular Progress",list:"Bullet List","ordered-list":"Numbered List",todo:"To-do List",quote:"Quote",divider:"Divider",note:"Link to Note",link:"Link",callout:"Callout",bookmark:"Bookmark",table:"Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",flow:"Linked Note",newNote:"New Note",tag:"Tag",makeMenu:"Flow Menu",selectStyle:"Style",toggleKeyboard:"Toggle Keyboard",rows:"Rows",masonry:"Gallery"},styles:{bold:"Bold",italics:"Italics",strikethrough:"Strikethrough",code:"Code",link:"Web Link",blocklink:"Link to Note",textColor:"Text Color",highlight:"Highlight"},commandsSuggest:{noResult:"No result"},commandPalette:{enable:"Enable",disabled:"Disable",openFlow:"Open Flow Blocks in Selection",closeFlow:"Close Flow Blocks in Selection",toggleBold:"Toggle Bold",toggleItalics:"Toggle Italics",openSpaces:"Open Spaces",migrateData:"Migrate Spaces From 0.7",blink:"Blink",openFileContext:"Open Explorer",convertPathToSpace:"Convert to Space",revealFile:"Reveal File in Spaces",releaseNotes:"Release Notes",toggleBacklinks:"Toggle Backlinks",collapseAllFolders:"Collapse All Folders",addFileSpace:"Add File to Space",removeFileSpace:"Remove File from Space"},frames:{sections:{kit:"Kit",paths:"Paths"},label:{label:"Label",description:"Label"},note:{label:"Note",description:"Link to a note"},table:{label:"Table",description:"Table"},context:{label:"Context",description:"Display a context view from another space"},calendar:{label:"Calendar View"},field:{label:"Field",description:"Dynamic node that displays a value based on property type"},event:{label:"Event"},divider:{label:"Divider",description:"Divider to separate your content"},button:{label:"Button",description:"Buttons can perform actions and open links"},callout:{label:"Callout",description:"Callout to highlight important information"},toggle:{label:"Toggle",description:"Toggle to show/hide content"}},menu:{newView:"New View",customView:"Custom View",detailsView:"Details View",catalogView:"Catalog View",galleryView:"Gallery View",deleteContext:"Delete Context",openSpace:"Open Space",revealInDefault:"Reveal in Finder",setNone:"None",fileMetadataDescription:"This note only",openFilePane:"Open in a new pane",rename:"Rename",changeToFolderNote:"New Space from Note",moveFile:"Move file to...",moveFolder:"Move folder to...",duplicate:"Make a copy",edit:"Edit",delete:"Delete",getHelp:"Make.md Community",vault:"Vault",openVault:"Open Another Vault",openVaultInFolder:"Open Vault Folder",obSettings:"Obsidian Settings",commandPalette:"Command Palette",backToSpace:"Back to Spaces",collapseAllSections:"Collapse All Spaces",expandAllSections:"Expand All Spaces",collapseAllFolders:"Collapse All Folders",expandAllFolders:"Expand All Folders",spaceTitle:"Add/Remove in Space",home:"Home",waypoints:"Waypoints",none:"None",tableView:"Table View",cardView:"Card View",boardView:"Board View",listView:"List View",flowView:"Flow View",groupBy:"Group By",sortBy:"Sort By",newFilter:"New Filter",clearFilters:"Clear Filters",hide:"Hide",unhideFields:"Unhide All Properties",importDataview:"Import All Dataview Properties",saveAllProperties:"Save All Properties to Files",mergeProperties:"Merge Properties",removeFromSpace:"Unpin from Space",removeFromWaypoints:"Unpin from Waypoints",editCode:"Edit Code",deleteProperty:"Delete Property",hideProperty:"Hide Property",unhideProperty:"Unhide Property",saveProperty:"Save Property",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",deleteRow:"Delete Item",collapseAll:"Collapse All",customSort:"Custom Sort",groupSpaces:"Group Spaces",fileNameSortAlphaAsc:"File Name (A to Z)",fileNameSortAlphaDesc:"File Name (Z to A)",createdTimeSortAsc:"Created Time (new to old)",createdTimeSortDesc:"Created Time (old to new)",modifiedTimeSortAsc:"Modified Time (new to old)",modifiedTimeSortDesc:"Modified Time (old to new)",sizeSortAsc:"Size (smallest to largest)",sizeSortDesc:"Size (largest to smallest)",spaces:"Spaces",tags:"Tags",manageHiddenFiles:"Manage Hidden Files",manageActions:"Manage Actions",deleteSpace:"Delete",changeColor:"Change Color",changePropertyType:"Change Type",deleteFiles:"Delete Files",createFolderSpace:"Create Space from Folder",folder:"Folder",syncToContext:"Add Property to Context",setIcon:"Set Icon",copyEmbedLink:"Copy Embed Link",moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",groupNodes:"Group Nodes",moveFrame:"Move Frame",renameFrame:"Rename Frame",deleteFrame:"Delete Frame"},editor:{rows:"Rows",columns:"Columns",catalog:"Catalog",gallery:"Gallery",grid:"Grid",scaleToFit:"Change to Fit",scaleToFill:"Change to Fill",fit:"Fit",strokeNone:"None",strokeSolid:"Solid",strokeDotted:"Dotted",strokeDashed:"Dashed",size:"Size",gap:"Gap",marginLeft:"Left",marginTop:"Top",marginRight:"Right",marginBottom:"Bottom",minimize:"Minimize",paddingLeft:"Left",paddingTop:"Top",paddingRight:"Right",paddingBottom:"Bottom",unlinkProperty:"Unlink Property",linkedProperty:"Linked Property",linkProperty:"Link Property",currentSpace:"Current Space",linkName:"\${1} Link",linkThumbnail:"\${1} Thumbnail",linkSticker:"\${1} Sticker",opacity:"Opacity",shadowSpread:"Spread",shadowBlur:"Blur",width:"Width",height:"Height",margin:"Margin",padding:"Padding",bold:"Bold",italic:"Italic",underline:"Underline",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",numberOfLines:"Lines",createVerticalSection:"Create Vertical Section",createHorizontalSection:"Create Horizontal Section",themeColors:"Theme Colors",uiColors:"UI Colors",hex:"Hex"},buttons:{add:"Add",addFilter:"Add Filter",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",changeBanner:"Change Cover",changeBannerShort:"Cover",saveChanges:"Save Changes",removeBanner:"Remove Cover",rename:"Change Name",editFrame:"Edit Frame",saveSpace:"Save Space",createSpace:"New Space",createFolder:"New Folder",createNote:"New Note",createCanvas:"New Canvas",addIntoSpace:"New Pin",addSmartSearch:"Add Smart Search",addItem:"Add Item",addProperty:"Add Property",addContext:"Add Context",cancel:"Cancel",search:"Search",delete:"Delete",toggleFlow:"Toggle Flow",openFlow:"Open Flow",hideFlow:"Hide Flow",openLink:"Open Link",addToSpace:"Add to Space",addToSpaceShort:"Pin",addTag:"Add Tag",tag:"Tag",syncFields:"Sync Properties",convertTable:"Convert to Markdown",cutTable:"Cut Table",deleteTable:"Delete Table",blink:"Blink",addFile:"Add Item",merge:"Merge",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",deleteView:"Delete View",renameTable:"Rename Table",renameTag:"Rename Tag",createTag:"Create Tag",currentFolder:"Current Folder",sync:"Sync",pasteCSS:"Paste CSS",save:"Save",run:"Run"},metadataTypes:{fileName:"File Name",path:"Path",folder:"Folder",sticker:"Sticker",color:"Color",created:"Created",lastModified:"Last Modified",extension:"Extension",size:"Size",tags:"Tags",inlinks:"Linked Mentions",outlinks:"Links",label:"Label",fileMetadata:"File Metadata",frontmatter:"Frontmatter"},filterTypes:{contains:"contains",notContains:"does not contain",is:"is",isNot:"is not",before:"before",after:"after",anyOf:"is any of",noneOf:"is none of",checked:"is checked",unchecked:"is unchecked",isEmpty:"is empty",isNotEmpty:"is not empty",isSameDate:"is same date",isSameDateAsToday:"today"},sortTypes:{alphaAsc:"A to Z",alphaDesc:"Z to A",earliest:"Earliest",latest:"Latest",checkAsc:"Checked \\u2192 Unchecked",checkDesc:"Unchecked \\u2192 Checked",itemsAsc:"Least Items",itemsDesc:"Most Items"},properties:{defaultField:"Name",text:{label:"Text",description:"Text field"},number:{label:"Number",description:"Number field with optional unit"},boolean:{label:"Yes/No",description:"Yes or No toggle to indicate the status"},date:{label:"Date",description:"Select a date from a calendar"},option:{label:"Option",description:"Select one or multiple option from a list"},file:{label:"File"},link:{label:"Link",description:"Link to another note or a website"},tags:{label:"Tags",description:"Use tags to quickly organize your items"},object:{label:"Object",description:"Store any complex objects"},context:{label:"Relation",description:"Connect to another context property and create a relation"},image:{label:"Image",description:"Select any image from your system or from the internet"},color:{label:"Color",description:"Use colors to label your items or status"},space:{label:"Context",description:"Link to a context"},icon:{label:"Sticker",description:"Use stickers to uniquely label your items or status"},super:{label:"Super Property",links:"Open Link",properties:"Update Property",api:"API",obsidianCommands:"Run Command",runCommand:"Run Command",performAction:"Perform Action",whenClicked:"When Clicked"},fileProperty:{name:"Name",label:"Formula",createdTime:"Created",modifiedTime:"Last Edited",sticker:"Sticker",links:"Links",tags:"Tags",spaces:"Spaces",extension:"Extension",size:"Size",preview:"Note Preview",parentFolder:"Folder",description:"Use a formula to dynamically display a property"}},views:{navigator:"Navigator",explorer:"Explorer",space:"Space"},subViews:{spaceItems:"Items",spaceContext:"Context",spaceLists:"Lists",spaceActions:"Actions",smartSearch:"Smart Search",filesAndFolders:"Files and Folders"},labels:{properties:"Properties",newAction:"New Action",newTable:"New Table",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSectionSmart:"Edit Smart Space",renameSection:"Edit Space",createSectionSmart:"New Smart Space",createSection:"New Folder",createNote:"New Note",contextMaker:"Context Maker",select:"Select",pinnedItems:"Pinned Items",collapse:"Collapse",expand:"Expand",all:"All",none:"None",view:"View",findStickers:"Find Sticker",mergeProperties:"Merge Properties",placeholder:"Type '\${1}' for commands",itemsSelected:"\${1} Selected",selectNote:"Select Note",selectIcon:"Select Icon",selectImage:"Select Image",selectSpace:"Select Space",styleSmall:"Small",styleMedium:"Medium",styleLarge:"Large",hiddenFilePattern:"Name, Suffixes and Extension",hiddenFileSpecific:"Exclude specific files and folders",textPlaceholder:"Enter Text",noFile:"is not created yet. Click to create.",navigatorSearchPlaceholder:"Search by Text or Filters",blinkPlaceholder:"Quickly Search a File, Folder, Tag... Press Tab to Edit",searchPlaceholder:"Type to search...",contextItemSelectPlaceholder:"Find Item",linkItemSelectPlaceholder:"Find or Create Note",pinNotePlaceholder:"Select a Note or Space to Pin",optionItemSelectPlaceholder:"Select Option",viewItemSelectPlaceholder:"Select View",tagItemSelectPlaceholder:"Find Tag",spaceSelectPlaceholder:"Select any Folder or Tag",propertyItemSelectPlaceholder:"Select Property",sortItemSelectPlaceholder:"Select Sort",filterItemSelectPlaceholder:"Select Filter",imageSelectPlaceholder:"Select an image or paste a URL",imageNotFoundPlaceholder:"No Images Found",syncFrontmatterProperty:"Sync Frontmatter Property",newProperty:"New Property",newPropertyShort:"New Property",propertyType:"Type",propertyDynamic:"Dyanmic",propertyValueSpace:"Space",propertyValueProperty:"Property",propertyLookup:"Edit Formula",dateFormat:"Date Format",propertyFileProp:"Property",multiple:"Multiple",filesCount:"{$1} Files",hiddenFiles:"Hidden Files",addExtension:"Add Rule",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",renameTable:"Rename Table",syncMetadata:"Sync Metadata",syncProperties:"Sync Properties",selectContext:"Select Context",metadata:"Metadata",backlinks:"Backlinks",spaces:"Spaces",context:"Context",content:"Content",deleteSpace:"Delete Space",deleteFiles:"Delete Files",outgoingLinks:"Outgoing Links",moveTo:"Move to",addTo:"Pin to",copyTo:"Copy to",reorderIn:"Reorder in",border:"Border",corners:"Corners",color:"Color",backgroundColor:"Background",cornerRadius:"Radius",onClick:"On Click",layout:"Layout",element:"Element",name:"Name",display:"Display",alignment:"Alignment",margin:"Margin",padding:"Padding",gap:"Gap",width:"Width",height:"Height",opacity:"Opacity",shadow:"Shadow",shadowBlur:"Blur",shadowSpread:"Spread",typography:"Typography",layers:"Layers",fontSize:"Size",props:"Props",styles:"Styles",events:"Events",code:"Code",selectedLayers:"\${1} Layers"},descriptions:{spaceActions:"Create actions that runs when you press a button",spaceLists:"Create lists to track data and organize them in your space",spaceItems:"Add new items to the space or pin items to the space",smartSearch:"Automatically pin notes to this space based on a set of searches",hiddenFileOptions:"Exclude any files and folders by name, suffix or extension.",deleteSpace:"Deleting the space will also delete the folder and its contents.",deleteFiles:"Delete \${1} files/folders and their contents?",addContext:"Contexts lets you connect properties from your tags",spaceProperties:"Define Properties for your Space Items",syncMetadata:"Select which fields from your notes to start syncing with the context.",syncProperties:"Contexts defines and syncs the same fields across your notes depending on their folder or tag.",selectContext:"Select which folder or tag context you want to sync the fields."},flowView:{emptyDoc:"Empty Document",itemsCount:" Items",emptyFolder:"This Folder is Empty"},notice:{duplicateFile:"Folder already contains note with same name",addedToSection:"Added to Space",fileExists:"File Already Exists",folderExists:"Folder Already Exists",noPropertyName:"Property Name is Required",duplicatePropertyName:"Duplicate Property Name",newSpaceName:"Enter a name for your space",duplicateSpaceName:"Space name already exists",cantConvertNoteToSpace:"The view is not a note"},settings:{layoutVertical:"Vertical",layoutHorizontal:"Horizontal",sectionSidebar:"Spaces",sectionEditor:"Maker Mode",sectionFlow:"Flow",sectionAdvanced:"Advanced",sectionDataview:"Dataview",sectionContext:"Context",sectionStickers:"Stickers",sectionNavigator:"Navigator",sectionDefault:"Default Spaces",sectionSpaceView:"Space View",sectionBlink:"Blink",sectionInlineContext:"Inline Context",sectionFlowBlock:"Flow Block",sectionFlowMenu:"Flow Menu",sectionFlowStyler:"Flow Styler",experimental:{name:"Experimental",desc:"Experimental features that are subject to change and may not be optimized for performance"},generateThumbnails:{name:"Generate Thumbnails",desc:"Create thumbnails for images to speed up performance"},minimalThemeFix:{name:"Minimal Theme Fix",description:"Apply fixes for the popular theme Minimal"},inlineStickerMenu:{name:"Inline Stickers",desc:"Add inline stickers by typing :"},openSpacesOnLaunch:{name:"Open Spaces as Default Tab",desc:"Open the Spaces tab when Obsidian launches"},defaultSpaceTemplate:{name:"Default Space Template",desc:"Select the default template for new spaces"},defaultDateFormat:{name:"Default Date Format",desc:"Set the default date format, example: yyyy-MM-dd (see https://date-fns.org/v2.30.0/docs/format)"},newNotePlaceholder:{name:"New Note Placeholder",desc:"Default name for new notes"},folderIndentationLines:{name:"Show Folder Indentation Lines",desc:"Turn on to show a line on the left of folders to indicate indentation"},folderNoteLocation:{name:"Folder Note Location Inside Folder",desc:"Turn on to have folder notes inside the folder, turn off to have it outside"},folderViewDefault:{name:"Show Folder Note by Default",desc:"Show the folder note by default when opening a folder"},internalLinkFlowEditor:{name:"Open Flow Blocks on Internal Link Click",desc:"Turn on to toggle Flow Blocks directly by clicking on internal links, otherwise a tooltip will be shown"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},inlineBacklinks:{name:"Show Inline Backlinks (Inline Context required)",desc:"Show editable backlinks at the bottom of your notes"},dataviewInlineContext:{name:"Show Dataview in Inline Context",desc:"Show dataview when inline context is enabled"},inlineContextExplorer:{name:"Inline Context",desc:"Display the context and a banner at the top of your notes"},inlineContextExpanded:{name:"Auto Expand Inline Context",desc:"Expand the inline context sections when opening a note"},inlineContextHorizontal:{name:"Inline Title and Sticker Layout",desc:"Layout for inline title and sticker in Inline Context"},hideFrontmatter:{name:"Hide Frontmatter Properties",desc:"Hide the frontmatter properties in inline context"},openFileContext:{name:"Auto Open Explorer",desc:"Automatically open explorer panel in the right panel"},folderNote:{name:"Enable Folder Note",desc:"Access the folder note in the folder page and hide the folder note from spaces"},expandFolder:{name:"Auto Expand Folder",desc:"Auto expand folders on click"},hoverPreview:{name:"Preview on Hover",desc:"Preview on Hover while holding Control/Command key"},activeFile:{name:"Reveal Active File",desc:"Automatically reveal the active file in Spaces"},contexts:{name:"Contexts",desc:"Contexts allows you to have full control over the metadata of your files"},spaces:{name:"Navigator",desc:"The navigator lets you create and organize your spaces"},spacesStickers:{name:"Stickers",desc:"Use Emojis to make it easier to find your notes"},spacesAlias:{name:"Alias",desc:"Use the alias metadata to show in Spaces"},spacesFileExplorerDual:{name:"Compatibility Mode",desc:"This will improve the compatibility of plugins while using Spaces"},spacesDeleteOption:{name:"Delete File Option",desc:"Select how you want files to be deleted"},spacesDeleteOptions:{permanant:"Delete Permanently",trash:"Move to Obsidian Trash","system-trash":"Move to System Trash"},hideRibbon:{name:"App Ribbon",desc:"Show/hide the left menu aka. ribbon"},spaceView:{name:"Space View",desc:"Open the space view when you click on a space"},defaultSpaces:{name:"Default Spaces",desc:"Recommended spaces for quickly organizing your vault"},homeSpace:{name:"Home Space",desc:"An easy-to-access space where you can add/organize your other spaces"},tagSpaces:{name:"Tag Spaces",desc:"Automatically create spaces for each of your tags"},readableLineWidth:{name:"Readable Line Width",desc:"Use Readable Line Width"},sidebarTabs:{name:"Sidebar Tabs",desc:"Show/hide other sidebar tabs"},spacesPerformance:{name:"Performance Mode",desc:"Turn on performance mode for Spaces, may affect scrolling appearance. Requires Restart"},indexSVG:{name:"Use SVGs as Stickers",desc:"Use any svg file in your vault as a sticker"},inlineStyler:{name:"Flow Styler",desc:"Select text to add styling"},inlineStylerColor:{name:"Text and Highlight Colors \\u{1F9EA}",desc:"Select text color and highlight color, (this may change in the future because of the limitations with HTML and Obsidian)"},spaceRowHeight:{name:"Row Height",desc:"The height for each row in spaces (in pixels), default is 28"},makeChar:{name:"Flow Menu Trigger",desc:"Character to open the Flow Menu"},mobileMakeBar:{name:"Flow Styler (Mobile)",desc:"Replaces the mobile toolbar"},editorMarkSans:{name:"Mark Sans \\u{1F9EA}",desc:"Use the editor without Markdown."},editorMakerMode:{name:"Flow (Beta)",desc:"An integrated and intuitive editor experience"},editorMakePlacholder:{name:"Flow Menu Hint Text",desc:"Show a hint text on how to open the Flow Menu Shortcut"},blink:{name:"Blink",desc:"A faster way to search and edit your notes"},editorMakeMenu:{name:"Flow Menu",desc:"Open the Flow menu to quickly add content"},editorMakeMenuTrigger:{name:"Flow Menu Shortcut",desc:"Trigger key to use flow menu"},editorFlowReplace:{name:"Flow Block",desc:"Open your internal links or toggle your embeds in the flow block."},editorFlowStyle:{name:"Flow Block Style",desc:"Select a theme for your flow block",seamless:"Seamless",classic:"Classic",minimal:"Minimal"}}}};this.lang="en";let r=ep.default.locale();["en"].includes(r)&&(this.lang=r)}get texts(){return this.all.en}},ce=new Vf().texts;var W_=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"text",label:ce.properties.text.label,metadata:!0,icon:"ui//text",description:ce.properties.text.description},{type:"number",label:ce.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],description:ce.properties.number.description},{type:"boolean",label:ce.properties.boolean.label,metadata:!0,icon:"ui//check-square",description:ce.properties.boolean.description},{type:"date",label:ce.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],description:ce.properties.date.description},{type:"option",label:ce.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options"],description:ce.properties.option.description},{type:"tags",label:ce.properties.tags.label,icon:"ui//tags",description:ce.properties.tags.description},{type:"file",label:ce.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:ce.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value"],description:ce.properties.fileProperty.description},{type:"link",label:ce.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",description:ce.properties.link.description},{type:"context",label:ce.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:ce.properties.context.description},{type:"object",label:ce.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type"],description:ce.properties.object.description},{type:"icon",label:ce.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",description:ce.properties.icon.description},{type:"image",label:ce.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",description:ce.properties.image.description},{type:"color",label:ce.properties.color.label,icon:"ui//mk-make-image",description:ce.properties.color.description},{type:"space",label:ce.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:ce.properties.space.description},{type:"table",label:ce.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:ce.properties.space.description},{type:"super",label:ce.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:ce.properties.super.label,icon:"ui//input",restricted:!0}];var hi="files",Wo={id:hi,name:"Files",type:"db",primary:"true"},iv="filesView",av={id:iv,name:"All",type:"view",def:JSON.stringify({db:hi,icon:"ui//file-stack"})},sv="main",ov=e=>({id:e,name:e,type:"frame",def:"",predicate:"",primary:"true"}),Y_={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[ov(sv),av]},Lo={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[Wo]},tp={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},Ro={...tp,rows:[{name:on,schemaId:hi,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:ce.properties.fileProperty.createdTime,schemaId:hi,type:"fileprop",value:on+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var B_=[{name:ce.properties.defaultField,schemaId:"",type:"text",primary:"true"}],Uf={...tp,rows:[{name:on,schemaId:hi,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var V_={schema:Wo,cols:Ro.rows,rows:[]},U_={schema:Wo,cols:Ro.rows,rows:[]},H_={schema:Wo,cols:Uf.rows,rows:[]},rp=(e,r)=>e.filter(a=>r.find(u=>u.id==a.schemaId&&u.type=="db")).reduce((a,u)=>({...a,...a[u.schemaId]?{[u.schemaId]:{uniques:u.unique=="true"?[...a[u.schemaId].uniques,u.name]:a[u.schemaId].uniques,cols:[...a[u.schemaId].cols,u.name],rows:[]}}:{[u.schemaId]:{uniques:u.unique=="true"?[u.name]:[],cols:[u.name],rows:[]}}}),{});var q_={m_schema:Lo,m_fields:Ro,...rp(Ro.rows,Lo.rows)},G_={m_schema:Lo,m_fields:Uf,...rp(Uf.rows,Lo.rows)};var np=(e,r)=>e.hiddenExtensions.some(a=>r.endsWith(a))||r.startsWith(e.spacesFolder+"/#")||e.hiddenFiles.some(a=>a==r);var ip=(e,r,a)=>{if(!e)return{changed:!1,cache:null};if(!r)return{changed:!1,cache:{path:e.path,frames:{},schemas:[]}};let u=Object.values(r).map(C=>C.schema),l=u.filter(C=>C.type=="frame").reduce((C,T)=>({...C,[T.id]:r[T.id]}),{}),p={path:e.path,frames:l,schemas:u},v=!0;return a&&Yo.default.isEqual(p,a)&&(v=!1),{changed:v,cache:p}},ap=(e,r,a,u)=>{let l={};if(!e)return{changed:!1,cache:null};if(!r)return{changed:!1,cache:{cols:[],path:e.path,schemas:[],outlinks:[],contexts:[],paths:[],tables:{},space:e,spaceMap:l}};let p=Object.values(r).map(K=>K.schema),v=p.find(K=>K.primary=="true"),C=r[v.id],T=r,A=C.cols?.filter(K=>K.type.startsWith("context"))??[],R=C.cols?.filter(K=>K.type.startsWith("link"))??[],V=sn(A.map(K=>K.value));A.forEach(K=>{l[K.name]={},C.rows.forEach(Xe=>{sr(Xe[K.name]).forEach(Re=>l[K.name][Re]=[...l[K.name][Re]??[],Xe[on]])})});let Z=T[hi]?.rows?.map(K=>K[on])??[],ne=Th(a??[],Z),N=sn(C.rows.reduce((K,Xe)=>sn([...K,...[...A,...R].flatMap(Re=>sr(Xe[Re.name]).map(it=>is(it)))]),[])),we={cols:C.cols,path:e.path,contexts:V,outlinks:N,paths:ne,tables:T,schemas:p,space:e,spaceMap:l},Ne=!0;return u&&Yo.default.isEqual(we,u)&&(Ne=!0),{changed:Ne,cache:we}},sp=(e,r,a,u)=>{let l={};for(let[p,v]of e){let C=a.get(p)?.defPath??p,T=e.get(C)??v,A=v?.parent??"",R=v?.type??"",V=v?.subtype??"",Z=T?.label,ne=u?.get(p),{changed:N,cache:we}=Hf(p,r,a,T,Z,R,V,A,ne);l[p]={changed:N,cache:we}}return l},Hf=(e,r,a,u,l,p,v,C,T)=>{let A=(me,at,mt)=>me?.length>0||me?.length>0?me:at=="space"?mt=="Spaces/Home"?"ui//home":mt=="/"?"ui//vault":mt.startsWith("spaces://#")?"ui//tags":"ui//folder":"ui//file",R={label:u?.label,path:e,name:Oo(e),displayName:Oo(e)},V=[],Z=u?.tags?.map(me=>me)??[],ne=np(r,e),N=(me,at,mt=new Set)=>{let Rt=[];for(let Me of at){let ze=me.get(Me)?.contexts??[];for(let Wt of ze)mt.has(Wt)||(Rt.push(Wt),mt.add(Wt),Rt.push(...N(me,[Fo(Wt)],mt)))}return Rt};if(a.has(C))for(let me of a.get(C).contexts??[])V.push(me);V.push(...Z);let we=l?.name,Ne=u?.properties?vf(u.properties[r.fmKeyAlias]):[],K=A(l?.sticker,p,e),Xe=l?.color??"",Re=u?.inlinks??[],it=u?.links??[],tt=r.spacesUseAlias?Ne[0]??we:we,Te={...R,name:we,tags:sn(V),type:p,subtype:v,displayName:tt,parent:C,label:{name:we,sticker:K,color:Xe,thumbnail:l?.thumbnail??"",preview:l?.preview??""},metadata:{...u},inlinks:Re,outlinks:it},Je=[];for(let me of V)Je.push(Fo(me));for(let[me,at]of a){if(at.defPath==e&&(ne=!0),at.space&&at.space.path==C){Je.push(me);continue}if(at.metadata?.filters?.length>0&&Yf(at.metadata.filters,Te)){Je.push(me);continue}if(at.metadata?.links?.length>0&&(at.metadata?.links??[]).find(Rt=>Rt==Te.path)){Je.push(me);continue}}let Ge=N(a,Je);Je.push(...Ge.map(me=>Fo(me))),Te.tags.push(...Ge);let pr=ne?{...Te,spaces:[],hidden:ne}:{...Te,spaces:sn(Je),hidden:ne},jt=!0;return T&&Yo.default.isEqual(pr,T)&&(jt=!1),{changed:jt,cache:pr}};var uv=(e,r,a)=>{if(e.length!==1)return"";let u=e.map(function(v){return v.compile().evaluate(a)}),l=a.get(u[0]),p=a.get("$properties")?.[u[0]]?.type;return(p=="file"||p=="link"||p=="context")&&(p.includes("multi")?l=sr(l).map(v=>a.get("$paths").get(v)):l=a.get("$paths").get(l)),l??""};uv.rawArgs=!0;var lv=(e,r,a)=>{if((e.length-1)%2!==0)return"";for(let u=0;u{if(e.length<1||e.length>2)return"";let u=e[0].compile().evaluate(a);u instanceof Date||(u=new Date(u));let l=e[1]?.compile().evaluate(a);return l?.length>0?fi(u,l):fi(u,a.get("$settings")?.dateFormat??"yyyy-MM-dd")};fv.rawArgs=!0;var hv=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],hp=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],pv="\\u200C\\u200D\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0898-\\u089F\\u08CA-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EBC\\u0EC8-\\u0ECE\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u180F-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1ABF-\\u1ACE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\u30FB\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F\\uFF65",pp="\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC",qf={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Gf="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",dv={5:Gf,"5module":Gf+" export import",6:Gf+" const class extends export import super"},mv=/^in(stanceof)?$/,gv=new RegExp("["+pp+"]"),yv=new RegExp("["+pp+pv+"]");function $f(e,r){for(var a=65536,u=0;ue)return!1;if(a+=r[u+1],a>=e)return!0}return!1}function ln(e,r){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&gv.test(String.fromCharCode(e)):r===!1?!1:$f(e,hp)}function aa(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&yv.test(String.fromCharCode(e)):r===!1?!1:$f(e,hp)||$f(e,hv)}var ve=function(r,a){a===void 0&&(a={}),this.label=r,this.keyword=a.keyword,this.beforeExpr=!!a.beforeExpr,this.startsExpr=!!a.startsExpr,this.isLoop=!!a.isLoop,this.isAssign=!!a.isAssign,this.prefix=!!a.prefix,this.postfix=!!a.postfix,this.binop=a.binop||null,this.updateContext=null};function or(e,r){return new ve(e,{beforeExpr:!0,binop:r})}var ur={beforeExpr:!0},Lt={startsExpr:!0},Kf={};function de(e,r){return r===void 0&&(r={}),r.keyword=e,Kf[e]=new ve(e,r)}var y={num:new ve("num",Lt),regexp:new ve("regexp",Lt),string:new ve("string",Lt),name:new ve("name",Lt),privateId:new ve("privateId",Lt),eof:new ve("eof"),bracketL:new ve("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new ve("]"),braceL:new ve("{",{beforeExpr:!0,startsExpr:!0}),braceR:new ve("}"),parenL:new ve("(",{beforeExpr:!0,startsExpr:!0}),parenR:new ve(")"),comma:new ve(",",ur),semi:new ve(";",ur),colon:new ve(":",ur),dot:new ve("."),question:new ve("?",ur),questionDot:new ve("?."),arrow:new ve("=>",ur),template:new ve("template"),invalidTemplate:new ve("invalidTemplate"),ellipsis:new ve("...",ur),backQuote:new ve("\`",Lt),dollarBraceL:new ve("\${",{beforeExpr:!0,startsExpr:!0}),eq:new ve("=",{beforeExpr:!0,isAssign:!0}),assign:new ve("_=",{beforeExpr:!0,isAssign:!0}),incDec:new ve("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new ve("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:or("||",1),logicalAND:or("&&",2),bitwiseOR:or("|",3),bitwiseXOR:or("^",4),bitwiseAND:or("&",5),equality:or("==/!=/===/!==",6),relational:or("/<=/>=",7),bitShift:or("<>/>>>",8),plusMin:new ve("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:or("%",10),star:or("*",10),slash:or("/",10),starstar:new ve("**",{beforeExpr:!0}),coalesce:or("??",1),_break:de("break"),_case:de("case",ur),_catch:de("catch"),_continue:de("continue"),_debugger:de("debugger"),_default:de("default",ur),_do:de("do",{isLoop:!0,beforeExpr:!0}),_else:de("else",ur),_finally:de("finally"),_for:de("for",{isLoop:!0}),_function:de("function",Lt),_if:de("if"),_return:de("return",ur),_switch:de("switch"),_throw:de("throw",ur),_try:de("try"),_var:de("var"),_const:de("const"),_while:de("while",{isLoop:!0}),_with:de("with"),_new:de("new",{beforeExpr:!0,startsExpr:!0}),_this:de("this",Lt),_super:de("super",Lt),_class:de("class",Lt),_extends:de("extends",ur),_export:de("export"),_import:de("import",Lt),_null:de("null",Lt),_true:de("true",Lt),_false:de("false",Lt),_in:de("in",{beforeExpr:!0,binop:7}),_instanceof:de("instanceof",{beforeExpr:!0,binop:7}),_typeof:de("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:de("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:de("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},cr=/\\r\\n?|\\n|\\u2028|\\u2029/,xv=new RegExp(cr.source,"g");function sa(e){return e===10||e===13||e===8232||e===8233}function dp(e,r,a){a===void 0&&(a=e.length);for(var u=r;u>10)+55296,(e&1023)+56320))}var _v=/(?:[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/,os=function(r,a){this.line=r,this.column=a};os.prototype.offset=function(r){return new os(this.line,this.column+r)};var qo=function(r,a,u){this.start=a,this.end=u,r.sourceFile!==null&&(this.source=r.sourceFile)};function yp(e,r){for(var a=1,u=0;;){var l=dp(e,u,r);if(l<0)return new os(a,r-u);++a,u=l}}var jf={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},lp=!1;function Sv(e){var r={};for(var a in jf)r[a]=e&&ls(e,a)?e[a]:jf[a];if(r.ecmaVersion==="latest"?r.ecmaVersion=1e8:r.ecmaVersion==null?(!lp&&typeof console=="object"&&console.warn&&(lp=!0,console.warn(\`Since Acorn 8.0.0, options.ecmaVersion is required. -Defaulting to 2020, but this will stop working in the future.\`)),r.ecmaVersion=11):r.ecmaVersion>=2015&&(r.ecmaVersion-=2009),r.allowReserved==null&&(r.allowReserved=r.ecmaVersion<5),(!e||e.allowHashBang==null)&&(r.allowHashBang=r.ecmaVersion>=14),op(r.onToken)){var u=r.onToken;r.onToken=function(l){return u.push(l)}}return op(r.onComment)&&(r.onComment=bv(r,r.onComment)),r}function bv(e,r){return function(a,u,l,p,v,C){var T={type:a?"Block":"Line",value:u,start:l,end:p};e.locations&&(T.loc=new qo(this,v,C)),e.ranges&&(T.range=[l,p]),r.push(T)}}var us=1,oa=2,Zf=4,xp=8,vp=16,wp=32,Xf=64,_p=128,fs=256,Jf=us|oa|fs;function ec(e,r){return oa|(e?Zf:0)|(r?xp:0)}var Vo=0,tc=1,cn=2,Sp=3,bp=4,kp=5,ft=function(r,a,u){this.options=r=Sv(r),this.sourceFile=r.sourceFile,this.keywords=Ln(dv[r.ecmaVersion>=6?6:r.sourceType==="module"?"5module":5]);var l="";r.allowReserved!==!0&&(l=qf[r.ecmaVersion>=6?6:r.ecmaVersion===5?5:3],r.sourceType==="module"&&(l+=" await")),this.reservedWords=Ln(l);var p=(l?l+" ":"")+qf.strict;this.reservedWordsStrict=Ln(p),this.reservedWordsStrictBind=Ln(p+" "+qf.strictBind),this.input=String(a),this.containsEsc=!1,u?(this.pos=u,this.lineStart=this.input.lastIndexOf(\` -\`,u-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(cr).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=y.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=r.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&r.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(us),this.regexpState=null,this.privateNameStack=[]},Ur={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};ft.prototype.parse=function(){var r=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(r)};Ur.inFunction.get=function(){return(this.currentVarScope().flags&oa)>0};Ur.inGenerator.get=function(){return(this.currentVarScope().flags&xp)>0&&!this.currentVarScope().inClassFieldInit};Ur.inAsync.get=function(){return(this.currentVarScope().flags&Zf)>0&&!this.currentVarScope().inClassFieldInit};Ur.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var r=this.scopeStack[e];if(r.inClassFieldInit||r.flags&fs)return!1;if(r.flags&oa)return(r.flags&Zf)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Ur.allowSuper.get=function(){var e=this.currentThisScope(),r=e.flags,a=e.inClassFieldInit;return(r&Xf)>0||a||this.options.allowSuperOutsideMethod};Ur.allowDirectSuper.get=function(){return(this.currentThisScope().flags&_p)>0};Ur.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Ur.allowNewDotTarget.get=function(){var e=this.currentThisScope(),r=e.flags,a=e.inClassFieldInit;return(r&(oa|fs))>0||a};Ur.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&fs)>0};ft.extend=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];for(var u=this,l=0;l=,?^&]/.test(l)||l==="!"&&this.input.charAt(u+1)==="=")}e+=r[0].length,lr.lastIndex=e,e+=lr.exec(this.input)[0].length,this.input[e]===";"&&e++}};Ct.eat=function(e){return this.type===e?(this.next(),!0):!1};Ct.isContextual=function(e){return this.type===y.name&&this.value===e&&!this.containsEsc};Ct.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};Ct.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};Ct.canInsertSemicolon=function(){return this.type===y.eof||this.type===y.braceR||cr.test(this.input.slice(this.lastTokEnd,this.start))};Ct.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};Ct.semicolon=function(){!this.eat(y.semi)&&!this.insertSemicolon()&&this.unexpected()};Ct.afterTrailingComma=function(e,r){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),r||this.next(),!0};Ct.expect=function(e){this.eat(e)||this.unexpected()};Ct.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Go=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Ct.checkPatternErrors=function(e,r){if(!!e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var a=r?e.parenthesizedAssign:e.parenthesizedBind;a>-1&&this.raiseRecoverable(a,r?"Assigning to rvalue":"Parenthesized pattern")}};Ct.checkExpressionErrors=function(e,r){if(!e)return!1;var a=e.shorthandAssign,u=e.doubleProto;if(!r)return a>=0||u>=0;a>=0&&this.raise(a,"Shorthand property assignments are valid only in destructuring patterns"),u>=0&&this.raiseRecoverable(u,"Redefinition of __proto__ property")};Ct.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&u<56320)return!0;if(ln(u,!0)){for(var l=a+1;aa(u=this.input.charCodeAt(l),!0);)++l;if(u===92||u>55295&&u<56320)return!0;var p=this.input.slice(a,l);if(!mv.test(p))return!0}return!1};z.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;lr.lastIndex=this.pos;var e=lr.exec(this.input),r=this.pos+e[0].length,a;return!cr.test(this.input.slice(this.pos,r))&&this.input.slice(r,r+8)==="function"&&(r+8===this.input.length||!(aa(a=this.input.charCodeAt(r+8))||a>55295&&a<56320))};z.parseStatement=function(e,r,a){var u=this.type,l=this.startNode(),p;switch(this.isLet(e)&&(u=y._var,p="let"),u){case y._break:case y._continue:return this.parseBreakContinueStatement(l,u.keyword);case y._debugger:return this.parseDebuggerStatement(l);case y._do:return this.parseDoStatement(l);case y._for:return this.parseForStatement(l);case y._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(l,!1,!e);case y._class:return e&&this.unexpected(),this.parseClass(l,!0);case y._if:return this.parseIfStatement(l);case y._return:return this.parseReturnStatement(l);case y._switch:return this.parseSwitchStatement(l);case y._throw:return this.parseThrowStatement(l);case y._try:return this.parseTryStatement(l);case y._const:case y._var:return p=p||this.value,e&&p!=="var"&&this.unexpected(),this.parseVarStatement(l,p);case y._while:return this.parseWhileStatement(l);case y._with:return this.parseWithStatement(l);case y.braceL:return this.parseBlock(!0,l);case y.semi:return this.parseEmptyStatement(l);case y._export:case y._import:if(this.options.ecmaVersion>10&&u===y._import){lr.lastIndex=this.pos;var v=lr.exec(this.input),C=this.pos+v[0].length,T=this.input.charCodeAt(C);if(T===40||T===46)return this.parseExpressionStatement(l,this.parseExpression())}return this.options.allowImportExportEverywhere||(r||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),u===y._import?this.parseImport(l):this.parseExport(l,a);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(l,!0,!e);var A=this.value,R=this.parseExpression();return u===y.name&&R.type==="Identifier"&&this.eat(y.colon)?this.parseLabeledStatement(l,A,R,e):this.parseExpressionStatement(l,R)}};z.parseBreakContinueStatement=function(e,r){var a=r==="break";this.next(),this.eat(y.semi)||this.insertSemicolon()?e.label=null:this.type!==y.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var u=0;u=6?this.eat(y.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};z.parseForStatement=function(e){this.next();var r=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(rc),this.enterScope(0),this.expect(y.parenL),this.type===y.semi)return r>-1&&this.unexpected(r),this.parseFor(e,null);var a=this.isLet();if(this.type===y._var||this.type===y._const||a){var u=this.startNode(),l=a?"let":this.value;return this.next(),this.parseVar(u,!0,l),this.finishNode(u,"VariableDeclaration"),(this.type===y._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&u.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===y._in?r>-1&&this.unexpected(r):e.await=r>-1),this.parseForIn(e,u)):(r>-1&&this.unexpected(r),this.parseFor(e,u))}var p=this.isContextual("let"),v=!1,C=new Go,T=this.parseExpression(r>-1?"await":!0,C);return this.type===y._in||(v=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===y._in?r>-1&&this.unexpected(r):e.await=r>-1),p&&v&&this.raise(T.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(T,!1,C),this.checkLValPattern(T),this.parseForIn(e,T)):(this.checkExpressionErrors(C,!0),r>-1&&this.unexpected(r),this.parseFor(e,T))};z.parseFunctionStatement=function(e,r,a){return this.next(),this.parseFunction(e,ss|(a?0:Qf),!1,r)};z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(y._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};z.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(y.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};z.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(y.braceL),this.labels.push(Cv),this.enterScope(0);for(var r,a=!1;this.type!==y.braceR;)if(this.type===y._case||this.type===y._default){var u=this.type===y._case;r&&this.finishNode(r,"SwitchCase"),e.cases.push(r=this.startNode()),r.consequent=[],this.next(),u?r.test=this.parseExpression():(a&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),a=!0,r.test=null),this.expect(y.colon)}else r||this.unexpected(),r.consequent.push(this.parseStatement(null));return this.exitScope(),r&&this.finishNode(r,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};z.parseThrowStatement=function(e){return this.next(),cr.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Tv=[];z.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),r=e.type==="Identifier";return this.enterScope(r?wp:0),this.checkLValPattern(e,r?bp:cn),this.expect(y.parenR),e};z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===y._catch){var r=this.startNode();this.next(),this.eat(y.parenL)?r.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),r.param=null,this.enterScope(0)),r.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(r,"CatchClause")}return e.finalizer=this.eat(y._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};z.parseVarStatement=function(e,r,a){return this.next(),this.parseVar(e,!1,r,a),this.semicolon(),this.finishNode(e,"VariableDeclaration")};z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(rc),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};z.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};z.parseLabeledStatement=function(e,r,a,u){for(var l=0,p=this.labels;l=0;T--){var A=this.labels[T];if(A.statementStart===e.start)A.statementStart=this.start,A.kind=C;else break}return this.labels.push({name:r,kind:C,statementStart:this.start}),e.body=this.parseStatement(u?u.indexOf("label")===-1?u+"label":u:"label"),this.labels.pop(),e.label=a,this.finishNode(e,"LabeledStatement")};z.parseExpressionStatement=function(e,r){return e.expression=r,this.semicolon(),this.finishNode(e,"ExpressionStatement")};z.parseBlock=function(e,r,a){for(e===void 0&&(e=!0),r===void 0&&(r=this.startNode()),r.body=[],this.expect(y.braceL),e&&this.enterScope(0);this.type!==y.braceR;){var u=this.parseStatement(null);r.body.push(u)}return a&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(r,"BlockStatement")};z.parseFor=function(e,r){return e.init=r,this.expect(y.semi),e.test=this.type===y.semi?null:this.parseExpression(),this.expect(y.semi),e.update=this.type===y.parenR?null:this.parseExpression(),this.expect(y.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};z.parseForIn=function(e,r){var a=this.type===y._in;return this.next(),r.type==="VariableDeclaration"&&r.declarations[0].init!=null&&(!a||this.options.ecmaVersion<8||this.strict||r.kind!=="var"||r.declarations[0].id.type!=="Identifier")&&this.raise(r.start,(a?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=r,e.right=a?this.parseExpression():this.parseMaybeAssign(),this.expect(y.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,a?"ForInStatement":"ForOfStatement")};z.parseVar=function(e,r,a,u){for(e.declarations=[],e.kind=a;;){var l=this.startNode();if(this.parseVarId(l,a),this.eat(y.eq)?l.init=this.parseMaybeAssign(r):!u&&a==="const"&&!(this.type===y._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!u&&l.id.type!=="Identifier"&&!(r&&(this.type===y._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):l.init=null,e.declarations.push(this.finishNode(l,"VariableDeclarator")),!this.eat(y.comma))break}return e};z.parseVarId=function(e,r){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,r==="var"?tc:cn,!1)};var ss=1,Qf=2,Cp=4;z.parseFunction=function(e,r,a,u,l){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!u)&&(this.type===y.star&&r&Qf&&this.unexpected(),e.generator=this.eat(y.star)),this.options.ecmaVersion>=8&&(e.async=!!u),r&ss&&(e.id=r&Cp&&this.type!==y.name?null:this.parseIdent(),e.id&&!(r&Qf)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?tc:cn:Sp));var p=this.yieldPos,v=this.awaitPos,C=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ec(e.async,e.generator)),r&ss||(e.id=this.type===y.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,a,!1,l),this.yieldPos=p,this.awaitPos=v,this.awaitIdentPos=C,this.finishNode(e,r&ss?"FunctionDeclaration":"FunctionExpression")};z.parseFunctionParams=function(e){this.expect(y.parenL),e.params=this.parseBindingList(y.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};z.parseClass=function(e,r){this.next();var a=this.strict;this.strict=!0,this.parseClassId(e,r),this.parseClassSuper(e);var u=this.enterClassBody(),l=this.startNode(),p=!1;for(l.body=[],this.expect(y.braceL);this.type!==y.braceR;){var v=this.parseClassElement(e.superClass!==null);v&&(l.body.push(v),v.type==="MethodDefinition"&&v.kind==="constructor"?(p&&this.raiseRecoverable(v.start,"Duplicate constructor in the same class"),p=!0):v.key&&v.key.type==="PrivateIdentifier"&&Pv(u,v)&&this.raiseRecoverable(v.key.start,"Identifier '#"+v.key.name+"' has already been declared"))}return this.strict=a,this.next(),e.body=this.finishNode(l,"ClassBody"),this.exitClassBody(),this.finishNode(e,r?"ClassDeclaration":"ClassExpression")};z.parseClassElement=function(e){if(this.eat(y.semi))return null;var r=this.options.ecmaVersion,a=this.startNode(),u="",l=!1,p=!1,v="method",C=!1;if(this.eatContextual("static")){if(r>=13&&this.eat(y.braceL))return this.parseClassStaticBlock(a),a;this.isClassElementNameStart()||this.type===y.star?C=!0:u="static"}if(a.static=C,!u&&r>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===y.star)&&!this.canInsertSemicolon()?p=!0:u="async"),!u&&(r>=9||!p)&&this.eat(y.star)&&(l=!0),!u&&!p&&!l){var T=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?v=T:u=T)}if(u?(a.computed=!1,a.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),a.key.name=u,this.finishNode(a.key,"Identifier")):this.parseClassElementName(a),r<13||this.type===y.parenL||v!=="method"||l||p){var A=!a.static&&Uo(a,"constructor"),R=A&&e;A&&v!=="method"&&this.raise(a.key.start,"Constructor can't have get/set modifier"),a.kind=A?"constructor":v,this.parseClassMethod(a,l,p,R)}else this.parseClassField(a);return a};z.isClassElementNameStart=function(){return this.type===y.name||this.type===y.privateId||this.type===y.num||this.type===y.string||this.type===y.bracketL||this.type.keyword};z.parseClassElementName=function(e){this.type===y.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};z.parseClassMethod=function(e,r,a,u){var l=e.key;e.kind==="constructor"?(r&&this.raise(l.start,"Constructor can't be a generator"),a&&this.raise(l.start,"Constructor can't be an async method")):e.static&&Uo(e,"prototype")&&this.raise(l.start,"Classes may not have a static property named prototype");var p=e.value=this.parseMethod(r,a,u);return e.kind==="get"&&p.params.length!==0&&this.raiseRecoverable(p.start,"getter should have no params"),e.kind==="set"&&p.params.length!==1&&this.raiseRecoverable(p.start,"setter should have exactly one param"),e.kind==="set"&&p.params[0].type==="RestElement"&&this.raiseRecoverable(p.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};z.parseClassField=function(e){if(Uo(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Uo(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(y.eq)){var r=this.currentThisScope(),a=r.inClassFieldInit;r.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),r.inClassFieldInit=a}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};z.parseClassStaticBlock=function(e){e.body=[];var r=this.labels;for(this.labels=[],this.enterScope(fs|Xf);this.type!==y.braceR;){var a=this.parseStatement(null);e.body.push(a)}return this.next(),this.exitScope(),this.labels=r,this.finishNode(e,"StaticBlock")};z.parseClassId=function(e,r){this.type===y.name?(e.id=this.parseIdent(),r&&this.checkLValSimple(e.id,cn,!1)):(r===!0&&this.unexpected(),e.id=null)};z.parseClassSuper=function(e){e.superClass=this.eat(y._extends)?this.parseExprSubscripts(null,!1):null};z.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};z.exitClassBody=function(){var e=this.privateNameStack.pop(),r=e.declared,a=e.used;if(!!this.options.checkPrivateFields)for(var u=this.privateNameStack.length,l=u===0?null:this.privateNameStack[u-1],p=0;p=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(r,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==y.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};z.parseExport=function(e,r){if(this.next(),this.eat(y.star))return this.parseExportAllDeclaration(e,r);if(this.eat(y._default))return this.checkExport(r,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(r,e.declaration.declarations):this.checkExport(r,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(r),this.eatContextual("from"))this.type!==y.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var a=0,u=e.specifiers;a=13&&this.type===y.string){var e=this.parseLiteral(this.value);return _v.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};z.adaptDirectivePrologue=function(e){for(var r=0;r=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var hr=ft.prototype;hr.toAssignable=function(e,r,a){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",a&&this.checkPatternErrors(a,!0);for(var u=0,l=e.properties;u=8&&!C&&T.name==="async"&&!this.canInsertSemicolon()&&this.eat(y._function))return this.overrideContext(We.f_expr),this.parseFunction(this.startNodeAt(p,v),0,!1,!0,r);if(l&&!this.canInsertSemicolon()){if(this.eat(y.arrow))return this.parseArrowExpression(this.startNodeAt(p,v),[T],!1,r);if(this.options.ecmaVersion>=8&&T.name==="async"&&this.type===y.name&&!C&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return T=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(y.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(p,v),[T],!0,r)}return T;case y.regexp:var A=this.value;return u=this.parseLiteral(A.value),u.regex={pattern:A.pattern,flags:A.flags},u;case y.num:case y.string:return this.parseLiteral(this.value);case y._null:case y._true:case y._false:return u=this.startNode(),u.value=this.type===y._null?null:this.type===y._true,u.raw=this.type.keyword,this.next(),this.finishNode(u,"Literal");case y.parenL:var R=this.start,V=this.parseParenAndDistinguishExpression(l,r);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(V)&&(e.parenthesizedAssign=R),e.parenthesizedBind<0&&(e.parenthesizedBind=R)),V;case y.bracketL:return u=this.startNode(),this.next(),u.elements=this.parseExprList(y.bracketR,!0,!0,e),this.finishNode(u,"ArrayExpression");case y.braceL:return this.overrideContext(We.b_expr),this.parseObj(!1,e);case y._function:return u=this.startNode(),this.next(),this.parseFunction(u,0);case y._class:return this.parseClass(this.startNode(),!1);case y._new:return this.parseNew();case y.backQuote:return this.parseTemplate();case y._import:return this.options.ecmaVersion>=11?this.parseExprImport(a):this.unexpected();default:return this.parseExprAtomDefault()}};J.parseExprAtomDefault=function(){this.unexpected()};J.parseExprImport=function(e){var r=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===y.parenL&&!e)return this.parseDynamicImport(r);if(this.type===y.dot){var a=this.startNodeAt(r.start,r.loc&&r.loc.start);return a.name="import",r.meta=this.finishNode(a,"Identifier"),this.parseImportMeta(r)}else this.unexpected()};J.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(y.parenR)){var r=this.start;this.eat(y.comma)&&this.eat(y.parenR)?this.raiseRecoverable(r,"Trailing comma is not allowed in import()"):this.unexpected(r)}return this.finishNode(e,"ImportExpression")};J.parseImportMeta=function(e){this.next();var r=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),r&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};J.parseLiteral=function(e){var r=this.startNode();return r.value=e,r.raw=this.input.slice(this.start,this.end),r.raw.charCodeAt(r.raw.length-1)===110&&(r.bigint=r.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(r,"Literal")};J.parseParenExpression=function(){this.expect(y.parenL);var e=this.parseExpression();return this.expect(y.parenR),e};J.shouldParseArrow=function(e){return!this.canInsertSemicolon()};J.parseParenAndDistinguishExpression=function(e,r){var a=this.start,u=this.startLoc,l,p=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var v=this.start,C=this.startLoc,T=[],A=!0,R=!1,V=new Go,Z=this.yieldPos,ne=this.awaitPos,N;for(this.yieldPos=0,this.awaitPos=0;this.type!==y.parenR;)if(A?A=!1:this.expect(y.comma),p&&this.afterTrailingComma(y.parenR,!0)){R=!0;break}else if(this.type===y.ellipsis){N=this.start,T.push(this.parseParenItem(this.parseRestBinding())),this.type===y.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else T.push(this.parseMaybeAssign(!1,V,this.parseParenItem));var we=this.lastTokEnd,Ne=this.lastTokEndLoc;if(this.expect(y.parenR),e&&this.shouldParseArrow(T)&&this.eat(y.arrow))return this.checkPatternErrors(V,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Z,this.awaitPos=ne,this.parseParenArrowList(a,u,T,r);(!T.length||R)&&this.unexpected(this.lastTokStart),N&&this.unexpected(N),this.checkExpressionErrors(V,!0),this.yieldPos=Z||this.yieldPos,this.awaitPos=ne||this.awaitPos,T.length>1?(l=this.startNodeAt(v,C),l.expressions=T,this.finishNodeAt(l,"SequenceExpression",we,Ne)):l=T[0]}else l=this.parseParenExpression();if(this.options.preserveParens){var K=this.startNodeAt(a,u);return K.expression=l,this.finishNode(K,"ParenthesizedExpression")}else return l};J.parseParenItem=function(e){return e};J.parseParenArrowList=function(e,r,a,u){return this.parseArrowExpression(this.startNodeAt(e,r),a,!1,u)};var Ev=[];J.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===y.dot){var r=this.startNodeAt(e.start,e.loc&&e.loc.start);r.name="new",e.meta=this.finishNode(r,"Identifier"),this.next();var a=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),a&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var u=this.start,l=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),u,l,!0,!1),this.eat(y.parenL)?e.arguments=this.parseExprList(y.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Ev,this.finishNode(e,"NewExpression")};J.parseTemplateElement=function(e){var r=e.isTagged,a=this.startNode();return this.type===y.invalidTemplate?(r||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),a.value={raw:this.value,cooked:null}):a.value={raw:this.input.slice(this.start,this.end).replace(/\\r\\n?/g,\` -\`),cooked:this.value},this.next(),a.tail=this.type===y.backQuote,this.finishNode(a,"TemplateElement")};J.parseTemplate=function(e){e===void 0&&(e={});var r=e.isTagged;r===void 0&&(r=!1);var a=this.startNode();this.next(),a.expressions=[];var u=this.parseTemplateElement({isTagged:r});for(a.quasis=[u];!u.tail;)this.type===y.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(y.dollarBraceL),a.expressions.push(this.parseExpression()),this.expect(y.braceR),a.quasis.push(u=this.parseTemplateElement({isTagged:r}));return this.next(),this.finishNode(a,"TemplateLiteral")};J.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===y.name||this.type===y.num||this.type===y.string||this.type===y.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===y.star)&&!cr.test(this.input.slice(this.lastTokEnd,this.start))};J.parseObj=function(e,r){var a=this.startNode(),u=!0,l={};for(a.properties=[],this.next();!this.eat(y.braceR);){if(u)u=!1;else if(this.expect(y.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(y.braceR))break;var p=this.parseProperty(e,r);e||this.checkPropClash(p,l,r),a.properties.push(p)}return this.finishNode(a,e?"ObjectPattern":"ObjectExpression")};J.parseProperty=function(e,r){var a=this.startNode(),u,l,p,v;if(this.options.ecmaVersion>=9&&this.eat(y.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===y.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(a.argument=this.parseMaybeAssign(!1,r),this.type===y.comma&&r&&r.trailingComma<0&&(r.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(e||r)&&(p=this.start,v=this.startLoc),e||(u=this.eat(y.star)));var C=this.containsEsc;return this.parsePropertyName(a),!e&&!C&&this.options.ecmaVersion>=8&&!u&&this.isAsyncProp(a)?(l=!0,u=this.options.ecmaVersion>=9&&this.eat(y.star),this.parsePropertyName(a)):l=!1,this.parsePropertyValue(a,e,u,l,p,v,r,C),this.finishNode(a,"Property")};J.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var r=e.kind==="get"?0:1;if(e.value.params.length!==r){var a=e.value.start;e.kind==="get"?this.raiseRecoverable(a,"getter should have no params"):this.raiseRecoverable(a,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};J.parsePropertyValue=function(e,r,a,u,l,p,v,C){(a||u)&&this.type===y.colon&&this.unexpected(),this.eat(y.colon)?(e.value=r?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,v),e.kind="init"):this.options.ecmaVersion>=6&&this.type===y.parenL?(r&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(a,u)):!r&&!C&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==y.comma&&this.type!==y.braceR&&this.type!==y.eq?((a||u)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((a||u)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=l),e.kind="init",r?e.value=this.parseMaybeDefault(l,p,this.copyNode(e.key)):this.type===y.eq&&v?(v.shorthandAssign<0&&(v.shorthandAssign=this.start),e.value=this.parseMaybeDefault(l,p,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};J.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(y.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(y.bracketR),e.key;e.computed=!1}return e.key=this.type===y.num||this.type===y.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};J.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};J.parseMethod=function(e,r,a){var u=this.startNode(),l=this.yieldPos,p=this.awaitPos,v=this.awaitIdentPos;return this.initFunction(u),this.options.ecmaVersion>=6&&(u.generator=e),this.options.ecmaVersion>=8&&(u.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ec(r,u.generator)|Xf|(a?_p:0)),this.expect(y.parenL),u.params=this.parseBindingList(y.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(u,!1,!0,!1),this.yieldPos=l,this.awaitPos=p,this.awaitIdentPos=v,this.finishNode(u,"FunctionExpression")};J.parseArrowExpression=function(e,r,a,u){var l=this.yieldPos,p=this.awaitPos,v=this.awaitIdentPos;return this.enterScope(ec(a,!1)|vp),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!a),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(r,!0),this.parseFunctionBody(e,!0,!1,u),this.yieldPos=l,this.awaitPos=p,this.awaitIdentPos=v,this.finishNode(e,"ArrowFunctionExpression")};J.parseFunctionBody=function(e,r,a,u){var l=r&&this.type!==y.braceL,p=this.strict,v=!1;if(l)e.body=this.parseMaybeAssign(u),e.expression=!0,this.checkParams(e,!1);else{var C=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!p||C)&&(v=this.strictDirective(this.end),v&&C&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var T=this.labels;this.labels=[],v&&(this.strict=!0),this.checkParams(e,!p&&!v&&!r&&!a&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,kp),e.body=this.parseBlock(!1,void 0,v&&!p),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=T}this.exitScope()};J.isSimpleParamList=function(e){for(var r=0,a=e;r-1||l.functions.indexOf(e)>-1||l.var.indexOf(e)>-1,l.lexical.push(e),this.inModule&&l.flags&us&&delete this.undefinedExports[e]}else if(r===bp){var p=this.currentScope();p.lexical.push(e)}else if(r===Sp){var v=this.currentScope();this.treatFunctionsAsVar?u=v.lexical.indexOf(e)>-1:u=v.lexical.indexOf(e)>-1||v.var.indexOf(e)>-1,v.functions.push(e)}else for(var C=this.scopeStack.length-1;C>=0;--C){var T=this.scopeStack[C];if(T.lexical.indexOf(e)>-1&&!(T.flags&wp&&T.lexical[0]===e)||!this.treatFunctionsAsVarInScope(T)&&T.functions.indexOf(e)>-1){u=!0;break}if(T.var.push(e),this.inModule&&T.flags&us&&delete this.undefinedExports[e],T.flags&Jf)break}u&&this.raiseRecoverable(a,"Identifier '"+e+"' has already been declared")};Wn.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};Wn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Wn.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&Jf)return r}};Wn.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&Jf&&!(r.flags&vp))return r}};var zo=function(r,a,u){this.type="",this.start=a,this.end=0,r.options.locations&&(this.loc=new qo(r,u)),r.options.directSourceFile&&(this.sourceFile=r.options.directSourceFile),r.options.ranges&&(this.range=[a,0])},cs=ft.prototype;cs.startNode=function(){return new zo(this,this.start,this.startLoc)};cs.startNodeAt=function(e,r){return new zo(this,e,r)};function Pp(e,r,a,u){return e.type=r,e.end=a,this.options.locations&&(e.loc.end=u),this.options.ranges&&(e.range[1]=a),e}cs.finishNode=function(e,r){return Pp.call(this,e,r,this.lastTokEnd,this.lastTokEndLoc)};cs.finishNodeAt=function(e,r,a,u){return Pp.call(this,e,r,a,u)};cs.copyNode=function(e){var r=new zo(this,e.start,this.startLoc);for(var a in e)r[a]=e[a];return r};var Ep="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Dp=Ep+" Extended_Pictographic",Ip=Dp,Mp=Ip+" EBase EComp EMod EPres ExtPict",Ap=Mp,Iv=Ap,Mv={9:Ep,10:Dp,11:Ip,12:Mp,13:Ap,14:Iv},Av="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Ov={9:"",10:"",11:"",12:"",13:"",14:Av},fp="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Op="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Fp=Op+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Np=Fp+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Lp=Np+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Rp=Lp+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Fv=Rp+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",Nv={9:Op,10:Fp,11:Np,12:Lp,13:Rp,14:Fv},Wp={};function Lv(e){var r=Wp[e]={binary:Ln(Mv[e]+" "+fp),binaryOfStrings:Ln(Ov[e]),nonBinary:{General_Category:Ln(fp),Script:Ln(Nv[e])}};r.nonBinary.Script_Extensions=r.nonBinary.Script,r.nonBinary.gc=r.nonBinary.General_Category,r.nonBinary.sc=r.nonBinary.Script,r.nonBinary.scx=r.nonBinary.Script_Extensions}for(Bo=0,zf=[9,10,11,12,13,14];Bo=6?"uy":"")+(r.options.ecmaVersion>=9?"s":"")+(r.options.ecmaVersion>=13?"d":"")+(r.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Wp[r.options.ecmaVersion>=14?14:r.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};Hr.prototype.reset=function(r,a,u){var l=u.indexOf("v")!==-1,p=u.indexOf("u")!==-1;this.start=r|0,this.source=a+"",this.flags=u,l&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=p&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=p&&this.parser.options.ecmaVersion>=9)};Hr.prototype.raise=function(r){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+r)};Hr.prototype.at=function(r,a){a===void 0&&(a=!1);var u=this.source,l=u.length;if(r>=l)return-1;var p=u.charCodeAt(r);if(!(a||this.switchU)||p<=55295||p>=57344||r+1>=l)return p;var v=u.charCodeAt(r+1);return v>=56320&&v<=57343?(p<<10)+v-56613888:p};Hr.prototype.nextIndex=function(r,a){a===void 0&&(a=!1);var u=this.source,l=u.length;if(r>=l)return l;var p=u.charCodeAt(r),v;return!(a||this.switchU)||p<=55295||p>=57344||r+1>=l||(v=u.charCodeAt(r+1))<56320||v>57343?r+1:r+2};Hr.prototype.current=function(r){return r===void 0&&(r=!1),this.at(this.pos,r)};Hr.prototype.lookahead=function(r){return r===void 0&&(r=!1),this.at(this.nextIndex(this.pos,r),r)};Hr.prototype.advance=function(r){r===void 0&&(r=!1),this.pos=this.nextIndex(this.pos,r)};Hr.prototype.eat=function(r,a){return a===void 0&&(a=!1),this.current(a)===r?(this.advance(a),!0):!1};Hr.prototype.eatChars=function(r,a){a===void 0&&(a=!1);for(var u=this.pos,l=0,p=r;l-1&&this.raise(e.start,"Duplicate regular expression flag"),v==="u"&&(u=!0),v==="v"&&(l=!0)}this.options.ecmaVersion>=15&&u&&l&&this.raise(e.start,"Invalid regular expression flag")};U.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};U.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var r=0,a=e.backReferenceNames;r=9&&(a=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!a,!0}return e.pos=r,!1};U.regexp_eatQuantifier=function(e,r){return r===void 0&&(r=!1),this.regexp_eatQuantifierPrefix(e,r)?(e.eat(63),!0):!1};U.regexp_eatQuantifierPrefix=function(e,r){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,r)};U.regexp_eatBracedQuantifier=function(e,r){var a=e.pos;if(e.eat(123)){var u=0,l=-1;if(this.regexp_eatDecimalDigits(e)&&(u=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(l=e.lastIntValue),e.eat(125)))return l!==-1&&l=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};U.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};U.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};U.regexp_eatSyntaxCharacter=function(e){var r=e.current();return Yp(r)?(e.lastIntValue=r,e.advance(),!0):!1};function Yp(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}U.regexp_eatPatternCharacters=function(e){for(var r=e.pos,a=0;(a=e.current())!==-1&&!Yp(a);)e.advance();return e.pos!==r};U.regexp_eatExtendedPatternCharacter=function(e){var r=e.current();return r!==-1&&r!==36&&!(r>=40&&r<=43)&&r!==46&&r!==63&&r!==91&&r!==94&&r!==124?(e.advance(),!0):!1};U.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};U.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};U.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Rn(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Rn(e.lastIntValue);return!0}return!1};U.regexp_eatRegExpIdentifierStart=function(e){var r=e.pos,a=this.options.ecmaVersion>=11,u=e.current(a);return e.advance(a),u===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,a)&&(u=e.lastIntValue),Rv(u)?(e.lastIntValue=u,!0):(e.pos=r,!1)};function Rv(e){return ln(e,!0)||e===36||e===95}U.regexp_eatRegExpIdentifierPart=function(e){var r=e.pos,a=this.options.ecmaVersion>=11,u=e.current(a);return e.advance(a),u===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,a)&&(u=e.lastIntValue),Wv(u)?(e.lastIntValue=u,!0):(e.pos=r,!1)};function Wv(e){return aa(e,!0)||e===36||e===95||e===8204||e===8205}U.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};U.regexp_eatBackReference=function(e){var r=e.pos;if(this.regexp_eatDecimalEscape(e)){var a=e.lastIntValue;if(e.switchU)return a>e.maxBackReference&&(e.maxBackReference=a),!0;if(a<=e.numCapturingParens)return!0;e.pos=r}return!1};U.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};U.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};U.regexp_eatCControlLetter=function(e){var r=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=r}return!1};U.regexp_eatZero=function(e){return e.current()===48&&!$o(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};U.regexp_eatControlEscape=function(e){var r=e.current();return r===116?(e.lastIntValue=9,e.advance(),!0):r===110?(e.lastIntValue=10,e.advance(),!0):r===118?(e.lastIntValue=11,e.advance(),!0):r===102?(e.lastIntValue=12,e.advance(),!0):r===114?(e.lastIntValue=13,e.advance(),!0):!1};U.regexp_eatControlLetter=function(e){var r=e.current();return Bp(r)?(e.lastIntValue=r%32,e.advance(),!0):!1};function Bp(e){return e>=65&&e<=90||e>=97&&e<=122}U.regexp_eatRegExpUnicodeEscapeSequence=function(e,r){r===void 0&&(r=!1);var a=e.pos,u=r||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var l=e.lastIntValue;if(u&&l>=55296&&l<=56319){var p=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var v=e.lastIntValue;if(v>=56320&&v<=57343)return e.lastIntValue=(l-55296)*1024+(v-56320)+65536,!0}e.pos=p,e.lastIntValue=l}return!0}if(u&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Yv(e.lastIntValue))return!0;u&&e.raise("Invalid unicode escape"),e.pos=a}return!1};function Yv(e){return e>=0&&e<=1114111}U.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var r=e.current();return r!==99&&(!e.switchN||r!==107)?(e.lastIntValue=r,e.advance(),!0):!1};U.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var r=e.current();if(r>=49&&r<=57){do e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();while((r=e.current())>=48&&r<=57);return!0}return!1};var Vp=0,fn=1,fr=2;U.regexp_eatCharacterClassEscape=function(e){var r=e.current();if(Bv(r))return e.lastIntValue=-1,e.advance(),fn;var a=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((a=r===80)||r===112)){e.lastIntValue=-1,e.advance();var u;if(e.eat(123)&&(u=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return a&&u===fr&&e.raise("Invalid property name"),u;e.raise("Invalid property name")}return Vp};function Bv(e){return e===100||e===68||e===115||e===83||e===119||e===87}U.regexp_eatUnicodePropertyValueExpression=function(e){var r=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var a=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var u=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,a,u),fn}}if(e.pos=r,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var l=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,l)}return Vp};U.regexp_validateUnicodePropertyNameAndValue=function(e,r,a){ls(e.unicodeProperties.nonBinary,r)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[r].test(a)||e.raise("Invalid property value")};U.regexp_validateUnicodePropertyNameOrValue=function(e,r){if(e.unicodeProperties.binary.test(r))return fn;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(r))return fr;e.raise("Invalid property name")};U.regexp_eatUnicodePropertyName=function(e){var r=0;for(e.lastStringValue="";Up(r=e.current());)e.lastStringValue+=Rn(r),e.advance();return e.lastStringValue!==""};function Up(e){return Bp(e)||e===95}U.regexp_eatUnicodePropertyValue=function(e){var r=0;for(e.lastStringValue="";Vv(r=e.current());)e.lastStringValue+=Rn(r),e.advance();return e.lastStringValue!==""};function Vv(e){return Up(e)||$o(e)}U.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};U.regexp_eatCharacterClass=function(e){if(e.eat(91)){var r=e.eat(94),a=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),r&&a===fr&&e.raise("Negated character class may contain strings"),!0}return!1};U.regexp_classContents=function(e){return e.current()===93?fn:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),fn)};U.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var r=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var a=e.lastIntValue;e.switchU&&(r===-1||a===-1)&&e.raise("Invalid character class"),r!==-1&&a!==-1&&r>a&&e.raise("Range out of order in character class")}}};U.regexp_eatClassAtom=function(e){var r=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var a=e.current();(a===99||Gp(a))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=r}var u=e.current();return u!==93?(e.lastIntValue=u,e.advance(),!0):!1};U.regexp_eatClassEscape=function(e){var r=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=r}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};U.regexp_classSetExpression=function(e){var r=fn,a;if(!this.regexp_eatClassSetRange(e))if(a=this.regexp_eatClassSetOperand(e)){a===fr&&(r=fr);for(var u=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(a=this.regexp_eatClassSetOperand(e))){a!==fr&&(r=fn);continue}e.raise("Invalid character in character class")}if(u!==e.pos)return r;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(u!==e.pos)return r}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(a=this.regexp_eatClassSetOperand(e),!a)return r;a===fr&&(r=fr)}};U.regexp_eatClassSetRange=function(e){var r=e.pos;if(this.regexp_eatClassSetCharacter(e)){var a=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var u=e.lastIntValue;return a!==-1&&u!==-1&&a>u&&e.raise("Range out of order in character class"),!0}e.pos=r}return!1};U.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?fn:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};U.regexp_eatNestedClass=function(e){var r=e.pos;if(e.eat(91)){var a=e.eat(94),u=this.regexp_classContents(e);if(e.eat(93))return a&&u===fr&&e.raise("Negated character class may contain strings"),u;e.pos=r}if(e.eat(92)){var l=this.regexp_eatCharacterClassEscape(e);if(l)return l;e.pos=r}return null};U.regexp_eatClassStringDisjunction=function(e){var r=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var a=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return a}else e.raise("Invalid escape");e.pos=r}return null};U.regexp_classStringDisjunctionContents=function(e){for(var r=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===fr&&(r=fr);return r};U.regexp_classString=function(e){for(var r=0;this.regexp_eatClassSetCharacter(e);)r++;return r===1?fn:fr};U.regexp_eatClassSetCharacter=function(e){var r=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=r,!1);var a=e.current();return a<0||a===e.lookahead()&&Uv(a)||Hv(a)?!1:(e.advance(),e.lastIntValue=a,!0)};function Uv(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Hv(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}U.regexp_eatClassSetReservedPunctuator=function(e){var r=e.current();return qv(r)?(e.lastIntValue=r,e.advance(),!0):!1};function qv(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}U.regexp_eatClassControlLetter=function(e){var r=e.current();return $o(r)||r===95?(e.lastIntValue=r%32,e.advance(),!0):!1};U.regexp_eatHexEscapeSequence=function(e){var r=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=r}return!1};U.regexp_eatDecimalDigits=function(e){var r=e.pos,a=0;for(e.lastIntValue=0;$o(a=e.current());)e.lastIntValue=10*e.lastIntValue+(a-48),e.advance();return e.pos!==r};function $o(e){return e>=48&&e<=57}U.regexp_eatHexDigits=function(e){var r=e.pos,a=0;for(e.lastIntValue=0;Hp(a=e.current());)e.lastIntValue=16*e.lastIntValue+qp(a),e.advance();return e.pos!==r};function Hp(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function qp(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}U.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var a=e.lastIntValue;r<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=r*64+a*8+e.lastIntValue:e.lastIntValue=r*8+a}else e.lastIntValue=r;return!0}return!1};U.regexp_eatOctalDigit=function(e){var r=e.current();return Gp(r)?(e.lastIntValue=r-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Gp(e){return e>=48&&e<=55}U.regexp_eatFixedHexDigits=function(e,r){var a=e.pos;e.lastIntValue=0;for(var u=0;u=this.input.length)return this.finishToken(y.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};he.readToken=function(e){return ln(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};he.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var r=this.input.charCodeAt(this.pos+1);return r<=56319||r>=57344?e:(e<<10)+r-56613888};he.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),r=this.pos,a=this.input.indexOf("*/",this.pos+=2);if(a===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=a+2,this.options.locations)for(var u=void 0,l=r;(u=dp(this.input,l,this.pos))>-1;)++this.curLine,l=this.lineStart=u;this.options.onComment&&this.options.onComment(!0,this.input.slice(r+2,a),r,this.pos,e,this.curPosition())};he.skipLineComment=function(e){for(var r=this.pos,a=this.options.onComment&&this.curPosition(),u=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&mp.test(String.fromCharCode(e)))++this.pos;else break e}}};he.finishToken=function(e,r){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var a=this.type;this.type=e,this.value=r,this.updateContext(a)};he.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var r=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&r===46?(this.pos+=3,this.finishToken(y.ellipsis)):(++this.pos,this.finishToken(y.dot))};he.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(y.assign,2):this.finishOp(y.slash,1)};he.readToken_mult_modulo_exp=function(e){var r=this.input.charCodeAt(this.pos+1),a=1,u=e===42?y.star:y.modulo;return this.options.ecmaVersion>=7&&e===42&&r===42&&(++a,u=y.starstar,r=this.input.charCodeAt(this.pos+2)),r===61?this.finishOp(y.assign,a+1):this.finishOp(u,a)};he.readToken_pipe_amp=function(e){var r=this.input.charCodeAt(this.pos+1);if(r===e){if(this.options.ecmaVersion>=12){var a=this.input.charCodeAt(this.pos+2);if(a===61)return this.finishOp(y.assign,3)}return this.finishOp(e===124?y.logicalOR:y.logicalAND,2)}return r===61?this.finishOp(y.assign,2):this.finishOp(e===124?y.bitwiseOR:y.bitwiseAND,1)};he.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(y.assign,2):this.finishOp(y.bitwiseXOR,1)};he.readToken_plus_min=function(e){var r=this.input.charCodeAt(this.pos+1);return r===e?r===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||cr.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(y.incDec,2):r===61?this.finishOp(y.assign,2):this.finishOp(y.plusMin,1)};he.readToken_lt_gt=function(e){var r=this.input.charCodeAt(this.pos+1),a=1;return r===e?(a=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+a)===61?this.finishOp(y.assign,a+1):this.finishOp(y.bitShift,a)):r===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(r===61&&(a=2),this.finishOp(y.relational,a))};he.readToken_eq_excl=function(e){var r=this.input.charCodeAt(this.pos+1);return r===61?this.finishOp(y.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&r===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(y.arrow)):this.finishOp(e===61?y.eq:y.prefix,1)};he.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var r=this.input.charCodeAt(this.pos+1);if(r===46){var a=this.input.charCodeAt(this.pos+2);if(a<48||a>57)return this.finishOp(y.questionDot,2)}if(r===63){if(e>=12){var u=this.input.charCodeAt(this.pos+2);if(u===61)return this.finishOp(y.assign,3)}return this.finishOp(y.coalesce,2)}}return this.finishOp(y.question,1)};he.readToken_numberSign=function(){var e=this.options.ecmaVersion,r=35;if(e>=13&&(++this.pos,r=this.fullCharCodeAtPos(),ln(r,!0)||r===92))return this.finishToken(y.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Rn(r)+"'")};he.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(y.parenL);case 41:return++this.pos,this.finishToken(y.parenR);case 59:return++this.pos,this.finishToken(y.semi);case 44:return++this.pos,this.finishToken(y.comma);case 91:return++this.pos,this.finishToken(y.bracketL);case 93:return++this.pos,this.finishToken(y.bracketR);case 123:return++this.pos,this.finishToken(y.braceL);case 125:return++this.pos,this.finishToken(y.braceR);case 58:return++this.pos,this.finishToken(y.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(y.backQuote);case 48:var r=this.input.charCodeAt(this.pos+1);if(r===120||r===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(r===111||r===79)return this.readRadixNumber(8);if(r===98||r===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(y.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Rn(e)+"'")};he.finishOp=function(e,r){var a=this.input.slice(this.pos,this.pos+r);return this.pos+=r,this.finishToken(e,a)};he.readRegexp=function(){for(var e,r,a=this.pos;;){this.pos>=this.input.length&&this.raise(a,"Unterminated regular expression");var u=this.input.charAt(this.pos);if(cr.test(u)&&this.raise(a,"Unterminated regular expression"),e)e=!1;else{if(u==="[")r=!0;else if(u==="]"&&r)r=!1;else if(u==="/"&&!r)break;e=u==="\\\\"}++this.pos}var l=this.input.slice(a,this.pos);++this.pos;var p=this.pos,v=this.readWord1();this.containsEsc&&this.unexpected(p);var C=this.regexpState||(this.regexpState=new Hr(this));C.reset(a,l,v),this.validateRegExpFlags(C),this.validateRegExpPattern(C);var T=null;try{T=new RegExp(l,v)}catch{}return this.finishToken(y.regexp,{pattern:l,flags:v,value:T})};he.readInt=function(e,r,a){for(var u=this.options.ecmaVersion>=12&&r===void 0,l=a&&this.input.charCodeAt(this.pos)===48,p=this.pos,v=0,C=0,T=0,A=r??1/0;T=97?V=R-97+10:R>=65?V=R-65+10:R>=48&&R<=57?V=R-48:V=1/0,V>=e)break;C=R,v=v*e+V}return u&&C===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===p||r!=null&&this.pos-p!==r?null:v};function Gv(e,r){return r?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function zp(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}he.readRadixNumber=function(e){var r=this.pos;this.pos+=2;var a=this.readInt(e);return a==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(a=zp(this.input.slice(r,this.pos)),++this.pos):ln(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(y.num,a)};he.readNumber=function(e){var r=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(r,"Invalid number");var a=this.pos-r>=2&&this.input.charCodeAt(r)===48;a&&this.strict&&this.raise(r,"Invalid number");var u=this.input.charCodeAt(this.pos);if(!a&&!e&&this.options.ecmaVersion>=11&&u===110){var l=zp(this.input.slice(r,this.pos));return++this.pos,ln(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(y.num,l)}a&&/[89]/.test(this.input.slice(r,this.pos))&&(a=!1),u===46&&!a&&(++this.pos,this.readInt(10),u=this.input.charCodeAt(this.pos)),(u===69||u===101)&&!a&&(u=this.input.charCodeAt(++this.pos),(u===43||u===45)&&++this.pos,this.readInt(10)===null&&this.raise(r,"Invalid number")),ln(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var p=Gv(this.input.slice(r,this.pos),a);return this.finishToken(y.num,p)};he.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),r;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var a=++this.pos;r=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,r>1114111&&this.invalidStringToken(a,"Code point out of bounds")}else r=this.readHexChar(4);return r};he.readString=function(e){for(var r="",a=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var u=this.input.charCodeAt(this.pos);if(u===e)break;u===92?(r+=this.input.slice(a,this.pos),r+=this.readEscapedChar(!1),a=this.pos):u===8232||u===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(sa(u)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return r+=this.input.slice(a,this.pos++),this.finishToken(y.string,r)};var $p={};he.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===$p)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};he.invalidStringToken=function(e,r){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw $p;this.raise(e,r)};he.readTmplToken=function(){for(var e="",r=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var a=this.input.charCodeAt(this.pos);if(a===96||a===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===y.template||this.type===y.invalidTemplate)?a===36?(this.pos+=2,this.finishToken(y.dollarBraceL)):(++this.pos,this.finishToken(y.backQuote)):(e+=this.input.slice(r,this.pos),this.finishToken(y.template,e));if(a===92)e+=this.input.slice(r,this.pos),e+=this.readEscapedChar(!0),r=this.pos;else if(sa(a)){switch(e+=this.input.slice(r,this.pos),++this.pos,a){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=\` -\`;break;default:e+=String.fromCharCode(a);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),r=this.pos}else++this.pos}};he.readInvalidTemplateToken=function(){for(;this.pos=48&&r<=55){var u=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],l=parseInt(u,8);return l>255&&(u=u.slice(0,-1),l=parseInt(u,8)),this.pos+=u.length-1,r=this.input.charCodeAt(this.pos),(u!=="0"||r===56||r===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-u.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(l)}return sa(r)?"":String.fromCharCode(r)}};he.readHexChar=function(e){var r=this.pos,a=this.readInt(16,e);return a===null&&this.invalidStringToken(r,"Bad character escape sequence"),a};he.readWord1=function(){this.containsEsc=!1;for(var e="",r=!0,a=this.pos,u=this.options.ecmaVersion>=6;this.pos":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},di=17;function la(e,r){let{generator:a}=e;if(e.write("("),r!=null&&r.length>0){a[r[0].type](r[0],e);let{length:u}=r;for(let l=1;l=0;return(S?c?"+":"":"-")+Math.pow(10,Math.max(0,m)).toString().substr(1)+h}var Pt=/(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,mi=/(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,fa={},hn={};function H(i,o,c,h){var m=h;typeof h=="string"&&(m=function(){return this[h]()}),i&&(hn[i]=m),o&&(hn[o[0]]=function(){return xt(m.apply(this,arguments),o[1],o[2])}),c&&(hn[c]=function(){return this.localeData().ordinal(m.apply(this,arguments),i)})}function gi(i){return i.match(/\\[[\\s\\S]/)?i.replace(/^\\[|\\]$/g,""):i.replace(/\\\\/g,"")}function Ko(i){var o=i.match(Pt),c,h;for(c=0,h=o.length;c=0&&mi.test(i);)i=i.replace(mi,h),mi.lastIndex=0,c-=1;return i}var Zo={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function yi(i){var o=this._longDateFormat[i],c=this._longDateFormat[i.toUpperCase()];return o||!c?o:(this._longDateFormat[i]=c.match(Pt).map(function(h){return h==="MMMM"||h==="MM"||h==="DD"||h==="dddd"?h.slice(1):h}).join(""),this._longDateFormat[i])}var xi="Invalid date";function hs(){return this._invalidDate}var Yt="%d",Yn=/\\d{1,2}/;function Xo(i){return this._ordinal.replace("%d",i)}var dr={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ps(i,o,c,h){var m=this._relativeTime[c];return me(m)?m(i,o,c,h):m.replace(/%d/i,i)}function Jo(i,o){var c=this._relativeTime[i>0?"future":"past"];return me(c)?c(o):c.replace(/%s/i,o)}var mr={};function De(i,o){var c=i.toLowerCase();mr[c]=mr[c+"s"]=mr[o]=i}function st(i){return typeof i=="string"?mr[i]||mr[i.toLowerCase()]:void 0}function dn(i){var o={},c,h;for(h in i)p(i,h)&&(c=st(h),c&&(o[c]=i[h]));return o}var ds={};function Ue(i,o){ds[i]=o}function eu(i){var o=[],c;for(c in i)p(i,c)&&o.push({unit:c,priority:ds[c]});return o.sort(function(h,m){return h.priority-m.priority}),o}function Dr(i){return i%4===0&&i%100!==0||i%400===0}function nt(i){return i<0?Math.ceil(i)||0:Math.floor(i)}function te(i){var o=+i,c=0;return o!==0&&isFinite(o)&&(c=nt(o)),c}function Ir(i,o){return function(c){return c!=null?(vi(this,i,c),r.updateOffset(this,o),this):mn(this,i)}}function mn(i,o){return i.isValid()?i._d["get"+(i._isUTC?"UTC":"")+o]():NaN}function vi(i,o,c){i.isValid()&&!isNaN(c)&&(o==="FullYear"&&Dr(i.year())&&i.month()===1&&i.date()===29?(c=te(c),i._d["set"+(i._isUTC?"UTC":"")+o](c,i.month(),Ei(c,i.month()))):i._d["set"+(i._isUTC?"UTC":"")+o](c))}function ca(i){return i=st(i),me(this[i])?this[i]():this}function ha(i,o){if(typeof i=="object"){i=dn(i);var c=eu(i),h,m=c.length;for(h=0;h68?1900:2e3)};var ba=Ir("FullYear",!0);function du(){return Dr(this.year())}function vs(i,o,c,h,m,S,E){var G;return i<100&&i>=0?(G=new Date(i+400,o,c,h,m,S,E),isFinite(G.getFullYear())&&G.setFullYear(i)):G=new Date(i,o,c,h,m,S,E),G}function yn(i){var o,c;return i<100&&i>=0?(c=Array.prototype.slice.call(arguments),c[0]=i+400,o=new Date(Date.UTC.apply(null,c)),isFinite(o.getUTCFullYear())&&o.setUTCFullYear(i)):o=new Date(Date.UTC.apply(null,arguments)),o}function xn(i,o,c){var h=7+o-c,m=(7+yn(i,0,h).getUTCDay()-o)%7;return-m+h-1}function ws(i,o,c,h,m){var S=(7+c-h)%7,E=xn(i,h,m),G=1+7*(o-1)+S+E,J,ve;return G<=0?(J=i-1,ve=Mr(J)+G):G>Mr(i)?(J=i+1,ve=G-Mr(i)):(J=i,ve=G),{year:J,dayOfYear:ve}}function vn(i,o,c){var h=xn(i.year(),o,c),m=Math.floor((i.dayOfYear()-h-1)/7)+1,S,E;return m<1?(E=i.year()-1,S=m+Vt(E,o,c)):m>Vt(i.year(),o,c)?(S=m-Vt(i.year(),o,c),E=i.year()+1):(E=i.year(),S=m),{week:S,year:E}}function Vt(i,o,c){var h=xn(i,o,c),m=xn(i+1,o,c);return(Mr(i)-h+m)/7}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),De("week","w"),De("isoWeek","W"),Ue("week",5),Ue("isoWeek",5),Y("w",Ae),Y("ww",Ae,ct),Y("W",Ae),Y("WW",Ae,ct),Vn(["w","ww","W","WW"],function(i,o,c,h){o[h.substr(0,1)]=te(i)});function ka(i){return vn(i,this._week.dow,this._week.doy).week}var wn={dow:0,doy:6};function Ss(){return this._week.dow}function _s(){return this._week.doy}function mu(i){var o=this.localeData().week(this);return i==null?o:this.add((i-o)*7,"d")}function bs(i){var o=vn(this,1,4).week;return i==null?o:this.add((i-o)*7,"d")}H("d",0,"do","day"),H("dd",0,0,function(i){return this.localeData().weekdaysMin(this,i)}),H("ddd",0,0,function(i){return this.localeData().weekdaysShort(this,i)}),H("dddd",0,0,function(i){return this.localeData().weekdays(this,i)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),De("day","d"),De("weekday","e"),De("isoWeekday","E"),Ue("day",11),Ue("weekday",11),Ue("isoWeekday",11),Y("d",Ae),Y("e",Ae),Y("E",Ae),Y("dd",function(i,o){return o.weekdaysMinRegex(i)}),Y("ddd",function(i,o){return o.weekdaysShortRegex(i)}),Y("dddd",function(i,o){return o.weekdaysRegex(i)}),Vn(["dd","ddd","dddd"],function(i,o,c,h){var m=c._locale.weekdaysParse(i,h,c._strict);m!=null?o.d=m:N(c).invalidWeekday=i}),Vn(["d","e","E"],function(i,o,c,h){o[h]=te(i)});function ks(i,o){return typeof i!="string"?i:isNaN(i)?(i=o.weekdaysParse(i),typeof i=="number"?i:null):parseInt(i,10)}function Cs(i,o){return typeof i=="string"?o.weekdaysParse(i)%7||7:isNaN(i)?null:i}function Di(i,o){return i.slice(o,7).concat(i.slice(0,o))}var gu="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ts="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),yu="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ps=qr,xu=qr,vu=qr;function wu(i,o){var c=u(this._weekdays)?this._weekdays:this._weekdays[i&&i!==!0&&this._weekdays.isFormat.test(o)?"format":"standalone"];return i===!0?Di(c,this._week.dow):i?c[i.day()]:c}function Su(i){return i===!0?Di(this._weekdaysShort,this._week.dow):i?this._weekdaysShort[i.day()]:this._weekdaysShort}function Ca(i){return i===!0?Di(this._weekdaysMin,this._week.dow):i?this._weekdaysMin[i.day()]:this._weekdaysMin}function _u(i,o,c){var h,m,S,E=i.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],h=0;h<7;++h)S=K([2e3,1]).day(h),this._minWeekdaysParse[h]=this.weekdaysMin(S,"").toLocaleLowerCase(),this._shortWeekdaysParse[h]=this.weekdaysShort(S,"").toLocaleLowerCase(),this._weekdaysParse[h]=this.weekdays(S,"").toLocaleLowerCase();return c?o==="dddd"?(m=Re.call(this._weekdaysParse,E),m!==-1?m:null):o==="ddd"?(m=Re.call(this._shortWeekdaysParse,E),m!==-1?m:null):(m=Re.call(this._minWeekdaysParse,E),m!==-1?m:null):o==="dddd"?(m=Re.call(this._weekdaysParse,E),m!==-1||(m=Re.call(this._shortWeekdaysParse,E),m!==-1)?m:(m=Re.call(this._minWeekdaysParse,E),m!==-1?m:null)):o==="ddd"?(m=Re.call(this._shortWeekdaysParse,E),m!==-1||(m=Re.call(this._weekdaysParse,E),m!==-1)?m:(m=Re.call(this._minWeekdaysParse,E),m!==-1?m:null)):(m=Re.call(this._minWeekdaysParse,E),m!==-1||(m=Re.call(this._weekdaysParse,E),m!==-1)?m:(m=Re.call(this._shortWeekdaysParse,E),m!==-1?m:null))}function bu(i,o,c){var h,m,S;if(this._weekdaysParseExact)return _u.call(this,i,o,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),h=0;h<7;h++){if(m=K([2e3,1]).day(h),c&&!this._fullWeekdaysParse[h]&&(this._fullWeekdaysParse[h]=new RegExp("^"+this.weekdays(m,"").replace(".","\\\\.?")+"$","i"),this._shortWeekdaysParse[h]=new RegExp("^"+this.weekdaysShort(m,"").replace(".","\\\\.?")+"$","i"),this._minWeekdaysParse[h]=new RegExp("^"+this.weekdaysMin(m,"").replace(".","\\\\.?")+"$","i")),this._weekdaysParse[h]||(S="^"+this.weekdays(m,"")+"|^"+this.weekdaysShort(m,"")+"|^"+this.weekdaysMin(m,""),this._weekdaysParse[h]=new RegExp(S.replace(".",""),"i")),c&&o==="dddd"&&this._fullWeekdaysParse[h].test(i))return h;if(c&&o==="ddd"&&this._shortWeekdaysParse[h].test(i))return h;if(c&&o==="dd"&&this._minWeekdaysParse[h].test(i))return h;if(!c&&this._weekdaysParse[h].test(i))return h}}function ku(i){if(!this.isValid())return i!=null?this:NaN;var o=this._isUTC?this._d.getUTCDay():this._d.getDay();return i!=null?(i=ks(i,this.localeData()),this.add(i-o,"d")):o}function Cu(i){if(!this.isValid())return i!=null?this:NaN;var o=(this.day()+7-this.localeData()._week.dow)%7;return i==null?o:this.add(i-o,"d")}function Tu(i){if(!this.isValid())return i!=null?this:NaN;if(i!=null){var o=Cs(i,this.localeData());return this.day(this.day()%7?o:o-7)}else return this.day()||7}function Fe(i){return this._weekdaysParseExact?(p(this,"_weekdaysRegex")||Ta.call(this),i?this._weekdaysStrictRegex:this._weekdaysRegex):(p(this,"_weekdaysRegex")||(this._weekdaysRegex=Ps),this._weekdaysStrictRegex&&i?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ie(i){return this._weekdaysParseExact?(p(this,"_weekdaysRegex")||Ta.call(this),i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(p(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=xu),this._weekdaysShortStrictRegex&&i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Pu(i){return this._weekdaysParseExact?(p(this,"_weekdaysRegex")||Ta.call(this),i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(p(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=vu),this._weekdaysMinStrictRegex&&i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ta(){function i(dt,rr){return rr.length-dt.length}var o=[],c=[],h=[],m=[],S,E,G,J,ve;for(S=0;S<7;S++)E=K([2e3,1]).day(S),G=vt(this.weekdaysMin(E,"")),J=vt(this.weekdaysShort(E,"")),ve=vt(this.weekdays(E,"")),o.push(G),c.push(J),h.push(ve),m.push(G),m.push(J),m.push(ve);o.sort(i),c.sort(i),h.sort(i),m.sort(i),this._weekdaysRegex=new RegExp("^("+m.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Pa(){return this.hours()%12||12}function Eu(){return this.hours()||24}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Pa),H("k",["kk",2],0,Eu),H("hmm",0,0,function(){return""+Pa.apply(this)+xt(this.minutes(),2)}),H("hmmss",0,0,function(){return""+Pa.apply(this)+xt(this.minutes(),2)+xt(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+xt(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+xt(this.minutes(),2)+xt(this.seconds(),2)});function Es(i,o){H(i,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),o)})}Es("a",!0),Es("A",!1),De("hour","h"),Ue("hour",13);function Ds(i,o){return o._meridiemParse}Y("a",Ds),Y("A",Ds),Y("H",Ae),Y("h",Ae),Y("k",Ae),Y("HH",Ae,ct),Y("hh",Ae,ct),Y("kk",Ae,ct),Y("hmm",da),Y("hmmss",ma),Y("Hmm",da),Y("Hmmss",ma),Ce(["H","HH"],Ke),Ce(["k","kk"],function(i,o,c){var h=te(i);o[Ke]=h===24?0:h}),Ce(["a","A"],function(i,o,c){c._isPm=c._locale.isPM(i),c._meridiem=i}),Ce(["h","hh"],function(i,o,c){o[Ke]=te(i),N(c).bigHour=!0}),Ce("hmm",function(i,o,c){var h=i.length-2;o[Ke]=te(i.substr(0,h)),o[Bt]=te(i.substr(h)),N(c).bigHour=!0}),Ce("hmmss",function(i,o,c){var h=i.length-4,m=i.length-2;o[Ke]=te(i.substr(0,h)),o[Bt]=te(i.substr(h,2)),o[gr]=te(i.substr(m)),N(c).bigHour=!0}),Ce("Hmm",function(i,o,c){var h=i.length-2;o[Ke]=te(i.substr(0,h)),o[Bt]=te(i.substr(h))}),Ce("Hmmss",function(i,o,c){var h=i.length-4,m=i.length-2;o[Ke]=te(i.substr(0,h)),o[Bt]=te(i.substr(h,2)),o[gr]=te(i.substr(m))});function Is(i){return(i+"").toLowerCase().charAt(0)==="p"}var Du=/[ap]\\.?m?\\.?/i,rt=Ir("Hours",!0);function Ea(i,o,c){return i>11?c?"pm":"PM":c?"am":"AM"}var Or={calendar:Qe,longDateFormat:Zo,invalidDate:xi,ordinal:Yt,dayOfMonthOrdinalParse:Yn,relativeTime:dr,months:uu,monthsShort:ms,week:wn,weekdays:gu,weekdaysMin:yu,weekdaysShort:Ts,meridiemParse:Du},Ne={},zr={},ut;function Ms(i,o){var c,h=Math.min(i.length,o.length);for(c=0;c0;){if(m=Un(S.slice(0,c).join("-")),m)return m;if(h&&h.length>=c&&Ms(S,h)>=c-1)break;c--}o++}return ut}function As(i){return i.match("^[^/\\\\\\\\]*$")!=null}function Un(i){var o=null,c;if(Ne[i]===void 0&&typeof ia<"u"&&ia&&ia.exports&&As(i))try{o=ut._abbr,c=require,c("./locale/"+i),yr(o)}catch{Ne[i]=null}return Ne[i]}function yr(i,o){var c;return i&&(C(o)?c=He(i):c=ht(i,o),c?ut=c:typeof console<"u"&&console.warn&&console.warn("Locale "+i+" not found. Did you forget to load it?")),ut._abbr}function ht(i,o){if(o!==null){var c,h=Or;if(o.abbr=i,Ne[i]!=null)jt("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),h=Ne[i]._config;else if(o.parentLocale!=null)if(Ne[o.parentLocale]!=null)h=Ne[o.parentLocale]._config;else if(c=Un(o.parentLocale),c!=null)h=c._config;else return zr[o.parentLocale]||(zr[o.parentLocale]=[]),zr[o.parentLocale].push({name:i,config:o}),null;return Ne[i]=new Rt(mt(h,o)),zr[i]&&zr[i].forEach(function(m){ht(m.name,m.config)}),yr(i),Ne[i]}else return delete Ne[i],null}function Iu(i,o){if(o!=null){var c,h,m=Or;Ne[i]!=null&&Ne[i].parentLocale!=null?Ne[i].set(mt(Ne[i]._config,o)):(h=Un(i),h!=null&&(m=h._config),o=mt(m,o),h==null&&(o.abbr=i),c=new Rt(o),c.parentLocale=Ne[i],Ne[i]=c),yr(i)}else Ne[i]!=null&&(Ne[i].parentLocale!=null?(Ne[i]=Ne[i].parentLocale,i===yr()&&yr(i)):Ne[i]!=null&&delete Ne[i]);return Ne[i]}function He(i){var o;if(i&&i._locale&&i._locale._abbr&&(i=i._locale._abbr),!i)return ut;if(!u(i)){if(o=Un(i),o)return o;i=[i]}return Os(i)}function Mu(){return Oe(Ne)}function Ii(i){var o,c=i._a;return c&&N(i).overflow===-2&&(o=c[Qt]<0||c[Qt]>11?Qt:c[Kt]<1||c[Kt]>Ei(c[ot],c[Qt])?Kt:c[Ke]<0||c[Ke]>24||c[Ke]===24&&(c[Bt]!==0||c[gr]!==0||c[Gr]!==0)?Ke:c[Bt]<0||c[Bt]>59?Bt:c[gr]<0||c[gr]>59?gr:c[Gr]<0||c[Gr]>999?Gr:-1,N(i)._overflowDayOfYear&&(oKt)&&(o=Kt),N(i)._overflowWeeks&&o===-1&&(o=su),N(i)._overflowWeekday&&o===-1&&(o=Pi),N(i).overflow=o),i}var Ar=/^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,Mi=/^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,Ia=/Z|[+-]\\d\\d(?::?\\d\\d)?/,Ee=[["YYYYYY-MM-DD",/[+-]\\d{6}-\\d\\d-\\d\\d/],["YYYY-MM-DD",/\\d{4}-\\d\\d-\\d\\d/],["GGGG-[W]WW-E",/\\d{4}-W\\d\\d-\\d/],["GGGG-[W]WW",/\\d{4}-W\\d\\d/,!1],["YYYY-DDD",/\\d{4}-\\d{3}/],["YYYY-MM",/\\d{4}-\\d\\d/,!1],["YYYYYYMMDD",/[+-]\\d{10}/],["YYYYMMDD",/\\d{8}/],["GGGG[W]WWE",/\\d{4}W\\d{3}/],["GGGG[W]WW",/\\d{4}W\\d{2}/,!1],["YYYYDDD",/\\d{7}/],["YYYYMM",/\\d{6}/,!1],["YYYY",/\\d{4}/,!1]],Zt=[["HH:mm:ss.SSSS",/\\d\\d:\\d\\d:\\d\\d\\.\\d+/],["HH:mm:ss,SSSS",/\\d\\d:\\d\\d:\\d\\d,\\d+/],["HH:mm:ss",/\\d\\d:\\d\\d:\\d\\d/],["HH:mm",/\\d\\d:\\d\\d/],["HHmmss.SSSS",/\\d\\d\\d\\d\\d\\d\\.\\d+/],["HHmmss,SSSS",/\\d\\d\\d\\d\\d\\d,\\d+/],["HHmmss",/\\d\\d\\d\\d\\d\\d/],["HHmm",/\\d\\d\\d\\d/],["HH",/\\d\\d/]],Ma=/^\\/?Date\\((-?\\d+)/i,Ou=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,Oa={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Fs(i){var o,c,h=i._i,m=Ar.exec(h)||Mi.exec(h),S,E,G,J,ve=Ee.length,dt=Zt.length;if(m){for(N(i).iso=!0,o=0,c=ve;oMr(E)||i._dayOfYear===0)&&(N(i)._overflowDayOfYear=!0),c=yn(E,0,i._dayOfYear),i._a[Qt]=c.getUTCMonth(),i._a[Kt]=c.getUTCDate()),o=0;o<3&&i._a[o]==null;++o)i._a[o]=h[o]=m[o];for(;o<7;o++)i._a[o]=h[o]=i._a[o]==null?o===2?1:0:i._a[o];i._a[Ke]===24&&i._a[Bt]===0&&i._a[gr]===0&&i._a[Gr]===0&&(i._nextDay=!0,i._a[Ke]=0),i._d=(i._useUTC?yn:vs).apply(null,h),S=i._useUTC?i._d.getUTCDay():i._d.getDay(),i._tzm!=null&&i._d.setUTCMinutes(i._d.getUTCMinutes()-i._tzm),i._nextDay&&(i._a[Ke]=24),i._w&&typeof i._w.d<"u"&&i._w.d!==S&&(N(i).weekdayMismatch=!0)}}function Ws(i){var o,c,h,m,S,E,G,J,ve;o=i._w,o.GG!=null||o.W!=null||o.E!=null?(S=1,E=4,c=$r(o.GG,i._a[ot],vn(Me(),1,4).year),h=$r(o.W,1),m=$r(o.E,1),(m<1||m>7)&&(J=!0)):(S=i._locale._week.dow,E=i._locale._week.doy,ve=vn(Me(),S,E),c=$r(o.gg,i._a[ot],ve.year),h=$r(o.w,ve.week),o.d!=null?(m=o.d,(m<0||m>6)&&(J=!0)):o.e!=null?(m=o.e+S,(o.e<0||o.e>6)&&(J=!0)):m=S),h<1||h>Vt(c,S,E)?N(i)._overflowWeeks=!0:J!=null?N(i)._overflowWeekday=!0:(G=ws(c,h,m,S,E),i._a[ot]=G.year,i._dayOfYear=G.dayOfYear)}r.ISO_8601=function(){},r.RFC_2822=function(){};function Fa(i){if(i._f===r.ISO_8601){Fs(i);return}if(i._f===r.RFC_2822){Ls(i);return}i._a=[],N(i).empty=!0;var o=""+i._i,c,h,m,S,E,G=o.length,J=0,ve,dt;for(m=pn(i._f,i._locale).match(Pt)||[],dt=m.length,c=0;c0&&N(i).unusedInput.push(E),o=o.slice(o.indexOf(h)+h.length),J+=h.length),hn[S]?(h?N(i).empty=!1:N(i).unusedTokens.push(S),au(S,h,i)):i._strict&&!h&&N(i).unusedTokens.push(S);N(i).charsLeftOver=G-J,o.length>0&&N(i).unusedInput.push(o),i._a[Ke]<=12&&N(i).bigHour===!0&&i._a[Ke]>0&&(N(i).bigHour=void 0),N(i).parsedDateParts=i._a.slice(0),N(i).meridiem=i._meridiem,i._a[Ke]=Na(i._locale,i._a[Ke],i._meridiem),ve=N(i).era,ve!==null&&(i._a[ot]=i._locale.erasConvertYear(ve,i._a[ot])),Hn(i),Ii(i)}function Na(i,o,c){var h;return c==null?o:i.meridiemHour!=null?i.meridiemHour(o,c):(i.isPM!=null&&(h=i.isPM(c),h&&o<12&&(o+=12),!h&&o===12&&(o=0)),o)}function La(i){var o,c,h,m,S,E,G=!1,J=i._f.length;if(J===0){N(i).invalidFormat=!0,i._d=new Date(NaN);return}for(m=0;mthis?this:i:ye()});function Vs(i,o){var c,h;if(o.length===1&&u(o[0])&&(o=o[0]),!o.length)return Me();for(c=o[0],h=1;hthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function D(){if(!C(this._isDSTShifted))return this._isDSTShifted;var i={},o;return ze(i,this),i=gt(i),i._a?(o=i._isUTC?K(i._a):Me(i._a),this._isDSTShifted=this.isValid()&&Uu(i._a,o.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function P(){return this.isValid()?!this._isUTC:!1}function B(){return this.isValid()?this._isUTC:!1}function Z(){return this.isValid()?this._isUTC&&this._offset===0:!1}var xe=/^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,Ze=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function se(i,o){var c=i,h=null,m,S,E;return Ut(i)?c={ms:i._milliseconds,d:i._days,M:i._months}:T(i)||!isNaN(+i)?(c={},o?c[o]=+i:c.milliseconds=+i):(h=xe.exec(i))?(m=h[1]==="-"?-1:1,c={y:0,d:te(h[Kt])*m,h:te(h[Ke])*m,m:te(h[Bt])*m,s:te(h[gr])*m,ms:te(bn(h[Gr]*1e3))*m}):(h=Ze.exec(i))?(m=h[1]==="-"?-1:1,c={y:xr(h[2],m),M:xr(h[3],m),w:xr(h[4],m),d:xr(h[5],m),h:xr(h[6],m),m:xr(h[7],m),s:xr(h[8],m)}):c==null?c={}:typeof c=="object"&&("from"in c||"to"in c)&&(E=Et(Me(c.from),Me(c.to)),c={},c.ms=E.milliseconds,c.M=E.months),S=new qn(c),Ut(i)&&p(i,"_locale")&&(S._locale=i._locale),Ut(i)&&p(i,"_isValid")&&(S._isValid=i._isValid),S}se.fn=qn.prototype,se.invalid=Wa;function xr(i,o){var c=i&&parseFloat(i.replace(",","."));return(isNaN(c)?0:c)*o}function Hs(i,o){var c={};return c.months=o.month()-i.month()+(o.year()-i.year())*12,i.clone().add(c.months,"M").isAfter(o)&&--c.months,c.milliseconds=+o-+i.clone().add(c.months,"M"),c}function Et(i,o){var c;return i.isValid()&&o.isValid()?(o=wt(o,i),i.isBefore(o)?c=Hs(i,o):(c=Hs(o,i),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function Gn(i,o){return function(c,h){var m,S;return h!==null&&!isNaN(+h)&&(jt(o,"moment()."+o+"(period, number) is deprecated. Please use moment()."+o+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),S=c,c=h,h=S),m=se(c,h),qs(this,m,i),this}}function qs(i,o,c,h){var m=o._milliseconds,S=bn(o._days),E=bn(o._months);!i.isValid()||(h=h??!0,E&&va(i,mn(i,"Month")+E*c),S&&vi(i,"Date",mn(i,"Date")+S*c),m&&i._d.setTime(i._d.valueOf()+m*c),h&&r.updateOffset(i,S||E))}var kn=Gn(1,"add"),Fi=Gn(-1,"subtract");function zn(i){return typeof i=="string"||i instanceof String}function be(i){return Pe(i)||A(i)||zn(i)||T(i)||Gs(i)||Qu(i)||i===null||i===void 0}function Qu(i){var o=l(i)&&!v(i),c=!1,h=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],m,S,E=h.length;for(m=0;mc.valueOf():c.valueOf()9999?Er(c,o?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):me(Date.prototype.toISOString)?o?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Er(c,"Z")):Er(c,o?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Qr(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var i="moment",o="",c,h,m,S;return this.isLocal()||(i=this.utcOffset()===0?"moment.utc":"moment.parseZone",o="Z"),c="["+i+'("]',h=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",m="-MM-DD[T]HH:mm:ss.SSS",S=o+'[")]',this.format(c+h+m+S)}function Yi(i){i||(i=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var o=Er(this,i);return this.localeData().postformat(o)}function Ju(i,o){return this.isValid()&&(Pe(i)&&i.isValid()||Me(i).isValid())?se({to:this,from:i}).locale(this.locale()).humanize(!o):this.localeData().invalidDate()}function el(i){return this.from(Me(),i)}function tl(i,o){return this.isValid()&&(Pe(i)&&i.isValid()||Me(i).isValid())?se({from:this,to:i}).locale(this.locale()).humanize(!o):this.localeData().invalidDate()}function Bi(i){return this.to(Me(),i)}function jn(i){var o;return i===void 0?this._locale._abbr:(o=He(i),o!=null&&(this._locale=o),this)}var Vi=je("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(i){return i===void 0?this.localeData():this.locale(i)});function Ks(){return this._locale}var Qn=1e3,Cn=60*Qn,Ui=60*Cn,qe=(365*400+97)*24*Ui;function Be(i,o){return(i%o+o)%o}function Zs(i,o,c){return i<100&&i>=0?new Date(i+400,o,c)-qe:new Date(i,o,c).valueOf()}function Xs(i,o,c){return i<100&&i>=0?Date.UTC(i+400,o,c)-qe:Date.UTC(i,o,c)}function Js(i){var o,c;if(i=st(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(c=this._isUTC?Xs:Zs,i){case"year":o=c(this.year(),0,1);break;case"quarter":o=c(this.year(),this.month()-this.month()%3,1);break;case"month":o=c(this.year(),this.month(),1);break;case"week":o=c(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":o=c(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":o=c(this.year(),this.month(),this.date());break;case"hour":o=this._d.valueOf(),o-=Be(o+(this._isUTC?0:this.utcOffset()*Cn),Ui);break;case"minute":o=this._d.valueOf(),o-=Be(o,Cn);break;case"second":o=this._d.valueOf(),o-=Be(o,Qn);break}return this._d.setTime(o),r.updateOffset(this,!0),this}function rl(i){var o,c;if(i=st(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(c=this._isUTC?Xs:Zs,i){case"year":o=c(this.year()+1,0,1)-1;break;case"quarter":o=c(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":o=c(this.year(),this.month()+1,1)-1;break;case"week":o=c(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":o=c(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":o=c(this.year(),this.month(),this.date()+1)-1;break;case"hour":o=this._d.valueOf(),o+=Ui-Be(o+(this._isUTC?0:this.utcOffset()*Cn),Ui)-1;break;case"minute":o=this._d.valueOf(),o+=Cn-Be(o,Cn)-1;break;case"second":o=this._d.valueOf(),o+=Qn-Be(o,Qn)-1;break}return this._d.setTime(o),r.updateOffset(this,!0),this}function Ya(){return this._d.valueOf()-(this._offset||0)*6e4}function Kn(){return Math.floor(this.valueOf()/1e3)}function Ba(){return new Date(this.valueOf())}function Tn(){var i=this;return[i.year(),i.month(),i.date(),i.hour(),i.minute(),i.second(),i.millisecond()]}function Zn(){var i=this;return{years:i.year(),months:i.month(),date:i.date(),hours:i.hours(),minutes:i.minutes(),seconds:i.seconds(),milliseconds:i.milliseconds()}}function Xn(){return this.isValid()?this.toISOString():null}function Hi(){return Le(this)}function Pn(){return V({},N(this))}function nl(){return N(this).overflow}function il(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),Y("N",ie),Y("NN",ie),Y("NNN",ie),Y("NNNN",ul),Y("NNNNN",ll),Ce(["N","NN","NNN","NNNN","NNNNN"],function(i,o,c,h){var m=c._locale.erasParse(i,h,c._strict);m?N(c).era=m:N(c).invalidEra=i}),Y("y",gn),Y("yy",gn),Y("yyy",gn),Y("yyyy",gn),Y("yo",fl),Ce(["y","yy","yyy","yyyy"],ot),Ce(["yo"],function(i,o,c,h){var m;c._locale._eraYearOrdinalRegex&&(m=i.match(c._locale._eraYearOrdinalRegex)),c._locale.eraYearOrdinalParse?o[ot]=c._locale.eraYearOrdinalParse(i,m):o[ot]=parseInt(i,10)});function al(i,o){var c,h,m,S=this._eras||He("en")._eras;for(c=0,h=S.length;c=0)return S[h]}function ol(i,o){var c=i.since<=i.until?1:-1;return o===void 0?r(i.since).year():r(i.since).year()+(o-i.offset)*c}function qi(){var i,o,c,h=this.localeData().eras();for(i=0,o=h.length;iS&&(o=S),gl.call(this,i,o,c,h,m))}function gl(i,o,c,h,m){var S=ws(i,o,c,h,m),E=yn(S.year,0,S.dayOfYear);return this.year(E.getUTCFullYear()),this.month(E.getUTCMonth()),this.date(E.getUTCDate()),this}H("Q",0,"Qo","quarter"),De("quarter","Q"),Ue("quarter",7),Y("Q",wi),Ce("Q",function(i,o){o[Qt]=(te(i)-1)*3});function yl(i){return i==null?Math.ceil((this.month()+1)/3):this.month((i-1)*3+this.month()%3)}H("D",["DD",2],"Do","date"),De("date","D"),Ue("date",9),Y("D",Ae),Y("DD",Ae,ct),Y("Do",function(i,o){return i?o._dayOfMonthOrdinalParse||o._ordinalParse:o._dayOfMonthOrdinalParseLenient}),Ce(["D","DD"],Kt),Ce("Do",function(i,o){o[Kt]=te(i.match(Ae)[0])});var ro=Ir("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),De("dayOfYear","DDD"),Ue("dayOfYear",4),Y("DDD",bi),Y("DDDD",Si),Ce(["DDD","DDDD"],function(i,o,c){c._dayOfYear=te(i)});function Sr(i){var o=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return i==null?o:this.add(i-o,"d")}H("m",["mm",2],0,"minute"),De("minute","m"),Ue("minute",14),Y("m",Ae),Y("mm",Ae,ct),Ce(["m","mm"],Bt);var xl=Ir("Minutes",!1);H("s",["ss",2],0,"second"),De("second","s"),Ue("second",15),Y("s",Ae),Y("ss",Ae,ct),Ce(["s","ss"],gr);var vl=Ir("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return this.millisecond()*10}),H(0,["SSSSS",5],0,function(){return this.millisecond()*100}),H(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),H(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),H(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),H(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),De("millisecond","ms"),Ue("millisecond",16),Y("S",bi,wi),Y("SS",bi,ct),Y("SSS",bi,Si);var Rr,no;for(Rr="SSSS";Rr.length<=9;Rr+="S")Y(Rr,gn);function wl(i,o){o[Gr]=te(("0."+i)*1e3)}for(Rr="S";Rr.length<=9;Rr+="S")Ce(Rr,wl);no=Ir("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");function Kr(){return this._isUTC?"UTC":""}function Sl(){return this._isUTC?"Coordinated Universal Time":""}var F=$e.prototype;F.add=kn,F.calendar=Zu,F.clone=Xu,F.diff=js,F.endOf=rl,F.format=Yi,F.from=Ju,F.fromNow=el,F.to=tl,F.toNow=Bi,F.get=ca,F.invalidAt=nl,F.isAfter=Li,F.isBefore=Lr,F.isBetween=Ri,F.isSame=zs,F.isSameOrAfter=Wi,F.isSameOrBefore=$s,F.isValid=Hi,F.lang=Vi,F.locale=jn,F.localeData=Ks,F.max=Lu,F.min=Bs,F.parsingFlags=Pn,F.set=ha,F.startOf=Js,F.subtract=Fi,F.toArray=Tn,F.toObject=Zn,F.toDate=Ba,F.toISOString=$n,F.inspect=Qr,typeof Symbol<"u"&&Symbol.for!=null&&(F[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),F.toJSON=Xn,F.toString=Qs,F.unix=Kn,F.valueOf=Ya,F.creationData=il,F.eraName=qi,F.eraNarrow=Jn,F.eraAbbr=eo,F.eraYear=g,F.year=ba,F.isLeapYear=du,F.weekYear=cl,F.isoWeekYear=hl,F.quarter=F.quarters=yl,F.month=wa,F.daysInMonth=xs,F.week=F.weeks=mu,F.isoWeek=F.isoWeeks=bs,F.weeksInYear=wr,F.weeksInWeekYear=ml,F.isoWeeksInYear=pl,F.isoWeeksInISOWeekYear=dl,F.date=ro,F.day=F.days=ku,F.weekday=Cu,F.isoWeekday=Tu,F.dayOfYear=Sr,F.hour=F.hours=rt,F.minute=F.minutes=xl,F.second=F.seconds=vl,F.millisecond=F.milliseconds=no,F.utcOffset=qu,F.utc=zu,F.local=$u,F.parseZone=ju,F.hasAlignedHourOffset=Nr,F.isDST=b,F.isLocal=P,F.isUtcOffset=B,F.isUtc=Z,F.isUTC=Z,F.zoneAbbr=Kr,F.zoneName=Sl,F.dates=je("dates accessor is deprecated. Use date instead.",ro),F.months=je("months accessor is deprecated. Use month instead",wa),F.years=je("years accessor is deprecated. Use year instead",ba),F.zone=je("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Gu),F.isDSTShifted=je("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",D);function Ht(i){return Me(i*1e3)}function _l(){return Me.apply(null,arguments).parseZone()}function io(i){return i}var ge=Rt.prototype;ge.calendar=Wt,ge.longDateFormat=yi,ge.invalidDate=hs,ge.ordinal=Xo,ge.preparse=io,ge.postformat=io,ge.relativeTime=ps,ge.pastFuture=Jo,ge.set=at,ge.eras=al,ge.erasParse=sl,ge.erasConvertYear=ol,ge.erasAbbrRegex=Gi,ge.erasNameRegex=En,ge.erasNarrowRegex=Dt,ge.months=lu,ge.monthsShort=fu,ge.monthsParse=hu,ge.monthsRegex=pu,ge.monthsShortRegex=Sa,ge.week=ka,ge.firstDayOfYear=_s,ge.firstDayOfWeek=Ss,ge.weekdays=wu,ge.weekdaysMin=Ca,ge.weekdaysShort=Su,ge.weekdaysParse=bu,ge.weekdaysRegex=Fe,ge.weekdaysShortRegex=Ie,ge.weekdaysMinRegex=Pu,ge.isPM=Is,ge.meridiem=Ea;function $i(i,o,c,h){var m=He(),S=K().set(h,o);return m[c](S,i)}function ao(i,o,c){if(T(i)&&(o=i,i=void 0),i=i||"",o!=null)return $i(i,o,c,"month");var h,m=[];for(h=0;h<12;h++)m[h]=$i(i,h,c,"month");return m}function ji(i,o,c,h){typeof i=="boolean"?(T(o)&&(c=o,o=void 0),o=o||""):(o=i,c=o,i=!1,T(o)&&(c=o,o=void 0),o=o||"");var m=He(),S=i?m._week.dow:0,E,G=[];if(c!=null)return $i(o,(c+S)%7,h,"day");for(E=0;E<7;E++)G[E]=$i(o,(E+S)%7,h,"day");return G}function so(i,o){return ao(i,o,"months")}function bl(i,o){return ao(i,o,"monthsShort")}function kl(i,o,c){return ji(i,o,c,"weekdays")}function Va(i,o,c){return ji(i,o,c,"weekdaysShort")}function ei(i,o,c){return ji(i,o,c,"weekdaysMin")}yr("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\\d{1,2}(th|st|nd|rd)/,ordinal:function(i){var o=i%10,c=te(i%100/10)===1?"th":o===1?"st":o===2?"nd":o===3?"rd":"th";return i+c}}),r.lang=je("moment.lang is deprecated. Use moment.locale instead.",yr),r.langData=je("moment.langData is deprecated. Use moment.localeData instead.",He);var It=Math.abs;function Cl(){var i=this._data;return this._milliseconds=It(this._milliseconds),this._days=It(this._days),this._months=It(this._months),i.milliseconds=It(i.milliseconds),i.seconds=It(i.seconds),i.minutes=It(i.minutes),i.hours=It(i.hours),i.months=It(i.months),i.years=It(i.years),this}function Ua(i,o,c,h){var m=se(o,c);return i._milliseconds+=h*m._milliseconds,i._days+=h*m._days,i._months+=h*m._months,i._bubble()}function Tl(i,o){return Ua(this,i,o,1)}function _r(i,o){return Ua(this,i,o,-1)}function Qi(i){return i<0?Math.floor(i):Math.ceil(i)}function Zr(){var i=this._milliseconds,o=this._days,c=this._months,h=this._data,m,S,E,G,J;return i>=0&&o>=0&&c>=0||i<=0&&o<=0&&c<=0||(i+=Qi(Ha(c)+o)*864e5,o=0,c=0),h.milliseconds=i%1e3,m=nt(i/1e3),h.seconds=m%60,S=nt(m/60),h.minutes=S%60,E=nt(S/60),h.hours=E%24,o+=nt(E/24),J=nt(St(o)),c+=J,o-=Qi(Ha(J)),G=nt(c/12),c%=12,h.days=o,h.months=c,h.years=G,this}function St(i){return i*4800/146097}function Ha(i){return i*146097/4800}function oo(i){if(!this.isValid())return NaN;var o,c,h=this._milliseconds;if(i=st(i),i==="month"||i==="quarter"||i==="year")switch(o=this._days+h/864e5,c=this._months+St(o),i){case"month":return c;case"quarter":return c/3;case"year":return c/12}else switch(o=this._days+Math.round(Ha(this._months)),i){case"week":return o/7+h/6048e5;case"day":return o+h/864e5;case"hour":return o*24+h/36e5;case"minute":return o*1440+h/6e4;case"second":return o*86400+h/1e3;case"millisecond":return Math.floor(o*864e5)+h;default:throw new Error("Unknown unit "+i)}}function uo(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+te(this._months/12)*31536e6:NaN}function _t(i){return function(){return this.as(i)}}var Wr=_t("ms"),lo=_t("s"),Pl=_t("m"),Ki=_t("h"),El=_t("d"),fo=_t("w"),it=_t("M"),qa=_t("Q"),co=_t("y");function Jt(){return se(this)}function Ga(i){return i=st(i),this.isValid()?this[i+"s"]():NaN}function er(i){return function(){return this.isValid()?this._data[i]:NaN}}var Xr=er("milliseconds"),ho=er("seconds"),pt=er("minutes"),za=er("hours"),Dl=er("days"),Il=er("months"),Ml=er("years");function $a(){return nt(this.days()/7)}var br=Math.round,tr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function po(i,o,c,h,m){return m.relativeTime(o||1,!!c,i,h)}function Ol(i,o,c,h){var m=se(i).abs(),S=br(m.as("s")),E=br(m.as("m")),G=br(m.as("h")),J=br(m.as("d")),ve=br(m.as("M")),dt=br(m.as("w")),rr=br(m.as("y")),kr=S<=c.ss&&["s",S]||S0,kr[4]=h,po.apply(null,kr)}function Al(i){return i===void 0?br:typeof i=="function"?(br=i,!0):!1}function ti(i,o){return tr[i]===void 0?!1:o===void 0?tr[i]:(tr[i]=o,i==="s"&&(tr.ss=o-1),!0)}function Fl(i,o){if(!this.isValid())return this.localeData().invalidDate();var c=!1,h=tr,m,S;return typeof i=="object"&&(o=i,i=!1),typeof i=="boolean"&&(c=i),typeof o=="object"&&(h=Object.assign({},tr,o),o.s!=null&&o.ss==null&&(h.ss=o.s-1)),m=this.localeData(),S=Ol(this,!c,h,m),c&&(S=m.pastFuture(+this,S)),m.postformat(S)}var ja=Math.abs;function Yr(i){return(i>0)-(i<0)||+i}function ri(){if(!this.isValid())return this.localeData().invalidDate();var i=ja(this._milliseconds)/1e3,o=ja(this._days),c=ja(this._months),h,m,S,E,G=this.asSeconds(),J,ve,dt,rr;return G?(h=nt(i/60),m=nt(h/60),i%=60,h%=60,S=nt(c/12),c%=12,E=i?i.toFixed(3).replace(/\\.?0+$/,""):"",J=G<0?"-":"",ve=Yr(this._months)!==Yr(G)?"-":"",dt=Yr(this._days)!==Yr(G)?"-":"",rr=Yr(this._milliseconds)!==Yr(G)?"-":"",J+"P"+(S?ve+S+"Y":"")+(c?ve+c+"M":"")+(o?dt+o+"D":"")+(m||h||i?"T":"")+(m?rr+m+"H":"")+(h?rr+h+"M":"")+(i?rr+E+"S":"")):"P0D"}var le=qn.prototype;le.isValid=Vu,le.abs=Cl,le.add=Tl,le.subtract=_r,le.as=oo,le.asMilliseconds=Wr,le.asSeconds=lo,le.asMinutes=Pl,le.asHours=Ki,le.asDays=El,le.asWeeks=fo,le.asMonths=it,le.asQuarters=qa,le.asYears=co,le.valueOf=uo,le._bubble=Zr,le.clone=Jt,le.get=Ga,le.milliseconds=Xr,le.seconds=ho,le.minutes=pt,le.hours=za,le.days=Dl,le.weeks=$a,le.months=Il,le.years=Ml,le.humanize=Fl,le.toISOString=ri,le.toString=ri,le.toJSON=ri,le.locale=jn,le.localeData=Ks,le.toIsoString=je("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ri),le.lang=Vi,H("X",0,0,"unix"),H("x",0,0,"valueOf"),Y("x",Bn),Y("X",ru),Ce("X",function(i,o,c){c._d=new Date(parseFloat(i)*1e3)}),Ce("x",function(i,o,c){c._d=new Date(te(i))});return r.version="2.29.4",a(Me),r.fn=F,r.min=Ru,r.max=Wu,r.now=Yu,r.utc=K,r.unix=Ht,r.months=so,r.isDate=A,r.locale=yr,r.invalid=ye,r.duration=se,r.isMoment=Pe,r.weekdays=kl,r.parseZone=_l,r.localeData=He,r.isDuration=Ut,r.monthsShort=bl,r.weekdaysMin=ei,r.defineLocale=ht,r.updateLocale=Iu,r.locales=Mu,r.weekdaysShort=Va,r.normalizeUnits=st,r.relativeTimeRounding=Al,r.relativeTimeThreshold=ti,r.calendarFormat=Ku,r.prototype=F,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r})});var Yo=yf(xf());var sn=e=>[...new Set(e)];var Th=(e,r)=>e.sort(function(a,u){let l=r.indexOf(a),p=r.indexOf(u);return l>p?l!=-1&&p==-1?-1:1:p!=-1&&l==-1?1:-1});var on="File";var Ao=e=>e.lastIndexOf("/")!=-1?e.lastIndexOf(".")!=-1?Ph(e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("."))):e.substring(e.lastIndexOf("/")+1):e.lastIndexOf(".")!=-1?e.substring(0,e.lastIndexOf(".")):e;function vf(e){return Array.isArray(e)?e:typeof e=="string"?[e]:[]}var Eh=(e,r)=>r.indexOf(e)>0?r.indexOf(e):r.length;var Fo=e=>"spaces://"+e;var Ph=e=>e.charAt(0)=="/"?e.substring(1):e;function si(e){return si=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},si(e)}function Nt(e){if(e===null||e===!0||e===!1)return NaN;var r=Number(e);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}function ke(e,r){if(r.length1?"s":"")+" required, but only "+r.length+" present")}function et(e){ke(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||si(e)==="object"&&r==="[object Date]"?new Date(e.getTime()):typeof e=="number"||r==="[object Number]"?new Date(e):((typeof e=="string"||r==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use \`parseISO\` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function wf(e,r){ke(2,arguments);var a=et(e).getTime(),u=Nt(r);return new Date(a+u)}var ux={};function An(){return ux}function Sf(e){var r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),e.getTime()-r.getTime()}function _f(e){return ke(1,arguments),e instanceof Date||si(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function bf(e){if(ke(1,arguments),!_f(e)&&typeof e!="number")return!1;var r=et(e);return!isNaN(Number(r))}function kf(e,r){ke(2,arguments);var a=Nt(r);return wf(e,-a)}var lx=864e5;function Cf(e){ke(1,arguments);var r=et(e),a=r.getTime();r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0);var u=r.getTime(),l=a-u;return Math.floor(l/lx)+1}function Fn(e){ke(1,arguments);var r=1,a=et(e),u=a.getUTCDay(),l=(u=l.getTime()?a+1:r.getTime()>=v.getTime()?a:a-1}function Tf(e){ke(1,arguments);var r=ts(e),a=new Date(0);a.setUTCFullYear(r,0,4),a.setUTCHours(0,0,0,0);var u=Fn(a);return u}var fx=6048e5;function Pf(e){ke(1,arguments);var r=et(e),a=Fn(r).getTime()-Tf(r).getTime();return Math.round(a/fx)+1}function Nn(e,r){var a,u,l,p,v,C,T,A;ke(1,arguments);var R=An(),V=Nt((a=(u=(l=(p=r?.weekStartsOn)!==null&&p!==void 0?p:r==null||(v=r.locale)===null||v===void 0||(C=v.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&l!==void 0?l:R.weekStartsOn)!==null&&u!==void 0?u:(T=R.locale)===null||T===void 0||(A=T.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&a!==void 0?a:0);if(!(V>=0&&V<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var K=et(e),re=K.getUTCDay(),N=(re=1&&re<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=new Date(0);N.setUTCFullYear(V+1,0,re),N.setUTCHours(0,0,0,0);var _e=Nn(N,r),Le=new Date(0);Le.setUTCFullYear(V,0,re),Le.setUTCHours(0,0,0,0);var ye=Nn(Le,r);return R.getTime()>=_e.getTime()?V+1:R.getTime()>=ye.getTime()?V:V-1}function Ef(e,r){var a,u,l,p,v,C,T,A;ke(1,arguments);var R=An(),V=Nt((a=(u=(l=(p=r?.firstWeekContainsDate)!==null&&p!==void 0?p:r==null||(v=r.locale)===null||v===void 0||(C=v.options)===null||C===void 0?void 0:C.firstWeekContainsDate)!==null&&l!==void 0?l:R.firstWeekContainsDate)!==null&&u!==void 0?u:(T=R.locale)===null||T===void 0||(A=T.options)===null||A===void 0?void 0:A.firstWeekContainsDate)!==null&&a!==void 0?a:1),K=rs(e,r),re=new Date(0);re.setUTCFullYear(K,0,V),re.setUTCHours(0,0,0,0);var N=Nn(re,r);return N}var cx=6048e5;function Df(e,r){ke(1,arguments);var a=et(e),u=Nn(a,r).getTime()-Ef(a,r).getTime();return Math.round(u/cx)+1}function Se(e,r){for(var a=e<0?"-":"",u=Math.abs(e).toString();u.length0?u:1-u;return Se(a==="yy"?l%100:l,a.length)},M:function(r,a){var u=r.getUTCMonth();return a==="M"?String(u+1):Se(u+1,2)},d:function(r,a){return Se(r.getUTCDate(),a.length)},a:function(r,a){var u=r.getUTCHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return u.toUpperCase();case"aaa":return u;case"aaaaa":return u[0];case"aaaa":default:return u==="am"?"a.m.":"p.m."}},h:function(r,a){return Se(r.getUTCHours()%12||12,a.length)},H:function(r,a){return Se(r.getUTCHours(),a.length)},m:function(r,a){return Se(r.getUTCMinutes(),a.length)},s:function(r,a){return Se(r.getUTCSeconds(),a.length)},S:function(r,a){var u=a.length,l=r.getUTCMilliseconds(),p=Math.floor(l*Math.pow(10,u-3));return Se(p,a.length)}},un=hx;var na={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},px={G:function(r,a,u){var l=r.getUTCFullYear()>0?1:0;switch(a){case"G":case"GG":case"GGG":return u.era(l,{width:"abbreviated"});case"GGGGG":return u.era(l,{width:"narrow"});case"GGGG":default:return u.era(l,{width:"wide"})}},y:function(r,a,u){if(a==="yo"){var l=r.getUTCFullYear(),p=l>0?l:1-l;return u.ordinalNumber(p,{unit:"year"})}return un.y(r,a)},Y:function(r,a,u,l){var p=rs(r,l),v=p>0?p:1-p;if(a==="YY"){var C=v%100;return Se(C,2)}return a==="Yo"?u.ordinalNumber(v,{unit:"year"}):Se(v,a.length)},R:function(r,a){var u=ts(r);return Se(u,a.length)},u:function(r,a){var u=r.getUTCFullYear();return Se(u,a.length)},Q:function(r,a,u){var l=Math.ceil((r.getUTCMonth()+1)/3);switch(a){case"Q":return String(l);case"QQ":return Se(l,2);case"Qo":return u.ordinalNumber(l,{unit:"quarter"});case"QQQ":return u.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return u.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return u.quarter(l,{width:"wide",context:"formatting"})}},q:function(r,a,u){var l=Math.ceil((r.getUTCMonth()+1)/3);switch(a){case"q":return String(l);case"qq":return Se(l,2);case"qo":return u.ordinalNumber(l,{unit:"quarter"});case"qqq":return u.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return u.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return u.quarter(l,{width:"wide",context:"standalone"})}},M:function(r,a,u){var l=r.getUTCMonth();switch(a){case"M":case"MM":return un.M(r,a);case"Mo":return u.ordinalNumber(l+1,{unit:"month"});case"MMM":return u.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return u.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return u.month(l,{width:"wide",context:"formatting"})}},L:function(r,a,u){var l=r.getUTCMonth();switch(a){case"L":return String(l+1);case"LL":return Se(l+1,2);case"Lo":return u.ordinalNumber(l+1,{unit:"month"});case"LLL":return u.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return u.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return u.month(l,{width:"wide",context:"standalone"})}},w:function(r,a,u,l){var p=Df(r,l);return a==="wo"?u.ordinalNumber(p,{unit:"week"}):Se(p,a.length)},I:function(r,a,u){var l=Pf(r);return a==="Io"?u.ordinalNumber(l,{unit:"week"}):Se(l,a.length)},d:function(r,a,u){return a==="do"?u.ordinalNumber(r.getUTCDate(),{unit:"date"}):un.d(r,a)},D:function(r,a,u){var l=Cf(r);return a==="Do"?u.ordinalNumber(l,{unit:"dayOfYear"}):Se(l,a.length)},E:function(r,a,u){var l=r.getUTCDay();switch(a){case"E":case"EE":case"EEE":return u.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return u.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return u.day(l,{width:"short",context:"formatting"});case"EEEE":default:return u.day(l,{width:"wide",context:"formatting"})}},e:function(r,a,u,l){var p=r.getUTCDay(),v=(p-l.weekStartsOn+8)%7||7;switch(a){case"e":return String(v);case"ee":return Se(v,2);case"eo":return u.ordinalNumber(v,{unit:"day"});case"eee":return u.day(p,{width:"abbreviated",context:"formatting"});case"eeeee":return u.day(p,{width:"narrow",context:"formatting"});case"eeeeee":return u.day(p,{width:"short",context:"formatting"});case"eeee":default:return u.day(p,{width:"wide",context:"formatting"})}},c:function(r,a,u,l){var p=r.getUTCDay(),v=(p-l.weekStartsOn+8)%7||7;switch(a){case"c":return String(v);case"cc":return Se(v,a.length);case"co":return u.ordinalNumber(v,{unit:"day"});case"ccc":return u.day(p,{width:"abbreviated",context:"standalone"});case"ccccc":return u.day(p,{width:"narrow",context:"standalone"});case"cccccc":return u.day(p,{width:"short",context:"standalone"});case"cccc":default:return u.day(p,{width:"wide",context:"standalone"})}},i:function(r,a,u){var l=r.getUTCDay(),p=l===0?7:l;switch(a){case"i":return String(p);case"ii":return Se(p,a.length);case"io":return u.ordinalNumber(p,{unit:"day"});case"iii":return u.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return u.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return u.day(l,{width:"short",context:"formatting"});case"iiii":default:return u.day(l,{width:"wide",context:"formatting"})}},a:function(r,a,u){var l=r.getUTCHours(),p=l/12>=1?"pm":"am";switch(a){case"a":case"aa":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"});case"aaa":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return u.dayPeriod(p,{width:"narrow",context:"formatting"});case"aaaa":default:return u.dayPeriod(p,{width:"wide",context:"formatting"})}},b:function(r,a,u){var l=r.getUTCHours(),p;switch(l===12?p=na.noon:l===0?p=na.midnight:p=l/12>=1?"pm":"am",a){case"b":case"bb":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"});case"bbb":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return u.dayPeriod(p,{width:"narrow",context:"formatting"});case"bbbb":default:return u.dayPeriod(p,{width:"wide",context:"formatting"})}},B:function(r,a,u){var l=r.getUTCHours(),p;switch(l>=17?p=na.evening:l>=12?p=na.afternoon:l>=4?p=na.morning:p=na.night,a){case"B":case"BB":case"BBB":return u.dayPeriod(p,{width:"abbreviated",context:"formatting"});case"BBBBB":return u.dayPeriod(p,{width:"narrow",context:"formatting"});case"BBBB":default:return u.dayPeriod(p,{width:"wide",context:"formatting"})}},h:function(r,a,u){if(a==="ho"){var l=r.getUTCHours()%12;return l===0&&(l=12),u.ordinalNumber(l,{unit:"hour"})}return un.h(r,a)},H:function(r,a,u){return a==="Ho"?u.ordinalNumber(r.getUTCHours(),{unit:"hour"}):un.H(r,a)},K:function(r,a,u){var l=r.getUTCHours()%12;return a==="Ko"?u.ordinalNumber(l,{unit:"hour"}):Se(l,a.length)},k:function(r,a,u){var l=r.getUTCHours();return l===0&&(l=24),a==="ko"?u.ordinalNumber(l,{unit:"hour"}):Se(l,a.length)},m:function(r,a,u){return a==="mo"?u.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):un.m(r,a)},s:function(r,a,u){return a==="so"?u.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):un.s(r,a)},S:function(r,a){return un.S(r,a)},X:function(r,a,u,l){var p=l._originalDate||r,v=p.getTimezoneOffset();if(v===0)return"Z";switch(a){case"X":return Mh(v);case"XXXX":case"XX":return oi(v);case"XXXXX":case"XXX":default:return oi(v,":")}},x:function(r,a,u,l){var p=l._originalDate||r,v=p.getTimezoneOffset();switch(a){case"x":return Mh(v);case"xxxx":case"xx":return oi(v);case"xxxxx":case"xxx":default:return oi(v,":")}},O:function(r,a,u,l){var p=l._originalDate||r,v=p.getTimezoneOffset();switch(a){case"O":case"OO":case"OOO":return"GMT"+Ih(v,":");case"OOOO":default:return"GMT"+oi(v,":")}},z:function(r,a,u,l){var p=l._originalDate||r,v=p.getTimezoneOffset();switch(a){case"z":case"zz":case"zzz":return"GMT"+Ih(v,":");case"zzzz":default:return"GMT"+oi(v,":")}},t:function(r,a,u,l){var p=l._originalDate||r,v=Math.floor(p.getTime()/1e3);return Se(v,a.length)},T:function(r,a,u,l){var p=l._originalDate||r,v=p.getTime();return Se(v,a.length)}};function Ih(e,r){var a=e>0?"-":"+",u=Math.abs(e),l=Math.floor(u/60),p=u%60;if(p===0)return a+String(l);var v=r||"";return a+String(l)+v+Se(p,2)}function Mh(e,r){if(e%60===0){var a=e>0?"-":"+";return a+Se(Math.abs(e)/60,2)}return oi(e,r)}function oi(e,r){var a=r||"",u=e>0?"-":"+",l=Math.abs(e),p=Se(Math.floor(l/60),2),v=Se(l%60,2);return u+p+a+v}var Oh=px;var Ah=function(r,a){switch(r){case"P":return a.date({width:"short"});case"PP":return a.date({width:"medium"});case"PPP":return a.date({width:"long"});case"PPPP":default:return a.date({width:"full"})}},Fh=function(r,a){switch(r){case"p":return a.time({width:"short"});case"pp":return a.time({width:"medium"});case"ppp":return a.time({width:"long"});case"pppp":default:return a.time({width:"full"})}},dx=function(r,a){var u=r.match(/(P+)(p+)?/)||[],l=u[1],p=u[2];if(!p)return Ah(r,a);var v;switch(l){case"P":v=a.dateTime({width:"short"});break;case"PP":v=a.dateTime({width:"medium"});break;case"PPP":v=a.dateTime({width:"long"});break;case"PPPP":default:v=a.dateTime({width:"full"});break}return v.replace("{{date}}",Ah(l,a)).replace("{{time}}",Fh(p,a))},mx={p:Fh,P:dx},Nh=mx;var gx=["D","DD"],yx=["YY","YYYY"];function Lh(e){return gx.indexOf(e)!==-1}function Rh(e){return yx.indexOf(e)!==-1}function If(e,r,a){if(e==="YYYY")throw new RangeError("Use \`yyyy\` instead of \`YYYY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(a,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use \`yy\` instead of \`YY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(a,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use \`d\` instead of \`D\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(a,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use \`dd\` instead of \`DD\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(a,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var xx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},vx=function(r,a,u){var l,p=xx[r];return typeof p=="string"?l=p:a===1?l=p.one:l=p.other.replace("{{count}}",a.toString()),u!=null&&u.addSuffix?u.comparison&&u.comparison>0?"in "+l:l+" ago":l},Wh=vx;function ns(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=r.width?String(r.width):e.defaultWidth,u=e.formats[a]||e.formats[e.defaultWidth];return u}}var wx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Sx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_x={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},bx={date:ns({formats:wx,defaultWidth:"full"}),time:ns({formats:Sx,defaultWidth:"full"}),dateTime:ns({formats:_x,defaultWidth:"full"})},Yh=bx;var kx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Cx=function(r,a,u,l){return kx[r]},Bh=Cx;function ui(e){return function(r,a){var u=a!=null&&a.context?String(a.context):"standalone",l;if(u==="formatting"&&e.formattingValues){var p=e.defaultFormattingWidth||e.defaultWidth,v=a!=null&&a.width?String(a.width):p;l=e.formattingValues[v]||e.formattingValues[p]}else{var C=e.defaultWidth,T=a!=null&&a.width?String(a.width):e.defaultWidth;l=e.values[T]||e.values[C]}var A=e.argumentCallback?e.argumentCallback(r):r;return l[A]}}var Tx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Px={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ex={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Dx={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ix={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ox=function(r,a){var u=Number(r),l=u%100;if(l>20||l<10)switch(l%10){case 1:return u+"st";case 2:return u+"nd";case 3:return u+"rd"}return u+"th"},Ax={ordinalNumber:Ox,era:ui({values:Tx,defaultWidth:"wide"}),quarter:ui({values:Px,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:ui({values:Ex,defaultWidth:"wide"}),day:ui({values:Dx,defaultWidth:"wide"}),dayPeriod:ui({values:Ix,defaultWidth:"wide",formattingValues:Mx,defaultFormattingWidth:"wide"})},Vh=Ax;function li(e){return function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=a.width,l=u&&e.matchPatterns[u]||e.matchPatterns[e.defaultMatchWidth],p=r.match(l);if(!p)return null;var v=p[0],C=u&&e.parsePatterns[u]||e.parsePatterns[e.defaultParseWidth],T=Array.isArray(C)?Nx(C,function(V){return V.test(v)}):Fx(C,function(V){return V.test(v)}),A;A=e.valueCallback?e.valueCallback(T):T,A=a.valueCallback?a.valueCallback(A):A;var R=r.slice(v.length);return{value:A,rest:R}}}function Fx(e,r){for(var a in e)if(e.hasOwnProperty(a)&&r(e[a]))return a}function Nx(e,r){for(var a=0;a1&&arguments[1]!==void 0?arguments[1]:{},u=r.match(e.matchPattern);if(!u)return null;var l=u[0],p=r.match(e.parsePattern);if(!p)return null;var v=e.valueCallback?e.valueCallback(p[0]):p[0];v=a.valueCallback?a.valueCallback(v):v;var C=r.slice(l.length);return{value:v,rest:C}}}var Lx=/^(\\d+)(th|st|nd|rd)?/i,Rx=/\\d+/i,Wx={narrow:/^(b|a)/i,abbreviated:/^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Yx={any:[/^b/i,/^(a|c)/i]},Bx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vx={any:[/1/i,/2/i,/3/i,/4/i]},Ux={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Hx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},qx={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Gx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},zx={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},$x={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},jx={ordinalNumber:Mf({matchPattern:Lx,parsePattern:Rx,valueCallback:function(r){return parseInt(r,10)}}),era:li({matchPatterns:Wx,defaultMatchWidth:"wide",parsePatterns:Yx,defaultParseWidth:"any"}),quarter:li({matchPatterns:Bx,defaultMatchWidth:"wide",parsePatterns:Vx,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:li({matchPatterns:Ux,defaultMatchWidth:"wide",parsePatterns:Hx,defaultParseWidth:"any"}),day:li({matchPatterns:qx,defaultMatchWidth:"wide",parsePatterns:Gx,defaultParseWidth:"any"}),dayPeriod:li({matchPatterns:zx,defaultMatchWidth:"any",parsePatterns:$x,defaultParseWidth:"any"})},Uh=jx;var Qx={code:"en-US",formatDistance:Wh,formatLong:Yh,formatRelative:Bh,localize:Vh,match:Uh,options:{weekStartsOn:0,firstWeekContainsDate:1}},Hh=Qx;var qh=Hh;var Kx=/[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g,Zx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xx=/^'([^]*?)'?$/,Jx=/''/g,ev=/[a-zA-Z]/;function fi(e,r,a){var u,l,p,v,C,T,A,R,V,K,re,N,_e,Le,ye,de,We,ze;ke(2,arguments);var $e=String(r),Pe=An(),tt=(u=(l=a?.locale)!==null&&l!==void 0?l:Pe.locale)!==null&&u!==void 0?u:qh,je=Nt((p=(v=(C=(T=a?.firstWeekContainsDate)!==null&&T!==void 0?T:a==null||(A=a.locale)===null||A===void 0||(R=A.options)===null||R===void 0?void 0:R.firstWeekContainsDate)!==null&&C!==void 0?C:Pe.firstWeekContainsDate)!==null&&v!==void 0?v:(V=Pe.locale)===null||V===void 0||(K=V.options)===null||K===void 0?void 0:K.firstWeekContainsDate)!==null&&p!==void 0?p:1);if(!(je>=1&&je<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var pr=Nt((re=(N=(_e=(Le=a?.weekStartsOn)!==null&&Le!==void 0?Le:a==null||(ye=a.locale)===null||ye===void 0||(de=ye.options)===null||de===void 0?void 0:de.weekStartsOn)!==null&&_e!==void 0?_e:Pe.weekStartsOn)!==null&&N!==void 0?N:(We=Pe.locale)===null||We===void 0||(ze=We.options)===null||ze===void 0?void 0:ze.weekStartsOn)!==null&&re!==void 0?re:0);if(!(pr>=0&&pr<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!tt.localize)throw new RangeError("locale must contain localize property");if(!tt.formatLong)throw new RangeError("locale must contain formatLong property");var jt=et(e);if(!bf(jt))throw new RangeError("Invalid time value");var me=Sf(jt),at=kf(jt,me),mt={firstWeekContainsDate:je,weekStartsOn:pr,locale:tt,_originalDate:jt},Rt=$e.match(Zx).map(function(Oe){var Qe=Oe[0];if(Qe==="p"||Qe==="P"){var Wt=Nh[Qe];return Wt(Oe,tt.formatLong)}return Oe}).join("").match(Kx).map(function(Oe){if(Oe==="''")return"'";var Qe=Oe[0];if(Qe==="'")return tv(Oe);var Wt=Oh[Qe];if(Wt)return!(a!=null&&a.useAdditionalWeekYearTokens)&&Rh(Oe)&&If(Oe,r,String(e)),!(a!=null&&a.useAdditionalDayOfYearTokens)&&Lh(Oe)&&If(Oe,r,String(e)),Wt(at,Oe,tt.localize,mt);if(Qe.match(ev))throw new RangeError("Format string contains an unescaped latin alphabet character \`"+Qe+"\`");return Oe}).join("");return Rt}function tv(e){var r=e.match(Xx);return r?r[1].replace(Jx,"'"):e}var Of=(e,r)=>{if(e instanceof Date)return"date";if(typeof e=="string"){if(/\\/\\/(\\S+?(?:jpe?g|png|gif|svg))/gi.test(e)||e.includes("unsplash"))return"image";if(/^\\d{4}-\\d{2}-\\d{2}$/.test(e))return"date";if(r=="tag"||r=="tags")return"tag";if(/\\[\\[.*?\\]\\]/.test(e))return"link"}else{if(typeof e=="number")return"number";if(typeof e=="boolean")return"boolean";if(e)if(Array.isArray(e)||typeof e=="string"&&e.indexOf(",")>-1){let a=Array.isArray(e)?e:[];if(typeof e=="string"&&e.indexOf(",")>-1&&(a=sr(e)),r=="tag"||r=="tags")return"tag-multi";if(a.length==1&&Array.isArray(a[0])&&a[0].length==1&&typeof a[0][0]=="string")return"link";let u=sn(a.map(l=>Of(l,r)));return u.length==1&&u[0]=="link"?"link-multi":u.some(l=>l=="object")?"object-multi":"option-multi"}else{if(e.isLuxonDateTime)return"date";if(e.isLuxonDuration)return"duration";if(e.type=="file")return"link";if(typeof e=="object"&&!Array.isArray(e)&&e!==null)return"object"}else return"unknown"}return"text"};var Gh=e=>e.map(r=>r.replace(",","\\\\,")).join(", "),ci=e=>e.map(r=>r.replace(",","\\\\,")).join(", ");var sr=e=>(e?.replace("\\\\,",",").match(/(\\\\.|[^,])+/g)??[]).map(r=>r.trim()),Af=(e,r)=>{switch(Of(r,e)){case"object":return JSON.stringify(r);case"number":return r.toString();case"boolean":return r?"true":"false";case"date":{if(r instanceof Date){let u=fi(new Date(r),"yyyy-MM-dd");if(typeof u=="string")return u}return typeof r!="string"?"":r}break;case"duration":return Gh(Object.keys(r.values).reduce((u,l)=>[...u,...r.values[l]>0?[r.values[l]+" "+l]:[]],[]));case"option-multi":case"link-multi":return typeof r=="string"?is(r):ci(r.map(u=>u?typeof u=="string"?is(u):u.path?u.path:Array.isArray(r)&&u.length==1&&Array.isArray(u[0])&&u[0].length==1&&typeof u[0][0]=="string"?u[0][0]:JSON.stringify(u):""));case"link":return Array.isArray(r)&&r.length==1&&Array.isArray(r[0])&&r[0].length==1&&typeof r[0][0]=="string"?r[0][0]:typeof r=="string"?is(r):r.path;case"text":case"tag":case"image":return r}return""};var is=e=>{if(!e)return"";let r=/\\[\\[(.*?)\\]\\]/g.exec(e),a=r?.length>1?r[1].substring(0,Eh("|",r[1])):e;return a||e};var No=(e,r)=>e==r,Ff=(e,r)=>(e??"").length==0,Nf=(e,r)=>(e??"").toLowerCase().includes((r??"").toLowerCase()),Lf=(e,r)=>parseFloat(e)>parseFloat(r),Rf=(e,r)=>parseInt(e)>parseInt(r),zh=(e,r)=>{let a=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),u=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return a.valueOf()>u.valueOf()},$h=(e,r)=>{let a=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),u=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return a.valueOf(){let a=e?sr(e):[];return(r?sr(r):[]).some(l=>a.some(p=>p==l))},jh=(e,r)=>{if(!e)return!1;let a=new Date(\`\${e.toString().replace(".",":")}\`),u=new Date(\`\${r}\`);return a.getMonth()===u.getMonth()&&a.getDate()===u.getDate()},Qh=e=>{if(!e)return!1;let r=new Date(\`\${e.toString()}T00:00\`),a=new Date;return r.getMonth()===a.getMonth()&&r.getDate()===a.getDate()};var as={isNotEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>!Ff(e,""),valueType:"none"},isEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>Ff(e,""),valueType:"none"},include:{fn:(e,r)=>Nf(e,r),type:["text","file","link","link-multi","fileprop","image"],valueType:"text"},notInclude:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>!Nf(e,r),valueType:"text"},is:{type:["text","file","link","context","fileprop"],fn:(e,r)=>No(e,r),valueType:"text"},isNot:{type:["text","file","link","context","fileprop"],fn:(e,r)=>!No(e,r),valueType:"text"},equal:{type:["number"],fn:(e,r)=>No(e,r),valueType:"number"},isGreatThan:{type:["number"],fn:(e,r)=>Lf(e,r),valueType:"number"},isLessThan:{type:["number"],fn:(e,r)=>Rf(e,r),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(e,r)=>!Lf(e,r),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(e,r)=>!Rf(e,r),valueType:"number"},dateBefore:{type:["date","fileprop"],fn:(e,r)=>$h(e,r),valueType:"date"},dateAfter:{type:["date","fileprop"],fn:(e,r)=>zh(e,r),valueType:"date"},isSameDate:{type:["date"],fn:(e,r)=>jh(e,r),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(e,r)=>Qh(e,r),valueType:"none"},isAnyInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(e,r)=>Wf(e,r),valueType:"list"},isNoneInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(e,r)=>!Wf(e,r),valueType:"list"},isTrue:{type:["boolean"],fn:(e,r)=>e=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(e,r)=>e!="true",valueType:"none"}};var rv=(e,r)=>r.reduce((u,l)=>{let[p,v]=u,C=l.type=="path"?Zh(v,l):l.type=="frontmatter"?Kh(v,l):Xh(v,l),T=v.filter(A=>!C.includes(A));return[[...p,...C],T]},[[],e])[0],nv=(e,r)=>r.reduce((a,u)=>u.type=="path"?Zh(a,u):u.type=="frontmatter"?Kh(a,u):Xh(a,u),e),Kh=(e,r)=>e.filter(a=>{let u=a.metadata?.property;if(!u||!u[r.field])return!1;let l=as[r.fn],p=!0;return l&&(p=l.fn(Af(r.field,u[r.field]),r.value)),p}),Zh=(e,r)=>e.filter(a=>{let u="";r.field=="outlinks"?u=ci(a.outlinks??[]):r.field=="inlinks"?u=ci(a.inlinks??[]):r.field=="tags"&&(u=ci(a.tags??[]));let l=as[r.fn],p=!0;return l&&(p=l.fn(u,r.value)),p}),Xh=(e,r)=>e.filter(a=>{let u=as[r.fn],l=!0;return u&&(l=u.fn(a.metadata?.[r.type]?.[r.field],r.value)),l}),Yf=(e,r)=>e.reduce((u,l)=>!u||l.filters.length==0?!1:l.type=="any"?rv([r],l.filters).length>0:nv([r],l.filters).length>0,!0);var ep=yf(Jh()),Vf=class{constructor(){this.lang="en";this.all={en:{hintText:{dragDropModifierKeys:"Hold \${1} to Pin and \${2} to Copy",createListItem:"Select/Create List Item Frame",dragDropProperties:"Drag and drop properties to link them into the list",newItem:"+ New",selectNote:"Select Note...",newFrame:"New"},defaults:{spaceNote:"Current Note",spaceContext:"Current Space"},commands:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",columns:"Columns",button:"Button",label:"Label",column:"Column",idea:"New",group:"Group",paragraph:"Text",card:"Card",progress:"Progress",rating:"Rating",circularProgress:"Circular Progress",list:"Bullet List","ordered-list":"Numbered List",todo:"To-do List",quote:"Quote",divider:"Divider",note:"Link to Note",link:"Link",callout:"Callout",bookmark:"Bookmark",table:"Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",flow:"Linked Note",newNote:"New Note",tag:"Tag",makeMenu:"Flow Menu",selectStyle:"Style",toggleKeyboard:"Toggle Keyboard",rows:"Rows",masonry:"Gallery"},styles:{bold:"Bold",italics:"Italics",strikethrough:"Strikethrough",code:"Code",link:"Web Link",blocklink:"Link to Note",textColor:"Text Color",highlight:"Highlight"},commandsSuggest:{noResult:"No result"},commandPalette:{enable:"Enable",disabled:"Disable",openFlow:"Open Flow Blocks in Selection",closeFlow:"Close Flow Blocks in Selection",toggleBold:"Toggle Bold",toggleItalics:"Toggle Italics",openSpaces:"Open Spaces",migrateData:"Migrate Spaces From 0.7",blink:"Blink",openFileContext:"Open Explorer",convertPathToSpace:"Convert to Space",revealFile:"Reveal File in Spaces",releaseNotes:"Release Notes",toggleBacklinks:"Toggle Backlinks",collapseAllFolders:"Collapse All Folders",addFileSpace:"Add File to Space",removeFileSpace:"Remove File from Space"},frames:{sections:{kit:"Kit",paths:"Paths"},label:{label:"Label",description:"Label"},note:{label:"Note",description:"Link to a note"},table:{label:"Table",description:"Table"},context:{label:"Context",description:"Display a context view from another space"},calendar:{label:"Calendar View"},field:{label:"Field",description:"Dynamic node that displays a value based on property type"},event:{label:"Event"},divider:{label:"Divider",description:"Divider to separate your content"},button:{label:"Button",description:"Buttons can perform actions and open links"},callout:{label:"Callout",description:"Callout to highlight important information"},toggle:{label:"Toggle",description:"Toggle to show/hide content"}},menu:{newView:"New View",customView:"Custom View",detailsView:"Details View",catalogView:"Catalog View",galleryView:"Gallery View",deleteContext:"Delete Context",openSpace:"Open Space",revealInDefault:"Reveal in Finder",setNone:"None",fileMetadataDescription:"This note only",openFilePane:"Open in a new pane",rename:"Rename",changeToFolderNote:"New Space from Note",moveFile:"Move file to...",moveFolder:"Move folder to...",duplicate:"Make a copy",edit:"Edit",delete:"Delete",getHelp:"Make.md Community",vault:"Vault",openVault:"Open Another Vault",openVaultInFolder:"Open Vault Folder",obSettings:"Obsidian Settings",commandPalette:"Command Palette",backToSpace:"Back to Spaces",collapseAllSections:"Collapse All Spaces",expandAllSections:"Expand All Spaces",collapseAllFolders:"Collapse All Folders",expandAllFolders:"Expand All Folders",spaceTitle:"Add/Remove in Space",home:"Home",waypoints:"Waypoints",none:"None",tableView:"Table View",cardView:"Card View",boardView:"Board View",listView:"List View",flowView:"Flow View",groupBy:"Group By",sortBy:"Sort By",newFilter:"New Filter",clearFilters:"Clear Filters",hide:"Hide",unhideFields:"Unhide All Properties",importDataview:"Import All Dataview Properties",saveAllProperties:"Save All Properties to Files",mergeProperties:"Merge Properties",removeFromSpace:"Unpin from Space",removeFromWaypoints:"Unpin from Waypoints",editCode:"Edit Code",deleteProperty:"Delete Property",hideProperty:"Hide Property",unhideProperty:"Unhide Property",saveProperty:"Save Property",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",deleteRow:"Delete Item",collapseAll:"Collapse All",customSort:"Custom Sort",groupSpaces:"Group Spaces",fileNameSortAlphaAsc:"File Name (A to Z)",fileNameSortAlphaDesc:"File Name (Z to A)",createdTimeSortAsc:"Created Time (new to old)",createdTimeSortDesc:"Created Time (old to new)",modifiedTimeSortAsc:"Modified Time (new to old)",modifiedTimeSortDesc:"Modified Time (old to new)",sizeSortAsc:"Size (smallest to largest)",sizeSortDesc:"Size (largest to smallest)",spaces:"Spaces",tags:"Tags",manageHiddenFiles:"Manage Hidden Files",manageActions:"Manage Actions",deleteSpace:"Delete",changeColor:"Change Color",changePropertyType:"Change Type",deleteFiles:"Delete Files",createFolderSpace:"Create Space from Folder",folder:"Folder",syncToContext:"Add Property to Context",setIcon:"Set Icon",copyEmbedLink:"Copy Embed Link",moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",groupNodes:"Group Nodes",moveFrame:"Move Frame",renameFrame:"Rename Frame",deleteFrame:"Delete Frame"},editor:{rows:"Rows",columns:"Columns",catalog:"Catalog",gallery:"Gallery",grid:"Grid",scaleToFit:"Change to Fit",scaleToFill:"Change to Fill",fit:"Fit",strokeNone:"None",strokeSolid:"Solid",strokeDotted:"Dotted",strokeDashed:"Dashed",size:"Size",gap:"Gap",marginLeft:"Left",marginTop:"Top",marginRight:"Right",marginBottom:"Bottom",minimize:"Minimize",paddingLeft:"Left",paddingTop:"Top",paddingRight:"Right",paddingBottom:"Bottom",unlinkProperty:"Unlink Property",linkedProperty:"Linked Property",linkProperty:"Link Property",currentSpace:"Current Space",linkName:"\${1} Link",linkThumbnail:"\${1} Thumbnail",linkSticker:"\${1} Sticker",opacity:"Opacity",shadowSpread:"Spread",shadowBlur:"Blur",width:"Width",height:"Height",margin:"Margin",padding:"Padding",bold:"Bold",italic:"Italic",underline:"Underline",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",numberOfLines:"Lines",createVerticalSection:"Create Vertical Section",createHorizontalSection:"Create Horizontal Section",themeColors:"Theme Colors",uiColors:"UI Colors",hex:"Hex"},buttons:{add:"Add",addFilter:"Add Filter",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",changeBanner:"Change Cover",changeBannerShort:"Cover",saveChanges:"Save Changes",removeBanner:"Remove Cover",rename:"Change Name",editFrame:"Edit Frame",saveSpace:"Save Space",createSpace:"New Space",createFolder:"New Folder",createNote:"New Note",createCanvas:"New Canvas",addIntoSpace:"New Pin",addSmartSearch:"Add Smart Search",addItem:"Add Item",addProperty:"Add Property",addContext:"Add Context",cancel:"Cancel",search:"Search",delete:"Delete",toggleFlow:"Toggle Flow",openFlow:"Open Flow",hideFlow:"Hide Flow",openLink:"Open Link",addToSpace:"Add to Space",addToSpaceShort:"Pin",addTag:"Add Tag",tag:"Tag",syncFields:"Sync Properties",convertTable:"Convert to Markdown",cutTable:"Cut Table",deleteTable:"Delete Table",blink:"Blink",addFile:"Add Item",merge:"Merge",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",deleteView:"Delete View",renameTable:"Rename Table",renameTag:"Rename Tag",createTag:"Create Tag",currentFolder:"Current Folder",sync:"Sync",pasteCSS:"Paste CSS",save:"Save",run:"Run"},metadataTypes:{fileName:"File Name",path:"Path",folder:"Folder",sticker:"Sticker",color:"Color",created:"Created",lastModified:"Last Modified",extension:"Extension",size:"Size",tags:"Tags",inlinks:"Linked Mentions",outlinks:"Links",label:"Label",fileMetadata:"File Metadata",frontmatter:"Frontmatter"},filterTypes:{contains:"contains",notContains:"does not contain",is:"is",isNot:"is not",before:"before",after:"after",anyOf:"is any of",noneOf:"is none of",checked:"is checked",unchecked:"is unchecked",isEmpty:"is empty",isNotEmpty:"is not empty",isSameDate:"is same date",isSameDateAsToday:"today"},sortTypes:{alphaAsc:"A to Z",alphaDesc:"Z to A",earliest:"Earliest",latest:"Latest",checkAsc:"Checked \\u2192 Unchecked",checkDesc:"Unchecked \\u2192 Checked",itemsAsc:"Least Items",itemsDesc:"Most Items"},properties:{defaultField:"Name",audio:{label:"Audio",description:"Audio"},text:{label:"Text",description:"Text field"},number:{label:"Number",description:"Number field with optional unit"},boolean:{label:"Yes/No",description:"Yes or No toggle to indicate the status"},date:{label:"Date",description:"Select a date from a calendar"},option:{label:"Option",description:"Select one or multiple option from a list"},file:{label:"File"},link:{label:"Link",description:"Link to another note or a website"},tags:{label:"Tags",description:"Use tags to quickly organize your items"},object:{label:"Object",description:"Store any complex objects"},context:{label:"Relation",description:"Connect to another context property and create a relation"},image:{label:"Image",description:"Select any image from your system or from the internet"},color:{label:"Color",description:"Use colors to label your items or status"},space:{label:"Context",description:"Link to a context"},icon:{label:"Sticker",description:"Use stickers to uniquely label your items or status"},super:{label:"Super Property",links:"Open Link",properties:"Update Property",api:"API",obsidianCommands:"Run Command",runCommand:"Run Command",performAction:"Perform Action",whenClicked:"When Clicked"},fileProperty:{name:"Name",label:"Formula",createdTime:"Created",modifiedTime:"Last Edited",sticker:"Sticker",links:"Links",tags:"Tags",spaces:"Spaces",extension:"Extension",size:"Size",preview:"Note Preview",parentFolder:"Folder",description:"Use a formula to dynamically display a property"}},views:{navigator:"Navigator",explorer:"Explorer",space:"Space"},subViews:{spaceItems:"Items",spaceContext:"Context",spaceLists:"Lists",spaceActions:"Actions",spaceTemplates:"Templates",smartSearch:"Smart Search",filesAndFolders:"Files and Folders"},labels:{properties:"Properties",newAction:"New Action",newTable:"New Table",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSectionSmart:"Edit Smart Space",renameSection:"Edit Space",createSectionSmart:"New Smart Space",createSection:"New Folder",createNote:"New Note",contextMaker:"Context Maker",select:"Select",pinnedItems:"Pinned Items",collapse:"Collapse",expand:"Expand",all:"All",none:"None",view:"View",findStickers:"Find Sticker",mergeProperties:"Merge Properties",placeholder:"Type '\${1}' for commands",itemsSelected:"\${1} Selected",selectNote:"Select Note",selectIcon:"Select Icon",selectImage:"Select Image",selectSpace:"Select Space",styleSmall:"Small",styleMedium:"Medium",styleLarge:"Large",hiddenFilePattern:"Name, Suffixes and Extension",hiddenFileSpecific:"Exclude specific files and folders",textPlaceholder:"Enter Text",noFile:"is not created yet. Click to create.",navigatorSearchPlaceholder:"Search by Text or Filters",blinkPlaceholder:"Quickly Search a File, Folder, Tag... Press Tab to Edit",searchPlaceholder:"Type to search...",contextItemSelectPlaceholder:"Find Item",linkItemSelectPlaceholder:"Find or Create Note",pinNotePlaceholder:"Select a Note or Space to Pin",optionItemSelectPlaceholder:"Select Option",viewItemSelectPlaceholder:"Select View",tagItemSelectPlaceholder:"Find Tag",spaceSelectPlaceholder:"Select any Folder or Tag",propertyItemSelectPlaceholder:"Select Property",sortItemSelectPlaceholder:"Select Sort",filterItemSelectPlaceholder:"Select Filter",imageSelectPlaceholder:"Select an image or paste a URL",imageNotFoundPlaceholder:"No Images Found",syncFrontmatterProperty:"Sync Frontmatter Property",newProperty:"New Property",newPropertyShort:"New Property",propertyType:"Type",propertyDynamic:"Dyanmic",propertyValueSpace:"Space",propertyValueProperty:"Property",propertyLookup:"Edit Formula",dateFormat:"Date Format",propertyFileProp:"Property",multiple:"Multiple",filesCount:"{$1} Files",hiddenFiles:"Hidden Files",addExtension:"Add Rule",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",renameTable:"Rename Table",syncMetadata:"Sync Metadata",syncProperties:"Sync Properties",selectContext:"Select Context",metadata:"Metadata",backlinks:"Backlinks",spaces:"Spaces",context:"Context",content:"Content",deleteSpace:"Delete Space",deleteFiles:"Delete Files",outgoingLinks:"Outgoing Links",moveTo:"Move to",addTo:"Pin to",copyTo:"Copy to",reorderIn:"Reorder in",border:"Border",corners:"Corners",color:"Color",backgroundColor:"Background",cornerRadius:"Radius",onClick:"On Click",layout:"Layout",element:"Element",name:"Name",display:"Display",alignment:"Alignment",margin:"Margin",padding:"Padding",gap:"Gap",width:"Width",height:"Height",opacity:"Opacity",shadow:"Shadow",shadowBlur:"Blur",shadowSpread:"Spread",typography:"Typography",layers:"Layers",fontSize:"Size",props:"Props",styles:"Styles",events:"Events",code:"Code",selectedLayers:"\${1} Layers"},descriptions:{spaceActions:"Create actions that runs when you press a button",spaceLists:"Create lists to track data and organize them in your space",spaceItems:"Add new items to the space or pin items to the space",smartSearch:"Automatically pin notes to this space based on a set of searches",hiddenFileOptions:"Exclude any files and folders by name, suffix or extension.",deleteSpace:"Deleting the space will also delete the folder and its contents.",deleteFiles:"Delete \${1} files/folders and their contents?",addContext:"Contexts lets you connect properties from your tags",spaceProperties:"Define Properties for your Space Items",syncMetadata:"Select which fields from your notes to start syncing with the context.",syncProperties:"Contexts defines and syncs the same fields across your notes depending on their folder or tag.",selectContext:"Select which folder or tag context you want to sync the fields."},flowView:{emptyDoc:"Empty Document",itemsCount:" Items",emptyFolder:"This Folder is Empty"},notice:{duplicateFile:"Folder already contains note with same name",addedToSection:"Added to Space",fileExists:"File Already Exists",folderExists:"Folder Already Exists",noPropertyName:"Property Name is Required",duplicatePropertyName:"Duplicate Property Name",newSpaceName:"Enter a name for your space",duplicateSpaceName:"Space name already exists",cantConvertNoteToSpace:"The view is not a note",templateSaved:"Template saved to space: "},settings:{layoutVertical:"Vertical",layoutHorizontal:"Horizontal",sectionSidebar:"Spaces",sectionEditor:"Maker Mode",sectionFlow:"Flow",sectionAdvanced:"Advanced",sectionDataview:"Dataview",sectionContext:"Context",sectionStickers:"Stickers",sectionNavigator:"Navigator",sectionDefault:"Default Spaces",sectionSpaceView:"Space View",sectionBlink:"Blink",sectionInlineContext:"Inline Context",sectionFlowBlock:"Flow Block",sectionFlowMenu:"Flow Menu",sectionFlowStyler:"Flow Styler",experimental:{name:"Experimental",desc:"Experimental features that are subject to change and may not be optimized for performance"},generateThumbnails:{name:"Generate Thumbnails",desc:"Create thumbnails for images to speed up performance"},minimalThemeFix:{name:"Minimal Theme Fix",description:"Apply fixes for the popular theme Minimal"},inlineStickerMenu:{name:"Inline Stickers",desc:"Add inline stickers by typing :"},openSpacesOnLaunch:{name:"Open Spaces as Default Tab",desc:"Open the Spaces tab when Obsidian launches"},defaultSpaceTemplate:{name:"Default Space Template",desc:"Select the default template for new spaces"},defaultDateFormat:{name:"Default Date Format",desc:"Set the default date format, example: yyyy-MM-dd (see https://date-fns.org/v2.30.0/docs/format)"},newNotePlaceholder:{name:"New Note Placeholder",desc:"Default name for new notes"},folderIndentationLines:{name:"Show Folder Indentation Lines",desc:"Turn on to show a line on the left of folders to indicate indentation"},folderNoteLocation:{name:"Folder Note Location Inside Folder",desc:"Turn on to have folder notes inside the folder, turn off to have it outside"},folderViewDefault:{name:"Show Folder Note by Default",desc:"Show the folder note by default when opening a folder"},internalLinkFlowEditor:{name:"Open Flow Blocks on Internal Link Click",desc:"Turn on to toggle Flow Blocks directly by clicking on internal links, otherwise a tooltip will be shown"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},inlineBacklinks:{name:"Show Inline Backlinks (Inline Context required)",desc:"Show editable backlinks at the bottom of your notes"},dataviewInlineContext:{name:"Show Dataview in Inline Context",desc:"Show dataview when inline context is enabled"},inlineContextExplorer:{name:"Inline Context",desc:"Display the context and a banner at the top of your notes"},inlineContextExpanded:{name:"Auto Expand Inline Context",desc:"Expand the inline context sections when opening a note"},inlineContextHorizontal:{name:"Inline Title and Sticker Layout",desc:"Layout for inline title and sticker in Inline Context"},hideFrontmatter:{name:"Hide Frontmatter Properties",desc:"Hide the frontmatter properties in inline context"},openFileContext:{name:"Auto Open Explorer",desc:"Automatically open explorer panel in the right panel"},folderNote:{name:"Enable Folder Note",desc:"Access the folder note in the folder page and hide the folder note from spaces"},expandFolder:{name:"Auto Expand Folder",desc:"Auto expand folders on click"},hoverPreview:{name:"Preview on Hover",desc:"Preview on Hover while holding Control/Command key"},activeFile:{name:"Reveal Active File",desc:"Automatically reveal the active file in Spaces"},contexts:{name:"Contexts",desc:"Contexts allows you to have full control over the metadata of your files"},spaces:{name:"Navigator",desc:"The navigator lets you create and organize your spaces"},spacesStickers:{name:"Stickers",desc:"Use Emojis to make it easier to find your notes"},spacesAlias:{name:"Alias",desc:"Use the alias metadata to show in Spaces"},spacesFileExplorerDual:{name:"Compatibility Mode",desc:"This will improve the compatibility of plugins while using Spaces"},spacesDeleteOption:{name:"Delete File Option",desc:"Select how you want files to be deleted"},spacesDeleteOptions:{permanant:"Delete Permanently",trash:"Move to Obsidian Trash","system-trash":"Move to System Trash"},hideRibbon:{name:"App Ribbon",desc:"Show/hide the left menu aka. ribbon"},spaceView:{name:"Space View",desc:"Open the space view when you click on a space"},defaultSpaces:{name:"Default Spaces",desc:"Recommended spaces for quickly organizing your vault"},homeSpace:{name:"Home Space",desc:"An easy-to-access space where you can add/organize your other spaces"},tagSpaces:{name:"Tag Spaces",desc:"Automatically create spaces for each of your tags"},readableLineWidth:{name:"Readable Line Width",desc:"Use Readable Line Width"},sidebarTabs:{name:"Sidebar Tabs",desc:"Show/hide other sidebar tabs"},spacesPerformance:{name:"Performance Mode",desc:"Turn on performance mode for Spaces, may affect scrolling appearance. Requires Restart"},indexSVG:{name:"Use SVGs as Stickers",desc:"Use any svg file in your vault as a sticker"},inlineStyler:{name:"Flow Styler",desc:"Select text to add styling"},inlineStylerColor:{name:"Text and Highlight Colors \\u{1F9EA}",desc:"Select text color and highlight color, (this may change in the future because of the limitations with HTML and Obsidian)"},spaceRowHeight:{name:"Row Height",desc:"The height for each row in spaces (in pixels), default is 28"},makeChar:{name:"Flow Menu Trigger",desc:"Character to open the Flow Menu"},mobileMakeBar:{name:"Flow Styler (Mobile)",desc:"Replaces the mobile toolbar"},editorMarkSans:{name:"Mark Sans \\u{1F9EA}",desc:"Use the editor without Markdown."},editorMakerMode:{name:"Flow (Beta)",desc:"An integrated and intuitive editor experience"},editorMakePlacholder:{name:"Flow Menu Hint Text",desc:"Show a hint text on how to open the Flow Menu Shortcut"},blink:{name:"Blink",desc:"A faster way to search and edit your notes"},editorMakeMenu:{name:"Flow Menu",desc:"Open the Flow menu to quickly add content"},editorMakeMenuTrigger:{name:"Flow Menu Shortcut",desc:"Trigger key to use flow menu"},editorFlowReplace:{name:"Flow Block",desc:"Open your internal links or toggle your embeds in the flow block."},editorFlowStyle:{name:"Flow Block Style",desc:"Select a theme for your flow block",seamless:"Seamless",classic:"Classic",minimal:"Minimal"}}}};this.lang="en";let r=ep.default.locale();["en"].includes(r)&&(this.lang=r)}get texts(){return this.all.en}},fe=new Vf().texts;var WS=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"text",label:fe.properties.text.label,metadata:!0,icon:"ui//text",description:fe.properties.text.description},{type:"number",label:fe.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],description:fe.properties.number.description},{type:"boolean",label:fe.properties.boolean.label,metadata:!0,icon:"ui//check-square",description:fe.properties.boolean.description},{type:"date",label:fe.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],description:fe.properties.date.description},{type:"option",label:fe.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options"],description:fe.properties.option.description},{type:"tags",label:fe.properties.tags.label,icon:"ui//tags",description:fe.properties.tags.description},{type:"file",label:fe.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:fe.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value"],description:fe.properties.fileProperty.description},{type:"link",label:fe.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",description:fe.properties.link.description},{type:"context",label:fe.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:fe.properties.context.description},{type:"object",label:fe.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type"],description:fe.properties.object.description},{type:"icon",label:fe.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",description:fe.properties.icon.description},{type:"image",label:fe.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",description:fe.properties.image.description},{type:"color",label:fe.properties.color.label,icon:"ui//mk-make-image",description:fe.properties.color.description},{type:"space",label:fe.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:fe.properties.space.description},{type:"table",label:fe.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:fe.properties.space.description},{type:"super",label:fe.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:fe.properties.super.label,icon:"ui//input",restricted:!0}];var hi="files",Wo={id:hi,name:"Files",type:"db",primary:"true"},iv="filesView",av={id:iv,name:"All",type:"view",def:JSON.stringify({db:hi,icon:"ui//file-stack"})},sv="main",ov=e=>({id:e,name:e,type:"frame",def:"",predicate:"",primary:"true"}),YS={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[ov(sv),av]},Lo={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[Wo]},tp={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},Ro={...tp,rows:[{name:on,schemaId:hi,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:fe.properties.fileProperty.createdTime,schemaId:hi,type:"fileprop",value:on+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var BS=[{name:fe.properties.defaultField,schemaId:"",type:"text",primary:"true"}],Uf={...tp,rows:[{name:on,schemaId:hi,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var VS={schema:Wo,cols:Ro.rows,rows:[]},US={schema:Wo,cols:Ro.rows,rows:[]},HS={schema:Wo,cols:Uf.rows,rows:[]},rp=(e,r)=>e.filter(a=>r.find(u=>u.id==a.schemaId&&u.type=="db")).reduce((a,u)=>({...a,...a[u.schemaId]?{[u.schemaId]:{uniques:u.unique=="true"?[...a[u.schemaId].uniques,u.name]:a[u.schemaId].uniques,cols:[...a[u.schemaId].cols,u.name],rows:[]}}:{[u.schemaId]:{uniques:u.unique=="true"?[u.name]:[],cols:[u.name],rows:[]}}}),{});var qS={m_schema:Lo,m_fields:Ro,...rp(Ro.rows,Lo.rows)},GS={m_schema:Lo,m_fields:Uf,...rp(Uf.rows,Lo.rows)};var np=(e,r)=>e.hiddenExtensions.some(a=>r.endsWith(a))||r.startsWith(e.spacesFolder+"/#")||e.hiddenFiles.some(a=>a==r);var ip=(e,r,a)=>{if(!e)return{changed:!1,cache:null};if(!r)return{changed:!1,cache:{path:e.path,frames:{},schemas:[]}};let u=Object.values(r).map(C=>C.schema),l=u.filter(C=>C.type=="frame").reduce((C,T)=>({...C,[T.id]:r[T.id]}),{}),p={path:e.path,frames:l,schemas:u},v=!0;return a&&Yo.default.isEqual(p,a)&&(v=!1),{changed:v,cache:p}},ap=(e,r,a,u,l)=>{let p={};if(!e)return{changed:!1,cache:null};if(!r)return{changed:!1,cache:{cols:[],path:e.path,schemas:[],outlinks:[],contexts:[],paths:[],tables:{},space:e,spaceMap:p,dbExists:!1}};let v=Object.values(r).map(de=>de.schema),C=v.find(de=>de.primary=="true"),T=r[C.id],A=r,R=T.cols?.filter(de=>de.type.startsWith("context"))??[],V=T.cols?.filter(de=>de.type.startsWith("link"))??[],K=sn(R.map(de=>de.value));R.forEach(de=>{p[de.name]={},T.rows.forEach(We=>{sr(We[de.name]).forEach(ze=>p[de.name][ze]=[...p[de.name][ze]??[],We[on]])})});let re=A[hi]?.rows?.map(de=>de[on])??[],N=Th(a??[],re),_e=sn(T.rows.reduce((de,We)=>sn([...de,...[...R,...V].flatMap(ze=>sr(We[ze.name]).map($e=>is($e)))]),[])),Le={cols:T.cols,path:e.path,contexts:K,outlinks:_e,paths:N,tables:A,schemas:v,space:e,spaceMap:p,dbExists:l},ye=!0;return u&&Yo.default.isEqual(Le,u)&&(ye=!0),{changed:ye,cache:Le}},sp=(e,r,a,u)=>{let l={};for(let[p,v]of e){let C=a.get(p)?.defPath??p,T=e.get(C)??v,A=v?.parent??"",R=v?.type??"",V=v?.subtype??"",K=T?.label,re=u?.get(p),{changed:N,cache:_e}=Hf(p,r,a,T,K,R,V,A,re);l[p]={changed:N,cache:_e}}return l},Hf=(e,r,a,u,l,p,v,C,T)=>{let A=(me,at,mt)=>me?.length>0||me?.length>0?me:at=="space"?mt=="Spaces/Home"?"ui//home":mt=="/"?"ui//vault":mt.startsWith("spaces://#")?"ui//tags":"ui//folder":"ui//file",R={label:u?.label,path:e,name:Ao(e),displayName:Ao(e)},V=[],K=u?.tags?.map(me=>me)??[],re=np(r,e),N=(me,at,mt=new Set)=>{let Rt=[];for(let Oe of at){let Qe=me.get(Oe)?.contexts??[];for(let Wt of Qe)mt.has(Wt)||(Rt.push(Wt),mt.add(Wt),Rt.push(...N(me,[Fo(Wt)],mt)))}return Rt};if(a.has(C))for(let me of a.get(C).contexts??[])V.push(me);V.push(...K);let _e=l?.name,Le=u?.properties?vf(u.properties[r.fmKeyAlias]):[],ye=A(l?.sticker,p,e),de=l?.color??"",We=u?.inlinks??[],ze=u?.links??[],$e=r.spacesUseAlias?Le[0]??_e:_e,Pe={...R,name:_e,tags:sn(V),type:p,subtype:v,displayName:$e,parent:C,label:{name:_e,sticker:ye,color:de,thumbnail:l?.thumbnail??"",preview:l?.preview??""},metadata:{...u},inlinks:We,outlinks:ze},tt=[];for(let me of V)tt.push(Fo(me));for(let[me,at]of a){if(at.defPath==e&&(re=!0),at.space&&at.space.path==C){tt.push(me);continue}if(at.metadata?.filters?.length>0&&Yf(at.metadata.filters,Pe)){tt.push(me);continue}if(at.metadata?.links?.length>0&&(at.metadata?.links??[]).find(Rt=>Rt==Pe.path)){tt.push(me);continue}}let je=N(a,tt);tt.push(...je.map(me=>Fo(me))),Pe.tags.push(...je);let pr=re?{...Pe,spaces:[],hidden:re}:{...Pe,spaces:sn(tt),hidden:re},jt=!0;return T&&Yo.default.isEqual(pr,T)&&(jt=!1),{changed:jt,cache:pr}};var uv=(e,r,a)=>{if(e.length!==1)return"";let u=e.map(function(v){return v.compile().evaluate(a)}),l=a.get(u[0]),p=a.get("$properties")?.[u[0]]?.type;return(p=="file"||p=="link"||p=="context")&&(p.includes("multi")?l=sr(l).map(v=>a.get("$paths").get(v)??v):l=a.get("$paths").get(l)??l),l??""};uv.rawArgs=!0;var lv=(e,r,a)=>{if((e.length-1)%2!==0)return"";for(let u=0;u{if(e.length<1||e.length>2)return"";let u=e[0].compile().evaluate(a);u instanceof Date||(u=new Date(u));let l=e[1]?.compile().evaluate(a);return l?.length>0?fi(u,l):fi(u,a.get("$settings")?.dateFormat??"yyyy-MM-dd")};fv.rawArgs=!0;var hv=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],hp=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],pv="\\u200C\\u200D\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0898-\\u089F\\u08CA-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EBC\\u0EC8-\\u0ECE\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u180F-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1ABF-\\u1ACE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\u30FB\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F\\uFF65",pp="\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC",qf={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Gf="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",dv={5:Gf,"5module":Gf+" export import",6:Gf+" const class extends export import super"},mv=/^in(stanceof)?$/,gv=new RegExp("["+pp+"]"),yv=new RegExp("["+pp+pv+"]");function $f(e,r){for(var a=65536,u=0;ue)return!1;if(a+=r[u+1],a>=e)return!0}return!1}function ln(e,r){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&gv.test(String.fromCharCode(e)):r===!1?!1:$f(e,hp)}function aa(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&yv.test(String.fromCharCode(e)):r===!1?!1:$f(e,hp)||$f(e,hv)}var we=function(r,a){a===void 0&&(a={}),this.label=r,this.keyword=a.keyword,this.beforeExpr=!!a.beforeExpr,this.startsExpr=!!a.startsExpr,this.isLoop=!!a.isLoop,this.isAssign=!!a.isAssign,this.prefix=!!a.prefix,this.postfix=!!a.postfix,this.binop=a.binop||null,this.updateContext=null};function or(e,r){return new we(e,{beforeExpr:!0,binop:r})}var ur={beforeExpr:!0},Lt={startsExpr:!0},Kf={};function pe(e,r){return r===void 0&&(r={}),r.keyword=e,Kf[e]=new we(e,r)}var y={num:new we("num",Lt),regexp:new we("regexp",Lt),string:new we("string",Lt),name:new we("name",Lt),privateId:new we("privateId",Lt),eof:new we("eof"),bracketL:new we("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new we("]"),braceL:new we("{",{beforeExpr:!0,startsExpr:!0}),braceR:new we("}"),parenL:new we("(",{beforeExpr:!0,startsExpr:!0}),parenR:new we(")"),comma:new we(",",ur),semi:new we(";",ur),colon:new we(":",ur),dot:new we("."),question:new we("?",ur),questionDot:new we("?."),arrow:new we("=>",ur),template:new we("template"),invalidTemplate:new we("invalidTemplate"),ellipsis:new we("...",ur),backQuote:new we("\`",Lt),dollarBraceL:new we("\${",{beforeExpr:!0,startsExpr:!0}),eq:new we("=",{beforeExpr:!0,isAssign:!0}),assign:new we("_=",{beforeExpr:!0,isAssign:!0}),incDec:new we("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new we("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:or("||",1),logicalAND:or("&&",2),bitwiseOR:or("|",3),bitwiseXOR:or("^",4),bitwiseAND:or("&",5),equality:or("==/!=/===/!==",6),relational:or("/<=/>=",7),bitShift:or("<>/>>>",8),plusMin:new we("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:or("%",10),star:or("*",10),slash:or("/",10),starstar:new we("**",{beforeExpr:!0}),coalesce:or("??",1),_break:pe("break"),_case:pe("case",ur),_catch:pe("catch"),_continue:pe("continue"),_debugger:pe("debugger"),_default:pe("default",ur),_do:pe("do",{isLoop:!0,beforeExpr:!0}),_else:pe("else",ur),_finally:pe("finally"),_for:pe("for",{isLoop:!0}),_function:pe("function",Lt),_if:pe("if"),_return:pe("return",ur),_switch:pe("switch"),_throw:pe("throw",ur),_try:pe("try"),_var:pe("var"),_const:pe("const"),_while:pe("while",{isLoop:!0}),_with:pe("with"),_new:pe("new",{beforeExpr:!0,startsExpr:!0}),_this:pe("this",Lt),_super:pe("super",Lt),_class:pe("class",Lt),_extends:pe("extends",ur),_export:pe("export"),_import:pe("import",Lt),_null:pe("null",Lt),_true:pe("true",Lt),_false:pe("false",Lt),_in:pe("in",{beforeExpr:!0,binop:7}),_instanceof:pe("instanceof",{beforeExpr:!0,binop:7}),_typeof:pe("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:pe("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:pe("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},cr=/\\r\\n?|\\n|\\u2028|\\u2029/,xv=new RegExp(cr.source,"g");function sa(e){return e===10||e===13||e===8232||e===8233}function dp(e,r,a){a===void 0&&(a=e.length);for(var u=r;u>10)+55296,(e&1023)+56320))}var Sv=/(?:[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/,os=function(r,a){this.line=r,this.column=a};os.prototype.offset=function(r){return new os(this.line,this.column+r)};var qo=function(r,a,u){this.start=a,this.end=u,r.sourceFile!==null&&(this.source=r.sourceFile)};function yp(e,r){for(var a=1,u=0;;){var l=dp(e,u,r);if(l<0)return new os(a,r-u);++a,u=l}}var jf={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},lp=!1;function _v(e){var r={};for(var a in jf)r[a]=e&&ls(e,a)?e[a]:jf[a];if(r.ecmaVersion==="latest"?r.ecmaVersion=1e8:r.ecmaVersion==null?(!lp&&typeof console=="object"&&console.warn&&(lp=!0,console.warn(\`Since Acorn 8.0.0, options.ecmaVersion is required. +Defaulting to 2020, but this will stop working in the future.\`)),r.ecmaVersion=11):r.ecmaVersion>=2015&&(r.ecmaVersion-=2009),r.allowReserved==null&&(r.allowReserved=r.ecmaVersion<5),(!e||e.allowHashBang==null)&&(r.allowHashBang=r.ecmaVersion>=14),op(r.onToken)){var u=r.onToken;r.onToken=function(l){return u.push(l)}}return op(r.onComment)&&(r.onComment=bv(r,r.onComment)),r}function bv(e,r){return function(a,u,l,p,v,C){var T={type:a?"Block":"Line",value:u,start:l,end:p};e.locations&&(T.loc=new qo(this,v,C)),e.ranges&&(T.range=[l,p]),r.push(T)}}var us=1,oa=2,Zf=4,xp=8,vp=16,wp=32,Xf=64,Sp=128,fs=256,Jf=us|oa|fs;function ec(e,r){return oa|(e?Zf:0)|(r?xp:0)}var Vo=0,tc=1,cn=2,_p=3,bp=4,kp=5,ft=function(r,a,u){this.options=r=_v(r),this.sourceFile=r.sourceFile,this.keywords=Ln(dv[r.ecmaVersion>=6?6:r.sourceType==="module"?"5module":5]);var l="";r.allowReserved!==!0&&(l=qf[r.ecmaVersion>=6?6:r.ecmaVersion===5?5:3],r.sourceType==="module"&&(l+=" await")),this.reservedWords=Ln(l);var p=(l?l+" ":"")+qf.strict;this.reservedWordsStrict=Ln(p),this.reservedWordsStrictBind=Ln(p+" "+qf.strictBind),this.input=String(a),this.containsEsc=!1,u?(this.pos=u,this.lineStart=this.input.lastIndexOf(\` +\`,u-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(cr).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=y.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=r.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&r.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(us),this.regexpState=null,this.privateNameStack=[]},Ur={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};ft.prototype.parse=function(){var r=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(r)};Ur.inFunction.get=function(){return(this.currentVarScope().flags&oa)>0};Ur.inGenerator.get=function(){return(this.currentVarScope().flags&xp)>0&&!this.currentVarScope().inClassFieldInit};Ur.inAsync.get=function(){return(this.currentVarScope().flags&Zf)>0&&!this.currentVarScope().inClassFieldInit};Ur.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var r=this.scopeStack[e];if(r.inClassFieldInit||r.flags&fs)return!1;if(r.flags&oa)return(r.flags&Zf)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Ur.allowSuper.get=function(){var e=this.currentThisScope(),r=e.flags,a=e.inClassFieldInit;return(r&Xf)>0||a||this.options.allowSuperOutsideMethod};Ur.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Sp)>0};Ur.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Ur.allowNewDotTarget.get=function(){var e=this.currentThisScope(),r=e.flags,a=e.inClassFieldInit;return(r&(oa|fs))>0||a};Ur.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&fs)>0};ft.extend=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];for(var u=this,l=0;l=,?^&]/.test(l)||l==="!"&&this.input.charAt(u+1)==="=")}e+=r[0].length,lr.lastIndex=e,e+=lr.exec(this.input)[0].length,this.input[e]===";"&&e++}};Ct.eat=function(e){return this.type===e?(this.next(),!0):!1};Ct.isContextual=function(e){return this.type===y.name&&this.value===e&&!this.containsEsc};Ct.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};Ct.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};Ct.canInsertSemicolon=function(){return this.type===y.eof||this.type===y.braceR||cr.test(this.input.slice(this.lastTokEnd,this.start))};Ct.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};Ct.semicolon=function(){!this.eat(y.semi)&&!this.insertSemicolon()&&this.unexpected()};Ct.afterTrailingComma=function(e,r){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),r||this.next(),!0};Ct.expect=function(e){this.eat(e)||this.unexpected()};Ct.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Go=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Ct.checkPatternErrors=function(e,r){if(!!e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var a=r?e.parenthesizedAssign:e.parenthesizedBind;a>-1&&this.raiseRecoverable(a,r?"Assigning to rvalue":"Parenthesized pattern")}};Ct.checkExpressionErrors=function(e,r){if(!e)return!1;var a=e.shorthandAssign,u=e.doubleProto;if(!r)return a>=0||u>=0;a>=0&&this.raise(a,"Shorthand property assignments are valid only in destructuring patterns"),u>=0&&this.raiseRecoverable(u,"Redefinition of __proto__ property")};Ct.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&u<56320)return!0;if(ln(u,!0)){for(var l=a+1;aa(u=this.input.charCodeAt(l),!0);)++l;if(u===92||u>55295&&u<56320)return!0;var p=this.input.slice(a,l);if(!mv.test(p))return!0}return!1};z.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;lr.lastIndex=this.pos;var e=lr.exec(this.input),r=this.pos+e[0].length,a;return!cr.test(this.input.slice(this.pos,r))&&this.input.slice(r,r+8)==="function"&&(r+8===this.input.length||!(aa(a=this.input.charCodeAt(r+8))||a>55295&&a<56320))};z.parseStatement=function(e,r,a){var u=this.type,l=this.startNode(),p;switch(this.isLet(e)&&(u=y._var,p="let"),u){case y._break:case y._continue:return this.parseBreakContinueStatement(l,u.keyword);case y._debugger:return this.parseDebuggerStatement(l);case y._do:return this.parseDoStatement(l);case y._for:return this.parseForStatement(l);case y._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(l,!1,!e);case y._class:return e&&this.unexpected(),this.parseClass(l,!0);case y._if:return this.parseIfStatement(l);case y._return:return this.parseReturnStatement(l);case y._switch:return this.parseSwitchStatement(l);case y._throw:return this.parseThrowStatement(l);case y._try:return this.parseTryStatement(l);case y._const:case y._var:return p=p||this.value,e&&p!=="var"&&this.unexpected(),this.parseVarStatement(l,p);case y._while:return this.parseWhileStatement(l);case y._with:return this.parseWithStatement(l);case y.braceL:return this.parseBlock(!0,l);case y.semi:return this.parseEmptyStatement(l);case y._export:case y._import:if(this.options.ecmaVersion>10&&u===y._import){lr.lastIndex=this.pos;var v=lr.exec(this.input),C=this.pos+v[0].length,T=this.input.charCodeAt(C);if(T===40||T===46)return this.parseExpressionStatement(l,this.parseExpression())}return this.options.allowImportExportEverywhere||(r||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),u===y._import?this.parseImport(l):this.parseExport(l,a);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(l,!0,!e);var A=this.value,R=this.parseExpression();return u===y.name&&R.type==="Identifier"&&this.eat(y.colon)?this.parseLabeledStatement(l,A,R,e):this.parseExpressionStatement(l,R)}};z.parseBreakContinueStatement=function(e,r){var a=r==="break";this.next(),this.eat(y.semi)||this.insertSemicolon()?e.label=null:this.type!==y.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var u=0;u=6?this.eat(y.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};z.parseForStatement=function(e){this.next();var r=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(rc),this.enterScope(0),this.expect(y.parenL),this.type===y.semi)return r>-1&&this.unexpected(r),this.parseFor(e,null);var a=this.isLet();if(this.type===y._var||this.type===y._const||a){var u=this.startNode(),l=a?"let":this.value;return this.next(),this.parseVar(u,!0,l),this.finishNode(u,"VariableDeclaration"),(this.type===y._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&u.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===y._in?r>-1&&this.unexpected(r):e.await=r>-1),this.parseForIn(e,u)):(r>-1&&this.unexpected(r),this.parseFor(e,u))}var p=this.isContextual("let"),v=!1,C=new Go,T=this.parseExpression(r>-1?"await":!0,C);return this.type===y._in||(v=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===y._in?r>-1&&this.unexpected(r):e.await=r>-1),p&&v&&this.raise(T.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(T,!1,C),this.checkLValPattern(T),this.parseForIn(e,T)):(this.checkExpressionErrors(C,!0),r>-1&&this.unexpected(r),this.parseFor(e,T))};z.parseFunctionStatement=function(e,r,a){return this.next(),this.parseFunction(e,ss|(a?0:Qf),!1,r)};z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(y._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};z.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(y.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};z.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(y.braceL),this.labels.push(Cv),this.enterScope(0);for(var r,a=!1;this.type!==y.braceR;)if(this.type===y._case||this.type===y._default){var u=this.type===y._case;r&&this.finishNode(r,"SwitchCase"),e.cases.push(r=this.startNode()),r.consequent=[],this.next(),u?r.test=this.parseExpression():(a&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),a=!0,r.test=null),this.expect(y.colon)}else r||this.unexpected(),r.consequent.push(this.parseStatement(null));return this.exitScope(),r&&this.finishNode(r,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};z.parseThrowStatement=function(e){return this.next(),cr.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Tv=[];z.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),r=e.type==="Identifier";return this.enterScope(r?wp:0),this.checkLValPattern(e,r?bp:cn),this.expect(y.parenR),e};z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===y._catch){var r=this.startNode();this.next(),this.eat(y.parenL)?r.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),r.param=null,this.enterScope(0)),r.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(r,"CatchClause")}return e.finalizer=this.eat(y._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};z.parseVarStatement=function(e,r,a){return this.next(),this.parseVar(e,!1,r,a),this.semicolon(),this.finishNode(e,"VariableDeclaration")};z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(rc),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};z.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};z.parseLabeledStatement=function(e,r,a,u){for(var l=0,p=this.labels;l=0;T--){var A=this.labels[T];if(A.statementStart===e.start)A.statementStart=this.start,A.kind=C;else break}return this.labels.push({name:r,kind:C,statementStart:this.start}),e.body=this.parseStatement(u?u.indexOf("label")===-1?u+"label":u:"label"),this.labels.pop(),e.label=a,this.finishNode(e,"LabeledStatement")};z.parseExpressionStatement=function(e,r){return e.expression=r,this.semicolon(),this.finishNode(e,"ExpressionStatement")};z.parseBlock=function(e,r,a){for(e===void 0&&(e=!0),r===void 0&&(r=this.startNode()),r.body=[],this.expect(y.braceL),e&&this.enterScope(0);this.type!==y.braceR;){var u=this.parseStatement(null);r.body.push(u)}return a&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(r,"BlockStatement")};z.parseFor=function(e,r){return e.init=r,this.expect(y.semi),e.test=this.type===y.semi?null:this.parseExpression(),this.expect(y.semi),e.update=this.type===y.parenR?null:this.parseExpression(),this.expect(y.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};z.parseForIn=function(e,r){var a=this.type===y._in;return this.next(),r.type==="VariableDeclaration"&&r.declarations[0].init!=null&&(!a||this.options.ecmaVersion<8||this.strict||r.kind!=="var"||r.declarations[0].id.type!=="Identifier")&&this.raise(r.start,(a?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=r,e.right=a?this.parseExpression():this.parseMaybeAssign(),this.expect(y.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,a?"ForInStatement":"ForOfStatement")};z.parseVar=function(e,r,a,u){for(e.declarations=[],e.kind=a;;){var l=this.startNode();if(this.parseVarId(l,a),this.eat(y.eq)?l.init=this.parseMaybeAssign(r):!u&&a==="const"&&!(this.type===y._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!u&&l.id.type!=="Identifier"&&!(r&&(this.type===y._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):l.init=null,e.declarations.push(this.finishNode(l,"VariableDeclarator")),!this.eat(y.comma))break}return e};z.parseVarId=function(e,r){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,r==="var"?tc:cn,!1)};var ss=1,Qf=2,Cp=4;z.parseFunction=function(e,r,a,u,l){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!u)&&(this.type===y.star&&r&Qf&&this.unexpected(),e.generator=this.eat(y.star)),this.options.ecmaVersion>=8&&(e.async=!!u),r&ss&&(e.id=r&Cp&&this.type!==y.name?null:this.parseIdent(),e.id&&!(r&Qf)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?tc:cn:_p));var p=this.yieldPos,v=this.awaitPos,C=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ec(e.async,e.generator)),r&ss||(e.id=this.type===y.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,a,!1,l),this.yieldPos=p,this.awaitPos=v,this.awaitIdentPos=C,this.finishNode(e,r&ss?"FunctionDeclaration":"FunctionExpression")};z.parseFunctionParams=function(e){this.expect(y.parenL),e.params=this.parseBindingList(y.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};z.parseClass=function(e,r){this.next();var a=this.strict;this.strict=!0,this.parseClassId(e,r),this.parseClassSuper(e);var u=this.enterClassBody(),l=this.startNode(),p=!1;for(l.body=[],this.expect(y.braceL);this.type!==y.braceR;){var v=this.parseClassElement(e.superClass!==null);v&&(l.body.push(v),v.type==="MethodDefinition"&&v.kind==="constructor"?(p&&this.raiseRecoverable(v.start,"Duplicate constructor in the same class"),p=!0):v.key&&v.key.type==="PrivateIdentifier"&&Pv(u,v)&&this.raiseRecoverable(v.key.start,"Identifier '#"+v.key.name+"' has already been declared"))}return this.strict=a,this.next(),e.body=this.finishNode(l,"ClassBody"),this.exitClassBody(),this.finishNode(e,r?"ClassDeclaration":"ClassExpression")};z.parseClassElement=function(e){if(this.eat(y.semi))return null;var r=this.options.ecmaVersion,a=this.startNode(),u="",l=!1,p=!1,v="method",C=!1;if(this.eatContextual("static")){if(r>=13&&this.eat(y.braceL))return this.parseClassStaticBlock(a),a;this.isClassElementNameStart()||this.type===y.star?C=!0:u="static"}if(a.static=C,!u&&r>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===y.star)&&!this.canInsertSemicolon()?p=!0:u="async"),!u&&(r>=9||!p)&&this.eat(y.star)&&(l=!0),!u&&!p&&!l){var T=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?v=T:u=T)}if(u?(a.computed=!1,a.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),a.key.name=u,this.finishNode(a.key,"Identifier")):this.parseClassElementName(a),r<13||this.type===y.parenL||v!=="method"||l||p){var A=!a.static&&Uo(a,"constructor"),R=A&&e;A&&v!=="method"&&this.raise(a.key.start,"Constructor can't have get/set modifier"),a.kind=A?"constructor":v,this.parseClassMethod(a,l,p,R)}else this.parseClassField(a);return a};z.isClassElementNameStart=function(){return this.type===y.name||this.type===y.privateId||this.type===y.num||this.type===y.string||this.type===y.bracketL||this.type.keyword};z.parseClassElementName=function(e){this.type===y.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};z.parseClassMethod=function(e,r,a,u){var l=e.key;e.kind==="constructor"?(r&&this.raise(l.start,"Constructor can't be a generator"),a&&this.raise(l.start,"Constructor can't be an async method")):e.static&&Uo(e,"prototype")&&this.raise(l.start,"Classes may not have a static property named prototype");var p=e.value=this.parseMethod(r,a,u);return e.kind==="get"&&p.params.length!==0&&this.raiseRecoverable(p.start,"getter should have no params"),e.kind==="set"&&p.params.length!==1&&this.raiseRecoverable(p.start,"setter should have exactly one param"),e.kind==="set"&&p.params[0].type==="RestElement"&&this.raiseRecoverable(p.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};z.parseClassField=function(e){if(Uo(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Uo(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(y.eq)){var r=this.currentThisScope(),a=r.inClassFieldInit;r.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),r.inClassFieldInit=a}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};z.parseClassStaticBlock=function(e){e.body=[];var r=this.labels;for(this.labels=[],this.enterScope(fs|Xf);this.type!==y.braceR;){var a=this.parseStatement(null);e.body.push(a)}return this.next(),this.exitScope(),this.labels=r,this.finishNode(e,"StaticBlock")};z.parseClassId=function(e,r){this.type===y.name?(e.id=this.parseIdent(),r&&this.checkLValSimple(e.id,cn,!1)):(r===!0&&this.unexpected(),e.id=null)};z.parseClassSuper=function(e){e.superClass=this.eat(y._extends)?this.parseExprSubscripts(null,!1):null};z.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};z.exitClassBody=function(){var e=this.privateNameStack.pop(),r=e.declared,a=e.used;if(!!this.options.checkPrivateFields)for(var u=this.privateNameStack.length,l=u===0?null:this.privateNameStack[u-1],p=0;p=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(r,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==y.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};z.parseExport=function(e,r){if(this.next(),this.eat(y.star))return this.parseExportAllDeclaration(e,r);if(this.eat(y._default))return this.checkExport(r,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(r,e.declaration.declarations):this.checkExport(r,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(r),this.eatContextual("from"))this.type!==y.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var a=0,u=e.specifiers;a=13&&this.type===y.string){var e=this.parseLiteral(this.value);return Sv.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};z.adaptDirectivePrologue=function(e){for(var r=0;r=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var hr=ft.prototype;hr.toAssignable=function(e,r,a){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",a&&this.checkPatternErrors(a,!0);for(var u=0,l=e.properties;u=8&&!C&&T.name==="async"&&!this.canInsertSemicolon()&&this.eat(y._function))return this.overrideContext(Ye.f_expr),this.parseFunction(this.startNodeAt(p,v),0,!1,!0,r);if(l&&!this.canInsertSemicolon()){if(this.eat(y.arrow))return this.parseArrowExpression(this.startNodeAt(p,v),[T],!1,r);if(this.options.ecmaVersion>=8&&T.name==="async"&&this.type===y.name&&!C&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return T=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(y.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(p,v),[T],!0,r)}return T;case y.regexp:var A=this.value;return u=this.parseLiteral(A.value),u.regex={pattern:A.pattern,flags:A.flags},u;case y.num:case y.string:return this.parseLiteral(this.value);case y._null:case y._true:case y._false:return u=this.startNode(),u.value=this.type===y._null?null:this.type===y._true,u.raw=this.type.keyword,this.next(),this.finishNode(u,"Literal");case y.parenL:var R=this.start,V=this.parseParenAndDistinguishExpression(l,r);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(V)&&(e.parenthesizedAssign=R),e.parenthesizedBind<0&&(e.parenthesizedBind=R)),V;case y.bracketL:return u=this.startNode(),this.next(),u.elements=this.parseExprList(y.bracketR,!0,!0,e),this.finishNode(u,"ArrayExpression");case y.braceL:return this.overrideContext(Ye.b_expr),this.parseObj(!1,e);case y._function:return u=this.startNode(),this.next(),this.parseFunction(u,0);case y._class:return this.parseClass(this.startNode(),!1);case y._new:return this.parseNew();case y.backQuote:return this.parseTemplate();case y._import:return this.options.ecmaVersion>=11?this.parseExprImport(a):this.unexpected();default:return this.parseExprAtomDefault()}};X.parseExprAtomDefault=function(){this.unexpected()};X.parseExprImport=function(e){var r=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===y.parenL&&!e)return this.parseDynamicImport(r);if(this.type===y.dot){var a=this.startNodeAt(r.start,r.loc&&r.loc.start);return a.name="import",r.meta=this.finishNode(a,"Identifier"),this.parseImportMeta(r)}else this.unexpected()};X.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(y.parenR)){var r=this.start;this.eat(y.comma)&&this.eat(y.parenR)?this.raiseRecoverable(r,"Trailing comma is not allowed in import()"):this.unexpected(r)}return this.finishNode(e,"ImportExpression")};X.parseImportMeta=function(e){this.next();var r=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),r&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};X.parseLiteral=function(e){var r=this.startNode();return r.value=e,r.raw=this.input.slice(this.start,this.end),r.raw.charCodeAt(r.raw.length-1)===110&&(r.bigint=r.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(r,"Literal")};X.parseParenExpression=function(){this.expect(y.parenL);var e=this.parseExpression();return this.expect(y.parenR),e};X.shouldParseArrow=function(e){return!this.canInsertSemicolon()};X.parseParenAndDistinguishExpression=function(e,r){var a=this.start,u=this.startLoc,l,p=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var v=this.start,C=this.startLoc,T=[],A=!0,R=!1,V=new Go,K=this.yieldPos,re=this.awaitPos,N;for(this.yieldPos=0,this.awaitPos=0;this.type!==y.parenR;)if(A?A=!1:this.expect(y.comma),p&&this.afterTrailingComma(y.parenR,!0)){R=!0;break}else if(this.type===y.ellipsis){N=this.start,T.push(this.parseParenItem(this.parseRestBinding())),this.type===y.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else T.push(this.parseMaybeAssign(!1,V,this.parseParenItem));var _e=this.lastTokEnd,Le=this.lastTokEndLoc;if(this.expect(y.parenR),e&&this.shouldParseArrow(T)&&this.eat(y.arrow))return this.checkPatternErrors(V,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=K,this.awaitPos=re,this.parseParenArrowList(a,u,T,r);(!T.length||R)&&this.unexpected(this.lastTokStart),N&&this.unexpected(N),this.checkExpressionErrors(V,!0),this.yieldPos=K||this.yieldPos,this.awaitPos=re||this.awaitPos,T.length>1?(l=this.startNodeAt(v,C),l.expressions=T,this.finishNodeAt(l,"SequenceExpression",_e,Le)):l=T[0]}else l=this.parseParenExpression();if(this.options.preserveParens){var ye=this.startNodeAt(a,u);return ye.expression=l,this.finishNode(ye,"ParenthesizedExpression")}else return l};X.parseParenItem=function(e){return e};X.parseParenArrowList=function(e,r,a,u){return this.parseArrowExpression(this.startNodeAt(e,r),a,!1,u)};var Ev=[];X.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===y.dot){var r=this.startNodeAt(e.start,e.loc&&e.loc.start);r.name="new",e.meta=this.finishNode(r,"Identifier"),this.next();var a=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),a&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var u=this.start,l=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),u,l,!0,!1),this.eat(y.parenL)?e.arguments=this.parseExprList(y.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Ev,this.finishNode(e,"NewExpression")};X.parseTemplateElement=function(e){var r=e.isTagged,a=this.startNode();return this.type===y.invalidTemplate?(r||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),a.value={raw:this.value,cooked:null}):a.value={raw:this.input.slice(this.start,this.end).replace(/\\r\\n?/g,\` +\`),cooked:this.value},this.next(),a.tail=this.type===y.backQuote,this.finishNode(a,"TemplateElement")};X.parseTemplate=function(e){e===void 0&&(e={});var r=e.isTagged;r===void 0&&(r=!1);var a=this.startNode();this.next(),a.expressions=[];var u=this.parseTemplateElement({isTagged:r});for(a.quasis=[u];!u.tail;)this.type===y.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(y.dollarBraceL),a.expressions.push(this.parseExpression()),this.expect(y.braceR),a.quasis.push(u=this.parseTemplateElement({isTagged:r}));return this.next(),this.finishNode(a,"TemplateLiteral")};X.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===y.name||this.type===y.num||this.type===y.string||this.type===y.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===y.star)&&!cr.test(this.input.slice(this.lastTokEnd,this.start))};X.parseObj=function(e,r){var a=this.startNode(),u=!0,l={};for(a.properties=[],this.next();!this.eat(y.braceR);){if(u)u=!1;else if(this.expect(y.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(y.braceR))break;var p=this.parseProperty(e,r);e||this.checkPropClash(p,l,r),a.properties.push(p)}return this.finishNode(a,e?"ObjectPattern":"ObjectExpression")};X.parseProperty=function(e,r){var a=this.startNode(),u,l,p,v;if(this.options.ecmaVersion>=9&&this.eat(y.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===y.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(a.argument=this.parseMaybeAssign(!1,r),this.type===y.comma&&r&&r.trailingComma<0&&(r.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(e||r)&&(p=this.start,v=this.startLoc),e||(u=this.eat(y.star)));var C=this.containsEsc;return this.parsePropertyName(a),!e&&!C&&this.options.ecmaVersion>=8&&!u&&this.isAsyncProp(a)?(l=!0,u=this.options.ecmaVersion>=9&&this.eat(y.star),this.parsePropertyName(a)):l=!1,this.parsePropertyValue(a,e,u,l,p,v,r,C),this.finishNode(a,"Property")};X.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var r=e.kind==="get"?0:1;if(e.value.params.length!==r){var a=e.value.start;e.kind==="get"?this.raiseRecoverable(a,"getter should have no params"):this.raiseRecoverable(a,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};X.parsePropertyValue=function(e,r,a,u,l,p,v,C){(a||u)&&this.type===y.colon&&this.unexpected(),this.eat(y.colon)?(e.value=r?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,v),e.kind="init"):this.options.ecmaVersion>=6&&this.type===y.parenL?(r&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(a,u)):!r&&!C&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==y.comma&&this.type!==y.braceR&&this.type!==y.eq?((a||u)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((a||u)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=l),e.kind="init",r?e.value=this.parseMaybeDefault(l,p,this.copyNode(e.key)):this.type===y.eq&&v?(v.shorthandAssign<0&&(v.shorthandAssign=this.start),e.value=this.parseMaybeDefault(l,p,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};X.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(y.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(y.bracketR),e.key;e.computed=!1}return e.key=this.type===y.num||this.type===y.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};X.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};X.parseMethod=function(e,r,a){var u=this.startNode(),l=this.yieldPos,p=this.awaitPos,v=this.awaitIdentPos;return this.initFunction(u),this.options.ecmaVersion>=6&&(u.generator=e),this.options.ecmaVersion>=8&&(u.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ec(r,u.generator)|Xf|(a?Sp:0)),this.expect(y.parenL),u.params=this.parseBindingList(y.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(u,!1,!0,!1),this.yieldPos=l,this.awaitPos=p,this.awaitIdentPos=v,this.finishNode(u,"FunctionExpression")};X.parseArrowExpression=function(e,r,a,u){var l=this.yieldPos,p=this.awaitPos,v=this.awaitIdentPos;return this.enterScope(ec(a,!1)|vp),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!a),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(r,!0),this.parseFunctionBody(e,!0,!1,u),this.yieldPos=l,this.awaitPos=p,this.awaitIdentPos=v,this.finishNode(e,"ArrowFunctionExpression")};X.parseFunctionBody=function(e,r,a,u){var l=r&&this.type!==y.braceL,p=this.strict,v=!1;if(l)e.body=this.parseMaybeAssign(u),e.expression=!0,this.checkParams(e,!1);else{var C=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!p||C)&&(v=this.strictDirective(this.end),v&&C&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var T=this.labels;this.labels=[],v&&(this.strict=!0),this.checkParams(e,!p&&!v&&!r&&!a&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,kp),e.body=this.parseBlock(!1,void 0,v&&!p),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=T}this.exitScope()};X.isSimpleParamList=function(e){for(var r=0,a=e;r-1||l.functions.indexOf(e)>-1||l.var.indexOf(e)>-1,l.lexical.push(e),this.inModule&&l.flags&us&&delete this.undefinedExports[e]}else if(r===bp){var p=this.currentScope();p.lexical.push(e)}else if(r===_p){var v=this.currentScope();this.treatFunctionsAsVar?u=v.lexical.indexOf(e)>-1:u=v.lexical.indexOf(e)>-1||v.var.indexOf(e)>-1,v.functions.push(e)}else for(var C=this.scopeStack.length-1;C>=0;--C){var T=this.scopeStack[C];if(T.lexical.indexOf(e)>-1&&!(T.flags&wp&&T.lexical[0]===e)||!this.treatFunctionsAsVarInScope(T)&&T.functions.indexOf(e)>-1){u=!0;break}if(T.var.push(e),this.inModule&&T.flags&us&&delete this.undefinedExports[e],T.flags&Jf)break}u&&this.raiseRecoverable(a,"Identifier '"+e+"' has already been declared")};Wn.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};Wn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Wn.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&Jf)return r}};Wn.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&Jf&&!(r.flags&vp))return r}};var zo=function(r,a,u){this.type="",this.start=a,this.end=0,r.options.locations&&(this.loc=new qo(r,u)),r.options.directSourceFile&&(this.sourceFile=r.options.directSourceFile),r.options.ranges&&(this.range=[a,0])},cs=ft.prototype;cs.startNode=function(){return new zo(this,this.start,this.startLoc)};cs.startNodeAt=function(e,r){return new zo(this,e,r)};function Pp(e,r,a,u){return e.type=r,e.end=a,this.options.locations&&(e.loc.end=u),this.options.ranges&&(e.range[1]=a),e}cs.finishNode=function(e,r){return Pp.call(this,e,r,this.lastTokEnd,this.lastTokEndLoc)};cs.finishNodeAt=function(e,r,a,u){return Pp.call(this,e,r,a,u)};cs.copyNode=function(e){var r=new zo(this,e.start,this.startLoc);for(var a in e)r[a]=e[a];return r};var Ep="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Dp=Ep+" Extended_Pictographic",Ip=Dp,Mp=Ip+" EBase EComp EMod EPres ExtPict",Op=Mp,Iv=Op,Mv={9:Ep,10:Dp,11:Ip,12:Mp,13:Op,14:Iv},Ov="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Av={9:"",10:"",11:"",12:"",13:"",14:Ov},fp="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ap="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Fp=Ap+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Np=Fp+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Lp=Np+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Rp=Lp+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Fv=Rp+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",Nv={9:Ap,10:Fp,11:Np,12:Lp,13:Rp,14:Fv},Wp={};function Lv(e){var r=Wp[e]={binary:Ln(Mv[e]+" "+fp),binaryOfStrings:Ln(Av[e]),nonBinary:{General_Category:Ln(fp),Script:Ln(Nv[e])}};r.nonBinary.Script_Extensions=r.nonBinary.Script,r.nonBinary.gc=r.nonBinary.General_Category,r.nonBinary.sc=r.nonBinary.Script,r.nonBinary.scx=r.nonBinary.Script_Extensions}for(Bo=0,zf=[9,10,11,12,13,14];Bo=6?"uy":"")+(r.options.ecmaVersion>=9?"s":"")+(r.options.ecmaVersion>=13?"d":"")+(r.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Wp[r.options.ecmaVersion>=14?14:r.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};Hr.prototype.reset=function(r,a,u){var l=u.indexOf("v")!==-1,p=u.indexOf("u")!==-1;this.start=r|0,this.source=a+"",this.flags=u,l&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=p&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=p&&this.parser.options.ecmaVersion>=9)};Hr.prototype.raise=function(r){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+r)};Hr.prototype.at=function(r,a){a===void 0&&(a=!1);var u=this.source,l=u.length;if(r>=l)return-1;var p=u.charCodeAt(r);if(!(a||this.switchU)||p<=55295||p>=57344||r+1>=l)return p;var v=u.charCodeAt(r+1);return v>=56320&&v<=57343?(p<<10)+v-56613888:p};Hr.prototype.nextIndex=function(r,a){a===void 0&&(a=!1);var u=this.source,l=u.length;if(r>=l)return l;var p=u.charCodeAt(r),v;return!(a||this.switchU)||p<=55295||p>=57344||r+1>=l||(v=u.charCodeAt(r+1))<56320||v>57343?r+1:r+2};Hr.prototype.current=function(r){return r===void 0&&(r=!1),this.at(this.pos,r)};Hr.prototype.lookahead=function(r){return r===void 0&&(r=!1),this.at(this.nextIndex(this.pos,r),r)};Hr.prototype.advance=function(r){r===void 0&&(r=!1),this.pos=this.nextIndex(this.pos,r)};Hr.prototype.eat=function(r,a){return a===void 0&&(a=!1),this.current(a)===r?(this.advance(a),!0):!1};Hr.prototype.eatChars=function(r,a){a===void 0&&(a=!1);for(var u=this.pos,l=0,p=r;l-1&&this.raise(e.start,"Duplicate regular expression flag"),v==="u"&&(u=!0),v==="v"&&(l=!0)}this.options.ecmaVersion>=15&&u&&l&&this.raise(e.start,"Invalid regular expression flag")};U.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};U.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var r=0,a=e.backReferenceNames;r=9&&(a=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!a,!0}return e.pos=r,!1};U.regexp_eatQuantifier=function(e,r){return r===void 0&&(r=!1),this.regexp_eatQuantifierPrefix(e,r)?(e.eat(63),!0):!1};U.regexp_eatQuantifierPrefix=function(e,r){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,r)};U.regexp_eatBracedQuantifier=function(e,r){var a=e.pos;if(e.eat(123)){var u=0,l=-1;if(this.regexp_eatDecimalDigits(e)&&(u=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(l=e.lastIntValue),e.eat(125)))return l!==-1&&l=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};U.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};U.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};U.regexp_eatSyntaxCharacter=function(e){var r=e.current();return Yp(r)?(e.lastIntValue=r,e.advance(),!0):!1};function Yp(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}U.regexp_eatPatternCharacters=function(e){for(var r=e.pos,a=0;(a=e.current())!==-1&&!Yp(a);)e.advance();return e.pos!==r};U.regexp_eatExtendedPatternCharacter=function(e){var r=e.current();return r!==-1&&r!==36&&!(r>=40&&r<=43)&&r!==46&&r!==63&&r!==91&&r!==94&&r!==124?(e.advance(),!0):!1};U.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};U.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};U.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Rn(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Rn(e.lastIntValue);return!0}return!1};U.regexp_eatRegExpIdentifierStart=function(e){var r=e.pos,a=this.options.ecmaVersion>=11,u=e.current(a);return e.advance(a),u===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,a)&&(u=e.lastIntValue),Rv(u)?(e.lastIntValue=u,!0):(e.pos=r,!1)};function Rv(e){return ln(e,!0)||e===36||e===95}U.regexp_eatRegExpIdentifierPart=function(e){var r=e.pos,a=this.options.ecmaVersion>=11,u=e.current(a);return e.advance(a),u===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,a)&&(u=e.lastIntValue),Wv(u)?(e.lastIntValue=u,!0):(e.pos=r,!1)};function Wv(e){return aa(e,!0)||e===36||e===95||e===8204||e===8205}U.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};U.regexp_eatBackReference=function(e){var r=e.pos;if(this.regexp_eatDecimalEscape(e)){var a=e.lastIntValue;if(e.switchU)return a>e.maxBackReference&&(e.maxBackReference=a),!0;if(a<=e.numCapturingParens)return!0;e.pos=r}return!1};U.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};U.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};U.regexp_eatCControlLetter=function(e){var r=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=r}return!1};U.regexp_eatZero=function(e){return e.current()===48&&!$o(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};U.regexp_eatControlEscape=function(e){var r=e.current();return r===116?(e.lastIntValue=9,e.advance(),!0):r===110?(e.lastIntValue=10,e.advance(),!0):r===118?(e.lastIntValue=11,e.advance(),!0):r===102?(e.lastIntValue=12,e.advance(),!0):r===114?(e.lastIntValue=13,e.advance(),!0):!1};U.regexp_eatControlLetter=function(e){var r=e.current();return Bp(r)?(e.lastIntValue=r%32,e.advance(),!0):!1};function Bp(e){return e>=65&&e<=90||e>=97&&e<=122}U.regexp_eatRegExpUnicodeEscapeSequence=function(e,r){r===void 0&&(r=!1);var a=e.pos,u=r||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var l=e.lastIntValue;if(u&&l>=55296&&l<=56319){var p=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var v=e.lastIntValue;if(v>=56320&&v<=57343)return e.lastIntValue=(l-55296)*1024+(v-56320)+65536,!0}e.pos=p,e.lastIntValue=l}return!0}if(u&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Yv(e.lastIntValue))return!0;u&&e.raise("Invalid unicode escape"),e.pos=a}return!1};function Yv(e){return e>=0&&e<=1114111}U.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var r=e.current();return r!==99&&(!e.switchN||r!==107)?(e.lastIntValue=r,e.advance(),!0):!1};U.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var r=e.current();if(r>=49&&r<=57){do e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();while((r=e.current())>=48&&r<=57);return!0}return!1};var Vp=0,fn=1,fr=2;U.regexp_eatCharacterClassEscape=function(e){var r=e.current();if(Bv(r))return e.lastIntValue=-1,e.advance(),fn;var a=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((a=r===80)||r===112)){e.lastIntValue=-1,e.advance();var u;if(e.eat(123)&&(u=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return a&&u===fr&&e.raise("Invalid property name"),u;e.raise("Invalid property name")}return Vp};function Bv(e){return e===100||e===68||e===115||e===83||e===119||e===87}U.regexp_eatUnicodePropertyValueExpression=function(e){var r=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var a=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var u=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,a,u),fn}}if(e.pos=r,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var l=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,l)}return Vp};U.regexp_validateUnicodePropertyNameAndValue=function(e,r,a){ls(e.unicodeProperties.nonBinary,r)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[r].test(a)||e.raise("Invalid property value")};U.regexp_validateUnicodePropertyNameOrValue=function(e,r){if(e.unicodeProperties.binary.test(r))return fn;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(r))return fr;e.raise("Invalid property name")};U.regexp_eatUnicodePropertyName=function(e){var r=0;for(e.lastStringValue="";Up(r=e.current());)e.lastStringValue+=Rn(r),e.advance();return e.lastStringValue!==""};function Up(e){return Bp(e)||e===95}U.regexp_eatUnicodePropertyValue=function(e){var r=0;for(e.lastStringValue="";Vv(r=e.current());)e.lastStringValue+=Rn(r),e.advance();return e.lastStringValue!==""};function Vv(e){return Up(e)||$o(e)}U.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};U.regexp_eatCharacterClass=function(e){if(e.eat(91)){var r=e.eat(94),a=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),r&&a===fr&&e.raise("Negated character class may contain strings"),!0}return!1};U.regexp_classContents=function(e){return e.current()===93?fn:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),fn)};U.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var r=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var a=e.lastIntValue;e.switchU&&(r===-1||a===-1)&&e.raise("Invalid character class"),r!==-1&&a!==-1&&r>a&&e.raise("Range out of order in character class")}}};U.regexp_eatClassAtom=function(e){var r=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var a=e.current();(a===99||Gp(a))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=r}var u=e.current();return u!==93?(e.lastIntValue=u,e.advance(),!0):!1};U.regexp_eatClassEscape=function(e){var r=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=r}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};U.regexp_classSetExpression=function(e){var r=fn,a;if(!this.regexp_eatClassSetRange(e))if(a=this.regexp_eatClassSetOperand(e)){a===fr&&(r=fr);for(var u=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(a=this.regexp_eatClassSetOperand(e))){a!==fr&&(r=fn);continue}e.raise("Invalid character in character class")}if(u!==e.pos)return r;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(u!==e.pos)return r}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(a=this.regexp_eatClassSetOperand(e),!a)return r;a===fr&&(r=fr)}};U.regexp_eatClassSetRange=function(e){var r=e.pos;if(this.regexp_eatClassSetCharacter(e)){var a=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var u=e.lastIntValue;return a!==-1&&u!==-1&&a>u&&e.raise("Range out of order in character class"),!0}e.pos=r}return!1};U.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?fn:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};U.regexp_eatNestedClass=function(e){var r=e.pos;if(e.eat(91)){var a=e.eat(94),u=this.regexp_classContents(e);if(e.eat(93))return a&&u===fr&&e.raise("Negated character class may contain strings"),u;e.pos=r}if(e.eat(92)){var l=this.regexp_eatCharacterClassEscape(e);if(l)return l;e.pos=r}return null};U.regexp_eatClassStringDisjunction=function(e){var r=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var a=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return a}else e.raise("Invalid escape");e.pos=r}return null};U.regexp_classStringDisjunctionContents=function(e){for(var r=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===fr&&(r=fr);return r};U.regexp_classString=function(e){for(var r=0;this.regexp_eatClassSetCharacter(e);)r++;return r===1?fn:fr};U.regexp_eatClassSetCharacter=function(e){var r=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=r,!1);var a=e.current();return a<0||a===e.lookahead()&&Uv(a)||Hv(a)?!1:(e.advance(),e.lastIntValue=a,!0)};function Uv(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Hv(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}U.regexp_eatClassSetReservedPunctuator=function(e){var r=e.current();return qv(r)?(e.lastIntValue=r,e.advance(),!0):!1};function qv(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}U.regexp_eatClassControlLetter=function(e){var r=e.current();return $o(r)||r===95?(e.lastIntValue=r%32,e.advance(),!0):!1};U.regexp_eatHexEscapeSequence=function(e){var r=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=r}return!1};U.regexp_eatDecimalDigits=function(e){var r=e.pos,a=0;for(e.lastIntValue=0;$o(a=e.current());)e.lastIntValue=10*e.lastIntValue+(a-48),e.advance();return e.pos!==r};function $o(e){return e>=48&&e<=57}U.regexp_eatHexDigits=function(e){var r=e.pos,a=0;for(e.lastIntValue=0;Hp(a=e.current());)e.lastIntValue=16*e.lastIntValue+qp(a),e.advance();return e.pos!==r};function Hp(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function qp(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}U.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var a=e.lastIntValue;r<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=r*64+a*8+e.lastIntValue:e.lastIntValue=r*8+a}else e.lastIntValue=r;return!0}return!1};U.regexp_eatOctalDigit=function(e){var r=e.current();return Gp(r)?(e.lastIntValue=r-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Gp(e){return e>=48&&e<=55}U.regexp_eatFixedHexDigits=function(e,r){var a=e.pos;e.lastIntValue=0;for(var u=0;u=this.input.length)return this.finishToken(y.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};ce.readToken=function(e){return ln(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};ce.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var r=this.input.charCodeAt(this.pos+1);return r<=56319||r>=57344?e:(e<<10)+r-56613888};ce.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),r=this.pos,a=this.input.indexOf("*/",this.pos+=2);if(a===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=a+2,this.options.locations)for(var u=void 0,l=r;(u=dp(this.input,l,this.pos))>-1;)++this.curLine,l=this.lineStart=u;this.options.onComment&&this.options.onComment(!0,this.input.slice(r+2,a),r,this.pos,e,this.curPosition())};ce.skipLineComment=function(e){for(var r=this.pos,a=this.options.onComment&&this.curPosition(),u=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&mp.test(String.fromCharCode(e)))++this.pos;else break e}}};ce.finishToken=function(e,r){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var a=this.type;this.type=e,this.value=r,this.updateContext(a)};ce.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var r=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&r===46?(this.pos+=3,this.finishToken(y.ellipsis)):(++this.pos,this.finishToken(y.dot))};ce.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(y.assign,2):this.finishOp(y.slash,1)};ce.readToken_mult_modulo_exp=function(e){var r=this.input.charCodeAt(this.pos+1),a=1,u=e===42?y.star:y.modulo;return this.options.ecmaVersion>=7&&e===42&&r===42&&(++a,u=y.starstar,r=this.input.charCodeAt(this.pos+2)),r===61?this.finishOp(y.assign,a+1):this.finishOp(u,a)};ce.readToken_pipe_amp=function(e){var r=this.input.charCodeAt(this.pos+1);if(r===e){if(this.options.ecmaVersion>=12){var a=this.input.charCodeAt(this.pos+2);if(a===61)return this.finishOp(y.assign,3)}return this.finishOp(e===124?y.logicalOR:y.logicalAND,2)}return r===61?this.finishOp(y.assign,2):this.finishOp(e===124?y.bitwiseOR:y.bitwiseAND,1)};ce.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(y.assign,2):this.finishOp(y.bitwiseXOR,1)};ce.readToken_plus_min=function(e){var r=this.input.charCodeAt(this.pos+1);return r===e?r===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||cr.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(y.incDec,2):r===61?this.finishOp(y.assign,2):this.finishOp(y.plusMin,1)};ce.readToken_lt_gt=function(e){var r=this.input.charCodeAt(this.pos+1),a=1;return r===e?(a=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+a)===61?this.finishOp(y.assign,a+1):this.finishOp(y.bitShift,a)):r===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(r===61&&(a=2),this.finishOp(y.relational,a))};ce.readToken_eq_excl=function(e){var r=this.input.charCodeAt(this.pos+1);return r===61?this.finishOp(y.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&r===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(y.arrow)):this.finishOp(e===61?y.eq:y.prefix,1)};ce.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var r=this.input.charCodeAt(this.pos+1);if(r===46){var a=this.input.charCodeAt(this.pos+2);if(a<48||a>57)return this.finishOp(y.questionDot,2)}if(r===63){if(e>=12){var u=this.input.charCodeAt(this.pos+2);if(u===61)return this.finishOp(y.assign,3)}return this.finishOp(y.coalesce,2)}}return this.finishOp(y.question,1)};ce.readToken_numberSign=function(){var e=this.options.ecmaVersion,r=35;if(e>=13&&(++this.pos,r=this.fullCharCodeAtPos(),ln(r,!0)||r===92))return this.finishToken(y.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Rn(r)+"'")};ce.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(y.parenL);case 41:return++this.pos,this.finishToken(y.parenR);case 59:return++this.pos,this.finishToken(y.semi);case 44:return++this.pos,this.finishToken(y.comma);case 91:return++this.pos,this.finishToken(y.bracketL);case 93:return++this.pos,this.finishToken(y.bracketR);case 123:return++this.pos,this.finishToken(y.braceL);case 125:return++this.pos,this.finishToken(y.braceR);case 58:return++this.pos,this.finishToken(y.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(y.backQuote);case 48:var r=this.input.charCodeAt(this.pos+1);if(r===120||r===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(r===111||r===79)return this.readRadixNumber(8);if(r===98||r===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(y.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Rn(e)+"'")};ce.finishOp=function(e,r){var a=this.input.slice(this.pos,this.pos+r);return this.pos+=r,this.finishToken(e,a)};ce.readRegexp=function(){for(var e,r,a=this.pos;;){this.pos>=this.input.length&&this.raise(a,"Unterminated regular expression");var u=this.input.charAt(this.pos);if(cr.test(u)&&this.raise(a,"Unterminated regular expression"),e)e=!1;else{if(u==="[")r=!0;else if(u==="]"&&r)r=!1;else if(u==="/"&&!r)break;e=u==="\\\\"}++this.pos}var l=this.input.slice(a,this.pos);++this.pos;var p=this.pos,v=this.readWord1();this.containsEsc&&this.unexpected(p);var C=this.regexpState||(this.regexpState=new Hr(this));C.reset(a,l,v),this.validateRegExpFlags(C),this.validateRegExpPattern(C);var T=null;try{T=new RegExp(l,v)}catch{}return this.finishToken(y.regexp,{pattern:l,flags:v,value:T})};ce.readInt=function(e,r,a){for(var u=this.options.ecmaVersion>=12&&r===void 0,l=a&&this.input.charCodeAt(this.pos)===48,p=this.pos,v=0,C=0,T=0,A=r??1/0;T=97?V=R-97+10:R>=65?V=R-65+10:R>=48&&R<=57?V=R-48:V=1/0,V>=e)break;C=R,v=v*e+V}return u&&C===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===p||r!=null&&this.pos-p!==r?null:v};function Gv(e,r){return r?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function zp(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}ce.readRadixNumber=function(e){var r=this.pos;this.pos+=2;var a=this.readInt(e);return a==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(a=zp(this.input.slice(r,this.pos)),++this.pos):ln(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(y.num,a)};ce.readNumber=function(e){var r=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(r,"Invalid number");var a=this.pos-r>=2&&this.input.charCodeAt(r)===48;a&&this.strict&&this.raise(r,"Invalid number");var u=this.input.charCodeAt(this.pos);if(!a&&!e&&this.options.ecmaVersion>=11&&u===110){var l=zp(this.input.slice(r,this.pos));return++this.pos,ln(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(y.num,l)}a&&/[89]/.test(this.input.slice(r,this.pos))&&(a=!1),u===46&&!a&&(++this.pos,this.readInt(10),u=this.input.charCodeAt(this.pos)),(u===69||u===101)&&!a&&(u=this.input.charCodeAt(++this.pos),(u===43||u===45)&&++this.pos,this.readInt(10)===null&&this.raise(r,"Invalid number")),ln(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var p=Gv(this.input.slice(r,this.pos),a);return this.finishToken(y.num,p)};ce.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),r;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var a=++this.pos;r=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,r>1114111&&this.invalidStringToken(a,"Code point out of bounds")}else r=this.readHexChar(4);return r};ce.readString=function(e){for(var r="",a=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var u=this.input.charCodeAt(this.pos);if(u===e)break;u===92?(r+=this.input.slice(a,this.pos),r+=this.readEscapedChar(!1),a=this.pos):u===8232||u===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(sa(u)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return r+=this.input.slice(a,this.pos++),this.finishToken(y.string,r)};var $p={};ce.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===$p)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};ce.invalidStringToken=function(e,r){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw $p;this.raise(e,r)};ce.readTmplToken=function(){for(var e="",r=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var a=this.input.charCodeAt(this.pos);if(a===96||a===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===y.template||this.type===y.invalidTemplate)?a===36?(this.pos+=2,this.finishToken(y.dollarBraceL)):(++this.pos,this.finishToken(y.backQuote)):(e+=this.input.slice(r,this.pos),this.finishToken(y.template,e));if(a===92)e+=this.input.slice(r,this.pos),e+=this.readEscapedChar(!0),r=this.pos;else if(sa(a)){switch(e+=this.input.slice(r,this.pos),++this.pos,a){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=\` +\`;break;default:e+=String.fromCharCode(a);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),r=this.pos}else++this.pos}};ce.readInvalidTemplateToken=function(){for(;this.pos=48&&r<=55){var u=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],l=parseInt(u,8);return l>255&&(u=u.slice(0,-1),l=parseInt(u,8)),this.pos+=u.length-1,r=this.input.charCodeAt(this.pos),(u!=="0"||r===56||r===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-u.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(l)}return sa(r)?"":String.fromCharCode(r)}};ce.readHexChar=function(e){var r=this.pos,a=this.readInt(16,e);return a===null&&this.invalidStringToken(r,"Bad character escape sequence"),a};ce.readWord1=function(){this.containsEsc=!1;for(var e="",r=!0,a=this.pos,u=this.options.ecmaVersion>=6;this.pos":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},di=17;function la(e,r){let{generator:a}=e;if(e.write("("),r!=null&&r.length>0){a[r[0].type](r[0],e);let{length:u}=r;for(let l=1;l0){e.write(u);for(let v=1;v0){a.VariableDeclarator(u[0],e);for(let p=1;p0){r.write(u),l&&e.comments!=null&&Tt(r,e.comments,p,u);let{length:C}=v;for(let T=0;T0){for(;l0&&r.write(", ");let p=a[l],v=p.type[6];if(v==="D")r.write(p.local.name,p),l++;else if(v==="N")r.write("* as "+p.local.name,p),l++;else break}if(l0)for(let l=0;;){let p=a[l],{name:v}=p.local;if(r.write(v,p),v!==p.exported.name&&r.write(" as "+p.exported.name),++l "),e.body.type[0]==="O"?(r.write("("),this.ObjectExpression(e.body,r),r.write(")")):this[e.body.type](e.body,r)},ThisExpression(e,r){r.write("this",e)},Super(e,r){r.write("super",e)},RestElement:Zp=function(e,r){r.write("..."),this[e.argument.type](e.argument,r)},SpreadElement:Zp,YieldExpression(e,r){r.write(e.delegate?"yield*":"yield"),e.argument&&(r.write(" "),this[e.argument.type](e.argument,r))},AwaitExpression(e,r){r.write("await ",e),Qo(r,e.argument,e)},TemplateLiteral(e,r){let{quasis:a,expressions:u}=e;r.write("\`");let{length:l}=u;for(let v=0;v0){let{elements:a}=e,{length:u}=a;for(let l=0;;){let p=a[l];if(p!=null&&this[p.type](p,r),++l0){r.write(u),l&&e.comments!=null&&Tt(r,e.comments,p,u);let v=","+u,{properties:C}=e,{length:T}=C;for(let A=0;;){let R=C[A];if(l&&R.comments!=null&&Tt(r,R.comments,p,u),r.write(p),this[R.type](R,r),++A0){let{properties:a}=e,{length:u}=a;for(let l=0;this[a[l].type](a[l],r),++l1||l[0]==="U"&&(l[1]==="n"||l[1]==="p")&&u.prefix&&u.operator[0]===a&&(a==="+"||a==="-"))&&r.write(" "),p?(r.write(a.length>1?" (":"("),this[l](u,r),r.write(")")):this[l](u,r)}else this[e.argument.type](e.argument,r),r.write(e.operator)},UpdateExpression(e,r){e.prefix?(r.write(e.operator),this[e.argument.type](e.argument,r)):(this[e.argument.type](e.argument,r),r.write(e.operator))},AssignmentExpression(e,r){this[e.left.type](e.left,r),r.write(" "+e.operator+" "),this[e.right.type](e.right,r)},AssignmentPattern(e,r){this[e.left.type](e.left,r),r.write(" = "),this[e.right.type](e.right,r)},BinaryExpression:Xp=function(e,r){let a=e.operator==="in";a&&r.write("("),Qo(r,e.left,e,!1),r.write(" "+e.operator+" "),Qo(r,e.right,e,!0),a&&r.write(")")},LogicalExpression:Xp,ConditionalExpression(e,r){let{test:a}=e,u=r.expressionsPrecedence[a.type];u===di||u<=r.expressionsPrecedence.ConditionalExpression?(r.write("("),this[a.type](a,r),r.write(")")):this[a.type](a,r),r.write(" ? "),this[e.consequent.type](e.consequent,r),r.write(" : "),this[e.alternate.type](e.alternate,r)},NewExpression(e,r){r.write("new ");let a=r.expressionsPrecedence[e.callee.type];a===di||a{let{payload:r,job:a}=e.data,u;a.type=="path"?u=rd(r):a.type=="context"?u=nd(r):a.type=="frames"?u=ad(r):a.type=="paths"&&(u=id(r));try{postMessage({job:a,result:u})}catch(l){console.log(l),postMessage({job:a,result:{$error:\`Failed to index \${a.type} \${a.path}: \${l}\`}})}}; +\`,v):(e.write("/*"),Kv(e,v.value,a,u),e.write("*/"+u))}}function Zv(e){let r=e;for(;r!=null;){let{type:a}=r;if(a[0]==="C"&&a[1]==="a")return!0;if(a[0]==="M"&&a[1]==="e"&&a[2]==="m")r=r.object;else return!1}}function ac(e,r){let{generator:a}=e,{declarations:u}=r;e.write(r.kind+" ");let{length:l}=u;if(l>0){a.VariableDeclarator(u[0],e);for(let p=1;p0){r.write(u),l&&e.comments!=null&&Tt(r,e.comments,p,u);let{length:C}=v;for(let T=0;T0){for(;l0&&r.write(", ");let p=a[l],v=p.type[6];if(v==="D")r.write(p.local.name,p),l++;else if(v==="N")r.write("* as "+p.local.name,p),l++;else break}if(l0)for(let l=0;;){let p=a[l],{name:v}=p.local;if(r.write(v,p),v!==p.exported.name&&r.write(" as "+p.exported.name),++l "),e.body.type[0]==="O"?(r.write("("),this.ObjectExpression(e.body,r),r.write(")")):this[e.body.type](e.body,r)},ThisExpression(e,r){r.write("this",e)},Super(e,r){r.write("super",e)},RestElement:Zp=function(e,r){r.write("..."),this[e.argument.type](e.argument,r)},SpreadElement:Zp,YieldExpression(e,r){r.write(e.delegate?"yield*":"yield"),e.argument&&(r.write(" "),this[e.argument.type](e.argument,r))},AwaitExpression(e,r){r.write("await ",e),Qo(r,e.argument,e)},TemplateLiteral(e,r){let{quasis:a,expressions:u}=e;r.write("\`");let{length:l}=u;for(let v=0;v0){let{elements:a}=e,{length:u}=a;for(let l=0;;){let p=a[l];if(p!=null&&this[p.type](p,r),++l0){r.write(u),l&&e.comments!=null&&Tt(r,e.comments,p,u);let v=","+u,{properties:C}=e,{length:T}=C;for(let A=0;;){let R=C[A];if(l&&R.comments!=null&&Tt(r,R.comments,p,u),r.write(p),this[R.type](R,r),++A0){let{properties:a}=e,{length:u}=a;for(let l=0;this[a[l].type](a[l],r),++l1||l[0]==="U"&&(l[1]==="n"||l[1]==="p")&&u.prefix&&u.operator[0]===a&&(a==="+"||a==="-"))&&r.write(" "),p?(r.write(a.length>1?" (":"("),this[l](u,r),r.write(")")):this[l](u,r)}else this[e.argument.type](e.argument,r),r.write(e.operator)},UpdateExpression(e,r){e.prefix?(r.write(e.operator),this[e.argument.type](e.argument,r)):(this[e.argument.type](e.argument,r),r.write(e.operator))},AssignmentExpression(e,r){this[e.left.type](e.left,r),r.write(" "+e.operator+" "),this[e.right.type](e.right,r)},AssignmentPattern(e,r){this[e.left.type](e.left,r),r.write(" = "),this[e.right.type](e.right,r)},BinaryExpression:Xp=function(e,r){let a=e.operator==="in";a&&r.write("("),Qo(r,e.left,e,!1),r.write(" "+e.operator+" "),Qo(r,e.right,e,!0),a&&r.write(")")},LogicalExpression:Xp,ConditionalExpression(e,r){let{test:a}=e,u=r.expressionsPrecedence[a.type];u===di||u<=r.expressionsPrecedence.ConditionalExpression?(r.write("("),this[a.type](a,r),r.write(")")):this[a.type](a,r),r.write(" ? "),this[e.consequent.type](e.consequent,r),r.write(" : "),this[e.alternate.type](e.alternate,r)},NewExpression(e,r){r.write("new ");let a=r.expressionsPrecedence[e.callee.type];a===di||a{let{payload:r,job:a}=e.data,u;a.type=="path"?u=rd(r):a.type=="context"?u=nd(r):a.type=="frames"?u=ad(r):a.type=="paths"&&(u=id(r));try{postMessage({job:a,result:u})}catch(l){console.log(l),postMessage({job:a,result:{$error:\`Failed to index \${a.type} \${a.path}: \${l}\`}})}}; /** * @license * Lodash @@ -88158,6 +88384,7 @@ var Indexer = class { this.busy[workerId] = true; return; } + const dbExists = await this.cache.spaceManager.spaceInitiated(space2.path); this.cache.spaceManager.readAllTables(space2.path).then((mdb) => { this.message(workerId, { job, @@ -88165,7 +88392,8 @@ var Indexer = class { space: space2, mdb, paths: [...this.cache.spacesMap.getInverse(job.path)], - oldCache: this.cache.contextsIndex.get(job.path) + oldCache: this.cache.contextsIndex.get(job.path), + dbExists } }); this.busy[workerId] = true; @@ -88213,10 +88441,10 @@ var Indexer = class { // src/core/superstate/workers/runner.worker.ts function Worker3() { - return inlineWorker(`"use strict";var e8=Object.create;var od=Object.defineProperty;var r8=Object.getOwnPropertyDescriptor;var t8=Object.getOwnPropertyNames;var n8=Object.getPrototypeOf,i8=Object.prototype.hasOwnProperty;var un=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),a8=(e,r)=>{for(var t in r)od(e,t,{get:r[t],enumerable:!0})},o8=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of t8(r))!i8.call(e,i)&&i!==t&&od(e,i,{get:()=>r[i],enumerable:!(n=r8(r,i))||n.enumerable});return e};var li=(e,r,t)=>(t=e!=null?e8(n8(e)):{},o8(r||!e||!e.__esModule?od(t,"default",{value:e,enumerable:!0}):t,e));var sd=un((qs,ff)=>{(function(){var e,r="4.17.21",t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid \`variable\` option passed into \`_.template\`",s="__lodash_hash_undefined__",c=500,f="__lodash_placeholder__",o=1,u=2,p=4,h=1,d=2,x=1,v=2,y=4,w=8,C=16,b=32,A=64,E=128,S=256,O=512,F=30,M="...",_=800,k=16,L=1,Y=2,$=3,V=1/0,q=9007199254740991,R=17976931348623157e292,j=0/0,U=4294967295,oe=U-1,me=U>>>1,ie=[["ary",E],["bind",x],["bindKey",v],["curry",w],["curryRight",C],["flip",O],["partial",b],["partialRight",A],["rearg",S]],H="[object Arguments]",ce="[object Array]",Me="[object AsyncFunction]",pe="[object Boolean]",ge="[object Date]",Se="[object DOMException]",xe="[object Error]",be="[object Function]",De="[object GeneratorFunction]",Ae="[object Map]",ze="[object Number]",Ze="[object Null]",K="[object Object]",te="[object Promise]",ye="[object Proxy]",ee="[object RegExp]",ne="[object Set]",ue="[object String]",Ee="[object Symbol]",Ce="[object Undefined]",Le="[object WeakMap]",Ie="[object WeakSet]",sr="[object ArrayBuffer]",ir="[object DataView]",Xe="[object Float32Array]",Or="[object Float64Array]",re="[object Int8Array]",le="[object Int16Array]",we="[object Int32Array]",Oe="[object Uint8Array]",ke="[object Uint8ClampedArray]",_e="[object Uint16Array]",Pe="[object Uint32Array]",We=/\\b__p \\+= '';/g,B=/\\b(__p \\+=) '' \\+/g,Q=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g,ve=/&(?:amp|lt|gt|quot|#39);/g,Be=/[&<>"']/g,er=RegExp(ve.source),fr=RegExp(Be.source),Zr=/<%-([\\s\\S]+?)%>/g,_t=/<%([\\s\\S]+?)%>/g,Yt=/<%=([\\s\\S]+?)%>/g,Zi=/\\.|\\[(?:[^[\\]]*|(["'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,Ai=/^\\w*$/,wu=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,Ei=/[\\\\^$.*+?()[\\]{}|]/g,Va=RegExp(Ei.source),rr=/^\\s+/,Du=/\\s/,Su=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,nn=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,Co=/,? & /,nt=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,va=/[()=,{}\\[\\]\\/\\s]/,Nu=/\\\\(\\\\)?/g,zt=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,En=/\\w*$/,Cn=/^[-+]0x[0-9a-f]+$/i,At=/^0b[01]+$/i,gn=/^\\[object .+?Constructor\\]$/,Wn=/^0o[0-7]+$/i,Ci=/^(?:0|[1-9]\\d*)$/,Au=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,Ya=/($^)/,Eu=/['\\n\\r\\u2028\\u2029\\\\]/g,pt="\\\\ud800-\\\\udfff",Ha="\\\\u0300-\\\\u036f",Cu="\\\\ufe20-\\\\ufe2f",us="\\\\u20d0-\\\\u20ff",Mo=Ha+Cu+us,fs="\\\\u2700-\\\\u27bf",ls="a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff",ga="\\\\xac\\\\xb1\\\\xd7\\\\xf7",Kr="\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf",jt="\\\\u2000-\\\\u206f",Mu=" \\\\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",Qi="A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde",Mi="\\\\ufe0e\\\\ufe0f",cs=ga+Kr+jt+Mu,_u="['\\u2019]",nm="["+pt+"]",Tu="["+cs+"]",Xi="["+Mo+"]",Fu="\\\\d+",im="["+fs+"]",Pf="["+ls+"]",Ga="[^"+pt+cs+Fu+fs+ls+Qi+"]",$a="\\\\ud83c[\\\\udffb-\\\\udfff]",kf="(?:"+Xi+"|"+$a+")",Za="[^"+pt+"]",Vn="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",Ou="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",Qa="["+Qi+"]",Rf="\\\\u200d",Lf="(?:"+Pf+"|"+Ga+")",am="(?:"+Qa+"|"+Ga+")",qf="(?:"+_u+"(?:d|ll|m|re|s|t|ve))?",Uf="(?:"+_u+"(?:D|LL|M|RE|S|T|VE))?",zf=kf+"?",ps="["+Mi+"]?",om="(?:"+Rf+"(?:"+[Za,Vn,Ou].join("|")+")"+ps+zf+")*",Wf="\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])",sm="\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])",Vf=ps+zf+om,um="(?:"+[im,Vn,Ou].join("|")+")"+Vf,fm="(?:"+[Za+Xi+"?",Xi,Vn,Ou,nm].join("|")+")",lm=RegExp(_u,"g"),cm=RegExp(Xi,"g"),Bu=RegExp($a+"(?="+$a+")|"+fm+Vf,"g"),pm=RegExp([Qa+"?"+Pf+"+"+qf+"(?="+[Tu,Qa,"$"].join("|")+")",am+"+"+Uf+"(?="+[Tu,Qa+Lf,"$"].join("|")+")",Qa+"?"+Lf+"+"+qf,Qa+"+"+Uf,sm,Wf,Fu,um].join("|"),"g"),mm=RegExp("["+Rf+pt+Mo+Mi+"]"),hm=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,dm=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],vm=-1,dt={};dt[Xe]=dt[Or]=dt[re]=dt[le]=dt[we]=dt[Oe]=dt[ke]=dt[_e]=dt[Pe]=!0,dt[H]=dt[ce]=dt[sr]=dt[pe]=dt[ir]=dt[ge]=dt[xe]=dt[be]=dt[Ae]=dt[ze]=dt[K]=dt[ee]=dt[ne]=dt[ue]=dt[Le]=!1;var mt={};mt[H]=mt[ce]=mt[sr]=mt[ir]=mt[pe]=mt[ge]=mt[Xe]=mt[Or]=mt[re]=mt[le]=mt[we]=mt[Ae]=mt[ze]=mt[K]=mt[ee]=mt[ne]=mt[ue]=mt[Ee]=mt[Oe]=mt[ke]=mt[_e]=mt[Pe]=!0,mt[xe]=mt[be]=mt[Le]=!1;var gm={\\u00C0:"A",\\u00C1:"A",\\u00C2:"A",\\u00C3:"A",\\u00C4:"A",\\u00C5:"A",\\u00E0:"a",\\u00E1:"a",\\u00E2:"a",\\u00E3:"a",\\u00E4:"a",\\u00E5:"a",\\u00C7:"C",\\u00E7:"c",\\u00D0:"D",\\u00F0:"d",\\u00C8:"E",\\u00C9:"E",\\u00CA:"E",\\u00CB:"E",\\u00E8:"e",\\u00E9:"e",\\u00EA:"e",\\u00EB:"e",\\u00CC:"I",\\u00CD:"I",\\u00CE:"I",\\u00CF:"I",\\u00EC:"i",\\u00ED:"i",\\u00EE:"i",\\u00EF:"i",\\u00D1:"N",\\u00F1:"n",\\u00D2:"O",\\u00D3:"O",\\u00D4:"O",\\u00D5:"O",\\u00D6:"O",\\u00D8:"O",\\u00F2:"o",\\u00F3:"o",\\u00F4:"o",\\u00F5:"o",\\u00F6:"o",\\u00F8:"o",\\u00D9:"U",\\u00DA:"U",\\u00DB:"U",\\u00DC:"U",\\u00F9:"u",\\u00FA:"u",\\u00FB:"u",\\u00FC:"u",\\u00DD:"Y",\\u00FD:"y",\\u00FF:"y",\\u00C6:"Ae",\\u00E6:"ae",\\u00DE:"Th",\\u00FE:"th",\\u00DF:"ss",\\u0100:"A",\\u0102:"A",\\u0104:"A",\\u0101:"a",\\u0103:"a",\\u0105:"a",\\u0106:"C",\\u0108:"C",\\u010A:"C",\\u010C:"C",\\u0107:"c",\\u0109:"c",\\u010B:"c",\\u010D:"c",\\u010E:"D",\\u0110:"D",\\u010F:"d",\\u0111:"d",\\u0112:"E",\\u0114:"E",\\u0116:"E",\\u0118:"E",\\u011A:"E",\\u0113:"e",\\u0115:"e",\\u0117:"e",\\u0119:"e",\\u011B:"e",\\u011C:"G",\\u011E:"G",\\u0120:"G",\\u0122:"G",\\u011D:"g",\\u011F:"g",\\u0121:"g",\\u0123:"g",\\u0124:"H",\\u0126:"H",\\u0125:"h",\\u0127:"h",\\u0128:"I",\\u012A:"I",\\u012C:"I",\\u012E:"I",\\u0130:"I",\\u0129:"i",\\u012B:"i",\\u012D:"i",\\u012F:"i",\\u0131:"i",\\u0134:"J",\\u0135:"j",\\u0136:"K",\\u0137:"k",\\u0138:"k",\\u0139:"L",\\u013B:"L",\\u013D:"L",\\u013F:"L",\\u0141:"L",\\u013A:"l",\\u013C:"l",\\u013E:"l",\\u0140:"l",\\u0142:"l",\\u0143:"N",\\u0145:"N",\\u0147:"N",\\u014A:"N",\\u0144:"n",\\u0146:"n",\\u0148:"n",\\u014B:"n",\\u014C:"O",\\u014E:"O",\\u0150:"O",\\u014D:"o",\\u014F:"o",\\u0151:"o",\\u0154:"R",\\u0156:"R",\\u0158:"R",\\u0155:"r",\\u0157:"r",\\u0159:"r",\\u015A:"S",\\u015C:"S",\\u015E:"S",\\u0160:"S",\\u015B:"s",\\u015D:"s",\\u015F:"s",\\u0161:"s",\\u0162:"T",\\u0164:"T",\\u0166:"T",\\u0163:"t",\\u0165:"t",\\u0167:"t",\\u0168:"U",\\u016A:"U",\\u016C:"U",\\u016E:"U",\\u0170:"U",\\u0172:"U",\\u0169:"u",\\u016B:"u",\\u016D:"u",\\u016F:"u",\\u0171:"u",\\u0173:"u",\\u0174:"W",\\u0175:"w",\\u0176:"Y",\\u0177:"y",\\u0178:"Y",\\u0179:"Z",\\u017B:"Z",\\u017D:"Z",\\u017A:"z",\\u017C:"z",\\u017E:"z",\\u0132:"IJ",\\u0133:"ij",\\u0152:"Oe",\\u0153:"oe",\\u0149:"'n",\\u017F:"s"},Iu={"&":"&","<":"<",">":">",'"':""","'":"'"},Pu={"&":"&","<":"<",">":">",""":'"',"'":"'"},xm={"\\\\":"\\\\","'":"'","\\n":"n","\\r":"r","\\u2028":"u2028","\\u2029":"u2029"},Yf=parseFloat,Hf=parseInt,Gf=typeof global=="object"&&global&&global.Object===Object&&global,ym=typeof self=="object"&&self&&self.Object===Object&&self,Wt=Gf||ym||Function("return this")(),ku=typeof qs=="object"&&qs&&!qs.nodeType&&qs,Ji=ku&&typeof ff=="object"&&ff&&!ff.nodeType&&ff,vt=Ji&&Ji.exports===ku,xa=vt&&Gf.process,en=function(){try{var he=Ji&&Ji.require&&Ji.require("util").types;return he||xa&&xa.binding&&xa.binding("util")}catch{}}(),$f=en&&en.isArrayBuffer,Ru=en&&en.isDate,Zf=en&&en.isMap,Qf=en&&en.isRegExp,_o=en&&en.isSet,_i=en&&en.isTypedArray;function an(he,Fe,Ne){switch(Ne.length){case 0:return he.call(Fe);case 1:return he.call(Fe,Ne[0]);case 2:return he.call(Fe,Ne[0],Ne[1]);case 3:return he.call(Fe,Ne[0],Ne[1],Ne[2])}return he.apply(Fe,Ne)}function bm(he,Fe,Ne,nr){for(var Nr=-1,jr=he==null?0:he.length;++Nr-1}function Lu(he,Fe,Ne){for(var nr=-1,Nr=he==null?0:he.length;++nr-1;);return Ne}function tl(he,Fe){for(var Ne=he.length;Ne--&&Xa(Fe,he[Ne],0)>-1;);return Ne}function Em(he,Fe){for(var Ne=he.length,nr=0;Ne--;)he[Ne]===Fe&&++nr;return nr}var nl=To(gm),Cm=To(Iu);function Mm(he){return"\\\\"+xm[he]}function _m(he,Fe){return he==null?e:he[Fe]}function ti(he){return mm.test(he)}function Tm(he){return hm.test(he)}function Fm(he){for(var Fe,Ne=[];!(Fe=he.next()).done;)Ne.push(Fe.value);return Ne}function Gu(he){var Fe=-1,Ne=Array(he.size);return he.forEach(function(nr,Nr){Ne[++Fe]=[Nr,nr]}),Ne}function Fo(he,Fe){return function(Ne){return he(Fe(Ne))}}function Yn(he,Fe){for(var Ne=-1,nr=he.length,Nr=0,jr=[];++Ne-1}function xl(l,m){var D=this.__data__,I=Tn(D,l);return I<0?(++this.size,D.push([l,m])):D[I][1]=m,this}Oi.prototype.clear=ah,Oi.prototype.delete=gl,Oi.prototype.get=oh,Oi.prototype.has=sh,Oi.prototype.set=xl;function Bi(l){var m=-1,D=l==null?0:l.length;for(this.clear();++m=m?l:m)),l}function yn(l,m,D,I,W,J){var ae,fe=m&o,de=m&u,Re=m&p;if(D&&(ae=W?D(l,I,W,J):D(l)),ae!==e)return ae;if(!Ct(l))return l;var qe=Fr(l);if(qe){if(ae=_I(l),!fe)return Fn(l,ae)}else{var Ve=pn(l),Ke=Ve==be||Ve==De;if(so(l))return u0(l,fe);if(Ve==K||Ve==H||Ke&&!W){if(ae=de||Ke?{}:C0(l),!fe)return de?xI(l,vh(ae,l)):gI(l,Xu(ae,l))}else{if(!mt[Ve])return W?l:{};ae=TI(l,Ve,fe)}}J||(J=new Hn);var cr=J.get(l);if(cr)return cr;J.set(l,ae),tx(l)?l.forEach(function(Dr){ae.add(yn(Dr,m,D,Dr,l,J))}):ex(l)&&l.forEach(function(Dr,qr){ae.set(qr,yn(Dr,m,D,qr,l,J))});var wr=Re?de?Rh:kh:de?Bn:rn,Pr=qe?e:wr(l);return Tt(Pr||l,function(Dr,qr){Pr&&(qr=Dr,Dr=l[qr]),zo(ae,qr,yn(Dr,m,D,qr,l,J))}),ae}function Ju(l){var m=rn(l);return function(D){return Sl(D,l,m)}}function Sl(l,m,D){var I=D.length;if(l==null)return!I;for(l=kr(l);I--;){var W=D[I],J=m[W],ae=l[W];if(ae===e&&!(W in l)||!J(ae))return!1}return!0}function Nl(l,m,D){if(typeof l!="function")throw new Mn(i);return sf(function(){l.apply(e,D)},m)}function bn(l,m,D,I){var W=-1,J=hs,ae=!0,fe=l.length,de=[],Re=m.length;if(!fe)return de;D&&(m=ct(m,cn(D))),I?(J=Lu,ae=!1):m.length>=t&&(J=Ja,ae=!1,m=new Da(m));e:for(;++WW?0:W+D),I=I===e||I>W?W:Br(I),I<0&&(I+=W),I=D>I?0:ix(I);D0&&D(fe)?m>1?Ht(fe,m-1,D,I,W):ri(W,fe):I||(W[W.length]=fe)}return W}var Ku=h0(),Cl=h0(!0);function ni(l,m){return l&&Ku(l,m,rn)}function ju(l,m){return l&&Cl(l,m,rn)}function ii(l,m){return Ki(m,function(D){return Ma(l[D])})}function Na(l,m){m=ao(m,l);for(var D=0,I=m.length;l!=null&&Dm}function yh(l,m){return l!=null&&at.call(l,m)}function bh(l,m){return l!=null&&m in kr(l)}function wh(l,m,D){return l>=Et(m,D)&&l=120&&qe.length>=120)?new Da(ae&&qe):e}qe=l[0];var Ve=-1,Ke=fe[0];e:for(;++Ve-1;)fe!==l&&ba.call(fe,de,1),ba.call(l,de,1);return l}function e0(l,m){for(var D=l?m.length:0,I=D-1;D--;){var W=m[D];if(D==I||W!==J){var J=W;Ca(W)?ba.call(l,W,1):_h(l,W)}}return l}function Eh(l,m){return l+Po(dl()*(m-l+1))}function oI(l,m,D,I){for(var W=-1,J=Ft(Ss((m-l)/(D||1)),0),ae=Ne(J);J--;)ae[I?J:++W]=l,l+=D;return ae}function Ch(l,m){var D="";if(!l||m<1||m>q)return D;do m%2&&(D+=l),m=Po(m/2),m&&(l+=l);while(m);return D}function Rr(l,m){return Yh(T0(l,m,In),l+"")}function sI(l){return Dl(Ls(l))}function uI(l,m){var D=Ls(l);return ql(D,Sa(m,0,D.length))}function nf(l,m,D,I){if(!Ct(l))return l;m=ao(m,l);for(var W=-1,J=m.length,ae=J-1,fe=l;fe!=null&&++WW?0:W+m),D=D>W?W:D,D<0&&(D+=W),W=m>D?0:D-m>>>0,m>>>=0;for(var J=Ne(W);++I>>1,ae=l[J];ae!==null&&!$n(ae)&&(D?ae<=m:ae=t){var Re=m?null:DI(l);if(Re)return Ka(Re);ae=!1,W=Ja,de=new Da}else de=m?[]:fe;e:for(;++I=I?l:si(l,m,D)}var s0=Vm||function(l){return Wt.clearTimeout(l)};function u0(l,m){if(m)return l.slice();var D=l.length,I=ul?ul(D):new l.constructor(D);return l.copy(I),I}function Bh(l){var m=new l.constructor(l.byteLength);return new bs(m).set(new bs(l)),m}function mI(l,m){var D=m?Bh(l.buffer):l.buffer;return new l.constructor(D,l.byteOffset,l.byteLength)}function hI(l){var m=new l.constructor(l.source,En.exec(l));return m.lastIndex=l.lastIndex,m}function dI(l){return Uo?kr(Uo.call(l)):{}}function f0(l,m){var D=m?Bh(l.buffer):l.buffer;return new l.constructor(D,l.byteOffset,l.length)}function l0(l,m){if(l!==m){var D=l!==e,I=l===null,W=l===l,J=$n(l),ae=m!==e,fe=m===null,de=m===m,Re=$n(m);if(!fe&&!Re&&!J&&l>m||J&&ae&&de&&!fe&&!Re||I&&ae&&de||!D&&de||!W)return 1;if(!I&&!J&&!Re&&l=fe)return de;var Re=D[I];return de*(Re=="desc"?-1:1)}}return l.index-m.index}function c0(l,m,D,I){for(var W=-1,J=l.length,ae=D.length,fe=-1,de=m.length,Re=Ft(J-ae,0),qe=Ne(de+Re),Ve=!I;++fe1?D[W-1]:e,ae=W>2?D[2]:e;for(J=l.length>3&&typeof J=="function"?(W--,J):e,ae&&wn(D[0],D[1],ae)&&(J=W<3?e:J,W=1),m=kr(m);++I-1?W[J?m[ae]:ae]:e}}function g0(l){return Ea(function(m){var D=m.length,I=D,W=_n.prototype.thru;for(l&&m.reverse();I--;){var J=m[I];if(typeof J!="function")throw new Mn(i);if(W&&!ae&&Rl(J)=="wrapper")var ae=new _n([],!0)}for(I=ae?I:D;++I1&&Hr.reverse(),qe&&defe))return!1;var Re=J.get(l),qe=J.get(m);if(Re&&qe)return Re==m&&qe==l;var Ve=-1,Ke=!0,cr=D&d?new Da:e;for(J.set(l,m),J.set(m,l);++Ve1?"& ":"")+m[I],m=m.join(D>2?", ":" "),l.replace(Su,\`{ + return inlineWorker(`"use strict";var t8=Object.create;var sd=Object.defineProperty;var n8=Object.getOwnPropertyDescriptor;var i8=Object.getOwnPropertyNames;var a8=Object.getPrototypeOf,o8=Object.prototype.hasOwnProperty;var un=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),s8=(e,r)=>{for(var t in r)sd(e,t,{get:r[t],enumerable:!0})},u8=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of i8(r))!o8.call(e,i)&&i!==t&&sd(e,i,{get:()=>r[i],enumerable:!(n=n8(r,i))||n.enumerable});return e};var ci=(e,r,t)=>(t=e!=null?t8(a8(e)):{},u8(r||!e||!e.__esModule?sd(t,"default",{value:e,enumerable:!0}):t,e));var ud=un((Us,lf)=>{(function(){var e,r="4.17.21",t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid \`variable\` option passed into \`_.template\`",s="__lodash_hash_undefined__",l=500,f="__lodash_placeholder__",o=1,u=2,p=4,h=1,d=2,x=1,v=2,y=4,w=8,C=16,b=32,A=64,E=128,S=256,O=512,F=30,M="...",_=800,k=16,L=1,Y=2,$=3,V=1/0,q=9007199254740991,R=17976931348623157e292,j=0/0,U=4294967295,oe=U-1,me=U>>>1,ie=[["ary",E],["bind",x],["bindKey",v],["curry",w],["curryRight",C],["flip",O],["partial",b],["partialRight",A],["rearg",S]],H="[object Arguments]",ce="[object Array]",Me="[object AsyncFunction]",pe="[object Boolean]",ge="[object Date]",Se="[object DOMException]",xe="[object Error]",be="[object Function]",De="[object GeneratorFunction]",Ae="[object Map]",ze="[object Number]",Ze="[object Null]",K="[object Object]",te="[object Promise]",ye="[object Proxy]",ee="[object RegExp]",ne="[object Set]",ue="[object String]",Ee="[object Symbol]",Ce="[object Undefined]",Le="[object WeakMap]",Ie="[object WeakSet]",sr="[object ArrayBuffer]",ir="[object DataView]",Xe="[object Float32Array]",Or="[object Float64Array]",re="[object Int8Array]",le="[object Int16Array]",we="[object Int32Array]",Oe="[object Uint8Array]",ke="[object Uint8ClampedArray]",_e="[object Uint16Array]",Pe="[object Uint32Array]",We=/\\b__p \\+= '';/g,B=/\\b(__p \\+=) '' \\+/g,Q=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g,ve=/&(?:amp|lt|gt|quot|#39);/g,Be=/[&<>"']/g,er=RegExp(ve.source),fr=RegExp(Be.source),Zr=/<%-([\\s\\S]+?)%>/g,_t=/<%([\\s\\S]+?)%>/g,Yt=/<%=([\\s\\S]+?)%>/g,Qi=/\\.|\\[(?:[^[\\]]*|(["'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,Ei=/^\\w*$/,Du=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,Ci=/[\\\\^$.*+?()[\\]{}|]/g,Ya=RegExp(Ci.source),rr=/^\\s+/,Su=/\\s/,Nu=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,nn=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,Mo=/,? & /,nt=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,ga=/[()=,{}\\[\\]\\/\\s]/,Au=/\\\\(\\\\)?/g,zt=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,En=/\\w*$/,Cn=/^[-+]0x[0-9a-f]+$/i,At=/^0b[01]+$/i,gn=/^\\[object .+?Constructor\\]$/,Wn=/^0o[0-7]+$/i,Mi=/^(?:0|[1-9]\\d*)$/,Eu=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,Ha=/($^)/,Cu=/['\\n\\r\\u2028\\u2029\\\\]/g,pt="\\\\ud800-\\\\udfff",Ga="\\\\u0300-\\\\u036f",Mu="\\\\ufe20-\\\\ufe2f",fs="\\\\u20d0-\\\\u20ff",_o=Ga+Mu+fs,ls="\\\\u2700-\\\\u27bf",cs="a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff",xa="\\\\xac\\\\xb1\\\\xd7\\\\xf7",Kr="\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf",jt="\\\\u2000-\\\\u206f",_u=" \\\\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",Xi="A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde",_i="\\\\ufe0e\\\\ufe0f",ps=xa+Kr+jt+_u,Tu="['\\u2019]",im="["+pt+"]",Fu="["+ps+"]",Ji="["+_o+"]",Ou="\\\\d+",am="["+ls+"]",kf="["+cs+"]",$a="[^"+pt+ps+Ou+ls+cs+Xi+"]",Za="\\\\ud83c[\\\\udffb-\\\\udfff]",Rf="(?:"+Ji+"|"+Za+")",Qa="[^"+pt+"]",Vn="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",Bu="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",Xa="["+Xi+"]",Lf="\\\\u200d",qf="(?:"+kf+"|"+$a+")",om="(?:"+Xa+"|"+$a+")",Uf="(?:"+Tu+"(?:d|ll|m|re|s|t|ve))?",zf="(?:"+Tu+"(?:D|LL|M|RE|S|T|VE))?",Wf=Rf+"?",ms="["+_i+"]?",sm="(?:"+Lf+"(?:"+[Qa,Vn,Bu].join("|")+")"+ms+Wf+")*",Vf="\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])",um="\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])",Yf=ms+Wf+sm,fm="(?:"+[am,Vn,Bu].join("|")+")"+Yf,lm="(?:"+[Qa+Ji+"?",Ji,Vn,Bu,im].join("|")+")",cm=RegExp(Tu,"g"),pm=RegExp(Ji,"g"),Iu=RegExp(Za+"(?="+Za+")|"+lm+Yf,"g"),mm=RegExp([Xa+"?"+kf+"+"+Uf+"(?="+[Fu,Xa,"$"].join("|")+")",om+"+"+zf+"(?="+[Fu,Xa+qf,"$"].join("|")+")",Xa+"?"+qf+"+"+Uf,Xa+"+"+zf,um,Vf,Ou,fm].join("|"),"g"),hm=RegExp("["+Lf+pt+_o+_i+"]"),dm=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,vm=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],gm=-1,dt={};dt[Xe]=dt[Or]=dt[re]=dt[le]=dt[we]=dt[Oe]=dt[ke]=dt[_e]=dt[Pe]=!0,dt[H]=dt[ce]=dt[sr]=dt[pe]=dt[ir]=dt[ge]=dt[xe]=dt[be]=dt[Ae]=dt[ze]=dt[K]=dt[ee]=dt[ne]=dt[ue]=dt[Le]=!1;var mt={};mt[H]=mt[ce]=mt[sr]=mt[ir]=mt[pe]=mt[ge]=mt[Xe]=mt[Or]=mt[re]=mt[le]=mt[we]=mt[Ae]=mt[ze]=mt[K]=mt[ee]=mt[ne]=mt[ue]=mt[Ee]=mt[Oe]=mt[ke]=mt[_e]=mt[Pe]=!0,mt[xe]=mt[be]=mt[Le]=!1;var xm={\\u00C0:"A",\\u00C1:"A",\\u00C2:"A",\\u00C3:"A",\\u00C4:"A",\\u00C5:"A",\\u00E0:"a",\\u00E1:"a",\\u00E2:"a",\\u00E3:"a",\\u00E4:"a",\\u00E5:"a",\\u00C7:"C",\\u00E7:"c",\\u00D0:"D",\\u00F0:"d",\\u00C8:"E",\\u00C9:"E",\\u00CA:"E",\\u00CB:"E",\\u00E8:"e",\\u00E9:"e",\\u00EA:"e",\\u00EB:"e",\\u00CC:"I",\\u00CD:"I",\\u00CE:"I",\\u00CF:"I",\\u00EC:"i",\\u00ED:"i",\\u00EE:"i",\\u00EF:"i",\\u00D1:"N",\\u00F1:"n",\\u00D2:"O",\\u00D3:"O",\\u00D4:"O",\\u00D5:"O",\\u00D6:"O",\\u00D8:"O",\\u00F2:"o",\\u00F3:"o",\\u00F4:"o",\\u00F5:"o",\\u00F6:"o",\\u00F8:"o",\\u00D9:"U",\\u00DA:"U",\\u00DB:"U",\\u00DC:"U",\\u00F9:"u",\\u00FA:"u",\\u00FB:"u",\\u00FC:"u",\\u00DD:"Y",\\u00FD:"y",\\u00FF:"y",\\u00C6:"Ae",\\u00E6:"ae",\\u00DE:"Th",\\u00FE:"th",\\u00DF:"ss",\\u0100:"A",\\u0102:"A",\\u0104:"A",\\u0101:"a",\\u0103:"a",\\u0105:"a",\\u0106:"C",\\u0108:"C",\\u010A:"C",\\u010C:"C",\\u0107:"c",\\u0109:"c",\\u010B:"c",\\u010D:"c",\\u010E:"D",\\u0110:"D",\\u010F:"d",\\u0111:"d",\\u0112:"E",\\u0114:"E",\\u0116:"E",\\u0118:"E",\\u011A:"E",\\u0113:"e",\\u0115:"e",\\u0117:"e",\\u0119:"e",\\u011B:"e",\\u011C:"G",\\u011E:"G",\\u0120:"G",\\u0122:"G",\\u011D:"g",\\u011F:"g",\\u0121:"g",\\u0123:"g",\\u0124:"H",\\u0126:"H",\\u0125:"h",\\u0127:"h",\\u0128:"I",\\u012A:"I",\\u012C:"I",\\u012E:"I",\\u0130:"I",\\u0129:"i",\\u012B:"i",\\u012D:"i",\\u012F:"i",\\u0131:"i",\\u0134:"J",\\u0135:"j",\\u0136:"K",\\u0137:"k",\\u0138:"k",\\u0139:"L",\\u013B:"L",\\u013D:"L",\\u013F:"L",\\u0141:"L",\\u013A:"l",\\u013C:"l",\\u013E:"l",\\u0140:"l",\\u0142:"l",\\u0143:"N",\\u0145:"N",\\u0147:"N",\\u014A:"N",\\u0144:"n",\\u0146:"n",\\u0148:"n",\\u014B:"n",\\u014C:"O",\\u014E:"O",\\u0150:"O",\\u014D:"o",\\u014F:"o",\\u0151:"o",\\u0154:"R",\\u0156:"R",\\u0158:"R",\\u0155:"r",\\u0157:"r",\\u0159:"r",\\u015A:"S",\\u015C:"S",\\u015E:"S",\\u0160:"S",\\u015B:"s",\\u015D:"s",\\u015F:"s",\\u0161:"s",\\u0162:"T",\\u0164:"T",\\u0166:"T",\\u0163:"t",\\u0165:"t",\\u0167:"t",\\u0168:"U",\\u016A:"U",\\u016C:"U",\\u016E:"U",\\u0170:"U",\\u0172:"U",\\u0169:"u",\\u016B:"u",\\u016D:"u",\\u016F:"u",\\u0171:"u",\\u0173:"u",\\u0174:"W",\\u0175:"w",\\u0176:"Y",\\u0177:"y",\\u0178:"Y",\\u0179:"Z",\\u017B:"Z",\\u017D:"Z",\\u017A:"z",\\u017C:"z",\\u017E:"z",\\u0132:"IJ",\\u0133:"ij",\\u0152:"Oe",\\u0153:"oe",\\u0149:"'n",\\u017F:"s"},Pu={"&":"&","<":"<",">":">",'"':""","'":"'"},ku={"&":"&","<":"<",">":">",""":'"',"'":"'"},ym={"\\\\":"\\\\","'":"'","\\n":"n","\\r":"r","\\u2028":"u2028","\\u2029":"u2029"},Hf=parseFloat,Gf=parseInt,$f=typeof global=="object"&&global&&global.Object===Object&&global,bm=typeof self=="object"&&self&&self.Object===Object&&self,Wt=$f||bm||Function("return this")(),Ru=typeof Us=="object"&&Us&&!Us.nodeType&&Us,Ki=Ru&&typeof lf=="object"&&lf&&!lf.nodeType&&lf,vt=Ki&&Ki.exports===Ru,ya=vt&&$f.process,en=function(){try{var he=Ki&&Ki.require&&Ki.require("util").types;return he||ya&&ya.binding&&ya.binding("util")}catch{}}(),Zf=en&&en.isArrayBuffer,Lu=en&&en.isDate,Qf=en&&en.isMap,Xf=en&&en.isRegExp,To=en&&en.isSet,Ti=en&&en.isTypedArray;function an(he,Fe,Ne){switch(Ne.length){case 0:return he.call(Fe);case 1:return he.call(Fe,Ne[0]);case 2:return he.call(Fe,Ne[0],Ne[1]);case 3:return he.call(Fe,Ne[0],Ne[1],Ne[2])}return he.apply(Fe,Ne)}function wm(he,Fe,Ne,nr){for(var Nr=-1,jr=he==null?0:he.length;++Nr-1}function qu(he,Fe,Ne){for(var nr=-1,Nr=he==null?0:he.length;++nr-1;);return Ne}function nl(he,Fe){for(var Ne=he.length;Ne--&&Ja(Fe,he[Ne],0)>-1;);return Ne}function Cm(he,Fe){for(var Ne=he.length,nr=0;Ne--;)he[Ne]===Fe&&++nr;return nr}var il=Fo(xm),Mm=Fo(Pu);function _m(he){return"\\\\"+ym[he]}function Tm(he,Fe){return he==null?e:he[Fe]}function ni(he){return hm.test(he)}function Fm(he){return dm.test(he)}function Om(he){for(var Fe,Ne=[];!(Fe=he.next()).done;)Ne.push(Fe.value);return Ne}function $u(he){var Fe=-1,Ne=Array(he.size);return he.forEach(function(nr,Nr){Ne[++Fe]=[Nr,nr]}),Ne}function Oo(he,Fe){return function(Ne){return he(Fe(Ne))}}function Yn(he,Fe){for(var Ne=-1,nr=he.length,Nr=0,jr=[];++Ne-1}function yl(c,m){var D=this.__data__,I=Tn(D,c);return I<0?(++this.size,D.push([c,m])):D[I][1]=m,this}Bi.prototype.clear=oh,Bi.prototype.delete=xl,Bi.prototype.get=sh,Bi.prototype.has=uh,Bi.prototype.set=yl;function Ii(c){var m=-1,D=c==null?0:c.length;for(this.clear();++m=m?c:m)),c}function yn(c,m,D,I,W,J){var ae,fe=m&o,de=m&u,Re=m&p;if(D&&(ae=W?D(c,I,W,J):D(c)),ae!==e)return ae;if(!Ct(c))return c;var qe=Fr(c);if(qe){if(ae=FI(c),!fe)return Fn(c,ae)}else{var Ve=pn(c),Ke=Ve==be||Ve==De;if(uo(c))return f0(c,fe);if(Ve==K||Ve==H||Ke&&!W){if(ae=de||Ke?{}:M0(c),!fe)return de?bI(c,gh(ae,c)):yI(c,Ju(ae,c))}else{if(!mt[Ve])return W?c:{};ae=OI(c,Ve,fe)}}J||(J=new Hn);var cr=J.get(c);if(cr)return cr;J.set(c,ae),nx(c)?c.forEach(function(Dr){ae.add(yn(Dr,m,D,Dr,c,J))}):rx(c)&&c.forEach(function(Dr,qr){ae.set(qr,yn(Dr,m,D,qr,c,J))});var wr=Re?de?Lh:Rh:de?Bn:rn,Pr=qe?e:wr(c);return Tt(Pr||c,function(Dr,qr){Pr&&(qr=Dr,Dr=c[qr]),Wo(ae,qr,yn(Dr,m,D,qr,c,J))}),ae}function Ku(c){var m=rn(c);return function(D){return Nl(D,c,m)}}function Nl(c,m,D){var I=D.length;if(c==null)return!I;for(c=kr(c);I--;){var W=D[I],J=m[W],ae=c[W];if(ae===e&&!(W in c)||!J(ae))return!1}return!0}function Al(c,m,D){if(typeof c!="function")throw new Mn(i);return uf(function(){c.apply(e,D)},m)}function bn(c,m,D,I){var W=-1,J=ds,ae=!0,fe=c.length,de=[],Re=m.length;if(!fe)return de;D&&(m=ct(m,cn(D))),I?(J=qu,ae=!1):m.length>=t&&(J=Ka,ae=!1,m=new Sa(m));e:for(;++WW?0:W+D),I=I===e||I>W?W:Br(I),I<0&&(I+=W),I=D>I?0:ax(I);D0&&D(fe)?m>1?Ht(fe,m-1,D,I,W):ti(W,fe):I||(W[W.length]=fe)}return W}var ju=d0(),Ml=d0(!0);function ii(c,m){return c&&ju(c,m,rn)}function ef(c,m){return c&&Ml(c,m,rn)}function ai(c,m){return ji(m,function(D){return _a(c[D])})}function Aa(c,m){m=oo(m,c);for(var D=0,I=m.length;c!=null&&Dm}function bh(c,m){return c!=null&&at.call(c,m)}function wh(c,m){return c!=null&&m in kr(c)}function Dh(c,m,D){return c>=Et(m,D)&&c=120&&qe.length>=120)?new Sa(ae&&qe):e}qe=c[0];var Ve=-1,Ke=fe[0];e:for(;++Ve-1;)fe!==c&&wa.call(fe,de,1),wa.call(c,de,1);return c}function r0(c,m){for(var D=c?m.length:0,I=D-1;D--;){var W=m[D];if(D==I||W!==J){var J=W;Ma(W)?wa.call(c,W,1):Th(c,W)}}return c}function Ch(c,m){return c+ko(vl()*(m-c+1))}function uI(c,m,D,I){for(var W=-1,J=Ft(Ns((m-c)/(D||1)),0),ae=Ne(J);J--;)ae[I?J:++W]=c,c+=D;return ae}function Mh(c,m){var D="";if(!c||m<1||m>q)return D;do m%2&&(D+=c),m=ko(m/2),m&&(c+=c);while(m);return D}function Rr(c,m){return Hh(F0(c,m,In),c+"")}function fI(c){return Sl(qs(c))}function lI(c,m){var D=qs(c);return Ul(D,Na(m,0,D.length))}function af(c,m,D,I){if(!Ct(c))return c;m=oo(m,c);for(var W=-1,J=m.length,ae=J-1,fe=c;fe!=null&&++WW?0:W+m),D=D>W?W:D,D<0&&(D+=W),W=m>D?0:D-m>>>0,m>>>=0;for(var J=Ne(W);++I>>1,ae=c[J];ae!==null&&!$n(ae)&&(D?ae<=m:ae=t){var Re=m?null:NI(c);if(Re)return ja(Re);ae=!1,W=Ka,de=new Sa}else de=m?[]:fe;e:for(;++I=I?c:ui(c,m,D)}var u0=Ym||function(c){return Wt.clearTimeout(c)};function f0(c,m){if(m)return c.slice();var D=c.length,I=fl?fl(D):new c.constructor(D);return c.copy(I),I}function Ih(c){var m=new c.constructor(c.byteLength);return new ws(m).set(new ws(c)),m}function dI(c,m){var D=m?Ih(c.buffer):c.buffer;return new c.constructor(D,c.byteOffset,c.byteLength)}function vI(c){var m=new c.constructor(c.source,En.exec(c));return m.lastIndex=c.lastIndex,m}function gI(c){return zo?kr(zo.call(c)):{}}function l0(c,m){var D=m?Ih(c.buffer):c.buffer;return new c.constructor(D,c.byteOffset,c.length)}function c0(c,m){if(c!==m){var D=c!==e,I=c===null,W=c===c,J=$n(c),ae=m!==e,fe=m===null,de=m===m,Re=$n(m);if(!fe&&!Re&&!J&&c>m||J&&ae&&de&&!fe&&!Re||I&&ae&&de||!D&&de||!W)return 1;if(!I&&!J&&!Re&&c=fe)return de;var Re=D[I];return de*(Re=="desc"?-1:1)}}return c.index-m.index}function p0(c,m,D,I){for(var W=-1,J=c.length,ae=D.length,fe=-1,de=m.length,Re=Ft(J-ae,0),qe=Ne(de+Re),Ve=!I;++fe1?D[W-1]:e,ae=W>2?D[2]:e;for(J=c.length>3&&typeof J=="function"?(W--,J):e,ae&&wn(D[0],D[1],ae)&&(J=W<3?e:J,W=1),m=kr(m);++I-1?W[J?m[ae]:ae]:e}}function x0(c){return Ca(function(m){var D=m.length,I=D,W=_n.prototype.thru;for(c&&m.reverse();I--;){var J=m[I];if(typeof J!="function")throw new Mn(i);if(W&&!ae&&Ll(J)=="wrapper")var ae=new _n([],!0)}for(I=ae?I:D;++I1&&Hr.reverse(),qe&&defe))return!1;var Re=J.get(c),qe=J.get(m);if(Re&&qe)return Re==m&&qe==c;var Ve=-1,Ke=!0,cr=D&d?new Sa:e;for(J.set(c,m),J.set(m,c);++Ve1?"& ":"")+m[I],m=m.join(D>2?", ":" "),c.replace(Nu,\`{ /* [wrapped with \`+m+\`] */ -\`)}function OI(l){return Fr(l)||Go(l)||!!(cl&&l&&l[cl])}function Ca(l,m){var D=typeof l;return m=m??q,!!m&&(D=="number"||D!="symbol"&&Ci.test(l))&&l>-1&&l%1==0&&l0){if(++m>=_)return arguments[0]}else m=0;return l.apply(e,arguments)}}function ql(l,m){var D=-1,I=l.length,W=I-1;for(m=m===e?I:m;++D1?l[m-1]:e;return D=typeof D=="function"?(l.pop(),D):e,W0(l,D)});function V0(l){var m=Z(l);return m.__chain__=!0,m}function V4(l,m){return m(l),l}function Ul(l,m){return m(l)}var Y4=Ea(function(l){var m=l.length,D=m?l[0]:0,I=this.__wrapped__,W=function(J){return Os(J,l)};return m>1||this.__actions__.length||!(I instanceof Ir)||!Ca(D)?this.thru(W):(I=I.slice(D,+D+(m?1:0)),I.__actions__.push({func:Ul,args:[W],thisArg:e}),new _n(I,this.__chain__).thru(function(J){return m&&!J.length&&J.push(e),J}))});function H4(){return V0(this)}function G4(){return new _n(this.value(),this.__chain__)}function $4(){this.__values__===e&&(this.__values__=nx(this.value()));var l=this.__index__>=this.__values__.length,m=l?e:this.__values__[this.__index__++];return{done:l,value:m}}function Z4(){return this}function Q4(l){for(var m,D=this;D instanceof Ms;){var I=k0(D);I.__index__=0,I.__values__=e,m?W.__wrapped__=I:m=I;var W=I;D=D.__wrapped__}return W.__wrapped__=l,m}function X4(){var l=this.__wrapped__;if(l instanceof Ir){var m=l;return this.__actions__.length&&(m=new Ir(this)),m=m.reverse(),m.__actions__.push({func:Ul,args:[Hh],thisArg:e}),new _n(m,this.__chain__)}return this.thru(Hh)}function J4(){return a0(this.__wrapped__,this.__actions__)}var K4=Ol(function(l,m,D){at.call(l,D)?++l[D]:Ii(l,D,1)});function j4(l,m,D){var I=Fr(l)?ms:gh;return D&&wn(l,m,D)&&(m=e),I(l,xr(m,3))}function eP(l,m){var D=Fr(l)?Ki:El;return D(l,xr(m,3))}var rP=v0(R0),tP=v0(L0);function nP(l,m){return Ht(zl(l,m),1)}function iP(l,m){return Ht(zl(l,m),V)}function aP(l,m,D){return D=D===e?1:Br(D),Ht(zl(l,m),D)}function Y0(l,m){var D=Fr(l)?Tt:na;return D(l,xr(m,3))}function H0(l,m){var D=Fr(l)?wm:Al;return D(l,xr(m,3))}var oP=Ol(function(l,m,D){at.call(l,D)?l[D].push(m):Ii(l,D,[m])});function sP(l,m,D,I){l=On(l)?l:Ls(l),D=D&&!I?Br(D):0;var W=l.length;return D<0&&(D=Ft(W+D,0)),Gl(l)?D<=W&&l.indexOf(m,D)>-1:!!W&&Xa(l,m,D)>-1}var uP=Rr(function(l,m,D){var I=-1,W=typeof m=="function",J=On(l)?Ne(l.length):[];return na(l,function(ae){J[++I]=W?an(m,ae,D):ai(ae,m,D)}),J}),fP=Ol(function(l,m,D){Ii(l,D,m)});function zl(l,m){var D=Fr(l)?ct:Te;return D(l,xr(m,3))}function lP(l,m,D,I){return l==null?[]:(Fr(m)||(m=m==null?[]:[m]),D=I?e:D,Fr(D)||(D=D==null?[]:[D]),ki(l,m,D))}var cP=Ol(function(l,m,D){l[D?0:1].push(m)},function(){return[[],[]]});function pP(l,m,D){var I=Fr(l)?qu:el,W=arguments.length<3;return I(l,xr(m,4),D,W,na)}function mP(l,m,D){var I=Fr(l)?Dm:el,W=arguments.length<3;return I(l,xr(m,4),D,W,Al)}function hP(l,m){var D=Fr(l)?Ki:El;return D(l,Yl(xr(m,3)))}function dP(l){var m=Fr(l)?Dl:sI;return m(l)}function vP(l,m,D){(D?wn(l,m,D):m===e)?m=1:m=Br(m);var I=Fr(l)?mh:uI;return I(l,m)}function gP(l){var m=Fr(l)?hh:lI;return m(l)}function xP(l){if(l==null)return 0;if(On(l))return Gl(l)?ji(l):l.length;var m=pn(l);return m==Ae||m==ne?l.size:z(l).length}function yP(l,m,D){var I=Fr(l)?Uu:cI;return D&&wn(l,m,D)&&(m=e),I(l,xr(m,3))}var bP=Rr(function(l,m){if(l==null)return[];var D=m.length;return D>1&&wn(l,m[0],m[1])?m=[]:D>2&&wn(m[0],m[1],m[2])&&(m=[m[0]]),ki(l,Ht(m,1),[])}),Wl=Ym||function(){return Wt.Date.now()};function wP(l,m){if(typeof m!="function")throw new Mn(i);return l=Br(l),function(){if(--l<1)return m.apply(this,arguments)}}function G0(l,m,D){return m=D?e:m,m=l&&m==null?l.length:m,Aa(l,E,e,e,e,e,m)}function $0(l,m){var D;if(typeof m!="function")throw new Mn(i);return l=Br(l),function(){return--l>0&&(D=m.apply(this,arguments)),l<=1&&(m=e),D}}var $h=Rr(function(l,m,D){var I=x;if(D.length){var W=Yn(D,ks($h));I|=b}return Aa(l,I,m,D,W)}),Z0=Rr(function(l,m,D){var I=x|v;if(D.length){var W=Yn(D,ks(Z0));I|=b}return Aa(m,I,l,D,W)});function Q0(l,m,D){m=D?e:m;var I=Aa(l,w,e,e,e,e,e,m);return I.placeholder=Q0.placeholder,I}function X0(l,m,D){m=D?e:m;var I=Aa(l,C,e,e,e,e,e,m);return I.placeholder=X0.placeholder,I}function J0(l,m,D){var I,W,J,ae,fe,de,Re=0,qe=!1,Ve=!1,Ke=!0;if(typeof l!="function")throw new Mn(i);m=fi(m)||0,Ct(D)&&(qe=!!D.leading,Ve="maxWait"in D,J=Ve?Ft(fi(D.maxWait)||0,m):J,Ke="trailing"in D?!!D.trailing:Ke);function cr(Rt){var Li=I,Ta=W;return I=W=e,Re=Rt,ae=l.apply(Ta,Li),ae}function wr(Rt){return Re=Rt,fe=sf(qr,m),qe?cr(Rt):ae}function Pr(Rt){var Li=Rt-de,Ta=Rt-Re,vx=m-Li;return Ve?Et(vx,J-Ta):vx}function Dr(Rt){var Li=Rt-de,Ta=Rt-Re;return de===e||Li>=m||Li<0||Ve&&Ta>=J}function qr(){var Rt=Wl();if(Dr(Rt))return Hr(Rt);fe=sf(qr,Pr(Rt))}function Hr(Rt){return fe=e,Ke&&I?cr(Rt):(I=W=e,ae)}function Zn(){fe!==e&&s0(fe),Re=0,I=de=W=fe=e}function Dn(){return fe===e?ae:Hr(Wl())}function Qn(){var Rt=Wl(),Li=Dr(Rt);if(I=arguments,W=this,de=Rt,Li){if(fe===e)return wr(de);if(Ve)return s0(fe),fe=sf(qr,m),cr(de)}return fe===e&&(fe=sf(qr,m)),ae}return Qn.cancel=Zn,Qn.flush=Dn,Qn}var DP=Rr(function(l,m){return Nl(l,1,m)}),SP=Rr(function(l,m,D){return Nl(l,fi(m)||0,D)});function NP(l){return Aa(l,O)}function Vl(l,m){if(typeof l!="function"||m!=null&&typeof m!="function")throw new Mn(i);var D=function(){var I=arguments,W=m?m.apply(this,I):I[0],J=D.cache;if(J.has(W))return J.get(W);var ae=l.apply(this,I);return D.cache=J.set(W,ae)||J,ae};return D.cache=new(Vl.Cache||Bi),D}Vl.Cache=Bi;function Yl(l){if(typeof l!="function")throw new Mn(i);return function(){var m=arguments;switch(m.length){case 0:return!l.call(this);case 1:return!l.call(this,m[0]);case 2:return!l.call(this,m[0],m[1]);case 3:return!l.call(this,m[0],m[1],m[2])}return!l.apply(this,m)}}function AP(l){return $0(2,l)}var EP=pI(function(l,m){m=m.length==1&&Fr(m[0])?ct(m[0],cn(xr())):ct(Ht(m,1),cn(xr()));var D=m.length;return Rr(function(I){for(var W=-1,J=Et(I.length,D);++W=m}),Go=_l(function(){return arguments}())?_l:function(l){return Ot(l)&&at.call(l,"callee")&&!ll.call(l,"callee")},Fr=Ne.isArray,zP=$f?cn($f):Dh;function On(l){return l!=null&&Hl(l.length)&&!Ma(l)}function kt(l){return Ot(l)&&On(l)}function WP(l){return l===!0||l===!1||Ot(l)&&on(l)==pe}var so=pl||ad,VP=Ru?cn(Ru):Sh;function YP(l){return Ot(l)&&l.nodeType===1&&!uf(l)}function HP(l){if(l==null)return!0;if(On(l)&&(Fr(l)||typeof l=="string"||typeof l.splice=="function"||so(l)||Rs(l)||Go(l)))return!l.length;var m=pn(l);if(m==Ae||m==ne)return!l.size;if(of(l))return!z(l).length;for(var D in l)if(at.call(l,D))return!1;return!0}function GP(l,m){return Wo(l,m)}function $P(l,m,D){D=typeof D=="function"?D:e;var I=D?D(l,m):e;return I===e?Wo(l,m,e,D):!!I}function Qh(l){if(!Ot(l))return!1;var m=on(l);return m==xe||m==Se||typeof l.message=="string"&&typeof l.name=="string"&&!uf(l)}function ZP(l){return typeof l=="number"&&ko(l)}function Ma(l){if(!Ct(l))return!1;var m=on(l);return m==be||m==De||m==Me||m==ye}function j0(l){return typeof l=="number"&&l==Br(l)}function Hl(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=q}function Ct(l){var m=typeof l;return l!=null&&(m=="object"||m=="function")}function Ot(l){return l!=null&&typeof l=="object"}var ex=Zf?cn(Zf):tf;function QP(l,m){return l===m||ia(l,m,qh(m))}function XP(l,m,D){return D=typeof D=="function"?D:e,ia(l,m,qh(m),D)}function JP(l){return rx(l)&&l!=+l}function KP(l){if(PI(l))throw new Nr(n);return Vo(l)}function jP(l){return l===null}function e5(l){return l==null}function rx(l){return typeof l=="number"||Ot(l)&&on(l)==ze}function uf(l){if(!Ot(l)||on(l)!=K)return!1;var m=ws(l);if(m===null)return!0;var D=at.call(m,"constructor")&&m.constructor;return typeof D=="function"&&D instanceof D&&Bo.call(D)==Um}var Xh=Qf?cn(Qf):Wr;function r5(l){return j0(l)&&l>=-q&&l<=q}var tx=_o?cn(_o):g;function Gl(l){return typeof l=="string"||!Fr(l)&&Ot(l)&&on(l)==ue}function $n(l){return typeof l=="symbol"||Ot(l)&&on(l)==Ee}var Rs=_i?cn(_i):N;function t5(l){return l===e}function n5(l){return Ot(l)&&pn(l)==Le}function i5(l){return Ot(l)&&on(l)==Ie}var a5=kl(se),o5=kl(function(l,m){return l<=m});function nx(l){if(!l)return[];if(On(l))return Gl(l)?xn(l):Fn(l);if(Io&&l[Io])return Fm(l[Io]());var m=pn(l),D=m==Ae?Gu:m==ne?Ka:Ls;return D(l)}function _a(l){if(!l)return l===0?l:0;if(l=fi(l),l===V||l===-V){var m=l<0?-1:1;return m*R}return l===l?l:0}function Br(l){var m=_a(l),D=m%1;return m===m?D?m-D:m:0}function ix(l){return l?Sa(Br(l),0,U):0}function fi(l){if(typeof l=="number")return l;if($n(l))return j;if(Ct(l)){var m=typeof l.valueOf=="function"?l.valueOf():l;l=Ct(m)?m+"":m}if(typeof l!="string")return l===0?l:+l;l=rl(l);var D=At.test(l);return D||Wn.test(l)?Hf(l.slice(2),D?2:8):Cn.test(l)?j:+l}function ax(l){return aa(l,Bn(l))}function s5(l){return l?Sa(Br(l),-q,q):l===0?l:0}function st(l){return l==null?"":Gn(l)}var u5=Is(function(l,m){if(of(m)||On(m)){aa(m,rn(m),l);return}for(var D in m)at.call(m,D)&&zo(l,D,m[D])}),ox=Is(function(l,m){aa(m,Bn(m),l)}),$l=Is(function(l,m,D,I){aa(m,Bn(m),l,I)}),f5=Is(function(l,m,D,I){aa(m,rn(m),l,I)}),l5=Ea(Os);function c5(l,m){var D=no(l);return m==null?D:Xu(D,m)}var p5=Rr(function(l,m){l=kr(l);var D=-1,I=m.length,W=I>2?m[2]:e;for(W&&wn(m[0],m[1],W)&&(I=1);++D1),J}),aa(l,Rh(l),D),I&&(D=yn(D,o|u|p,SI));for(var W=m.length;W--;)_h(D,m[W]);return D});function T5(l,m){return ux(l,Yl(xr(m)))}var F5=Ea(function(l,m){return l==null?{}:iI(l,m)});function ux(l,m){if(l==null)return{};var D=ct(Rh(l),function(I){return[I]});return m=xr(m),jg(l,D,function(I,W){return m(I,W[0])})}function O5(l,m,D){m=ao(m,l);var I=-1,W=m.length;for(W||(W=1,l=e);++Im){var I=l;l=m,m=I}if(D||l%1||m%1){var W=dl();return Et(l+W*(m-l+Yf("1e-"+((W+"").length-1))),m)}return Eh(l,m)}var V5=Ps(function(l,m,D){return m=m.toLowerCase(),l+(D?cx(m):m)});function cx(l){return jh(st(l).toLowerCase())}function px(l){return l=st(l),l&&l.replace(Au,nl).replace(cm,"")}function Y5(l,m,D){l=st(l),m=Gn(m);var I=l.length;D=D===e?I:Sa(Br(D),0,I);var W=D;return D-=m.length,D>=0&&l.slice(D,W)==m}function H5(l){return l=st(l),l&&fr.test(l)?l.replace(Be,Cm):l}function G5(l){return l=st(l),l&&Va.test(l)?l.replace(Ei,"\\\\$&"):l}var $5=Ps(function(l,m,D){return l+(D?"-":"")+m.toLowerCase()}),Z5=Ps(function(l,m,D){return l+(D?" ":"")+m.toLowerCase()}),Q5=d0("toLowerCase");function X5(l,m,D){l=st(l),m=Br(m);var I=m?ji(l):0;if(!m||I>=m)return l;var W=(m-I)/2;return Pl(Po(W),D)+l+Pl(Ss(W),D)}function J5(l,m,D){l=st(l),m=Br(m);var I=m?ji(l):0;return m&&I>>0,D?(l=st(l),l&&(typeof m=="string"||m!=null&&!Xh(m))&&(m=Gn(m),!m&&ti(l))?oo(xn(l),0,D):l.split(m,D)):[]}var i6=Ps(function(l,m,D){return l+(D?" ":"")+jh(m)});function a6(l,m,D){return l=st(l),D=D==null?0:Sa(Br(D),0,l.length),m=Gn(m),l.slice(D,D+m.length)==m}function o6(l,m,D){var I=Z.templateSettings;D&&wn(l,m,D)&&(m=e),l=st(l),m=$l({},m,I,D0);var W=$l({},m.imports,I.imports,D0),J=rn(W),ae=Hu(W,J),fe,de,Re=0,qe=m.interpolate||Ya,Ve="__p += '",Ke=Ti((m.escape||Ya).source+"|"+qe.source+"|"+(qe===Yt?zt:Ya).source+"|"+(m.evaluate||Ya).source+"|$","g"),cr="//# sourceURL="+(at.call(m,"sourceURL")?(m.sourceURL+"").replace(/\\s/g," "):"lodash.templateSources["+ ++vm+"]")+\` -\`;l.replace(Ke,function(Dr,qr,Hr,Zn,Dn,Qn){return Hr||(Hr=Zn),Ve+=l.slice(Re,Qn).replace(Eu,Mm),qr&&(fe=!0,Ve+=\`' + +\`)}function II(c){return Fr(c)||$o(c)||!!(pl&&c&&c[pl])}function Ma(c,m){var D=typeof c;return m=m??q,!!m&&(D=="number"||D!="symbol"&&Mi.test(c))&&c>-1&&c%1==0&&c0){if(++m>=_)return arguments[0]}else m=0;return c.apply(e,arguments)}}function Ul(c,m){var D=-1,I=c.length,W=I-1;for(m=m===e?I:m;++D1?c[m-1]:e;return D=typeof D=="function"?(c.pop(),D):e,V0(c,D)});function Y0(c){var m=Z(c);return m.__chain__=!0,m}function H4(c,m){return m(c),c}function zl(c,m){return m(c)}var G4=Ca(function(c){var m=c.length,D=m?c[0]:0,I=this.__wrapped__,W=function(J){return Bs(J,c)};return m>1||this.__actions__.length||!(I instanceof Ir)||!Ma(D)?this.thru(W):(I=I.slice(D,+D+(m?1:0)),I.__actions__.push({func:zl,args:[W],thisArg:e}),new _n(I,this.__chain__).thru(function(J){return m&&!J.length&&J.push(e),J}))});function $4(){return Y0(this)}function Z4(){return new _n(this.value(),this.__chain__)}function Q4(){this.__values__===e&&(this.__values__=ix(this.value()));var c=this.__index__>=this.__values__.length,m=c?e:this.__values__[this.__index__++];return{done:c,value:m}}function X4(){return this}function J4(c){for(var m,D=this;D instanceof _s;){var I=R0(D);I.__index__=0,I.__values__=e,m?W.__wrapped__=I:m=I;var W=I;D=D.__wrapped__}return W.__wrapped__=c,m}function K4(){var c=this.__wrapped__;if(c instanceof Ir){var m=c;return this.__actions__.length&&(m=new Ir(this)),m=m.reverse(),m.__actions__.push({func:zl,args:[Gh],thisArg:e}),new _n(m,this.__chain__)}return this.thru(Gh)}function j4(){return o0(this.__wrapped__,this.__actions__)}var eP=Bl(function(c,m,D){at.call(c,D)?++c[D]:Pi(c,D,1)});function rP(c,m,D){var I=Fr(c)?hs:xh;return D&&wn(c,m,D)&&(m=e),I(c,xr(m,3))}function tP(c,m){var D=Fr(c)?ji:Cl;return D(c,xr(m,3))}var nP=g0(L0),iP=g0(q0);function aP(c,m){return Ht(Wl(c,m),1)}function oP(c,m){return Ht(Wl(c,m),V)}function sP(c,m,D){return D=D===e?1:Br(D),Ht(Wl(c,m),D)}function H0(c,m){var D=Fr(c)?Tt:ia;return D(c,xr(m,3))}function G0(c,m){var D=Fr(c)?Dm:El;return D(c,xr(m,3))}var uP=Bl(function(c,m,D){at.call(c,D)?c[D].push(m):Pi(c,D,[m])});function fP(c,m,D,I){c=On(c)?c:qs(c),D=D&&!I?Br(D):0;var W=c.length;return D<0&&(D=Ft(W+D,0)),$l(c)?D<=W&&c.indexOf(m,D)>-1:!!W&&Ja(c,m,D)>-1}var lP=Rr(function(c,m,D){var I=-1,W=typeof m=="function",J=On(c)?Ne(c.length):[];return ia(c,function(ae){J[++I]=W?an(m,ae,D):oi(ae,m,D)}),J}),cP=Bl(function(c,m,D){Pi(c,D,m)});function Wl(c,m){var D=Fr(c)?ct:Te;return D(c,xr(m,3))}function pP(c,m,D,I){return c==null?[]:(Fr(m)||(m=m==null?[]:[m]),D=I?e:D,Fr(D)||(D=D==null?[]:[D]),Ri(c,m,D))}var mP=Bl(function(c,m,D){c[D?0:1].push(m)},function(){return[[],[]]});function hP(c,m,D){var I=Fr(c)?Uu:rl,W=arguments.length<3;return I(c,xr(m,4),D,W,ia)}function dP(c,m,D){var I=Fr(c)?Sm:rl,W=arguments.length<3;return I(c,xr(m,4),D,W,El)}function vP(c,m){var D=Fr(c)?ji:Cl;return D(c,Hl(xr(m,3)))}function gP(c){var m=Fr(c)?Sl:fI;return m(c)}function xP(c,m,D){(D?wn(c,m,D):m===e)?m=1:m=Br(m);var I=Fr(c)?hh:lI;return I(c,m)}function yP(c){var m=Fr(c)?dh:pI;return m(c)}function bP(c){if(c==null)return 0;if(On(c))return $l(c)?ea(c):c.length;var m=pn(c);return m==Ae||m==ne?c.size:z(c).length}function wP(c,m,D){var I=Fr(c)?zu:mI;return D&&wn(c,m,D)&&(m=e),I(c,xr(m,3))}var DP=Rr(function(c,m){if(c==null)return[];var D=m.length;return D>1&&wn(c,m[0],m[1])?m=[]:D>2&&wn(m[0],m[1],m[2])&&(m=[m[0]]),Ri(c,Ht(m,1),[])}),Vl=Hm||function(){return Wt.Date.now()};function SP(c,m){if(typeof m!="function")throw new Mn(i);return c=Br(c),function(){if(--c<1)return m.apply(this,arguments)}}function $0(c,m,D){return m=D?e:m,m=c&&m==null?c.length:m,Ea(c,E,e,e,e,e,m)}function Z0(c,m){var D;if(typeof m!="function")throw new Mn(i);return c=Br(c),function(){return--c>0&&(D=m.apply(this,arguments)),c<=1&&(m=e),D}}var Zh=Rr(function(c,m,D){var I=x;if(D.length){var W=Yn(D,Rs(Zh));I|=b}return Ea(c,I,m,D,W)}),Q0=Rr(function(c,m,D){var I=x|v;if(D.length){var W=Yn(D,Rs(Q0));I|=b}return Ea(m,I,c,D,W)});function X0(c,m,D){m=D?e:m;var I=Ea(c,w,e,e,e,e,e,m);return I.placeholder=X0.placeholder,I}function J0(c,m,D){m=D?e:m;var I=Ea(c,C,e,e,e,e,e,m);return I.placeholder=J0.placeholder,I}function K0(c,m,D){var I,W,J,ae,fe,de,Re=0,qe=!1,Ve=!1,Ke=!0;if(typeof c!="function")throw new Mn(i);m=li(m)||0,Ct(D)&&(qe=!!D.leading,Ve="maxWait"in D,J=Ve?Ft(li(D.maxWait)||0,m):J,Ke="trailing"in D?!!D.trailing:Ke);function cr(Rt){var qi=I,Fa=W;return I=W=e,Re=Rt,ae=c.apply(Fa,qi),ae}function wr(Rt){return Re=Rt,fe=uf(qr,m),qe?cr(Rt):ae}function Pr(Rt){var qi=Rt-de,Fa=Rt-Re,gx=m-qi;return Ve?Et(gx,J-Fa):gx}function Dr(Rt){var qi=Rt-de,Fa=Rt-Re;return de===e||qi>=m||qi<0||Ve&&Fa>=J}function qr(){var Rt=Vl();if(Dr(Rt))return Hr(Rt);fe=uf(qr,Pr(Rt))}function Hr(Rt){return fe=e,Ke&&I?cr(Rt):(I=W=e,ae)}function Zn(){fe!==e&&u0(fe),Re=0,I=de=W=fe=e}function Dn(){return fe===e?ae:Hr(Vl())}function Qn(){var Rt=Vl(),qi=Dr(Rt);if(I=arguments,W=this,de=Rt,qi){if(fe===e)return wr(de);if(Ve)return u0(fe),fe=uf(qr,m),cr(de)}return fe===e&&(fe=uf(qr,m)),ae}return Qn.cancel=Zn,Qn.flush=Dn,Qn}var NP=Rr(function(c,m){return Al(c,1,m)}),AP=Rr(function(c,m,D){return Al(c,li(m)||0,D)});function EP(c){return Ea(c,O)}function Yl(c,m){if(typeof c!="function"||m!=null&&typeof m!="function")throw new Mn(i);var D=function(){var I=arguments,W=m?m.apply(this,I):I[0],J=D.cache;if(J.has(W))return J.get(W);var ae=c.apply(this,I);return D.cache=J.set(W,ae)||J,ae};return D.cache=new(Yl.Cache||Ii),D}Yl.Cache=Ii;function Hl(c){if(typeof c!="function")throw new Mn(i);return function(){var m=arguments;switch(m.length){case 0:return!c.call(this);case 1:return!c.call(this,m[0]);case 2:return!c.call(this,m[0],m[1]);case 3:return!c.call(this,m[0],m[1],m[2])}return!c.apply(this,m)}}function CP(c){return Z0(2,c)}var MP=hI(function(c,m){m=m.length==1&&Fr(m[0])?ct(m[0],cn(xr())):ct(Ht(m,1),cn(xr()));var D=m.length;return Rr(function(I){for(var W=-1,J=Et(I.length,D);++W=m}),$o=Tl(function(){return arguments}())?Tl:function(c){return Ot(c)&&at.call(c,"callee")&&!cl.call(c,"callee")},Fr=Ne.isArray,VP=Zf?cn(Zf):Sh;function On(c){return c!=null&&Gl(c.length)&&!_a(c)}function kt(c){return Ot(c)&&On(c)}function YP(c){return c===!0||c===!1||Ot(c)&&on(c)==pe}var uo=ml||od,HP=Lu?cn(Lu):Nh;function GP(c){return Ot(c)&&c.nodeType===1&&!ff(c)}function $P(c){if(c==null)return!0;if(On(c)&&(Fr(c)||typeof c=="string"||typeof c.splice=="function"||uo(c)||Ls(c)||$o(c)))return!c.length;var m=pn(c);if(m==Ae||m==ne)return!c.size;if(sf(c))return!z(c).length;for(var D in c)if(at.call(c,D))return!1;return!0}function ZP(c,m){return Vo(c,m)}function QP(c,m,D){D=typeof D=="function"?D:e;var I=D?D(c,m):e;return I===e?Vo(c,m,e,D):!!I}function Xh(c){if(!Ot(c))return!1;var m=on(c);return m==xe||m==Se||typeof c.message=="string"&&typeof c.name=="string"&&!ff(c)}function XP(c){return typeof c=="number"&&Ro(c)}function _a(c){if(!Ct(c))return!1;var m=on(c);return m==be||m==De||m==Me||m==ye}function ex(c){return typeof c=="number"&&c==Br(c)}function Gl(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=q}function Ct(c){var m=typeof c;return c!=null&&(m=="object"||m=="function")}function Ot(c){return c!=null&&typeof c=="object"}var rx=Qf?cn(Qf):nf;function JP(c,m){return c===m||aa(c,m,Uh(m))}function KP(c,m,D){return D=typeof D=="function"?D:e,aa(c,m,Uh(m),D)}function jP(c){return tx(c)&&c!=+c}function e5(c){if(RI(c))throw new Nr(n);return Yo(c)}function r5(c){return c===null}function t5(c){return c==null}function tx(c){return typeof c=="number"||Ot(c)&&on(c)==ze}function ff(c){if(!Ot(c)||on(c)!=K)return!1;var m=Ds(c);if(m===null)return!0;var D=at.call(m,"constructor")&&m.constructor;return typeof D=="function"&&D instanceof D&&Io.call(D)==zm}var Jh=Xf?cn(Xf):Wr;function n5(c){return ex(c)&&c>=-q&&c<=q}var nx=To?cn(To):g;function $l(c){return typeof c=="string"||!Fr(c)&&Ot(c)&&on(c)==ue}function $n(c){return typeof c=="symbol"||Ot(c)&&on(c)==Ee}var Ls=Ti?cn(Ti):N;function i5(c){return c===e}function a5(c){return Ot(c)&&pn(c)==Le}function o5(c){return Ot(c)&&on(c)==Ie}var s5=Rl(se),u5=Rl(function(c,m){return c<=m});function ix(c){if(!c)return[];if(On(c))return $l(c)?xn(c):Fn(c);if(Po&&c[Po])return Om(c[Po]());var m=pn(c),D=m==Ae?$u:m==ne?ja:qs;return D(c)}function Ta(c){if(!c)return c===0?c:0;if(c=li(c),c===V||c===-V){var m=c<0?-1:1;return m*R}return c===c?c:0}function Br(c){var m=Ta(c),D=m%1;return m===m?D?m-D:m:0}function ax(c){return c?Na(Br(c),0,U):0}function li(c){if(typeof c=="number")return c;if($n(c))return j;if(Ct(c)){var m=typeof c.valueOf=="function"?c.valueOf():c;c=Ct(m)?m+"":m}if(typeof c!="string")return c===0?c:+c;c=tl(c);var D=At.test(c);return D||Wn.test(c)?Gf(c.slice(2),D?2:8):Cn.test(c)?j:+c}function ox(c){return oa(c,Bn(c))}function f5(c){return c?Na(Br(c),-q,q):c===0?c:0}function st(c){return c==null?"":Gn(c)}var l5=Ps(function(c,m){if(sf(m)||On(m)){oa(m,rn(m),c);return}for(var D in m)at.call(m,D)&&Wo(c,D,m[D])}),sx=Ps(function(c,m){oa(m,Bn(m),c)}),Zl=Ps(function(c,m,D,I){oa(m,Bn(m),c,I)}),c5=Ps(function(c,m,D,I){oa(m,rn(m),c,I)}),p5=Ca(Bs);function m5(c,m){var D=io(c);return m==null?D:Ju(D,m)}var h5=Rr(function(c,m){c=kr(c);var D=-1,I=m.length,W=I>2?m[2]:e;for(W&&wn(m[0],m[1],W)&&(I=1);++D1),J}),oa(c,Lh(c),D),I&&(D=yn(D,o|u|p,AI));for(var W=m.length;W--;)Th(D,m[W]);return D});function O5(c,m){return fx(c,Hl(xr(m)))}var B5=Ca(function(c,m){return c==null?{}:oI(c,m)});function fx(c,m){if(c==null)return{};var D=ct(Lh(c),function(I){return[I]});return m=xr(m),e0(c,D,function(I,W){return m(I,W[0])})}function I5(c,m,D){m=oo(m,c);var I=-1,W=m.length;for(W||(W=1,c=e);++Im){var I=c;c=m,m=I}if(D||c%1||m%1){var W=vl();return Et(c+W*(m-c+Hf("1e-"+((W+"").length-1))),m)}return Ch(c,m)}var H5=ks(function(c,m,D){return m=m.toLowerCase(),c+(D?px(m):m)});function px(c){return ed(st(c).toLowerCase())}function mx(c){return c=st(c),c&&c.replace(Eu,il).replace(pm,"")}function G5(c,m,D){c=st(c),m=Gn(m);var I=c.length;D=D===e?I:Na(Br(D),0,I);var W=D;return D-=m.length,D>=0&&c.slice(D,W)==m}function $5(c){return c=st(c),c&&fr.test(c)?c.replace(Be,Mm):c}function Z5(c){return c=st(c),c&&Ya.test(c)?c.replace(Ci,"\\\\$&"):c}var Q5=ks(function(c,m,D){return c+(D?"-":"")+m.toLowerCase()}),X5=ks(function(c,m,D){return c+(D?" ":"")+m.toLowerCase()}),J5=v0("toLowerCase");function K5(c,m,D){c=st(c),m=Br(m);var I=m?ea(c):0;if(!m||I>=m)return c;var W=(m-I)/2;return kl(ko(W),D)+c+kl(Ns(W),D)}function j5(c,m,D){c=st(c),m=Br(m);var I=m?ea(c):0;return m&&I>>0,D?(c=st(c),c&&(typeof m=="string"||m!=null&&!Jh(m))&&(m=Gn(m),!m&&ni(c))?so(xn(c),0,D):c.split(m,D)):[]}var o6=ks(function(c,m,D){return c+(D?" ":"")+ed(m)});function s6(c,m,D){return c=st(c),D=D==null?0:Na(Br(D),0,c.length),m=Gn(m),c.slice(D,D+m.length)==m}function u6(c,m,D){var I=Z.templateSettings;D&&wn(c,m,D)&&(m=e),c=st(c),m=Zl({},m,I,S0);var W=Zl({},m.imports,I.imports,S0),J=rn(W),ae=Gu(W,J),fe,de,Re=0,qe=m.interpolate||Ha,Ve="__p += '",Ke=Fi((m.escape||Ha).source+"|"+qe.source+"|"+(qe===Yt?zt:Ha).source+"|"+(m.evaluate||Ha).source+"|$","g"),cr="//# sourceURL="+(at.call(m,"sourceURL")?(m.sourceURL+"").replace(/\\s/g," "):"lodash.templateSources["+ ++gm+"]")+\` +\`;c.replace(Ke,function(Dr,qr,Hr,Zn,Dn,Qn){return Hr||(Hr=Zn),Ve+=c.slice(Re,Qn).replace(Cu,_m),qr&&(fe=!0,Ve+=\`' + __e(\`+qr+\`) + '\`),Dn&&(de=!0,Ve+=\`'; \`+Dn+\`; @@ -88226,24 +88454,24 @@ __p += '\`),Hr&&(Ve+=\`' + \`;var wr=at.call(m,"variable")&&m.variable;if(!wr)Ve=\`with (obj) { \`+Ve+\` } -\`;else if(va.test(wr))throw new Nr(a);Ve=(de?Ve.replace(We,""):Ve).replace(B,"$1").replace(Q,"$1;"),Ve="function("+(wr||"obj")+\`) { +\`;else if(ga.test(wr))throw new Nr(a);Ve=(de?Ve.replace(We,""):Ve).replace(B,"$1").replace(Q,"$1;"),Ve="function("+(wr||"obj")+\`) { \`+(wr?"":\`obj || (obj = {}); \`)+"var __t, __p = ''"+(fe?", __e = _.escape":"")+(de?\`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } \`:\`; \`)+Ve+\`return __p -}\`;var Pr=hx(function(){return jr(J,cr+"return "+Ve).apply(e,ae)});if(Pr.source=Ve,Qh(Pr))throw Pr;return Pr}function s6(l){return st(l).toLowerCase()}function u6(l){return st(l).toUpperCase()}function f6(l,m,D){if(l=st(l),l&&(D||m===e))return rl(l);if(!l||!(m=Gn(m)))return l;var I=xn(l),W=xn(m),J=ht(I,W),ae=tl(I,W)+1;return oo(I,J,ae).join("")}function l6(l,m,D){if(l=st(l),l&&(D||m===e))return l.slice(0,vs(l)+1);if(!l||!(m=Gn(m)))return l;var I=xn(l),W=tl(I,xn(m))+1;return oo(I,0,W).join("")}function c6(l,m,D){if(l=st(l),l&&(D||m===e))return l.replace(rr,"");if(!l||!(m=Gn(m)))return l;var I=xn(l),W=ht(I,xn(m));return oo(I,W).join("")}function p6(l,m){var D=F,I=M;if(Ct(m)){var W="separator"in m?m.separator:W;D="length"in m?Br(m.length):D,I="omission"in m?Gn(m.omission):I}l=st(l);var J=l.length;if(ti(l)){var ae=xn(l);J=ae.length}if(D>=J)return l;var fe=D-ji(I);if(fe<1)return I;var de=ae?oo(ae,0,fe).join(""):l.slice(0,fe);if(W===e)return de+I;if(ae&&(fe+=de.length-fe),Xh(W)){if(l.slice(fe).search(W)){var Re,qe=de;for(W.global||(W=Ti(W.source,st(En.exec(W))+"g")),W.lastIndex=0;Re=W.exec(qe);)var Ve=Re.index;de=de.slice(0,Ve===e?fe:Ve)}}else if(l.indexOf(Gn(W),fe)!=fe){var Ke=de.lastIndexOf(W);Ke>-1&&(de=de.slice(0,Ke))}return de+I}function m6(l){return l=st(l),l&&er.test(l)?l.replace(ve,Im):l}var h6=Ps(function(l,m,D){return l+(D?" ":"")+m.toUpperCase()}),jh=d0("toUpperCase");function mx(l,m,D){return l=st(l),m=D?e:m,m===e?Tm(l)?Rm(l):Nm(l):l.match(m)||[]}var hx=Rr(function(l,m){try{return an(l,e,m)}catch(D){return Qh(D)?D:new Nr(D)}}),d6=Ea(function(l,m){return Tt(m,function(D){D=oa(D),Ii(l,D,$h(l[D],l))}),l});function v6(l){var m=l==null?0:l.length,D=xr();return l=m?ct(l,function(I){if(typeof I[1]!="function")throw new Mn(i);return[D(I[0]),I[1]]}):[],Rr(function(I){for(var W=-1;++Wq)return[];var D=U,I=Et(l,U);m=xr(m),l-=U;for(var W=Yu(I,m);++D0||m<0)?new Ir(D):(l<0?D=D.takeRight(-l):l&&(D=D.drop(l)),m!==e&&(m=Br(m),D=m<0?D.dropRight(-m):D.take(m-l)),D)},Ir.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Ir.prototype.toArray=function(){return this.take(U)},ni(Ir.prototype,function(l,m){var D=/^(?:filter|find|map|reject)|While$/.test(m),I=/^(?:head|last)$/.test(m),W=Z[I?"take"+(m=="last"?"Right":""):m],J=I||/^find/.test(m);!W||(Z.prototype[m]=function(){var ae=this.__wrapped__,fe=I?[1]:arguments,de=ae instanceof Ir,Re=fe[0],qe=de||Fr(ae),Ve=function(qr){var Hr=W.apply(Z,ri([qr],fe));return I&&Ke?Hr[0]:Hr};qe&&D&&typeof Re=="function"&&Re.length!=1&&(de=qe=!1);var Ke=this.__chain__,cr=!!this.__actions__.length,wr=J&&!Ke,Pr=de&&!cr;if(!J&&qe){ae=Pr?ae:new Ir(this);var Dr=l.apply(ae,fe);return Dr.__actions__.push({func:Ul,args:[Ve],thisArg:e}),new _n(Dr,Ke)}return wr&&Pr?l.apply(this,fe):(Dr=this.thru(Ve),wr?I?Dr.value()[0]:Dr.value():Dr)})}),Tt(["pop","push","shift","sort","splice","unshift"],function(l){var m=Oo[l],D=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",I=/^(?:pop|shift)$/.test(l);Z.prototype[l]=function(){var W=arguments;if(I&&!this.__chain__){var J=this.value();return m.apply(Fr(J)?J:[],W)}return this[D](function(ae){return m.apply(Fr(ae)?ae:[],W)})}}),ni(Ir.prototype,function(l,m){var D=Z[m];if(D){var I=D.name+"";at.call(to,I)||(to[I]=[]),to[I].push({name:m,func:D})}}),to[Bl(e,v).name]=[{name:"wrapper",func:e}],Ir.prototype.clone=Km,Ir.prototype.reverse=jm,Ir.prototype.value=eh,Z.prototype.at=Y4,Z.prototype.chain=H4,Z.prototype.commit=G4,Z.prototype.next=$4,Z.prototype.plant=Q4,Z.prototype.reverse=X4,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=J4,Z.prototype.first=Z.prototype.head,Io&&(Z.prototype[Io]=Z4),Z},ea=Lm();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Wt._=ea,define(function(){return ea})):Ji?((Ji.exports=ea)._=ea,ku._=ea):Wt._=ea}).call(qs)});var Wx=un((Td,zs)=>{(function(e,r){typeof Td=="object"&&typeof zs<"u"?zs.exports=r():typeof define=="function"&&define.amd?define(r):e.moment=r()})(Td,function(){"use strict";var e;function r(){return e.apply(null,arguments)}function t(g){e=g}function n(g){return g instanceof Array||Object.prototype.toString.call(g)==="[object Array]"}function i(g){return g!=null&&Object.prototype.toString.call(g)==="[object Object]"}function a(g,N){return Object.prototype.hasOwnProperty.call(g,N)}function s(g){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(g).length===0;var N;for(N in g)if(a(g,N))return!1;return!0}function c(g){return g===void 0}function f(g){return typeof g=="number"||Object.prototype.toString.call(g)==="[object Number]"}function o(g){return g instanceof Date||Object.prototype.toString.call(g)==="[object Date]"}function u(g,N){var P=[],z,G=g.length;for(z=0;z>>0,z;for(z=0;z0)for(P=0;P=J)return c;var fe=D-ea(I);if(fe<1)return I;var de=ae?so(ae,0,fe).join(""):c.slice(0,fe);if(W===e)return de+I;if(ae&&(fe+=de.length-fe),Jh(W)){if(c.slice(fe).search(W)){var Re,qe=de;for(W.global||(W=Fi(W.source,st(En.exec(W))+"g")),W.lastIndex=0;Re=W.exec(qe);)var Ve=Re.index;de=de.slice(0,Ve===e?fe:Ve)}}else if(c.indexOf(Gn(W),fe)!=fe){var Ke=de.lastIndexOf(W);Ke>-1&&(de=de.slice(0,Ke))}return de+I}function d6(c){return c=st(c),c&&er.test(c)?c.replace(ve,Pm):c}var v6=ks(function(c,m,D){return c+(D?" ":"")+m.toUpperCase()}),ed=v0("toUpperCase");function hx(c,m,D){return c=st(c),m=D?e:m,m===e?Fm(c)?Lm(c):Am(c):c.match(m)||[]}var dx=Rr(function(c,m){try{return an(c,e,m)}catch(D){return Xh(D)?D:new Nr(D)}}),g6=Ca(function(c,m){return Tt(m,function(D){D=sa(D),Pi(c,D,Zh(c[D],c))}),c});function x6(c){var m=c==null?0:c.length,D=xr();return c=m?ct(c,function(I){if(typeof I[1]!="function")throw new Mn(i);return[D(I[0]),I[1]]}):[],Rr(function(I){for(var W=-1;++Wq)return[];var D=U,I=Et(c,U);m=xr(m),c-=U;for(var W=Hu(I,m);++D0||m<0)?new Ir(D):(c<0?D=D.takeRight(-c):c&&(D=D.drop(c)),m!==e&&(m=Br(m),D=m<0?D.dropRight(-m):D.take(m-c)),D)},Ir.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Ir.prototype.toArray=function(){return this.take(U)},ii(Ir.prototype,function(c,m){var D=/^(?:filter|find|map|reject)|While$/.test(m),I=/^(?:head|last)$/.test(m),W=Z[I?"take"+(m=="last"?"Right":""):m],J=I||/^find/.test(m);!W||(Z.prototype[m]=function(){var ae=this.__wrapped__,fe=I?[1]:arguments,de=ae instanceof Ir,Re=fe[0],qe=de||Fr(ae),Ve=function(qr){var Hr=W.apply(Z,ti([qr],fe));return I&&Ke?Hr[0]:Hr};qe&&D&&typeof Re=="function"&&Re.length!=1&&(de=qe=!1);var Ke=this.__chain__,cr=!!this.__actions__.length,wr=J&&!Ke,Pr=de&&!cr;if(!J&&qe){ae=Pr?ae:new Ir(this);var Dr=c.apply(ae,fe);return Dr.__actions__.push({func:zl,args:[Ve],thisArg:e}),new _n(Dr,Ke)}return wr&&Pr?c.apply(this,fe):(Dr=this.thru(Ve),wr?I?Dr.value()[0]:Dr.value():Dr)})}),Tt(["pop","push","shift","sort","splice","unshift"],function(c){var m=Bo[c],D=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",I=/^(?:pop|shift)$/.test(c);Z.prototype[c]=function(){var W=arguments;if(I&&!this.__chain__){var J=this.value();return m.apply(Fr(J)?J:[],W)}return this[D](function(ae){return m.apply(Fr(ae)?ae:[],W)})}}),ii(Ir.prototype,function(c,m){var D=Z[m];if(D){var I=D.name+"";at.call(no,I)||(no[I]=[]),no[I].push({name:m,func:D})}}),no[Il(e,v).name]=[{name:"wrapper",func:e}],Ir.prototype.clone=jm,Ir.prototype.reverse=eh,Ir.prototype.value=rh,Z.prototype.at=G4,Z.prototype.chain=$4,Z.prototype.commit=Z4,Z.prototype.next=Q4,Z.prototype.plant=J4,Z.prototype.reverse=K4,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=j4,Z.prototype.first=Z.prototype.head,Po&&(Z.prototype[Po]=X4),Z},ra=qm();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Wt._=ra,define(function(){return ra})):Ki?((Ki.exports=ra)._=ra,Ru._=ra):Wt._=ra}).call(Us)});var Vx=un((Fd,Ws)=>{(function(e,r){typeof Fd=="object"&&typeof Ws<"u"?Ws.exports=r():typeof define=="function"&&define.amd?define(r):e.moment=r()})(Fd,function(){"use strict";var e;function r(){return e.apply(null,arguments)}function t(g){e=g}function n(g){return g instanceof Array||Object.prototype.toString.call(g)==="[object Array]"}function i(g){return g!=null&&Object.prototype.toString.call(g)==="[object Object]"}function a(g,N){return Object.prototype.hasOwnProperty.call(g,N)}function s(g){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(g).length===0;var N;for(N in g)if(a(g,N))return!1;return!0}function l(g){return g===void 0}function f(g){return typeof g=="number"||Object.prototype.toString.call(g)==="[object Number]"}function o(g){return g instanceof Date||Object.prototype.toString.call(g)==="[object Date]"}function u(g,N){var P=[],z,G=g.length;for(z=0;z>>0,z;for(z=0;z0)for(P=0;P=0;return(se?P?"+":"":"-")+Math.pow(10,Math.max(0,G)).toString().substr(1)+z}var U=/(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,oe=/(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,me={},ie={};function H(g,N,P,z){var G=z;typeof z=="string"&&(G=function(){return this[z]()}),g&&(ie[g]=G),N&&(ie[N[0]]=function(){return j(G.apply(this,arguments),N[1],N[2])}),P&&(ie[P]=function(){return this.localeData().ordinal(G.apply(this,arguments),g)})}function ce(g){return g.match(/\\[[\\s\\S]/)?g.replace(/^\\[|\\]$/g,""):g.replace(/\\\\/g,"")}function Me(g){var N=g.match(U),P,z;for(P=0,z=N.length;P=0&&oe.test(g);)g=g.replace(oe,z),oe.lastIndex=0,P-=1;return g}var Se={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function xe(g){var N=this._longDateFormat[g],P=this._longDateFormat[g.toUpperCase()];return N||!P?N:(this._longDateFormat[g]=P.match(U).map(function(z){return z==="MMMM"||z==="MM"||z==="DD"||z==="dddd"?z.slice(1):z}).join(""),this._longDateFormat[g])}var be="Invalid date";function De(){return this._invalidDate}var Ae="%d",ze=/\\d{1,2}/;function Ze(g){return this._ordinal.replace("%d",g)}var K={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function te(g,N,P,z){var G=this._relativeTime[P];return k(G)?G(g,N,P,z):G.replace(/%d/i,g)}function ye(g,N){var P=this._relativeTime[g>0?"future":"past"];return k(P)?P(N):P.replace(/%s/i,N)}var ee={};function ne(g,N){var P=g.toLowerCase();ee[P]=ee[P+"s"]=ee[N]=g}function ue(g){return typeof g=="string"?ee[g]||ee[g.toLowerCase()]:void 0}function Ee(g){var N={},P,z;for(z in g)a(g,z)&&(P=ue(z),P&&(N[P]=g[z]));return N}var Ce={};function Le(g,N){Ce[g]=N}function Ie(g){var N=[],P;for(P in g)a(g,P)&&N.push({unit:P,priority:Ce[P]});return N.sort(function(z,G){return z.priority-G.priority}),N}function sr(g){return g%4===0&&g%100!==0||g%400===0}function ir(g){return g<0?Math.ceil(g)||0:Math.floor(g)}function Xe(g){var N=+g,P=0;return N!==0&&isFinite(N)&&(P=ir(N)),P}function Or(g,N){return function(P){return P!=null?(le(this,g,P),r.updateOffset(this,N),this):re(this,g)}}function re(g,N){return g.isValid()?g._d["get"+(g._isUTC?"UTC":"")+N]():NaN}function le(g,N,P){g.isValid()&&!isNaN(P)&&(N==="FullYear"&&sr(g.year())&&g.month()===1&&g.date()===29?(P=Xe(P),g._d["set"+(g._isUTC?"UTC":"")+N](P,g.month(),Ha(P,g.month()))):g._d["set"+(g._isUTC?"UTC":"")+N](P))}function we(g){return g=ue(g),k(this[g])?this[g]():this}function Oe(g,N){if(typeof g=="object"){g=Ee(g);var P=Ie(g),z,G=P.length;for(z=0;z68?1900:2e3)};var Fu=Or("FullYear",!0);function im(){return sr(this.year())}function Pf(g,N,P,z,G,se,Te){var mr;return g<100&&g>=0?(mr=new Date(g+400,N,P,z,G,se,Te),isFinite(mr.getFullYear())&&mr.setFullYear(g)):mr=new Date(g,N,P,z,G,se,Te),mr}function Ga(g){var N,P;return g<100&&g>=0?(P=Array.prototype.slice.call(arguments),P[0]=g+400,N=new Date(Date.UTC.apply(null,P)),isFinite(N.getUTCFullYear())&&N.setUTCFullYear(g)):N=new Date(Date.UTC.apply(null,arguments)),N}function $a(g,N,P){var z=7+N-P,G=(7+Ga(g,0,z).getUTCDay()-N)%7;return-G+z-1}function kf(g,N,P,z,G){var se=(7+P-z)%7,Te=$a(g,z,G),mr=1+7*(N-1)+se+Te,Tr,et;return mr<=0?(Tr=g-1,et=Xi(Tr)+mr):mr>Xi(g)?(Tr=g+1,et=mr-Xi(g)):(Tr=g,et=mr),{year:Tr,dayOfYear:et}}function Za(g,N,P){var z=$a(g.year(),N,P),G=Math.floor((g.dayOfYear()-z-1)/7)+1,se,Te;return G<1?(Te=g.year()-1,se=G+Vn(Te,N,P)):G>Vn(g.year(),N,P)?(se=G-Vn(g.year(),N,P),Te=g.year()+1):(Te=g.year(),se=G),{week:se,year:Te}}function Vn(g,N,P){var z=$a(g,N,P),G=$a(g+1,N,P);return(Xi(g)-z+G)/7}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),ne("week","w"),ne("isoWeek","W"),Le("week",5),Le("isoWeek",5),rr("w",Q),rr("ww",Q,_e),rr("W",Q),rr("WW",Q,_e),va(["w","ww","W","WW"],function(g,N,P,z){N[z.substr(0,1)]=Xe(g)});function Ou(g){return Za(g,this._week.dow,this._week.doy).week}var Qa={dow:0,doy:6};function Rf(){return this._week.dow}function Lf(){return this._week.doy}function am(g){var N=this.localeData().week(this);return g==null?N:this.add((g-N)*7,"d")}function qf(g){var N=Za(this,1,4).week;return g==null?N:this.add((g-N)*7,"d")}H("d",0,"do","day"),H("dd",0,0,function(g){return this.localeData().weekdaysMin(this,g)}),H("ddd",0,0,function(g){return this.localeData().weekdaysShort(this,g)}),H("dddd",0,0,function(g){return this.localeData().weekdays(this,g)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),ne("day","d"),ne("weekday","e"),ne("isoWeekday","E"),Le("day",11),Le("weekday",11),Le("isoWeekday",11),rr("d",Q),rr("e",Q),rr("E",Q),rr("dd",function(g,N){return N.weekdaysMinRegex(g)}),rr("ddd",function(g,N){return N.weekdaysShortRegex(g)}),rr("dddd",function(g,N){return N.weekdaysRegex(g)}),va(["dd","ddd","dddd"],function(g,N,P,z){var G=P._locale.weekdaysParse(g,z,P._strict);G!=null?N.d=G:x(P).invalidWeekday=g}),va(["d","e","E"],function(g,N,P,z){N[z]=Xe(g)});function Uf(g,N){return typeof g!="string"?g:isNaN(g)?(g=N.weekdaysParse(g),typeof g=="number"?g:null):parseInt(g,10)}function zf(g,N){return typeof g=="string"?N.weekdaysParse(g)%7||7:isNaN(g)?null:g}function ps(g,N){return g.slice(N,7).concat(g.slice(0,N))}var om="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Wf="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),sm="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Vf=Ei,um=Ei,fm=Ei;function lm(g,N){var P=n(this._weekdays)?this._weekdays:this._weekdays[g&&g!==!0&&this._weekdays.isFormat.test(N)?"format":"standalone"];return g===!0?ps(P,this._week.dow):g?P[g.day()]:P}function cm(g){return g===!0?ps(this._weekdaysShort,this._week.dow):g?this._weekdaysShort[g.day()]:this._weekdaysShort}function Bu(g){return g===!0?ps(this._weekdaysMin,this._week.dow):g?this._weekdaysMin[g.day()]:this._weekdaysMin}function pm(g,N,P){var z,G,se,Te=g.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],z=0;z<7;++z)se=h([2e3,1]).day(z),this._minWeekdaysParse[z]=this.weekdaysMin(se,"").toLocaleLowerCase(),this._shortWeekdaysParse[z]=this.weekdaysShort(se,"").toLocaleLowerCase(),this._weekdaysParse[z]=this.weekdays(se,"").toLocaleLowerCase();return P?N==="dddd"?(G=pt.call(this._weekdaysParse,Te),G!==-1?G:null):N==="ddd"?(G=pt.call(this._shortWeekdaysParse,Te),G!==-1?G:null):(G=pt.call(this._minWeekdaysParse,Te),G!==-1?G:null):N==="dddd"?(G=pt.call(this._weekdaysParse,Te),G!==-1||(G=pt.call(this._shortWeekdaysParse,Te),G!==-1)?G:(G=pt.call(this._minWeekdaysParse,Te),G!==-1?G:null)):N==="ddd"?(G=pt.call(this._shortWeekdaysParse,Te),G!==-1||(G=pt.call(this._weekdaysParse,Te),G!==-1)?G:(G=pt.call(this._minWeekdaysParse,Te),G!==-1?G:null)):(G=pt.call(this._minWeekdaysParse,Te),G!==-1||(G=pt.call(this._weekdaysParse,Te),G!==-1)?G:(G=pt.call(this._shortWeekdaysParse,Te),G!==-1?G:null))}function mm(g,N,P){var z,G,se;if(this._weekdaysParseExact)return pm.call(this,g,N,P);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),z=0;z<7;z++){if(G=h([2e3,1]).day(z),P&&!this._fullWeekdaysParse[z]&&(this._fullWeekdaysParse[z]=new RegExp("^"+this.weekdays(G,"").replace(".","\\\\.?")+"$","i"),this._shortWeekdaysParse[z]=new RegExp("^"+this.weekdaysShort(G,"").replace(".","\\\\.?")+"$","i"),this._minWeekdaysParse[z]=new RegExp("^"+this.weekdaysMin(G,"").replace(".","\\\\.?")+"$","i")),this._weekdaysParse[z]||(se="^"+this.weekdays(G,"")+"|^"+this.weekdaysShort(G,"")+"|^"+this.weekdaysMin(G,""),this._weekdaysParse[z]=new RegExp(se.replace(".",""),"i")),P&&N==="dddd"&&this._fullWeekdaysParse[z].test(g))return z;if(P&&N==="ddd"&&this._shortWeekdaysParse[z].test(g))return z;if(P&&N==="dd"&&this._minWeekdaysParse[z].test(g))return z;if(!P&&this._weekdaysParse[z].test(g))return z}}function hm(g){if(!this.isValid())return g!=null?this:NaN;var N=this._isUTC?this._d.getUTCDay():this._d.getDay();return g!=null?(g=Uf(g,this.localeData()),this.add(g-N,"d")):N}function dm(g){if(!this.isValid())return g!=null?this:NaN;var N=(this.day()+7-this.localeData()._week.dow)%7;return g==null?N:this.add(g-N,"d")}function vm(g){if(!this.isValid())return g!=null?this:NaN;if(g!=null){var N=zf(g,this.localeData());return this.day(this.day()%7?N:N-7)}else return this.day()||7}function dt(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Iu.call(this),g?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Vf),this._weekdaysStrictRegex&&g?this._weekdaysStrictRegex:this._weekdaysRegex)}function mt(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Iu.call(this),g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=um),this._weekdaysShortStrictRegex&&g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function gm(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Iu.call(this),g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=fm),this._weekdaysMinStrictRegex&&g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Iu(){function g(sn,oi){return oi.length-sn.length}var N=[],P=[],z=[],G=[],se,Te,mr,Tr,et;for(se=0;se<7;se++)Te=h([2e3,1]).day(se),mr=nn(this.weekdaysMin(Te,"")),Tr=nn(this.weekdaysShort(Te,"")),et=nn(this.weekdays(Te,"")),N.push(mr),P.push(Tr),z.push(et),G.push(mr),G.push(Tr),G.push(et);N.sort(g),P.sort(g),z.sort(g),G.sort(g),this._weekdaysRegex=new RegExp("^("+G.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+z.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+P.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+N.join("|")+")","i")}function Pu(){return this.hours()%12||12}function xm(){return this.hours()||24}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Pu),H("k",["kk",2],0,xm),H("hmm",0,0,function(){return""+Pu.apply(this)+j(this.minutes(),2)}),H("hmmss",0,0,function(){return""+Pu.apply(this)+j(this.minutes(),2)+j(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+j(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+j(this.minutes(),2)+j(this.seconds(),2)});function Yf(g,N){H(g,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),N)})}Yf("a",!0),Yf("A",!1),ne("hour","h"),Le("hour",13);function Hf(g,N){return N._meridiemParse}rr("a",Hf),rr("A",Hf),rr("H",Q),rr("h",Q),rr("k",Q),rr("HH",Q,_e),rr("hh",Q,_e),rr("kk",Q,_e),rr("hmm",ve),rr("hmmss",Be),rr("Hmm",ve),rr("Hmmss",Be),nt(["H","HH"],At),nt(["k","kk"],function(g,N,P){var z=Xe(g);N[At]=z===24?0:z}),nt(["a","A"],function(g,N,P){P._isPm=P._locale.isPM(g),P._meridiem=g}),nt(["h","hh"],function(g,N,P){N[At]=Xe(g),x(P).bigHour=!0}),nt("hmm",function(g,N,P){var z=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z)),x(P).bigHour=!0}),nt("hmmss",function(g,N,P){var z=g.length-4,G=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z,2)),N[Wn]=Xe(g.substr(G)),x(P).bigHour=!0}),nt("Hmm",function(g,N,P){var z=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z))}),nt("Hmmss",function(g,N,P){var z=g.length-4,G=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z,2)),N[Wn]=Xe(g.substr(G))});function Gf(g){return(g+"").toLowerCase().charAt(0)==="p"}var ym=/[ap]\\.?m?\\.?/i,Wt=Or("Hours",!0);function ku(g,N,P){return g>11?P?"pm":"PM":P?"am":"AM"}var Ji={calendar:q,longDateFormat:Se,invalidDate:be,ordinal:Ae,dayOfMonthOrdinalParse:ze,relativeTime:K,months:Cu,monthsShort:us,week:Qa,weekdays:om,weekdaysMin:sm,weekdaysShort:Wf,meridiemParse:ym},vt={},xa={},en;function $f(g,N){var P,z=Math.min(g.length,N.length);for(P=0;P0;){if(G=_o(se.slice(0,P).join("-")),G)return G;if(z&&z.length>=P&&$f(se,z)>=P-1)break;P--}N++}return en}function Qf(g){return g.match("^[^/\\\\\\\\]*$")!=null}function _o(g){var N=null,P;if(vt[g]===void 0&&typeof zs<"u"&&zs&&zs.exports&&Qf(g))try{N=en._abbr,P=require,P("./locale/"+g),_i(N)}catch{vt[g]=null}return vt[g]}function _i(g,N){var P;return g&&(c(N)?P=Tt(g):P=an(g,N),P?en=P:typeof console<"u"&&console.warn&&console.warn("Locale "+g+" not found. Did you forget to load it?")),en._abbr}function an(g,N){if(N!==null){var P,z=Ji;if(N.abbr=g,vt[g]!=null)_("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),z=vt[g]._config;else if(N.parentLocale!=null)if(vt[N.parentLocale]!=null)z=vt[N.parentLocale]._config;else if(P=_o(N.parentLocale),P!=null)z=P._config;else return xa[N.parentLocale]||(xa[N.parentLocale]=[]),xa[N.parentLocale].push({name:g,config:N}),null;return vt[g]=new $(Y(z,N)),xa[g]&&xa[g].forEach(function(G){an(G.name,G.config)}),_i(g),vt[g]}else return delete vt[g],null}function bm(g,N){if(N!=null){var P,z,G=Ji;vt[g]!=null&&vt[g].parentLocale!=null?vt[g].set(Y(vt[g]._config,N)):(z=_o(g),z!=null&&(G=z._config),N=Y(G,N),z==null&&(N.abbr=g),P=new $(N),P.parentLocale=vt[g],vt[g]=P),_i(g)}else vt[g]!=null&&(vt[g].parentLocale!=null?(vt[g]=vt[g].parentLocale,g===_i()&&_i(g)):vt[g]!=null&&delete vt[g]);return vt[g]}function Tt(g){var N;if(g&&g._locale&&g._locale._abbr&&(g=g._locale._abbr),!g)return en;if(!n(g)){if(N=_o(g),N)return N;g=[g]}return Zf(g)}function wm(){return V(vt)}function ms(g){var N,P=g._a;return P&&x(g).overflow===-2&&(N=P[En]<0||P[En]>11?En:P[Cn]<1||P[Cn]>Ha(P[zt],P[En])?Cn:P[At]<0||P[At]>24||P[At]===24&&(P[gn]!==0||P[Wn]!==0||P[Ci]!==0)?At:P[gn]<0||P[gn]>59?gn:P[Wn]<0||P[Wn]>59?Wn:P[Ci]<0||P[Ci]>999?Ci:-1,x(g)._overflowDayOfYear&&(NCn)&&(N=Cn),x(g)._overflowWeeks&&N===-1&&(N=Au),x(g)._overflowWeekday&&N===-1&&(N=Ya),x(g).overflow=N),g}var Ki=/^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,hs=/^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,Lu=/Z|[+-]\\d\\d(?::?\\d\\d)?/,ct=[["YYYYYY-MM-DD",/[+-]\\d{6}-\\d\\d-\\d\\d/],["YYYY-MM-DD",/\\d{4}-\\d\\d-\\d\\d/],["GGGG-[W]WW-E",/\\d{4}-W\\d\\d-\\d/],["GGGG-[W]WW",/\\d{4}-W\\d\\d/,!1],["YYYY-DDD",/\\d{4}-\\d{3}/],["YYYY-MM",/\\d{4}-\\d\\d/,!1],["YYYYYYMMDD",/[+-]\\d{10}/],["YYYYMMDD",/\\d{8}/],["GGGG[W]WWE",/\\d{4}W\\d{3}/],["GGGG[W]WW",/\\d{4}W\\d{2}/,!1],["YYYYDDD",/\\d{7}/],["YYYYMM",/\\d{6}/,!1],["YYYY",/\\d{4}/,!1]],ri=[["HH:mm:ss.SSSS",/\\d\\d:\\d\\d:\\d\\d\\.\\d+/],["HH:mm:ss,SSSS",/\\d\\d:\\d\\d:\\d\\d,\\d+/],["HH:mm:ss",/\\d\\d:\\d\\d:\\d\\d/],["HH:mm",/\\d\\d:\\d\\d/],["HHmmss.SSSS",/\\d\\d\\d\\d\\d\\d\\.\\d+/],["HHmmss,SSSS",/\\d\\d\\d\\d\\d\\d,\\d+/],["HHmmss",/\\d\\d\\d\\d\\d\\d/],["HHmm",/\\d\\d\\d\\d/],["HH",/\\d\\d/]],qu=/^\\/?Date\\((-?\\d+)/i,Dm=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,Uu={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Xf(g){var N,P,z=g._i,G=Ki.exec(z)||hs.exec(z),se,Te,mr,Tr,et=ct.length,sn=ri.length;if(G){for(x(g).iso=!0,N=0,P=et;NXi(Te)||g._dayOfYear===0)&&(x(g)._overflowDayOfYear=!0),P=Ga(Te,0,g._dayOfYear),g._a[En]=P.getUTCMonth(),g._a[Cn]=P.getUTCDate()),N=0;N<3&&g._a[N]==null;++N)g._a[N]=z[N]=G[N];for(;N<7;N++)g._a[N]=z[N]=g._a[N]==null?N===2?1:0:g._a[N];g._a[At]===24&&g._a[gn]===0&&g._a[Wn]===0&&g._a[Ci]===0&&(g._nextDay=!0,g._a[At]=0),g._d=(g._useUTC?Ga:Pf).apply(null,z),se=g._useUTC?g._d.getUTCDay():g._d.getDay(),g._tzm!=null&&g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),g._nextDay&&(g._a[At]=24),g._w&&typeof g._w.d<"u"&&g._w.d!==se&&(x(g).weekdayMismatch=!0)}}function el(g){var N,P,z,G,se,Te,mr,Tr,et;N=g._w,N.GG!=null||N.W!=null||N.E!=null?(se=1,Te=4,P=ya(N.GG,g._a[zt],Za(ht(),1,4).year),z=ya(N.W,1),G=ya(N.E,1),(G<1||G>7)&&(Tr=!0)):(se=g._locale._week.dow,Te=g._locale._week.doy,et=Za(ht(),se,Te),P=ya(N.gg,g._a[zt],et.year),z=ya(N.w,et.week),N.d!=null?(G=N.d,(G<0||G>6)&&(Tr=!0)):N.e!=null?(G=N.e+se,(N.e<0||N.e>6)&&(Tr=!0)):G=se),z<1||z>Vn(P,se,Te)?x(g)._overflowWeeks=!0:Tr!=null?x(g)._overflowWeekday=!0:(mr=kf(P,z,G,se,Te),g._a[zt]=mr.year,g._dayOfYear=mr.dayOfYear)}r.ISO_8601=function(){},r.RFC_2822=function(){};function Wu(g){if(g._f===r.ISO_8601){Xf(g);return}if(g._f===r.RFC_2822){Kf(g);return}g._a=[],x(g).empty=!0;var N=""+g._i,P,z,G,se,Te,mr=N.length,Tr=0,et,sn;for(G=ge(g._f,g._locale).match(U)||[],sn=G.length,P=0;P0&&x(g).unusedInput.push(Te),N=N.slice(N.indexOf(z)+z.length),Tr+=z.length),ie[se]?(z?x(g).empty=!1:x(g).unusedTokens.push(se),Nu(se,z,g)):g._strict&&!z&&x(g).unusedTokens.push(se);x(g).charsLeftOver=mr-Tr,N.length>0&&x(g).unusedInput.push(N),g._a[At]<=12&&x(g).bigHour===!0&&g._a[At]>0&&(x(g).bigHour=void 0),x(g).parsedDateParts=g._a.slice(0),x(g).meridiem=g._meridiem,g._a[At]=Vu(g._locale,g._a[At],g._meridiem),et=x(g).era,et!==null&&(g._a[zt]=g._locale.erasConvertYear(et,g._a[zt])),To(g),ms(g)}function Vu(g,N,P){var z;return P==null?N:g.meridiemHour!=null?g.meridiemHour(N,P):(g.isPM!=null&&(z=g.isPM(P),z&&N<12&&(N+=12),!z&&N===12&&(N=0)),N)}function Yu(g){var N,P,z,G,se,Te,mr=!1,Tr=g._f.length;if(Tr===0){x(g).invalidFormat=!0,g._d=new Date(NaN);return}for(G=0;Gthis?this:g:w()});function nl(g,N){var P,z;if(N.length===1&&n(N[0])&&(N=N[0]),!N.length)return ht();for(P=N[0],z=1;zthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Fe(){if(!c(this._isDSTShifted))return this._isDSTShifted;var g={},N;return A(g,this),g=cn(g),g._a?(N=g._isUTC?h(g._a):ht(g._a),this._isDSTShifted=this.isValid()&&Om(g._a,N.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Ne(){return this.isValid()?!this._isUTC:!1}function nr(){return this.isValid()?this._isUTC:!1}function Nr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var jr=/^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,Pt=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function kr(g,N){var P=g,z=null,G,se,Te;return Yn(g)?P={ms:g._milliseconds,d:g._days,M:g._months}:f(g)||!isNaN(+g)?(P={},N?P[N]=+g:P.milliseconds=+g):(z=jr.exec(g))?(G=z[1]==="-"?-1:1,P={y:0,d:Xe(z[Cn])*G,h:Xe(z[At])*G,m:Xe(z[gn])*G,s:Xe(z[Wn])*G,ms:Xe(Ka(z[Ci]*1e3))*G}):(z=Pt.exec(g))?(G=z[1]==="-"?-1:1,P={y:Ti(z[2],G),M:Ti(z[3],G),w:Ti(z[4],G),d:Ti(z[5],G),h:Ti(z[6],G),m:Ti(z[7],G),s:Ti(z[8],G)}):P==null?P={}:typeof P=="object"&&("from"in P||"to"in P)&&(Te=Mn(ht(P.from),ht(P.to)),P={},P.ms=Te.milliseconds,P.M=Te.months),se=new Fo(P),Yn(g)&&a(g,"_locale")&&(se._locale=g._locale),Yn(g)&&a(g,"_isValid")&&(se._isValid=g._isValid),se}kr.fn=Fo.prototype,kr.invalid=Gu;function Ti(g,N){var P=g&&parseFloat(g.replace(",","."));return(isNaN(P)?0:P)*N}function al(g,N){var P={};return P.months=N.month()-g.month()+(N.year()-g.year())*12,g.clone().add(P.months,"M").isAfter(N)&&--P.months,P.milliseconds=+N-+g.clone().add(P.months,"M"),P}function Mn(g,N){var P;return g.isValid()&&N.isValid()?(N=xn(N,g),g.isBefore(N)?P=al(g,N):(P=al(N,g),P.milliseconds=-P.milliseconds,P.months=-P.months),P):{milliseconds:0,months:0}}function Oo(g,N){return function(P,z){var G,se;return z!==null&&!isNaN(+z)&&(_(N,"moment()."+N+"(period, number) is deprecated. Please use moment()."+N+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),se=P,P=z,z=se),G=kr(P,z),ol(this,G,g),this}}function ol(g,N,P,z){var G=N._milliseconds,se=Ka(N._days),Te=Ka(N._months);!g.isValid()||(z=z??!0,Te&&Qi(g,re(g,"Month")+Te*P),se&&le(g,"Date",re(g,"Date")+se*P),G&&g._d.setTime(g._d.valueOf()+G*P),z&&r.updateOffset(g,se||Te))}var ja=Oo(1,"add"),gs=Oo(-1,"subtract");function Bo(g){return typeof g=="string"||g instanceof String}function at(g){return S(g)||o(g)||Bo(g)||f(g)||sl(g)||qm(g)||g===null||g===void 0}function qm(g){var N=i(g)&&!s(g),P=!1,z=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],G,se,Te=z.length;for(G=0;GP.valueOf():P.valueOf()9999?pe(P,N?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):k(Date.prototype.toISOString)?N?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",pe(P,"Z")):pe(P,N?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function wa(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var g="moment",N="",P,z,G,se;return this.isLocal()||(g=this.utcOffset()===0?"moment.utc":"moment.parseZone",N="Z"),P="["+g+'("]',z=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",G="-MM-DD[T]HH:mm:ss.SSS",se=N+'[")]',this.format(P+z+G+se)}function Ds(g){g||(g=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var N=pe(this,g);return this.localeData().postformat(N)}function Vm(g,N){return this.isValid()&&(S(g)&&g.isValid()||ht(g).isValid())?kr({to:this,from:g}).locale(this.locale()).humanize(!N):this.localeData().invalidDate()}function Ym(g){return this.from(ht(),g)}function Hm(g,N){return this.isValid()&&(S(g)&&g.isValid()||ht(g).isValid())?kr({from:this,to:g}).locale(this.locale()).humanize(!N):this.localeData().invalidDate()}function Ss(g){return this.to(ht(),g)}function Po(g){var N;return g===void 0?this._locale._abbr:(N=Tt(g),N!=null&&(this._locale=N),this)}var Ns=F("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(g){return g===void 0?this.localeData():this.locale(g)});function pl(){return this._locale}var ko=1e3,eo=60*ko,As=60*eo,Ft=(365*400+97)*24*As;function Et(g,N){return(g%N+N)%N}function ml(g,N,P){return g<100&&g>=0?new Date(g+400,N,P)-Ft:new Date(g,N,P).valueOf()}function hl(g,N,P){return g<100&&g>=0?Date.UTC(g+400,N,P)-Ft:Date.UTC(g,N,P)}function dl(g){var N,P;if(g=ue(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(P=this._isUTC?hl:ml,g){case"year":N=P(this.year(),0,1);break;case"quarter":N=P(this.year(),this.month()-this.month()%3,1);break;case"month":N=P(this.year(),this.month(),1);break;case"week":N=P(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":N=P(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":N=P(this.year(),this.month(),this.date());break;case"hour":N=this._d.valueOf(),N-=Et(N+(this._isUTC?0:this.utcOffset()*eo),As);break;case"minute":N=this._d.valueOf(),N-=Et(N,eo);break;case"second":N=this._d.valueOf(),N-=Et(N,ko);break}return this._d.setTime(N),r.updateOffset(this,!0),this}function Gm(g){var N,P;if(g=ue(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(P=this._isUTC?hl:ml,g){case"year":N=P(this.year()+1,0,1)-1;break;case"quarter":N=P(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":N=P(this.year(),this.month()+1,1)-1;break;case"week":N=P(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":N=P(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":N=P(this.year(),this.month(),this.date()+1)-1;break;case"hour":N=this._d.valueOf(),N+=As-Et(N+(this._isUTC?0:this.utcOffset()*eo),As)-1;break;case"minute":N=this._d.valueOf(),N+=eo-Et(N,eo)-1;break;case"second":N=this._d.valueOf(),N+=ko-Et(N,ko)-1;break}return this._d.setTime(N),r.updateOffset(this,!0),this}function $u(){return this._d.valueOf()-(this._offset||0)*6e4}function Ro(){return Math.floor(this.valueOf()/1e3)}function Zu(){return new Date(this.valueOf())}function ro(){var g=this;return[g.year(),g.month(),g.date(),g.hour(),g.minute(),g.second(),g.millisecond()]}function Lo(){var g=this;return{years:g.year(),months:g.month(),date:g.date(),hours:g.hours(),minutes:g.minutes(),seconds:g.seconds(),milliseconds:g.milliseconds()}}function qo(){return this.isValid()?this.toISOString():null}function Es(){return y(this)}function to(){return p({},x(this))}function $m(){return x(this).overflow}function Zm(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),rr("N",Ir),rr("NN",Ir),rr("NNN",Ir),rr("NNNN",Km),rr("NNNNN",jm),nt(["N","NN","NNN","NNNN","NNNNN"],function(g,N,P,z){var G=P._locale.erasParse(g,z,P._strict);G?x(P).era=G:x(P).invalidEra=g}),rr("y",_t),rr("yy",_t),rr("yyy",_t),rr("yyyy",_t),rr("yo",eh),nt(["y","yy","yyy","yyyy"],zt),nt(["yo"],function(g,N,P,z){var G;P._locale._eraYearOrdinalRegex&&(G=g.match(P._locale._eraYearOrdinalRegex)),P._locale.eraYearOrdinalParse?N[zt]=P._locale.eraYearOrdinalParse(g,G):N[zt]=parseInt(g,10)});function Qm(g,N){var P,z,G,se=this._eras||Tt("en")._eras;for(P=0,z=se.length;P=0)return se[z]}function Jm(g,N){var P=g.since<=g.until?1:-1;return N===void 0?r(g.since).year():r(g.since).year()+(N-g.offset)*P}function Cs(){var g,N,P,z=this.localeData().eras();for(g=0,N=z.length;gse&&(N=se),oh.call(this,g,N,P,z,G))}function oh(g,N,P,z,G){var se=kf(g,N,P,z,G),Te=Ga(se.year,0,se.dayOfYear);return this.year(Te.getUTCFullYear()),this.month(Te.getUTCMonth()),this.date(Te.getUTCDate()),this}H("Q",0,"Qo","quarter"),ne("quarter","Q"),Le("quarter",7),rr("Q",ke),nt("Q",function(g,N){N[En]=(Xe(g)-1)*3});function sh(g){return g==null?Math.ceil((this.month()+1)/3):this.month((g-1)*3+this.month()%3)}H("D",["DD",2],"Do","date"),ne("date","D"),Le("date",9),rr("D",Q),rr("DD",Q,_e),rr("Do",function(g,N){return g?N._dayOfMonthOrdinalParse||N._ordinalParse:N._dayOfMonthOrdinalParseLenient}),nt(["D","DD"],Cn),nt("Do",function(g,N){N[Cn]=Xe(g.match(Q)[0])});var xl=Or("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),ne("dayOfYear","DDD"),Le("dayOfYear",4),rr("DDD",er),rr("DDDD",Pe),nt(["DDD","DDDD"],function(g,N,P){P._dayOfYear=Xe(g)});function Bi(g){var N=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return g==null?N:this.add(g-N,"d")}H("m",["mm",2],0,"minute"),ne("minute","m"),Le("minute",14),rr("m",Q),rr("mm",Q,_e),nt(["m","mm"],gn);var uh=Or("Minutes",!1);H("s",["ss",2],0,"second"),ne("second","s"),Le("second",15),rr("s",Q),rr("ss",Q,_e),nt(["s","ss"],Wn);var fh=Or("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return this.millisecond()*10}),H(0,["SSSSS",5],0,function(){return this.millisecond()*100}),H(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),H(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),H(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),H(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ne("millisecond","ms"),Le("millisecond",16),rr("S",er,ke),rr("SS",er,_e),rr("SSS",er,Pe);var ta,yl;for(ta="SSSS";ta.length<=9;ta+="S")rr(ta,_t);function lh(g,N){N[Ci]=Xe(("0."+g)*1e3)}for(ta="S";ta.length<=9;ta+="S")nt(ta,lh);yl=Or("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");function Da(){return this._isUTC?"UTC":""}function ch(){return this._isUTC?"Coordinated Universal Time":""}var Ye=E.prototype;Ye.add=ja,Ye.calendar=zm,Ye.clone=Wm,Ye.diff=ll,Ye.endOf=Gm,Ye.format=Ds,Ye.from=Vm,Ye.fromNow=Ym,Ye.to=Hm,Ye.toNow=Ss,Ye.get=we,Ye.invalidAt=$m,Ye.isAfter=ys,Ye.isBefore=ra,Ye.isBetween=bs,Ye.isSame=ul,Ye.isSameOrAfter=ws,Ye.isSameOrBefore=fl,Ye.isValid=Es,Ye.lang=Ns,Ye.locale=Po,Ye.localeData=pl,Ye.max=Em,Ye.min=tl,Ye.parsingFlags=to,Ye.set=Oe,Ye.startOf=dl,Ye.subtract=gs,Ye.toArray=ro,Ye.toObject=Lo,Ye.toDate=Zu,Ye.toISOString=Io,Ye.inspect=wa,typeof Symbol<"u"&&Symbol.for!=null&&(Ye[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Ye.toJSON=qo,Ye.toString=cl,Ye.unix=Ro,Ye.valueOf=$u,Ye.creationData=Zm,Ye.eraName=Cs,Ye.eraNarrow=Uo,Ye.eraAbbr=vl,Ye.eraYear=Z,Ye.year=Fu,Ye.isLeapYear=im,Ye.weekYear=rh,Ye.isoWeekYear=th,Ye.quarter=Ye.quarters=sh,Ye.month=Mi,Ye.daysInMonth=cs,Ye.week=Ye.weeks=am,Ye.isoWeek=Ye.isoWeeks=qf,Ye.weeksInYear=Oi,Ye.weeksInWeekYear=ah,Ye.isoWeeksInYear=nh,Ye.isoWeeksInISOWeekYear=ih,Ye.date=xl,Ye.day=Ye.days=hm,Ye.weekday=dm,Ye.isoWeekday=vm,Ye.dayOfYear=Bi,Ye.hour=Ye.hours=Wt,Ye.minute=Ye.minutes=uh,Ye.second=Ye.seconds=fh,Ye.millisecond=Ye.milliseconds=yl,Ye.utcOffset=Im,Ye.utc=km,Ye.local=Rm,Ye.parseZone=Lm,Ye.hasAlignedHourOffset=ea,Ye.isDST=he,Ye.isLocal=Ne,Ye.isUtcOffset=nr,Ye.isUtc=Nr,Ye.isUTC=Nr,Ye.zoneAbbr=Da,Ye.zoneName=ch,Ye.dates=F("dates accessor is deprecated. Use date instead.",xl),Ye.months=F("months accessor is deprecated. Use month instead",Mi),Ye.years=F("years accessor is deprecated. Use year instead",Fu),Ye.zone=F("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Pm),Ye.isDSTShifted=F("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Fe);function Hn(g){return ht(g*1e3)}function ph(){return ht.apply(null,arguments).parseZone()}function bl(g){return g}var Qr=$.prototype;Qr.calendar=R,Qr.longDateFormat=xe,Qr.invalidDate=De,Qr.ordinal=Ze,Qr.preparse=bl,Qr.postformat=bl,Qr.relativeTime=te,Qr.pastFuture=ye,Qr.set=L,Qr.eras=Qm,Qr.erasParse=Xm,Qr.erasConvertYear=Jm,Qr.erasAbbrRegex=Ms,Qr.erasNameRegex=no,Qr.erasNarrowRegex=_n,Qr.months=ga,Qr.monthsShort=Kr,Qr.monthsParse=Mu,Qr.monthsRegex=nm,Qr.monthsShortRegex=_u,Qr.week=Ou,Qr.firstDayOfYear=Lf,Qr.firstDayOfWeek=Rf,Qr.weekdays=lm,Qr.weekdaysMin=Bu,Qr.weekdaysShort=cm,Qr.weekdaysParse=mm,Qr.weekdaysRegex=dt,Qr.weekdaysShortRegex=mt,Qr.weekdaysMinRegex=gm,Qr.isPM=Gf,Qr.meridiem=ku;function Ts(g,N,P,z){var G=Tt(),se=h().set(z,N);return G[P](se,g)}function wl(g,N,P){if(f(g)&&(N=g,g=void 0),g=g||"",N!=null)return Ts(g,N,P,"month");var z,G=[];for(z=0;z<12;z++)G[z]=Ts(g,z,P,"month");return G}function Fs(g,N,P,z){typeof g=="boolean"?(f(N)&&(P=N,N=void 0),N=N||""):(N=g,P=N,g=!1,f(N)&&(P=N,N=void 0),N=N||"");var G=Tt(),se=g?G._week.dow:0,Te,mr=[];if(P!=null)return Ts(N,(P+se)%7,z,"day");for(Te=0;Te<7;Te++)mr[Te]=Ts(N,(Te+se)%7,z,"day");return mr}function Dl(g,N){return wl(g,N,"months")}function mh(g,N){return wl(g,N,"monthsShort")}function hh(g,N,P){return Fs(g,N,P,"weekdays")}function Qu(g,N,P){return Fs(g,N,P,"weekdaysShort")}function zo(g,N,P){return Fs(g,N,P,"weekdaysMin")}_i("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\\d{1,2}(th|st|nd|rd)/,ordinal:function(g){var N=g%10,P=Xe(g%100/10)===1?"th":N===1?"st":N===2?"nd":N===3?"rd":"th";return g+P}}),r.lang=F("moment.lang is deprecated. Use moment.locale instead.",_i),r.langData=F("moment.langData is deprecated. Use moment.localeData instead.",Tt);var Tn=Math.abs;function dh(){var g=this._data;return this._milliseconds=Tn(this._milliseconds),this._days=Tn(this._days),this._months=Tn(this._months),g.milliseconds=Tn(g.milliseconds),g.seconds=Tn(g.seconds),g.minutes=Tn(g.minutes),g.hours=Tn(g.hours),g.months=Tn(g.months),g.years=Tn(g.years),this}function Xu(g,N,P,z){var G=kr(N,P);return g._milliseconds+=z*G._milliseconds,g._days+=z*G._days,g._months+=z*G._months,g._bubble()}function vh(g,N){return Xu(this,g,N,1)}function Ii(g,N){return Xu(this,g,N,-1)}function Os(g){return g<0?Math.floor(g):Math.ceil(g)}function Sa(){var g=this._milliseconds,N=this._days,P=this._months,z=this._data,G,se,Te,mr,Tr;return g>=0&&N>=0&&P>=0||g<=0&&N<=0&&P<=0||(g+=Os(Ju(P)+N)*864e5,N=0,P=0),z.milliseconds=g%1e3,G=ir(g/1e3),z.seconds=G%60,se=ir(G/60),z.minutes=se%60,Te=ir(se/60),z.hours=Te%24,N+=ir(Te/24),Tr=ir(yn(N)),P+=Tr,N-=Os(Ju(Tr)),mr=ir(P/12),P%=12,z.days=N,z.months=P,z.years=mr,this}function yn(g){return g*4800/146097}function Ju(g){return g*146097/4800}function Sl(g){if(!this.isValid())return NaN;var N,P,z=this._milliseconds;if(g=ue(g),g==="month"||g==="quarter"||g==="year")switch(N=this._days+z/864e5,P=this._months+yn(N),g){case"month":return P;case"quarter":return P/3;case"year":return P/12}else switch(N=this._days+Math.round(Ju(this._months)),g){case"week":return N/7+z/6048e5;case"day":return N+z/864e5;case"hour":return N*24+z/36e5;case"minute":return N*1440+z/6e4;case"second":return N*86400+z/1e3;case"millisecond":return Math.floor(N*864e5)+z;default:throw new Error("Unknown unit "+g)}}function Nl(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Xe(this._months/12)*31536e6:NaN}function bn(g){return function(){return this.as(g)}}var na=bn("ms"),Al=bn("s"),gh=bn("m"),Bs=bn("h"),xh=bn("d"),El=bn("w"),Ht=bn("M"),Ku=bn("Q"),Cl=bn("y");function ni(){return kr(this)}function ju(g){return g=ue(g),this.isValid()?this[g+"s"]():NaN}function ii(g){return function(){return this.isValid()?this._data[g]:NaN}}var Na=ii("milliseconds"),Ml=ii("seconds"),on=ii("minutes"),ef=ii("hours"),yh=ii("days"),bh=ii("months"),wh=ii("years");function rf(){return ir(this.days()/7)}var Pi=Math.round,ai={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function _l(g,N,P,z,G){return G.relativeTime(N||1,!!P,g,z)}function Dh(g,N,P,z){var G=kr(g).abs(),se=Pi(G.as("s")),Te=Pi(G.as("m")),mr=Pi(G.as("h")),Tr=Pi(G.as("d")),et=Pi(G.as("M")),sn=Pi(G.as("w")),oi=Pi(G.as("y")),ki=se<=P.ss&&["s",se]||se0,ki[4]=z,_l.apply(null,ki)}function Sh(g){return g===void 0?Pi:typeof g=="function"?(Pi=g,!0):!1}function Wo(g,N){return ai[g]===void 0?!1:N===void 0?ai[g]:(ai[g]=N,g==="s"&&(ai.ss=N-1),!0)}function Nh(g,N){if(!this.isValid())return this.localeData().invalidDate();var P=!1,z=ai,G,se;return typeof g=="object"&&(N=g,g=!1),typeof g=="boolean"&&(P=g),typeof N=="object"&&(z=Object.assign({},ai,N),N.s!=null&&N.ss==null&&(z.ss=N.s-1)),G=this.localeData(),se=Dh(this,!P,z,G),P&&(se=G.pastFuture(+this,se)),G.postformat(se)}var tf=Math.abs;function ia(g){return(g>0)-(g<0)||+g}function Vo(){if(!this.isValid())return this.localeData().invalidDate();var g=tf(this._milliseconds)/1e3,N=tf(this._days),P=tf(this._months),z,G,se,Te,mr=this.asSeconds(),Tr,et,sn,oi;return mr?(z=ir(g/60),G=ir(z/60),g%=60,z%=60,se=ir(P/12),P%=12,Te=g?g.toFixed(3).replace(/\\.?0+$/,""):"",Tr=mr<0?"-":"",et=ia(this._months)!==ia(mr)?"-":"",sn=ia(this._days)!==ia(mr)?"-":"",oi=ia(this._milliseconds)!==ia(mr)?"-":"",Tr+"P"+(se?et+se+"Y":"")+(P?et+P+"M":"")+(N?sn+N+"D":"")+(G||z||g?"T":"")+(G?oi+G+"H":"")+(z?oi+z+"M":"")+(g?oi+Te+"S":"")):"P0D"}var Wr=Fo.prototype;Wr.isValid=Fm,Wr.abs=dh,Wr.add=vh,Wr.subtract=Ii,Wr.as=Sl,Wr.asMilliseconds=na,Wr.asSeconds=Al,Wr.asMinutes=gh,Wr.asHours=Bs,Wr.asDays=xh,Wr.asWeeks=El,Wr.asMonths=Ht,Wr.asQuarters=Ku,Wr.asYears=Cl,Wr.valueOf=Nl,Wr._bubble=Sa,Wr.clone=ni,Wr.get=ju,Wr.milliseconds=Na,Wr.seconds=Ml,Wr.minutes=on,Wr.hours=ef,Wr.days=yh,Wr.weeks=rf,Wr.months=bh,Wr.years=wh,Wr.humanize=Nh,Wr.toISOString=Vo,Wr.toString=Vo,Wr.toJSON=Vo,Wr.locale=Po,Wr.localeData=pl,Wr.toIsoString=F("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Vo),Wr.lang=Ns,H("X",0,0,"unix"),H("x",0,0,"valueOf"),rr("x",Yt),rr("X",wu),nt("X",function(g,N,P){P._d=new Date(parseFloat(g)*1e3)}),nt("x",function(g,N,P){P._d=new Date(Xe(g))});return r.version="2.29.4",t(ht),r.fn=Ye,r.min=Cm,r.max=Mm,r.now=_m,r.utc=h,r.unix=Hn,r.months=Dl,r.isDate=o,r.locale=_i,r.invalid=w,r.duration=kr,r.isMoment=S,r.weekdays=hh,r.parseZone=ph,r.localeData=Tt,r.isDuration=Yn,r.monthsShort=mh,r.weekdaysMin=zo,r.defineLocale=an,r.updateLocale=bm,r.locales=wm,r.weekdaysShort=Qu,r.normalizeUnits=ue,r.relativeTimeRounding=Sh,r.relativeTimeThreshold=Wo,r.calendarFormat=Um,r.prototype=Ye,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r})});var vc=un((kd,Rd)=>{(function(e,r){typeof kd=="object"&&typeof Rd<"u"?Rd.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e["'typed'"]=r())})(kd,function(){"use strict";function e(){return!0}function r(){return!1}function t(){}let n="Argument is not a typed-function.";function i(){function s(re){return typeof re=="object"&&re!==null&&re.constructor===Object}let c=[{name:"number",test:function(re){return typeof re=="number"}},{name:"string",test:function(re){return typeof re=="string"}},{name:"boolean",test:function(re){return typeof re=="boolean"}},{name:"Function",test:function(re){return typeof re=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(re){return re instanceof Date}},{name:"RegExp",test:function(re){return re instanceof RegExp}},{name:"Object",test:s},{name:"null",test:function(re){return re===null}},{name:"undefined",test:function(re){return re===void 0}}],f={name:"any",test:e,isAny:!0},o,u,p=0,h={createCount:0};function d(re){let le=o.get(re);if(le)return le;let we='Unknown type "'+re+'"',Oe=re.toLowerCase(),ke;for(ke of u)if(ke.toLowerCase()===Oe){we+='. Did you mean "'+ke+'" ?';break}throw new TypeError(we)}function x(re){let le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",we=le?d(le).index:u.length,Oe=[];for(let _e=0;_e{let Oe=o.get(we);return!Oe.isAny&&Oe.test(re)});return le.length?le:["any"]}function C(re){return re&&typeof re=="function"&&"_typedFunctionData"in re}function b(re,le,we){if(!C(re))throw new TypeError(n);let Oe=we&&we.exact,ke=Array.isArray(le)?le.join(","):le,_e=_(ke),Pe=S(_e);if(!Oe||Pe in re.signatures){let ve=re._typedFunctionData.signatureMap.get(Pe);if(ve)return ve}let We=_e.length,B;if(Oe){B=[];let ve;for(ve in re.signatures)B.push(re._typedFunctionData.signatureMap.get(ve))}else B=re._typedFunctionData.signatures;for(let ve=0;ve!_t.has(Yt.name)))continue}er.push(fr)}}if(B=er,B.length===0)break}let Q;for(Q of B)if(Q.params.length<=We)return Q;throw new TypeError("Signature not found (signature: "+(re.name||"unnamed")+"("+S(_e,", ")+"))")}function A(re,le,we){return b(re,le,we).implementation}function E(re,le){let we=d(le);if(we.test(re))return re;let Oe=we.conversionsTo;if(Oe.length===0)throw new Error("There are no conversions to "+le+" defined.");for(let ke=0;ke1&&arguments[1]!==void 0?arguments[1]:",";return re.map(we=>we.name).join(le)}function O(re){let le=re.indexOf("...")===0,Oe=(le?re.length>3?re.slice(3):"any":re).split("|").map(We=>d(We.trim())),ke=!1,_e=le?"...":"";return{types:Oe.map(function(We){return ke=We.isAny||ke,_e+=We.name+"|",{name:We.name,typeIndex:We.index,test:We.test,isAny:We.isAny,conversion:null,conversionIndex:-1}}),name:_e.slice(0,-1),hasAny:ke,hasConversion:!1,restParam:le}}function F(re){let le=re.types.map(Pe=>Pe.name),we=H(le),Oe=re.hasAny,ke=re.name,_e=we.map(function(Pe){let We=d(Pe.from);return Oe=We.isAny||Oe,ke+="|"+Pe.from,{name:Pe.from,typeIndex:We.index,test:We.test,isAny:We.isAny,conversion:Pe,conversionIndex:Pe.index}});return{types:re.types.concat(_e),name:ke,hasAny:Oe,hasConversion:_e.length>0,restParam:re.restParam}}function M(re){return re.typeSet||(re.typeSet=new Set,re.types.forEach(le=>re.typeSet.add(le.name))),re.typeSet}function _(re){let le=[];if(typeof re!="string")throw new TypeError("Signatures must be strings");let we=re.trim();if(we==="")return le;let Oe=we.split(",");for(let ke=0;ke=ke+1}}else return re.length===0?function(_e){return _e.length===0}:re.length===1?(we=L(re[0]),function(_e){return we(_e[0])&&_e.length===1}):re.length===2?(we=L(re[0]),Oe=L(re[1]),function(_e){return we(_e[0])&&Oe(_e[1])&&_e.length===2}):(le=re.map(L),function(_e){for(let Pe=0;Pe{let ke=V(Oe.params,le),_e;for(_e of ke)we.add(_e)}),we.has("any")?["any"]:Array.from(we)}function j(re,le,we){let Oe,ke,_e=re||"unnamed",Pe=we,We;for(We=0;We{let fr=$(er.params,We),Zr=L(fr);(We0){let er=w(le[We]);return Oe=new TypeError("Unexpected type of argument in function "+_e+" (expected: "+ke.join(" or ")+", actual: "+er.join(" | ")+", index: "+We+")"),Oe.data={category:"wrongType",fn:_e,index:We,actual:er,expected:ke},Oe}}else Pe=Be}let B=Pe.map(function(Be){return k(Be.params)?1/0:Be.params.length});if(le.lengthQ)return Oe=new TypeError("Too many arguments in function "+_e+" (expected: "+Q+", actual: "+le.length+")"),Oe.data={category:"tooManyArgs",fn:_e,index:le.length,expectedLength:Q},Oe;let ve=[];for(let Be=0;Be0)return 1;let Oe=oe(re)-oe(le);return Oe<0?-1:Oe>0?1:0}function ie(re,le){let we=re.params,Oe=le.params,ke=K(we),_e=K(Oe),Pe=k(we),We=k(Oe);if(Pe&&ke.hasAny){if(!We||!_e.hasAny)return 1}else if(We&&_e.hasAny)return-1;let B=0,Q=0,ve;for(ve of we)ve.hasAny&&++B,ve.hasConversion&&++Q;let Be=0,er=0;for(ve of Oe)ve.hasAny&&++Be,ve.hasConversion&&++er;if(B!==Be)return B-Be;if(Pe&&ke.hasConversion){if(!We||!_e.hasConversion)return 1}else if(We&&_e.hasConversion)return-1;if(Q!==er)return Q-er;if(Pe){if(!We)return 1}else if(We)return-1;let fr=(we.length-Oe.length)*(Pe?-1:1);if(fr!==0)return fr;let Zr=[],_t=0;for(let Zi=0;Zi1&&le.sort((ke,_e)=>ke.index-_e.index);let we=le[0].conversionsTo;if(re.length===1)return we;we=we.concat([]);let Oe=new Set(re);for(let ke=1;keke.hasConversion)){let ke=k(re),_e=re.map(Me);we=function(){let We=[],B=ke?arguments.length-1:arguments.length;for(let Q=0;QB.name).join("|"),hasAny:We.some(B=>B.isAny),hasConversion:!1,restParam:!0}),Pe.push(_e)}else Pe=_e.types.map(function(We){return{types:[We],name:We.name,hasAny:We.isAny,hasConversion:We.conversion,restParam:!1}});return ee(Pe,function(We){return le(we,Oe+1,ke.concat([We]))})}else return[ke]}return le(re,0,[])}function ge(re,le){let we=Math.max(re.length,le.length);for(let We=0;We=Oe:Pe?Oe>=ke:Oe===ke}function Se(re){return re.map(le=>Le(le)?Ee(le.referToSelf.callback):Ce(le)?ue(le.referTo.references,le.referTo.callback):le)}function xe(re,le,we){let Oe=[],ke;for(ke of re){let _e=we[ke];if(typeof _e!="number")throw new TypeError('No definition for referenced signature "'+ke+'"');if(_e=le[_e],typeof _e!="function")return!1;Oe.push(_e)}return Oe}function be(re,le,we){let Oe=Se(re),ke=new Array(Oe.length).fill(!1),_e=!0;for(;_e;){_e=!1;let Pe=!0;for(let We=0;We{let Oe=re[we];if(le.test(Oe.toString()))throw new SyntaxError("Using \`this\` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function Ae(re,le){if(h.createCount++,Object.keys(le).length===0)throw new SyntaxError("No signatures provided");h.warnAgainstDeprecatedThis&&De(le);let we=[],Oe=[],ke={},_e=[],Pe;for(Pe in le){if(!Object.prototype.hasOwnProperty.call(le,Pe))continue;let Kr=_(Pe);if(!Kr)continue;we.forEach(function(Mi){if(ge(Mi,Kr))throw new TypeError('Conflicting signatures "'+S(Mi)+'" and "'+S(Kr)+'".')}),we.push(Kr);let jt=Oe.length;Oe.push(le[Pe]);let Mu=Kr.map(F),Qi;for(Qi of pe(Mu)){let Mi=S(Qi);_e.push({params:Qi,name:Mi,fn:jt}),Qi.every(cs=>!cs.hasConversion)&&(ke[Mi]=jt)}}_e.sort(ie);let We=be(Oe,ke,ga),B;for(B in ke)Object.prototype.hasOwnProperty.call(ke,B)&&(ke[B]=We[ke[B]]);let Q=[],ve=new Map;for(B of _e)ve.has(B.name)||(B.fn=We[B.fn],Q.push(B),ve.set(B.name,B));let Be=Q[0]&&Q[0].params.length<=2&&!k(Q[0].params),er=Q[1]&&Q[1].params.length<=2&&!k(Q[1].params),fr=Q[2]&&Q[2].params.length<=2&&!k(Q[2].params),Zr=Q[3]&&Q[3].params.length<=2&&!k(Q[3].params),_t=Q[4]&&Q[4].params.length<=2&&!k(Q[4].params),Yt=Q[5]&&Q[5].params.length<=2&&!k(Q[5].params),Zi=Be&&er&&fr&&Zr&&_t&&Yt;for(let Kr=0;KrKr.test),fs=Q.map(Kr=>Kr.implementation),ls=function(){for(let jt=Cu;jtS(_(we))),le=K(arguments);if(typeof le!="function")throw new TypeError("Callback function expected as last argument");return ue(re,le)}function ue(re,le){return{referTo:{references:re,callback:le}}}function Ee(re){if(typeof re!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:re}}}function Ce(re){return re&&typeof re.referTo=="object"&&Array.isArray(re.referTo.references)&&typeof re.referTo.callback=="function"}function Le(re){return re&&typeof re.referToSelf=="object"&&typeof re.referToSelf.callback=="function"}function Ie(re,le){if(!re)return le;if(le&&le!==re){let we=new Error("Function names do not match (expected: "+re+", actual: "+le+")");throw we.data={actual:le,expected:re},we}return re}function sr(re){let le;for(let we in re)Object.prototype.hasOwnProperty.call(re,we)&&(C(re[we])||typeof re[we].signature=="string")&&(le=Ie(le,re[we].name));return le}function ir(re,le){let we;for(we in le)if(Object.prototype.hasOwnProperty.call(le,we)){if(we in re&&le[we]!==re[we]){let Oe=new Error('Signature "'+we+'" is defined twice');throw Oe.data={signature:we,sourceFunction:le[we],destFunction:re[we]},Oe}re[we]=le[we]}}let Xe=h;h=function(re){let le=typeof re=="string",we=le?1:0,Oe=le?re:"",ke={};for(let _e=we;_eke.from===re.from);if(!we)throw new Error("Attempt to remove nonexistent conversion from "+re.from+" to "+re.to);if(we.convert!==re.convert)throw new Error("Conversion to remove does not match existing conversion");let Oe=le.conversionsTo.indexOf(we);le.conversionsTo.splice(Oe,1)},h.resolve=function(re,le){if(!C(re))throw new TypeError(n);let we=re._typedFunctionData.signatures;for(let Oe=0;Oe{(function(e){"use strict";var r=Math.cosh||function(o){return Math.abs(o)<1e-9?1-o:(Math.exp(o)+Math.exp(-o))*.5},t=Math.sinh||function(o){return Math.abs(o)<1e-9?o:(Math.exp(o)-Math.exp(-o))*.5},n=function(o){var u=Math.PI/4;if(-u>o||o>u)return Math.cos(o)-1;var p=o*o;return p*(p*(p*(p*(p*(p*(p*(p/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},i=function(o,u){var p=Math.abs(o),h=Math.abs(u);return p<3e3&&h<3e3?Math.sqrt(p*p+h*h):(p0&&a();break;case"number":p.im=0,p.re=o;break;default:a()}return isNaN(p.re)||isNaN(p.im),p};function f(o,u){if(!(this instanceof f))return new f(o,u);var p=c(o,u);this.re=p.re,this.im=p.im}f.prototype={re:0,im:0,sign:function(){var o=this.abs();return new f(this.re/o,this.im/o)},add:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:new f(this.re+p.re,this.im+p.im)},sub:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:new f(this.re-p.re,this.im-p.im)},mul:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isZero()||this.isZero()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:p.im===0&&this.im===0?new f(this.re*p.re,0):new f(this.re*p.re-this.im*p.im,this.re*p.im+this.im*p.re)},div:function(o,u){var p=new f(o,u);if(this.isZero()&&p.isZero()||this.isInfinite()&&p.isInfinite())return f.NAN;if(this.isInfinite()||p.isZero())return f.INFINITY;if(this.isZero()||p.isInfinite())return f.ZERO;o=this.re,u=this.im;var h=p.re,d=p.im,x,v;return d===0?new f(o/h,u/h):Math.abs(h)0)return new f(Math.pow(o,p.re),0);if(o===0)switch((p.re%4+4)%4){case 0:return new f(Math.pow(u,p.re),0);case 1:return new f(0,Math.pow(u,p.re));case 2:return new f(-Math.pow(u,p.re),0);case 3:return new f(0,-Math.pow(u,p.re))}}if(o===0&&u===0&&p.re>0&&p.im>=0)return f.ZERO;var h=Math.atan2(u,o),d=s(o,u);return o=Math.exp(p.re*d-p.im*h),u=p.im*d+p.re*h,new f(o*Math.cos(u),o*Math.sin(u))},sqrt:function(){var o=this.re,u=this.im,p=this.abs(),h,d;if(o>=0){if(u===0)return new f(Math.sqrt(o),0);h=.5*Math.sqrt(2*(p+o))}else h=Math.abs(u)/Math.sqrt(2*(p-o));return o<=0?d=.5*Math.sqrt(2*(p-o)):d=Math.abs(u)/Math.sqrt(2*(p+o)),new f(h,u<0?-d:d)},exp:function(){var o=Math.exp(this.re);return this.im,new f(o*Math.cos(this.im),o*Math.sin(this.im))},expm1:function(){var o=this.re,u=this.im;return new f(Math.expm1(o)*Math.cos(u)+n(u),Math.exp(o)*Math.sin(u))},log:function(){var o=this.re,u=this.im;return u===0&&o>0,new f(s(o,u),Math.atan2(u,o))},abs:function(){return i(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var o=this.re,u=this.im;return new f(Math.sin(o)*r(u),Math.cos(o)*t(u))},cos:function(){var o=this.re,u=this.im;return new f(Math.cos(o)*r(u),-Math.sin(o)*t(u))},tan:function(){var o=2*this.re,u=2*this.im,p=Math.cos(o)+r(u);return new f(Math.sin(o)/p,t(u)/p)},cot:function(){var o=2*this.re,u=2*this.im,p=Math.cos(o)-r(u);return new f(-Math.sin(o)/p,t(u)/p)},sec:function(){var o=this.re,u=this.im,p=.5*r(2*u)+.5*Math.cos(2*o);return new f(Math.cos(o)*r(u)/p,Math.sin(o)*t(u)/p)},csc:function(){var o=this.re,u=this.im,p=.5*r(2*u)-.5*Math.cos(2*o);return new f(Math.sin(o)*r(u)/p,-Math.cos(o)*t(u)/p)},asin:function(){var o=this.re,u=this.im,p=new f(u*u-o*o+1,-2*o*u).sqrt(),h=new f(p.re-u,p.im+o).log();return new f(h.im,-h.re)},acos:function(){var o=this.re,u=this.im,p=new f(u*u-o*o+1,-2*o*u).sqrt(),h=new f(p.re-u,p.im+o).log();return new f(Math.PI/2-h.im,h.re)},atan:function(){var o=this.re,u=this.im;if(o===0){if(u===1)return new f(0,1/0);if(u===-1)return new f(0,-1/0)}var p=o*o+(1-u)*(1-u),h=new f((1-u*u-o*o)/p,-2*o/p).log();return new f(-.5*h.im,.5*h.re)},acot:function(){var o=this.re,u=this.im;if(u===0)return new f(Math.atan2(1,o),0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).atan():new f(o!==0?o/0:0,u!==0?-u/0:0).atan()},asec:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(0,1/0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).acos():new f(o!==0?o/0:0,u!==0?-u/0:0).acos()},acsc:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(Math.PI/2,1/0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).asin():new f(o!==0?o/0:0,u!==0?-u/0:0).asin()},sinh:function(){var o=this.re,u=this.im;return new f(t(o)*Math.cos(u),r(o)*Math.sin(u))},cosh:function(){var o=this.re,u=this.im;return new f(r(o)*Math.cos(u),t(o)*Math.sin(u))},tanh:function(){var o=2*this.re,u=2*this.im,p=r(o)+Math.cos(u);return new f(t(o)/p,Math.sin(u)/p)},coth:function(){var o=2*this.re,u=2*this.im,p=r(o)-Math.cos(u);return new f(t(o)/p,-Math.sin(u)/p)},csch:function(){var o=this.re,u=this.im,p=Math.cos(2*u)-r(2*o);return new f(-2*t(o)*Math.cos(u)/p,2*r(o)*Math.sin(u)/p)},sech:function(){var o=this.re,u=this.im,p=Math.cos(2*u)+r(2*o);return new f(2*r(o)*Math.cos(u)/p,-2*t(o)*Math.sin(u)/p)},asinh:function(){var o=this.im;this.im=-this.re,this.re=o;var u=this.asin();return this.re=-this.im,this.im=o,o=u.re,u.re=-u.im,u.im=o,u},acosh:function(){var o=this.acos();if(o.im<=0){var u=o.re;o.re=-o.im,o.im=u}else{var u=o.im;o.im=-o.re,o.re=u}return o},atanh:function(){var o=this.re,u=this.im,p=o>1&&u===0,h=1-o,d=1+o,x=h*h+u*u,v=x!==0?new f((d*h-u*u)/x,(u*h+d*u)/x):new f(o!==-1?o/0:0,u!==0?u/0:0),y=v.re;return v.re=s(v.re,v.im)/2,v.im=Math.atan2(v.im,y)/2,p&&(v.im=-v.im),v},acoth:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(0,Math.PI/2);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).atanh():new f(o!==0?o/0:0,u!==0?-u/0:0).atanh()},acsch:function(){var o=this.re,u=this.im;if(u===0)return new f(o!==0?Math.log(o+Math.sqrt(o*o+1)):1/0,0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).asinh():new f(o!==0?o/0:0,u!==0?-u/0:0).asinh()},asech:function(){var o=this.re,u=this.im;if(this.isZero())return f.INFINITY;var p=o*o+u*u;return p!==0?new f(o/p,-u/p).acosh():new f(o!==0?o/0:0,u!==0?-u/0:0).acosh()},inverse:function(){if(this.isZero())return f.INFINITY;if(this.isInfinite())return f.ZERO;var o=this.re,u=this.im,p=o*o+u*u;return new f(o/p,-u/p)},conjugate:function(){return new f(this.re,-this.im)},neg:function(){return new f(-this.re,-this.im)},ceil:function(o){return o=Math.pow(10,o||0),new f(Math.ceil(this.re*o)/o,Math.ceil(this.im*o)/o)},floor:function(o){return o=Math.pow(10,o||0),new f(Math.floor(this.re*o)/o,Math.floor(this.im*o)/o)},round:function(o){return o=Math.pow(10,o||0),new f(Math.round(this.re*o)/o,Math.round(this.im*o)/o)},equals:function(o,u){var p=new f(o,u);return Math.abs(p.re-this.re)<=f.EPSILON&&Math.abs(p.im-this.im)<=f.EPSILON},clone:function(){return new f(this.re,this.im)},toString:function(){var o=this.re,u=this.im,p="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(o){(function(e){"use strict";var r=2e3,t={s:1,n:0,d:1};function n(v,y){if(isNaN(v=parseInt(v,10)))throw d();return v*y}function i(v,y){if(y===0)throw h();var w=Object.create(p.prototype);w.s=v<0?-1:1,v=v<0?-v:v;var C=u(v,y);return w.n=v/C,w.d=y/C,w}function a(v){for(var y={},w=v,C=2,b=4;b<=w;){for(;w%C===0;)w/=C,y[C]=(y[C]||0)+1;b+=1+2*C++}return w!==v?w>1&&(y[w]=(y[w]||0)+1):y[v]=(y[v]||0)+1,y}var s=function(v,y){var w=0,C=1,b=1,A=0,E=0,S=0,O=1,F=1,M=0,_=1,k=1,L=1,Y=1e7,$;if(v!=null)if(y!==void 0){if(w=v,C=y,b=w*C,w%1!==0||C%1!==0)throw x()}else switch(typeof v){case"object":{if("d"in v&&"n"in v)w=v.n,C=v.d,"s"in v&&(w*=v.s);else if(0 in v)w=v[0],1 in v&&(C=v[1]);else throw d();b=w*C;break}case"number":{if(v<0&&(b=v,v=-v),v%1===0)w=v;else if(v>0){for(v>=1&&(F=Math.pow(10,Math.floor(1+Math.log(v)/Math.LN10)),v/=F);_<=Y&&L<=Y;)if($=(M+k)/(_+L),v===$){_+L<=Y?(w=M+k,C=_+L):L>_?(w=k,C=L):(w=M,C=_);break}else v>$?(M+=k,_+=L):(k+=M,L+=_),_>Y?(w=k,C=L):(w=M,C=_);w*=F}else(isNaN(v)||isNaN(y))&&(C=w=NaN);break}case"string":{if(_=v.match(/\\d+|./g),_===null)throw d();if(_[M]==="-"?(b=-1,M++):_[M]==="+"&&M++,_.length===M+1?E=n(_[M++],b):_[M+1]==="."||_[M]==="."?(_[M]!=="."&&(A=n(_[M++],b)),M++,(M+1===_.length||_[M+1]==="("&&_[M+3]===")"||_[M+1]==="'"&&_[M+3]==="'")&&(E=n(_[M],b),O=Math.pow(10,_[M].length),M++),(_[M]==="("&&_[M+2]===")"||_[M]==="'"&&_[M+2]==="'")&&(S=n(_[M+1],b),F=Math.pow(10,_[M+1].length)-1,M+=3)):_[M+1]==="/"||_[M+1]===":"?(E=n(_[M],b),O=n(_[M+2],1),M+=3):_[M+3]==="/"&&_[M+1]===" "&&(A=n(_[M],b),E=n(_[M+2],b),O=n(_[M+4],1),M+=5),_.length<=M){C=O*F,b=w=S+C*A+F*E;break}}default:throw d()}if(C===0)throw h();t.s=b<0?-1:1,t.n=Math.abs(w),t.d=Math.abs(C)};function c(v,y,w){for(var C=1;y>0;v=v*v%w,y>>=1)y&1&&(C=C*v%w);return C}function f(v,y){for(;y%2===0;y/=2);for(;y%5===0;y/=5);if(y===1)return 0;for(var w=10%y,C=1;w!==1;C++)if(w=w*10%y,C>r)return 0;return C}function o(v,y,w){for(var C=1,b=c(10,w,y),A=0;A<300;A++){if(C===b)return A;C=C*10%y,b=b*10%y}return 0}function u(v,y){if(!v)return y;if(!y)return v;for(;;){if(v%=y,!v)return y;if(y%=v,!y)return v}}function p(v,y){if(s(v,y),this instanceof p)v=u(t.d,t.n),this.s=t.s,this.n=t.n/v,this.d=t.d/v;else return i(t.s*t.n,t.d)}var h=function(){return new Error("Division by Zero")},d=function(){return new Error("Invalid argument")},x=function(){return new Error("Parameters must be integer")};p.prototype={s:1,n:0,d:1,abs:function(){return i(this.n,this.d)},neg:function(){return i(-this.s*this.n,this.d)},add:function(v,y){return s(v,y),i(this.s*this.n*t.d+t.s*this.d*t.n,this.d*t.d)},sub:function(v,y){return s(v,y),i(this.s*this.n*t.d-t.s*this.d*t.n,this.d*t.d)},mul:function(v,y){return s(v,y),i(this.s*t.s*this.n*t.n,this.d*t.d)},div:function(v,y){return s(v,y),i(this.s*t.s*this.n*t.d,this.d*t.n)},clone:function(){return i(this.s*this.n,this.d)},mod:function(v,y){if(isNaN(this.n)||isNaN(this.d))return new p(NaN);if(v===void 0)return i(this.s*this.n%this.d,1);if(s(v,y),t.n===0&&this.d===0)throw h();return i(this.s*(t.d*this.n)%(t.n*this.d),t.d*this.d)},gcd:function(v,y){return s(v,y),i(u(t.n,this.n)*u(t.d,this.d),t.d*this.d)},lcm:function(v,y){return s(v,y),t.n===0&&this.n===0?i(0,1):i(t.n*this.n,u(t.n,this.n)*u(t.d,this.d))},ceil:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.ceil(v*this.s*this.n/this.d),v)},floor:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.floor(v*this.s*this.n/this.d),v)},round:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.round(v*this.s*this.n/this.d),v)},inverse:function(){return i(this.s*this.d,this.n)},pow:function(v,y){if(s(v,y),t.d===1)return t.s<0?i(Math.pow(this.s*this.d,t.n),Math.pow(this.n,t.n)):i(Math.pow(this.s*this.n,t.n),Math.pow(this.d,t.n));if(this.s<0)return null;var w=a(this.n),C=a(this.d),b=1,A=1;for(var E in w)if(E!=="1"){if(E==="0"){b=0;break}if(w[E]*=t.n,w[E]%t.d===0)w[E]/=t.d;else return null;b*=Math.pow(E,w[E])}for(var E in C)if(E!=="1"){if(C[E]*=t.n,C[E]%t.d===0)C[E]/=t.d;else return null;A*=Math.pow(E,C[E])}return t.s<0?i(A,b):i(b,A)},equals:function(v,y){return s(v,y),this.s*this.n*t.d===t.s*t.n*this.d},compare:function(v,y){s(v,y);var w=this.s*this.n*t.d-t.s*t.n*this.d;return(0=0;A--)b=b.inverse().add(w[A]);if(Math.abs(b.sub(y).valueOf())0&&(w+=y,w+=" ",C%=b),w+=C,w+="/",w+=b),w},toLatex:function(v){var y,w="",C=this.n,b=this.d;return this.s<0&&(w+="-"),b===1?w+=C:(v&&(y=Math.floor(C/b))>0&&(w+=y,C%=b),w+="\\\\frac{",w+=C,w+="}{",w+=b,w+="}"),w},toContinued:function(){var v,y=this.n,w=this.d,C=[];if(isNaN(y)||isNaN(w))return C;do C.push(Math.floor(y/w)),v=y%w,y=w,w=v;while(y!==1);return C},toString:function(v){var y=this.n,w=this.d;if(isNaN(y)||isNaN(w))return"NaN";v=v||15;var C=f(y,w),b=o(y,w,C),A=this.s<0?"-":"";if(A+=y/w|0,y%=w,y*=10,y&&(A+="."),C){for(var E=b;E--;)A+=y/w|0,y%=w,y*=10;A+="(";for(var E=C;E--;)A+=y/w|0,y%=w,y*=10;A+=")"}else for(var E=v;y&&E--;)A+=y/w|0,y%=w,y*=10;return A}},typeof ov=="object"?(Object.defineProperty(p,"__esModule",{value:!0}),p.default=p,p.Fraction=p,jy.exports=p):e.Fraction=p})(ov)});var vS=un((Woe,dS)=>{dS.exports=function e(r,t){"use strict";var n=/(^([+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)?$|^0x[0-9a-f]+$|\\d+)/gi,i=/(^[ ]*|[ ]*$)/g,a=/(^([\\w ]+,?[\\w ]+)?[\\w ]+,?[\\w ]+\\d+:\\d+(:\\d+)?[\\w ]?|^\\d{1,4}[\\/\\-]\\d{1,4}[\\/\\-]\\d{1,4}|^\\w+, \\w+ \\d+, \\d{4})/,s=/^0x[0-9a-f]+$/i,c=/^0/,f=function(b){return e.insensitive&&(""+b).toLowerCase()||""+b},o=f(r).replace(i,"")||"",u=f(t).replace(i,"")||"",p=o.replace(n,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0"),h=u.replace(n,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0"),d=parseInt(o.match(s),16)||p.length!==1&&o.match(a)&&Date.parse(o),x=parseInt(u.match(s),16)||d&&u.match(a)&&Date.parse(u)||null,v,y;if(x){if(dx)return 1}for(var w=0,C=Math.max(p.length,h.length);wy)return 1}return 0}});var O2=un((ape,F2)=>{"use strict";var cg=Object.assign||function(e){for(var r=1;r1&&arguments[1]!==void 0?arguments[1]:{},t=r.preserveFormatting,n=t===void 0?!1:t,i=r.escapeMapFn,a=i===void 0?rz:i,s=String(e),c="",f=a(cg({},jU),n?cg({},ez):{}),o=Object.keys(f),u=function(){var h=!1;o.forEach(function(d,x){h||s.length>=d.length&&s.slice(0,d.length)===d&&(c+=f[o[x]],s=s.slice(d.length,s.length),h=!0)}),h||(c+=s.slice(0,1),s=s.slice(1,s.length))};s;)u();return c}});var rF=un((eF,yg)=>{(function(e,r,t){function n(c){var f=this,o=s();f.next=function(){var u=2091639*f.s0+f.c*23283064365386963e-26;return f.s0=f.s1,f.s1=f.s2,f.s2=u-(f.c=u|0)},f.c=1,f.s0=o(" "),f.s1=o(" "),f.s2=o(" "),f.s0-=o(c),f.s0<0&&(f.s0+=1),f.s1-=o(c),f.s1<0&&(f.s1+=1),f.s2-=o(c),f.s2<0&&(f.s2+=1),o=null}function i(c,f){return f.c=c.c,f.s0=c.s0,f.s1=c.s1,f.s2=c.s2,f}function a(c,f){var o=new n(c),u=f&&f.state,p=o.next;return p.int32=function(){return o.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,u&&(typeof u=="object"&&i(u,o),p.state=function(){return i(o,{})}),p}function s(){var c=4022871197,f=function(o){o=String(o);for(var u=0;u>>0,p-=c,p*=c,c=p>>>0,p-=c,c+=p*4294967296}return(c>>>0)*23283064365386963e-26};return f}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.alea=a})(eF,typeof yg=="object"&&yg,typeof define=="function"&&define)});var nF=un((tF,bg)=>{(function(e,r,t){function n(s){var c=this,f="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var u=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^u^u>>>8},s===(s|0)?c.x=s:f+=s;for(var o=0;o>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xor128=a})(tF,typeof bg=="object"&&bg,typeof define=="function"&&define)});var aF=un((iF,wg)=>{(function(e,r,t){function n(s){var c=this,f="";c.next=function(){var u=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(u^u<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,s===(s|0)?c.x=s:f+=s;for(var o=0;o>>4),c.next()}function i(s,c){return c.x=s.x,c.y=s.y,c.z=s.z,c.w=s.w,c.v=s.v,c.d=s.d,c}function a(s,c){var f=new n(s),o=c&&c.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xorwow=a})(iF,typeof wg=="object"&&wg,typeof define=="function"&&define)});var sF=un((oF,Dg)=>{(function(e,r,t){function n(s){var c=this;c.next=function(){var o=c.x,u=c.i,p,h,d;return p=o[u],p^=p>>>7,h=p^p<<24,p=o[u+1&7],h^=p^p>>>10,p=o[u+3&7],h^=p^p>>>3,p=o[u+4&7],h^=p^p<<7,p=o[u+7&7],p=p^p<<13,h^=p^p<<9,o[u]=h,c.i=u+1&7,h};function f(o,u){var p,h,d=[];if(u===(u|0))h=d[0]=u;else for(u=""+u,p=0;p0;--p)o.next()}f(c,s)}function i(s,c){return c.x=s.x.slice(),c.i=s.i,c}function a(s,c){s==null&&(s=+new Date);var f=new n(s),o=c&&c.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(o.x&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xorshift7=a})(oF,typeof Dg=="object"&&Dg,typeof define=="function"&&define)});var fF=un((uF,Sg)=>{(function(e,r,t){function n(s){var c=this;c.next=function(){var o=c.w,u=c.X,p=c.i,h,d;return c.w=o=o+1640531527|0,d=u[p+34&127],h=u[p=p+1&127],d^=d<<13,h^=h<<17,d^=d>>>15,h^=h>>>12,d=u[p]=d^h,c.i=p,d+(o^o>>>16)|0};function f(o,u){var p,h,d,x,v,y=[],w=128;for(u===(u|0)?(h=u,u=null):(u=u+"\\0",h=0,w=Math.max(w,u.length)),d=0,x=-32;x>>15,h^=h<<4,h^=h>>>13,x>=0&&(v=v+1640531527|0,p=y[x&127]^=h+v,d=p==0?d+1:0);for(d>=128&&(y[(u&&u.length||0)&127]=-1),d=127,x=4*128;x>0;--x)h=y[d+34&127],p=y[d=d+1&127],h^=h<<13,p^=p<<17,h^=h>>>15,p^=p>>>12,y[d]=h^p;o.w=v,o.X=y,o.i=d}f(c,s)}function i(s,c){return c.i=s.i,c.w=s.w,c.X=s.X.slice(),c}function a(s,c){s==null&&(s=+new Date);var f=new n(s),o=c&&c.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(o.X&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xor4096=a})(uF,typeof Sg=="object"&&Sg,typeof define=="function"&&define)});var cF=un((lF,Ng)=>{(function(e,r,t){function n(s){var c=this,f="";c.next=function(){var u=c.b,p=c.c,h=c.d,d=c.a;return u=u<<25^u>>>7^p,p=p-h|0,h=h<<24^h>>>8^d,d=d-u|0,c.b=u=u<<20^u>>>12^p,c.c=p=p-h|0,c.d=h<<16^p>>>16^d,c.a=d-u|0},c.a=0,c.b=0,c.c=-1640531527,c.d=1367130551,s===Math.floor(s)?(c.a=s/4294967296|0,c.b=s|0):f+=s;for(var o=0;o>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.tychei=a})(lF,typeof Ng=="object"&&Ng,typeof define=="function"&&define)});var pF=un(()=>{});var hF=un((mF,Wp)=>{(function(e,r,t){var n=256,i=6,a=52,s="random",c=t.pow(n,i),f=t.pow(2,a),o=f*2,u=n-1,p;function h(b,A,E){var S=[];A=A==!0?{entropy:!0}:A||{};var O=y(v(A.entropy?[b,C(r)]:b??w(),3),S),F=new d(S),M=function(){for(var _=F.g(i),k=c,L=0;_=o;)_/=2,k/=2,L>>>=1;return(_+L)/k};return M.int32=function(){return F.g(4)|0},M.quick=function(){return F.g(4)/4294967296},M.double=M,y(C(F.S),r),(A.pass||E||function(_,k,L,Y){return Y&&(Y.S&&x(Y,F),_.state=function(){return x(F,{})}),L?(t[s]=_,k):_})(M,O,"global"in A?A.global:this==t,A.state)}function d(b){var A,E=b.length,S=this,O=0,F=S.i=S.j=0,M=S.S=[];for(E||(b=[E++]);O{var xW=rF(),yW=nF(),bW=aF(),wW=sF(),DW=fF(),SW=cF(),os=hF();os.alea=xW;os.xor128=yW;os.xorwow=bW;os.xorshift7=wW;os.xor4096=DW;os.tychei=SW;dF.exports=os});var YO=un((R3e,Fg)=>{function Tg(){}Tg.prototype={on:function(e,r,t){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:r,ctx:t}),this},once:function(e,r,t){var n=this;function i(){n.off(e,i),r.apply(t,arguments)}return i._=r,this.on(e,i,t)},emit:function(e){var r=[].slice.call(arguments,1),t=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=t.length;for(n;n[...new Set(e)];var uo="File";function ud(e){return Array.isArray(e)?e:typeof e=="string"?[e]:[]}function gx(e){return e?typeof e!="string"?e.toString():e:""}var xx=(e,r)=>r.indexOf(e)>0?r.indexOf(e):r.length;function ci(e){return ci=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ci(e)}function Pn(e){if(e===null||e===!0||e===!1)return NaN;var r=Number(e);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}function ot(e,r){if(r.length1?"s":"")+" required, but only "+r.length+" present")}function Lt(e){ot(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||ci(e)==="object"&&r==="[object Date]"?new Date(e.getTime()):typeof e=="number"||r==="[object Number]"?new Date(e):((typeof e=="string"||r==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use \`parseISO\` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function fd(e,r){ot(2,arguments);var t=Lt(e).getTime(),n=Pn(r);return new Date(t+n)}var u8={};function fo(){return u8}function ld(e){var r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),e.getTime()-r.getTime()}function cd(e){return ot(1,arguments),e instanceof Date||ci(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function pd(e){if(ot(1,arguments),!cd(e)&&typeof e!="number")return!1;var r=Lt(e);return!isNaN(Number(r))}function md(e,r){ot(2,arguments);var t=Pn(r);return fd(e,-t)}var f8=864e5;function hd(e){ot(1,arguments);var r=Lt(e),t=r.getTime();r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0);var n=r.getTime(),i=t-n;return Math.floor(i/f8)+1}function lo(e){ot(1,arguments);var r=1,t=Lt(e),n=t.getUTCDay(),i=(n=i.getTime()?t+1:r.getTime()>=s.getTime()?t:t-1}function dd(e){ot(1,arguments);var r=lf(e),t=new Date(0);t.setUTCFullYear(r,0,4),t.setUTCHours(0,0,0,0);var n=lo(t);return n}var l8=6048e5;function vd(e){ot(1,arguments);var r=Lt(e),t=lo(r).getTime()-dd(r).getTime();return Math.round(t/l8)+1}function co(e,r){var t,n,i,a,s,c,f,o;ot(1,arguments);var u=fo(),p=Pn((t=(n=(i=(a=r?.weekStartsOn)!==null&&a!==void 0?a:r==null||(s=r.locale)===null||s===void 0||(c=s.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&n!==void 0?n:(f=u.locale)===null||f===void 0||(o=f.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&t!==void 0?t:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=Lt(e),d=h.getUTCDay(),x=(d=1&&d<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(p+1,0,d),x.setUTCHours(0,0,0,0);var v=co(x,r),y=new Date(0);y.setUTCFullYear(p,0,d),y.setUTCHours(0,0,0,0);var w=co(y,r);return u.getTime()>=v.getTime()?p+1:u.getTime()>=w.getTime()?p:p-1}function gd(e,r){var t,n,i,a,s,c,f,o;ot(1,arguments);var u=fo(),p=Pn((t=(n=(i=(a=r?.firstWeekContainsDate)!==null&&a!==void 0?a:r==null||(s=r.locale)===null||s===void 0||(c=s.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&n!==void 0?n:(f=u.locale)===null||f===void 0||(o=f.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&t!==void 0?t:1),h=cf(e,r),d=new Date(0);d.setUTCFullYear(h,0,p),d.setUTCHours(0,0,0,0);var x=co(d,r);return x}var c8=6048e5;function xd(e,r){ot(1,arguments);var t=Lt(e),n=co(t,r).getTime()-gd(t,r).getTime();return Math.round(n/c8)+1}function it(e,r){for(var t=e<0?"-":"",n=Math.abs(e).toString();n.length0?n:1-n;return it(t==="yy"?i%100:i,t.length)},M:function(r,t){var n=r.getUTCMonth();return t==="M"?String(n+1):it(n+1,2)},d:function(r,t){return it(r.getUTCDate(),t.length)},a:function(r,t){var n=r.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(r,t){return it(r.getUTCHours()%12||12,t.length)},H:function(r,t){return it(r.getUTCHours(),t.length)},m:function(r,t){return it(r.getUTCMinutes(),t.length)},s:function(r,t){return it(r.getUTCSeconds(),t.length)},S:function(r,t){var n=t.length,i=r.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return it(a,t.length)}},Fa=p8;var Us={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},m8={G:function(r,t,n){var i=r.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(r,t,n){if(t==="yo"){var i=r.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return Fa.y(r,t)},Y:function(r,t,n,i){var a=cf(r,i),s=a>0?a:1-a;if(t==="YY"){var c=s%100;return it(c,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):it(s,t.length)},R:function(r,t){var n=lf(r);return it(n,t.length)},u:function(r,t){var n=r.getUTCFullYear();return it(n,t.length)},Q:function(r,t,n){var i=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return it(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(r,t,n){var i=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return it(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(r,t,n){var i=r.getUTCMonth();switch(t){case"M":case"MM":return Fa.M(r,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(r,t,n){var i=r.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return it(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(r,t,n,i){var a=xd(r,i);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):it(a,t.length)},I:function(r,t,n){var i=vd(r);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):it(i,t.length)},d:function(r,t,n){return t==="do"?n.ordinalNumber(r.getUTCDate(),{unit:"date"}):Fa.d(r,t)},D:function(r,t,n){var i=hd(r);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):it(i,t.length)},E:function(r,t,n){var i=r.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(r,t,n,i){var a=r.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return it(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(r,t,n,i){var a=r.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return it(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(r,t,n){var i=r.getUTCDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return it(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(r,t,n){var i=r.getUTCHours(),a=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(r,t,n){var i=r.getUTCHours(),a;switch(i===12?a=Us.noon:i===0?a=Us.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(r,t,n){var i=r.getUTCHours(),a;switch(i>=17?a=Us.evening:i>=12?a=Us.afternoon:i>=4?a=Us.morning:a=Us.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(r,t,n){if(t==="ho"){var i=r.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Fa.h(r,t)},H:function(r,t,n){return t==="Ho"?n.ordinalNumber(r.getUTCHours(),{unit:"hour"}):Fa.H(r,t)},K:function(r,t,n){var i=r.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):it(i,t.length)},k:function(r,t,n){var i=r.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):it(i,t.length)},m:function(r,t,n){return t==="mo"?n.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):Fa.m(r,t)},s:function(r,t,n){return t==="so"?n.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):Fa.s(r,t)},S:function(r,t){return Fa.S(r,t)},X:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return bx(s);case"XXXX":case"XX":return $o(s);case"XXXXX":case"XXX":default:return $o(s,":")}},x:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"x":return bx(s);case"xxxx":case"xx":return $o(s);case"xxxxx":case"xxx":default:return $o(s,":")}},O:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+yx(s,":");case"OOOO":default:return"GMT"+$o(s,":")}},z:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+yx(s,":");case"zzzz":default:return"GMT"+$o(s,":")}},t:function(r,t,n,i){var a=i._originalDate||r,s=Math.floor(a.getTime()/1e3);return it(s,t.length)},T:function(r,t,n,i){var a=i._originalDate||r,s=a.getTime();return it(s,t.length)}};function yx(e,r){var t=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return t+String(i);var s=r||"";return t+String(i)+s+it(a,2)}function bx(e,r){if(e%60===0){var t=e>0?"-":"+";return t+it(Math.abs(e)/60,2)}return $o(e,r)}function $o(e,r){var t=r||"",n=e>0?"-":"+",i=Math.abs(e),a=it(Math.floor(i/60),2),s=it(i%60,2);return n+a+t+s}var wx=m8;var Dx=function(r,t){switch(r){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Sx=function(r,t){switch(r){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},h8=function(r,t){var n=r.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return Dx(r,t);var s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Dx(i,t)).replace("{{time}}",Sx(a,t))},d8={p:Sx,P:h8},Nx=d8;var v8=["D","DD"],g8=["YY","YYYY"];function Ax(e){return v8.indexOf(e)!==-1}function Ex(e){return g8.indexOf(e)!==-1}function yd(e,r,t){if(e==="YYYY")throw new RangeError("Use \`yyyy\` instead of \`YYYY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use \`yy\` instead of \`YY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use \`d\` instead of \`D\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use \`dd\` instead of \`DD\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var x8={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},y8=function(r,t,n){var i,a=x8[r];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},Cx=y8;function pf(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.width?String(r.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var b8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},w8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},D8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},S8={date:pf({formats:b8,defaultWidth:"full"}),time:pf({formats:w8,defaultWidth:"full"}),dateTime:pf({formats:D8,defaultWidth:"full"})},Mx=S8;var N8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},A8=function(r,t,n,i){return N8[r]},_x=A8;function Zo(e){return function(r,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,s=t!=null&&t.width?String(t.width):a;i=e.formattingValues[s]||e.formattingValues[a]}else{var c=e.defaultWidth,f=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[f]||e.values[c]}var o=e.argumentCallback?e.argumentCallback(r):r;return i[o]}}var E8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},C8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},M8={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},_8={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},T8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},F8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},O8=function(r,t){var n=Number(r),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},B8={ordinalNumber:O8,era:Zo({values:E8,defaultWidth:"wide"}),quarter:Zo({values:C8,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:Zo({values:M8,defaultWidth:"wide"}),day:Zo({values:_8,defaultWidth:"wide"}),dayPeriod:Zo({values:T8,defaultWidth:"wide",formattingValues:F8,defaultFormattingWidth:"wide"})},Tx=B8;function Qo(e){return function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=r.match(i);if(!a)return null;var s=a[0],c=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],f=Array.isArray(c)?P8(c,function(p){return p.test(s)}):I8(c,function(p){return p.test(s)}),o;o=e.valueCallback?e.valueCallback(f):f,o=t.valueCallback?t.valueCallback(o):o;var u=r.slice(s.length);return{value:o,rest:u}}}function I8(e,r){for(var t in e)if(e.hasOwnProperty(t)&&r(e[t]))return t}function P8(e,r){for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:{},n=r.match(e.matchPattern);if(!n)return null;var i=n[0],a=r.match(e.parsePattern);if(!a)return null;var s=e.valueCallback?e.valueCallback(a[0]):a[0];s=t.valueCallback?t.valueCallback(s):s;var c=r.slice(i.length);return{value:s,rest:c}}}var k8=/^(\\d+)(th|st|nd|rd)?/i,R8=/\\d+/i,L8={narrow:/^(b|a)/i,abbreviated:/^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},q8={any:[/^b/i,/^(a|c)/i]},U8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},z8={any:[/1/i,/2/i,/3/i,/4/i]},W8={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},V8={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Y8={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},H8={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},G8={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},$8={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Z8={ordinalNumber:bd({matchPattern:k8,parsePattern:R8,valueCallback:function(r){return parseInt(r,10)}}),era:Qo({matchPatterns:L8,defaultMatchWidth:"wide",parsePatterns:q8,defaultParseWidth:"any"}),quarter:Qo({matchPatterns:U8,defaultMatchWidth:"wide",parsePatterns:z8,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:Qo({matchPatterns:W8,defaultMatchWidth:"wide",parsePatterns:V8,defaultParseWidth:"any"}),day:Qo({matchPatterns:Y8,defaultMatchWidth:"wide",parsePatterns:H8,defaultParseWidth:"any"}),dayPeriod:Qo({matchPatterns:G8,defaultMatchWidth:"any",parsePatterns:$8,defaultParseWidth:"any"})},Fx=Z8;var Q8={code:"en-US",formatDistance:Cx,formatLong:Mx,formatRelative:_x,localize:Tx,match:Fx,options:{weekStartsOn:0,firstWeekContainsDate:1}},Ox=Q8;var Bx=Ox;var X8=/[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g,J8=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,K8=/^'([^]*?)'?$/,j8=/''/g,ek=/[a-zA-Z]/;function Oa(e,r,t){var n,i,a,s,c,f,o,u,p,h,d,x,v,y,w,C,b,A;ot(2,arguments);var E=String(r),S=fo(),O=(n=(i=t?.locale)!==null&&i!==void 0?i:S.locale)!==null&&n!==void 0?n:Bx,F=Pn((a=(s=(c=(f=t?.firstWeekContainsDate)!==null&&f!==void 0?f:t==null||(o=t.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&c!==void 0?c:S.firstWeekContainsDate)!==null&&s!==void 0?s:(p=S.locale)===null||p===void 0||(h=p.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(F>=1&&F<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=Pn((d=(x=(v=(y=t?.weekStartsOn)!==null&&y!==void 0?y:t==null||(w=t.locale)===null||w===void 0||(C=w.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&v!==void 0?v:S.weekStartsOn)!==null&&x!==void 0?x:(b=S.locale)===null||b===void 0||(A=b.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&d!==void 0?d:0);if(!(M>=0&&M<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!O.localize)throw new RangeError("locale must contain localize property");if(!O.formatLong)throw new RangeError("locale must contain formatLong property");var _=Lt(e);if(!pd(_))throw new RangeError("Invalid time value");var k=ld(_),L=md(_,k),Y={firstWeekContainsDate:F,weekStartsOn:M,locale:O,_originalDate:_},$=E.match(J8).map(function(V){var q=V[0];if(q==="p"||q==="P"){var R=Nx[q];return R(V,O.formatLong)}return V}).join("").match(X8).map(function(V){if(V==="''")return"'";var q=V[0];if(q==="'")return rk(V);var R=wx[q];if(R)return!(t!=null&&t.useAdditionalWeekYearTokens)&&Ex(V)&&yd(V,r,String(e)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&Ax(V)&&yd(V,r,String(e)),R(L,V,O.localize,Y);if(q.match(ek))throw new RangeError("Format string contains an unescaped latin alphabet character \`"+q+"\`");return V}).join("");return $}function rk(e){var r=e.match(K8);return r?r[1].replace(j8,"'"):e}function wd(e,r){if(ci(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(ci(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Dd(e){var r=wd(e,"string");return ci(r)=="symbol"?r:r+""}function Ur(e,r,t){return r=Dd(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var Sd=(e,r)=>{if(e instanceof Date)return"date";if(typeof e=="string"){if(/\\/\\/(\\S+?(?:jpe?g|png|gif|svg))/gi.test(e)||e.includes("unsplash"))return"image";if(/^\\d{4}-\\d{2}-\\d{2}$/.test(e))return"date";if(r=="tag"||r=="tags")return"tag";if(/\\[\\[.*?\\]\\]/.test(e))return"link"}else{if(typeof e=="number")return"number";if(typeof e=="boolean")return"boolean";if(e)if(Array.isArray(e)||typeof e=="string"&&e.indexOf(",")>-1){let t=Array.isArray(e)?e:[];if(typeof e=="string"&&e.indexOf(",")>-1&&(t=qi(e)),r=="tag"||r=="tags")return"tag-multi";if(t.length==1&&Array.isArray(t[0])&&t[0].length==1&&typeof t[0][0]=="string")return"link";let n=Zl(t.map(i=>Sd(i,r)));return n.length==1&&n[0]=="link"?"link-multi":n.some(i=>i=="object")?"object-multi":"option-multi"}else{if(e.isLuxonDateTime)return"date";if(e.isLuxonDuration)return"duration";if(e.type=="file")return"link";if(typeof e=="object"&&!Array.isArray(e)&&e!==null)return"object"}else return"unknown"}return"text"};var Ix=e=>e.join(", "),Xo=e=>e.join(",");var qi=e=>e?.match(/(\\\\.|[^,])+/g)??[],Jl=(e,r)=>{switch(Sd(r,e)){case"object":return JSON.stringify(r);case"number":return r.toString();case"boolean":return r?"true":"false";case"date":{if(r instanceof Date){let n=Oa(new Date(r),"yyyy-MM-dd");if(typeof n=="string")return n}return typeof r!="string"?"":r}break;case"duration":return Ix(Object.keys(r.values).reduce((n,i)=>[...n,...r.values[i]>0?[r.values[i]+" "+i]:[]],[]));case"option-multi":case"link-multi":return typeof r=="string"?Xl(r):Xo(r.map(n=>n?typeof n=="string"?Xl(n):n.path?n.path:Array.isArray(r)&&n.length==1&&Array.isArray(n[0])&&n[0].length==1&&typeof n[0][0]=="string"?n[0][0]:JSON.stringify(n):""));case"link":return Array.isArray(r)&&r.length==1&&Array.isArray(r[0])&&r[0].length==1&&typeof r[0][0]=="string"?r[0][0]:typeof r=="string"?Xl(r):r.path;case"text":case"tag":case"image":return r}return""},Ql=e=>{let r;try{r=JSON.parse(e)}catch{}return r};var Xl=e=>{if(!e)return"";let r=/\\[\\[(.*?)\\]\\]/g.exec(e),t=r?.length>1?r[1].substring(0,xx("|",r[1])):e;return t||e};var Kl=(e,r)=>e==r,Nd=(e,r)=>(e??"").length==0,Ad=(e,r)=>(e??"").toLowerCase().includes((r??"").toLowerCase()),Ed=(e,r)=>parseFloat(e)>parseFloat(r),Cd=(e,r)=>parseInt(e)>parseInt(r),Px=(e,r)=>{let t=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),n=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return t.valueOf()>n.valueOf()},kx=(e,r)=>{let t=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),n=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return t.valueOf(){let t=e?qi(e):[];return(r?qi(r):[]).some(i=>t.some(a=>a==i))},Rx=(e,r)=>{if(!e)return!1;let t=new Date(\`\${e.toString().replace(".",":")}\`),n=new Date(\`\${r}\`);return t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()},Lx=e=>{if(!e)return!1;let r=new Date(\`\${e.toString()}T00:00\`),t=new Date;return r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()};var mf={isNotEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>!Nd(e,""),valueType:"none"},isEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>Nd(e,""),valueType:"none"},include:{fn:(e,r)=>Ad(e,r),type:["text","file","link","link-multi","fileprop","image"],valueType:"text"},notInclude:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>!Ad(e,r),valueType:"text"},is:{type:["text","file","link","context","fileprop"],fn:(e,r)=>Kl(e,r),valueType:"text"},isNot:{type:["text","file","link","context","fileprop"],fn:(e,r)=>!Kl(e,r),valueType:"text"},equal:{type:["number"],fn:(e,r)=>Kl(e,r),valueType:"number"},isGreatThan:{type:["number"],fn:(e,r)=>Ed(e,r),valueType:"number"},isLessThan:{type:["number"],fn:(e,r)=>Cd(e,r),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(e,r)=>!Ed(e,r),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(e,r)=>!Cd(e,r),valueType:"number"},dateBefore:{type:["date","fileprop"],fn:(e,r)=>kx(e,r),valueType:"date"},dateAfter:{type:["date","fileprop"],fn:(e,r)=>Px(e,r),valueType:"date"},isSameDate:{type:["date"],fn:(e,r)=>Rx(e,r),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(e,r)=>Lx(e,r),valueType:"none"},isAnyInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(e,r)=>Md(e,r),valueType:"list"},isNoneInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(e,r)=>!Md(e,r),valueType:"list"},isTrue:{type:["boolean"],fn:(e,r)=>e=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(e,r)=>e!="true",valueType:"none"}};var tk=(e,r)=>r.reduce((n,i)=>{let[a,s]=n,c=i.type=="path"?Ux(s,i):i.type=="frontmatter"?qx(s,i):zx(s,i),f=s.filter(o=>!c.includes(o));return[[...a,...c],f]},[[],e])[0],nk=(e,r)=>r.reduce((t,n)=>n.type=="path"?Ux(t,n):n.type=="frontmatter"?qx(t,n):zx(t,n),e),qx=(e,r)=>e.filter(t=>{let n=t.metadata?.property;if(!n||!n[r.field])return!1;let i=mf[r.fn],a=!0;return i&&(a=i.fn(Jl(r.field,n[r.field]),r.value)),a}),Ux=(e,r)=>e.filter(t=>{let n="";r.field=="outlinks"?n=Xo(t.outlinks??[]):r.field=="inlinks"?n=Xo(t.inlinks??[]):r.field=="tags"&&(n=Xo(t.tags??[]));let i=mf[r.fn],a=!0;return i&&(a=i.fn(n,r.value)),a}),zx=(e,r)=>e.filter(t=>{let n=mf[r.fn],i=!0;return n&&(i=n.fn(t.metadata?.[r.type]?.[r.field],r.value)),i}),_d=(e,r)=>e.reduce((n,i)=>!n||i.filters.length==0?!1:i.type=="any"?tk([r],i.filters).length>0:nk([r],i.filters).length>0,!0);var Vx=li(Wx()),Fd=class{constructor(){this.lang="en";this.all={en:{hintText:{dragDropModifierKeys:"Hold \${1} to Pin and \${2} to Copy",createListItem:"Select/Create List Item Frame",dragDropProperties:"Drag and drop properties to link them into the list",newItem:"+ New",selectNote:"Select Note...",newFrame:"New"},defaults:{spaceNote:"Current Note",spaceContext:"Current Space"},commands:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",columns:"Columns",button:"Button",label:"Label",column:"Column",idea:"New",group:"Group",paragraph:"Text",card:"Card",progress:"Progress",rating:"Rating",circularProgress:"Circular Progress",list:"Bullet List","ordered-list":"Numbered List",todo:"To-do List",quote:"Quote",divider:"Divider",note:"Link to Note",link:"Link",callout:"Callout",bookmark:"Bookmark",table:"Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",flow:"Linked Note",newNote:"New Note",tag:"Tag",makeMenu:"Flow Menu",selectStyle:"Style",toggleKeyboard:"Toggle Keyboard",rows:"Rows",masonry:"Gallery"},styles:{bold:"Bold",italics:"Italics",strikethrough:"Strikethrough",code:"Code",link:"Web Link",blocklink:"Link to Note",textColor:"Text Color",highlight:"Highlight"},commandsSuggest:{noResult:"No result"},commandPalette:{enable:"Enable",disabled:"Disable",openFlow:"Open Flow Blocks in Selection",closeFlow:"Close Flow Blocks in Selection",toggleBold:"Toggle Bold",toggleItalics:"Toggle Italics",openSpaces:"Open Spaces",migrateData:"Migrate Spaces From 0.7",blink:"Blink",openFileContext:"Open Explorer",convertPathToSpace:"Convert to Space",revealFile:"Reveal File in Spaces",releaseNotes:"Release Notes",toggleBacklinks:"Toggle Backlinks",collapseAllFolders:"Collapse All Folders",addFileSpace:"Add File to Space",removeFileSpace:"Remove File from Space"},frames:{sections:{kit:"Kit",paths:"Paths"},label:{label:"Label",description:"Label"},note:{label:"Note",description:"Link to a note"},table:{label:"Table",description:"Table"},context:{label:"Context",description:"Display a context view from another space"},calendar:{label:"Calendar View"},field:{label:"Field",description:"Dynamic node that displays a value based on property type"},event:{label:"Event"},divider:{label:"Divider",description:"Divider to separate your content"},button:{label:"Button",description:"Buttons can perform actions and open links"},callout:{label:"Callout",description:"Callout to highlight important information"},toggle:{label:"Toggle",description:"Toggle to show/hide content"}},menu:{newView:"New View",customView:"Custom View",detailsView:"Details View",catalogView:"Catalog View",galleryView:"Gallery View",deleteContext:"Delete Context",openSpace:"Open Space",revealInDefault:"Reveal in Finder",setNone:"None",fileMetadataDescription:"This note only",openFilePane:"Open in a new pane",rename:"Rename",changeToFolderNote:"New Space from Note",moveFile:"Move file to...",moveFolder:"Move folder to...",duplicate:"Make a copy",edit:"Edit",delete:"Delete",getHelp:"Make.md Community",vault:"Vault",openVault:"Open Another Vault",openVaultInFolder:"Open Vault Folder",obSettings:"Obsidian Settings",commandPalette:"Command Palette",backToSpace:"Back to Spaces",collapseAllSections:"Collapse All Spaces",expandAllSections:"Expand All Spaces",collapseAllFolders:"Collapse All Folders",expandAllFolders:"Expand All Folders",spaceTitle:"Add/Remove in Space",home:"Home",waypoints:"Waypoints",none:"None",tableView:"Table View",cardView:"Card View",boardView:"Board View",listView:"List View",flowView:"Flow View",groupBy:"Group By",sortBy:"Sort By",newFilter:"New Filter",clearFilters:"Clear Filters",hide:"Hide",unhideFields:"Unhide All Properties",importDataview:"Import All Dataview Properties",saveAllProperties:"Save All Properties to Files",mergeProperties:"Merge Properties",removeFromSpace:"Unpin from Space",removeFromWaypoints:"Unpin from Waypoints",editCode:"Edit Code",deleteProperty:"Delete Property",hideProperty:"Hide Property",unhideProperty:"Unhide Property",saveProperty:"Save Property",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",deleteRow:"Delete Item",collapseAll:"Collapse All",customSort:"Custom Sort",groupSpaces:"Group Spaces",fileNameSortAlphaAsc:"File Name (A to Z)",fileNameSortAlphaDesc:"File Name (Z to A)",createdTimeSortAsc:"Created Time (new to old)",createdTimeSortDesc:"Created Time (old to new)",modifiedTimeSortAsc:"Modified Time (new to old)",modifiedTimeSortDesc:"Modified Time (old to new)",sizeSortAsc:"Size (smallest to largest)",sizeSortDesc:"Size (largest to smallest)",spaces:"Spaces",tags:"Tags",manageHiddenFiles:"Manage Hidden Files",manageActions:"Manage Actions",deleteSpace:"Delete",changeColor:"Change Color",changePropertyType:"Change Type",deleteFiles:"Delete Files",createFolderSpace:"Create Space from Folder",folder:"Folder",syncToContext:"Add Property to Context",setIcon:"Set Icon",copyEmbedLink:"Copy Embed Link",moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",groupNodes:"Group Nodes",moveFrame:"Move Frame",renameFrame:"Rename Frame",deleteFrame:"Delete Frame"},editor:{rows:"Rows",columns:"Columns",catalog:"Catalog",gallery:"Gallery",grid:"Grid",scaleToFit:"Change to Fit",scaleToFill:"Change to Fill",fit:"Fit",strokeNone:"None",strokeSolid:"Solid",strokeDotted:"Dotted",strokeDashed:"Dashed",size:"Size",gap:"Gap",marginLeft:"Left",marginTop:"Top",marginRight:"Right",marginBottom:"Bottom",minimize:"Minimize",paddingLeft:"Left",paddingTop:"Top",paddingRight:"Right",paddingBottom:"Bottom",unlinkProperty:"Unlink Property",linkedProperty:"Linked Property",linkProperty:"Link Property",currentSpace:"Current Space",linkName:"\${1} Link",linkThumbnail:"\${1} Thumbnail",linkSticker:"\${1} Sticker",opacity:"Opacity",shadowSpread:"Spread",shadowBlur:"Blur",width:"Width",height:"Height",margin:"Margin",padding:"Padding",bold:"Bold",italic:"Italic",underline:"Underline",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",numberOfLines:"Lines",createVerticalSection:"Create Vertical Section",createHorizontalSection:"Create Horizontal Section",themeColors:"Theme Colors",uiColors:"UI Colors",hex:"Hex"},buttons:{add:"Add",addFilter:"Add Filter",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",changeBanner:"Change Cover",changeBannerShort:"Cover",saveChanges:"Save Changes",removeBanner:"Remove Cover",rename:"Change Name",editFrame:"Edit Frame",saveSpace:"Save Space",createSpace:"New Space",createFolder:"New Folder",createNote:"New Note",createCanvas:"New Canvas",addIntoSpace:"New Pin",addSmartSearch:"Add Smart Search",addItem:"Add Item",addProperty:"Add Property",addContext:"Add Context",cancel:"Cancel",search:"Search",delete:"Delete",toggleFlow:"Toggle Flow",openFlow:"Open Flow",hideFlow:"Hide Flow",openLink:"Open Link",addToSpace:"Add to Space",addToSpaceShort:"Pin",addTag:"Add Tag",tag:"Tag",syncFields:"Sync Properties",convertTable:"Convert to Markdown",cutTable:"Cut Table",deleteTable:"Delete Table",blink:"Blink",addFile:"Add Item",merge:"Merge",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",deleteView:"Delete View",renameTable:"Rename Table",renameTag:"Rename Tag",createTag:"Create Tag",currentFolder:"Current Folder",sync:"Sync",pasteCSS:"Paste CSS",save:"Save",run:"Run"},metadataTypes:{fileName:"File Name",path:"Path",folder:"Folder",sticker:"Sticker",color:"Color",created:"Created",lastModified:"Last Modified",extension:"Extension",size:"Size",tags:"Tags",inlinks:"Linked Mentions",outlinks:"Links",label:"Label",fileMetadata:"File Metadata",frontmatter:"Frontmatter"},filterTypes:{contains:"contains",notContains:"does not contain",is:"is",isNot:"is not",before:"before",after:"after",anyOf:"is any of",noneOf:"is none of",checked:"is checked",unchecked:"is unchecked",isEmpty:"is empty",isNotEmpty:"is not empty",isSameDate:"is same date",isSameDateAsToday:"today"},sortTypes:{alphaAsc:"A to Z",alphaDesc:"Z to A",earliest:"Earliest",latest:"Latest",checkAsc:"Checked \\u2192 Unchecked",checkDesc:"Unchecked \\u2192 Checked",itemsAsc:"Least Items",itemsDesc:"Most Items"},properties:{defaultField:"Name",text:{label:"Text",description:"Text field"},number:{label:"Number",description:"Number field with optional unit"},boolean:{label:"Yes/No",description:"Yes or No toggle to indicate the status"},date:{label:"Date",description:"Select a date from a calendar"},option:{label:"Option",description:"Select one or multiple option from a list"},file:{label:"File"},link:{label:"Link",description:"Link to another note or a website"},tags:{label:"Tags",description:"Use tags to quickly organize your items"},object:{label:"Object",description:"Store any complex objects"},context:{label:"Relation",description:"Connect to another context property and create a relation"},image:{label:"Image",description:"Select any image from your system or from the internet"},color:{label:"Color",description:"Use colors to label your items or status"},space:{label:"Context",description:"Link to a context"},icon:{label:"Sticker",description:"Use stickers to uniquely label your items or status"},super:{label:"Super Property",links:"Open Link",properties:"Update Property",api:"API",obsidianCommands:"Run Command",runCommand:"Run Command",performAction:"Perform Action",whenClicked:"When Clicked"},fileProperty:{name:"Name",label:"Formula",createdTime:"Created",modifiedTime:"Last Edited",sticker:"Sticker",links:"Links",tags:"Tags",spaces:"Spaces",extension:"Extension",size:"Size",preview:"Note Preview",parentFolder:"Folder",description:"Use a formula to dynamically display a property"}},views:{navigator:"Navigator",explorer:"Explorer",space:"Space"},subViews:{spaceItems:"Items",spaceContext:"Context",spaceLists:"Lists",spaceActions:"Actions",smartSearch:"Smart Search",filesAndFolders:"Files and Folders"},labels:{properties:"Properties",newAction:"New Action",newTable:"New Table",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSectionSmart:"Edit Smart Space",renameSection:"Edit Space",createSectionSmart:"New Smart Space",createSection:"New Folder",createNote:"New Note",contextMaker:"Context Maker",select:"Select",pinnedItems:"Pinned Items",collapse:"Collapse",expand:"Expand",all:"All",none:"None",view:"View",findStickers:"Find Sticker",mergeProperties:"Merge Properties",placeholder:"Type '\${1}' for commands",itemsSelected:"\${1} Selected",selectNote:"Select Note",selectIcon:"Select Icon",selectImage:"Select Image",selectSpace:"Select Space",styleSmall:"Small",styleMedium:"Medium",styleLarge:"Large",hiddenFilePattern:"Name, Suffixes and Extension",hiddenFileSpecific:"Exclude specific files and folders",textPlaceholder:"Enter Text",noFile:"is not created yet. Click to create.",navigatorSearchPlaceholder:"Search by Text or Filters",blinkPlaceholder:"Quickly Search a File, Folder, Tag... Press Tab to Edit",searchPlaceholder:"Type to search...",contextItemSelectPlaceholder:"Find Item",linkItemSelectPlaceholder:"Find or Create Note",pinNotePlaceholder:"Select a Note or Space to Pin",optionItemSelectPlaceholder:"Select Option",viewItemSelectPlaceholder:"Select View",tagItemSelectPlaceholder:"Find Tag",spaceSelectPlaceholder:"Select any Folder or Tag",propertyItemSelectPlaceholder:"Select Property",sortItemSelectPlaceholder:"Select Sort",filterItemSelectPlaceholder:"Select Filter",imageSelectPlaceholder:"Select an image or paste a URL",imageNotFoundPlaceholder:"No Images Found",syncFrontmatterProperty:"Sync Frontmatter Property",newProperty:"New Property",newPropertyShort:"New Property",propertyType:"Type",propertyDynamic:"Dyanmic",propertyValueSpace:"Space",propertyValueProperty:"Property",propertyLookup:"Edit Formula",dateFormat:"Date Format",propertyFileProp:"Property",multiple:"Multiple",filesCount:"{$1} Files",hiddenFiles:"Hidden Files",addExtension:"Add Rule",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",renameTable:"Rename Table",syncMetadata:"Sync Metadata",syncProperties:"Sync Properties",selectContext:"Select Context",metadata:"Metadata",backlinks:"Backlinks",spaces:"Spaces",context:"Context",content:"Content",deleteSpace:"Delete Space",deleteFiles:"Delete Files",outgoingLinks:"Outgoing Links",moveTo:"Move to",addTo:"Pin to",copyTo:"Copy to",reorderIn:"Reorder in",border:"Border",corners:"Corners",color:"Color",backgroundColor:"Background",cornerRadius:"Radius",onClick:"On Click",layout:"Layout",element:"Element",name:"Name",display:"Display",alignment:"Alignment",margin:"Margin",padding:"Padding",gap:"Gap",width:"Width",height:"Height",opacity:"Opacity",shadow:"Shadow",shadowBlur:"Blur",shadowSpread:"Spread",typography:"Typography",layers:"Layers",fontSize:"Size",props:"Props",styles:"Styles",events:"Events",code:"Code",selectedLayers:"\${1} Layers"},descriptions:{spaceActions:"Create actions that runs when you press a button",spaceLists:"Create lists to track data and organize them in your space",spaceItems:"Add new items to the space or pin items to the space",smartSearch:"Automatically pin notes to this space based on a set of searches",hiddenFileOptions:"Exclude any files and folders by name, suffix or extension.",deleteSpace:"Deleting the space will also delete the folder and its contents.",deleteFiles:"Delete \${1} files/folders and their contents?",addContext:"Contexts lets you connect properties from your tags",spaceProperties:"Define Properties for your Space Items",syncMetadata:"Select which fields from your notes to start syncing with the context.",syncProperties:"Contexts defines and syncs the same fields across your notes depending on their folder or tag.",selectContext:"Select which folder or tag context you want to sync the fields."},flowView:{emptyDoc:"Empty Document",itemsCount:" Items",emptyFolder:"This Folder is Empty"},notice:{duplicateFile:"Folder already contains note with same name",addedToSection:"Added to Space",fileExists:"File Already Exists",folderExists:"Folder Already Exists",noPropertyName:"Property Name is Required",duplicatePropertyName:"Duplicate Property Name",newSpaceName:"Enter a name for your space",duplicateSpaceName:"Space name already exists",cantConvertNoteToSpace:"The view is not a note"},settings:{layoutVertical:"Vertical",layoutHorizontal:"Horizontal",sectionSidebar:"Spaces",sectionEditor:"Maker Mode",sectionFlow:"Flow",sectionAdvanced:"Advanced",sectionDataview:"Dataview",sectionContext:"Context",sectionStickers:"Stickers",sectionNavigator:"Navigator",sectionDefault:"Default Spaces",sectionSpaceView:"Space View",sectionBlink:"Blink",sectionInlineContext:"Inline Context",sectionFlowBlock:"Flow Block",sectionFlowMenu:"Flow Menu",sectionFlowStyler:"Flow Styler",experimental:{name:"Experimental",desc:"Experimental features that are subject to change and may not be optimized for performance"},generateThumbnails:{name:"Generate Thumbnails",desc:"Create thumbnails for images to speed up performance"},minimalThemeFix:{name:"Minimal Theme Fix",description:"Apply fixes for the popular theme Minimal"},inlineStickerMenu:{name:"Inline Stickers",desc:"Add inline stickers by typing :"},openSpacesOnLaunch:{name:"Open Spaces as Default Tab",desc:"Open the Spaces tab when Obsidian launches"},defaultSpaceTemplate:{name:"Default Space Template",desc:"Select the default template for new spaces"},defaultDateFormat:{name:"Default Date Format",desc:"Set the default date format, example: yyyy-MM-dd (see https://date-fns.org/v2.30.0/docs/format)"},newNotePlaceholder:{name:"New Note Placeholder",desc:"Default name for new notes"},folderIndentationLines:{name:"Show Folder Indentation Lines",desc:"Turn on to show a line on the left of folders to indicate indentation"},folderNoteLocation:{name:"Folder Note Location Inside Folder",desc:"Turn on to have folder notes inside the folder, turn off to have it outside"},folderViewDefault:{name:"Show Folder Note by Default",desc:"Show the folder note by default when opening a folder"},internalLinkFlowEditor:{name:"Open Flow Blocks on Internal Link Click",desc:"Turn on to toggle Flow Blocks directly by clicking on internal links, otherwise a tooltip will be shown"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},inlineBacklinks:{name:"Show Inline Backlinks (Inline Context required)",desc:"Show editable backlinks at the bottom of your notes"},dataviewInlineContext:{name:"Show Dataview in Inline Context",desc:"Show dataview when inline context is enabled"},inlineContextExplorer:{name:"Inline Context",desc:"Display the context and a banner at the top of your notes"},inlineContextExpanded:{name:"Auto Expand Inline Context",desc:"Expand the inline context sections when opening a note"},inlineContextHorizontal:{name:"Inline Title and Sticker Layout",desc:"Layout for inline title and sticker in Inline Context"},hideFrontmatter:{name:"Hide Frontmatter Properties",desc:"Hide the frontmatter properties in inline context"},openFileContext:{name:"Auto Open Explorer",desc:"Automatically open explorer panel in the right panel"},folderNote:{name:"Enable Folder Note",desc:"Access the folder note in the folder page and hide the folder note from spaces"},expandFolder:{name:"Auto Expand Folder",desc:"Auto expand folders on click"},hoverPreview:{name:"Preview on Hover",desc:"Preview on Hover while holding Control/Command key"},activeFile:{name:"Reveal Active File",desc:"Automatically reveal the active file in Spaces"},contexts:{name:"Contexts",desc:"Contexts allows you to have full control over the metadata of your files"},spaces:{name:"Navigator",desc:"The navigator lets you create and organize your spaces"},spacesStickers:{name:"Stickers",desc:"Use Emojis to make it easier to find your notes"},spacesAlias:{name:"Alias",desc:"Use the alias metadata to show in Spaces"},spacesFileExplorerDual:{name:"Compatibility Mode",desc:"This will improve the compatibility of plugins while using Spaces"},spacesDeleteOption:{name:"Delete File Option",desc:"Select how you want files to be deleted"},spacesDeleteOptions:{permanant:"Delete Permanently",trash:"Move to Obsidian Trash","system-trash":"Move to System Trash"},hideRibbon:{name:"App Ribbon",desc:"Show/hide the left menu aka. ribbon"},spaceView:{name:"Space View",desc:"Open the space view when you click on a space"},defaultSpaces:{name:"Default Spaces",desc:"Recommended spaces for quickly organizing your vault"},homeSpace:{name:"Home Space",desc:"An easy-to-access space where you can add/organize your other spaces"},tagSpaces:{name:"Tag Spaces",desc:"Automatically create spaces for each of your tags"},readableLineWidth:{name:"Readable Line Width",desc:"Use Readable Line Width"},sidebarTabs:{name:"Sidebar Tabs",desc:"Show/hide other sidebar tabs"},spacesPerformance:{name:"Performance Mode",desc:"Turn on performance mode for Spaces, may affect scrolling appearance. Requires Restart"},indexSVG:{name:"Use SVGs as Stickers",desc:"Use any svg file in your vault as a sticker"},inlineStyler:{name:"Flow Styler",desc:"Select text to add styling"},inlineStylerColor:{name:"Text and Highlight Colors \\u{1F9EA}",desc:"Select text color and highlight color, (this may change in the future because of the limitations with HTML and Obsidian)"},spaceRowHeight:{name:"Row Height",desc:"The height for each row in spaces (in pixels), default is 28"},makeChar:{name:"Flow Menu Trigger",desc:"Character to open the Flow Menu"},mobileMakeBar:{name:"Flow Styler (Mobile)",desc:"Replaces the mobile toolbar"},editorMarkSans:{name:"Mark Sans \\u{1F9EA}",desc:"Use the editor without Markdown."},editorMakerMode:{name:"Flow (Beta)",desc:"An integrated and intuitive editor experience"},editorMakePlacholder:{name:"Flow Menu Hint Text",desc:"Show a hint text on how to open the Flow Menu Shortcut"},blink:{name:"Blink",desc:"A faster way to search and edit your notes"},editorMakeMenu:{name:"Flow Menu",desc:"Open the Flow menu to quickly add content"},editorMakeMenuTrigger:{name:"Flow Menu Shortcut",desc:"Trigger key to use flow menu"},editorFlowReplace:{name:"Flow Block",desc:"Open your internal links or toggle your embeds in the flow block."},editorFlowStyle:{name:"Flow Block Style",desc:"Select a theme for your flow block",seamless:"Seamless",classic:"Classic",minimal:"Minimal"}}}};this.lang="en";let r=Vx.default.locale();["en"].includes(r)&&(this.lang=r)}get texts(){return this.all.en}},Vr=new Fd().texts;var Yx=(e,r)=>r==uo?Ws.find(t=>t.type=="file"):r=="tags"?Ws.find(t=>t.type=="tags"):r=="aliases"?Ws.find(t=>t.type=="option-multi"):r=="sticker"?Ws.find(t=>e=="icon"):Ws.find(t=>e==t.type)||Ws.find(t=>e==t.multiType),Ws=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"text",label:Vr.properties.text.label,metadata:!0,icon:"ui//text",description:Vr.properties.text.description},{type:"number",label:Vr.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],description:Vr.properties.number.description},{type:"boolean",label:Vr.properties.boolean.label,metadata:!0,icon:"ui//check-square",description:Vr.properties.boolean.description},{type:"date",label:Vr.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],description:Vr.properties.date.description},{type:"option",label:Vr.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options"],description:Vr.properties.option.description},{type:"tags",label:Vr.properties.tags.label,icon:"ui//tags",description:Vr.properties.tags.description},{type:"file",label:Vr.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:Vr.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value"],description:Vr.properties.fileProperty.description},{type:"link",label:Vr.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",description:Vr.properties.link.description},{type:"context",label:Vr.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:Vr.properties.context.description},{type:"object",label:Vr.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type"],description:Vr.properties.object.description},{type:"icon",label:Vr.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",description:Vr.properties.icon.description},{type:"image",label:Vr.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",description:Vr.properties.image.description},{type:"color",label:Vr.properties.color.label,icon:"ui//mk-make-image",description:Vr.properties.color.description},{type:"space",label:Vr.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Vr.properties.space.description},{type:"table",label:Vr.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Vr.properties.space.description},{type:"super",label:Vr.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:Vr.properties.super.label,icon:"ui//input",restricted:!0}];var Vs="files",rc={id:Vs,name:"Files",type:"db",primary:"true"},ik="filesView",ak={id:ik,name:"All",type:"view",def:JSON.stringify({db:Vs,icon:"ui//file-stack"})},ok="main",sk=e=>({id:e,name:e,type:"frame",def:"",predicate:"",primary:"true"}),C$={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[sk(ok),ak]},jl={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[rc]},Hx={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},ec={...Hx,rows:[{name:uo,schemaId:Vs,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:Vr.properties.fileProperty.createdTime,schemaId:Vs,type:"fileprop",value:uo+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var M$=[{name:Vr.properties.defaultField,schemaId:"",type:"text",primary:"true"}],Od={...Hx,rows:[{name:uo,schemaId:Vs,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var _$={schema:rc,cols:ec.rows,rows:[]},T$={schema:rc,cols:ec.rows,rows:[]},F$={schema:rc,cols:Od.rows,rows:[]},Gx=(e,r)=>e.filter(t=>r.find(n=>n.id==t.schemaId&&n.type=="db")).reduce((t,n)=>({...t,...t[n.schemaId]?{[n.schemaId]:{uniques:n.unique=="true"?[...t[n.schemaId].uniques,n.name]:t[n.schemaId].uniques,cols:[...t[n.schemaId].cols,n.name],rows:[]}}:{[n.schemaId]:{uniques:n.unique=="true"?[n.name]:[],cols:[n.name],rows:[]}}}),{});var O$={m_schema:jl,m_fields:ec,...Gx(ec.rows,jl.rows)},B$={m_schema:jl,m_fields:Od,...Gx(Od.rows,jl.rows)};var fk=(e,r)=>{let t=n=>n=="builtin"?"Builtin":n=="api"?"Spaces":"Action";return[...(e.actionsIndex.get(r)??[]).map(n=>({name:n.schema.name,description:"Action",value:\`\${r}/#;\${n.schema.id}\`,section:"Action"}))??[],...[...e.cli.allCommands()].map(n=>({name:n.schema.name,description:t(n.schema.type),value:n.path,section:t(n.schema.type)}))]};var $x=({field:e,value:r})=>r=="ctime"?{value:\`parseDate(prop('\${e}')['metadata']['file']['\${r}'])\`}:{value:\`prop('\${e}')['metadata']['file']['\${r}']\`},Bd=(e,r,t,n)=>{let i=Ql(e);if(i)return r=="fileprop"&&i.field?$x(i):(r=="option"&&i.source?.length>0&&(i.source=="$commands"?i.options=t.cli.allCommands():i.source=="$links"?i.options=t.spaceManager.allPaths().map(a=>({name:a,value:a})):i.source=="$super"&&(i.options=fk(t,n))),[...Yx(r).configKeys??[],"alias","default"].reduce((a,s)=>({...a,[s]:i[s]}),{}));if(!r)return{};if(!i)if(r=="context")e?.length>0?i={space:e}:i={};else if(r.startsWith("date"))e?.length>0?i={format:e}:i={};else if(r.startsWith("fileprop"))if(e?.length>0){let[a,s]=e.split(".");i=$x({field:a,value:s})}else i={};else r.startsWith("option")&&(e?.length>0?i={options:qi(e).map(s=>({name:s,value:s}))}:i={});return i??{}};function Mt(){return Mt=Object.assign?Object.assign.bind():function(e){for(var r=1;re[r])}var Kx=["Matrix","Array"],jx=["number","BigNumber","Fraction"];function ry(e,r){function t(n){if(n){var i=Gs(e,tr);ey(n,"matrix",Kx),ey(n,"number",jx),Id(e,n);var a=Gs(e,tr),s=Gs(n,tr);return r("config",a,i,s),a}else return Gs(e,tr)}return t.MATRIX_OPTIONS=Kx,t.NUMBER_OPTIONS=jx,Object.keys(tc).forEach(n=>{Object.defineProperty(t,n,{get:()=>e[n],enumerable:!0,configurable:!0})}),t}function lk(e,r){return e.indexOf(r)!==-1}function ey(e,r,t){e[r]!==void 0&&!lk(t,e[r])&&console.warn('Warning: Unknown value "'+e[r]+'" for configuration option "'+r+'". Available options: '+t.map(n=>JSON.stringify(n)).join(", ")+".")}var Mg={};a8(Mg,{createAbs:()=>tb,createAccessorNode:()=>N2,createAcos:()=>eN,createAcosh:()=>tN,createAcot:()=>iN,createAcoth:()=>oN,createAcsc:()=>uN,createAcsch:()=>lN,createAdd:()=>m2,createAddScalar:()=>ab,createAnd:()=>tp,createAndTransform:()=>UO,createApply:()=>au,createApplyTransform:()=>mO,createArg:()=>ow,createArrayNode:()=>A2,createAsec:()=>pN,createAsech:()=>hN,createAsin:()=>vN,createAsinh:()=>gN,createAssignmentNode:()=>M2,createAtan:()=>xN,createAtan2:()=>bN,createAtanh:()=>DN,createAtomicMass:()=>G3,createAvogadro:()=>$3,createBellNumbers:()=>EF,createBigNumberClass:()=>Qy,createBignumber:()=>L1,createBin:()=>AD,createBitAnd:()=>Vc,createBitAndTransform:()=>WO,createBitNot:()=>rw,createBitOr:()=>Yc,createBitOrTransform:()=>VO,createBitXor:()=>iw,createBlockNode:()=>_2,createBohrMagneton:()=>E3,createBohrRadius:()=>O3,createBoltzmann:()=>Z3,createBoolean:()=>R1,createCatalan:()=>MF,createCbrt:()=>fb,createCeil:()=>lb,createChain:()=>eT,createChainClass:()=>NA,createClassicalElectronRadius:()=>B3,createClone:()=>s1,createColumn:()=>$c,createColumnTransform:()=>hO,createCombinations:()=>RT,createCombinationsWithRep:()=>UT,createCompare:()=>hS,createCompareNatural:()=>xS,createCompareText:()=>bS,createCompile:()=>Q2,createComplex:()=>q1,createComplexClass:()=>Ky,createComposition:()=>TF,createConcat:()=>Gc,createConcatTransform:()=>CO,createConditionalNode:()=>T2,createConductanceQuantum:()=>C3,createConj:()=>uw,createConstantNode:()=>k2,createCorr:()=>IT,createCos:()=>NN,createCosh:()=>EN,createCot:()=>MN,createCoth:()=>TN,createCoulomb:()=>N3,createCount:()=>ww,createCreateUnit:()=>KS,createCross:()=>Sw,createCsc:()=>ON,createCsch:()=>IN,createCtranspose:()=>oD,createCube:()=>pb,createCumSum:()=>Rp,createCumSumTransform:()=>PO,createDeepEqual:()=>_S,createDenseMatrixClass:()=>a1,createDerivative:()=>WF,createDet:()=>tT,createDeuteronMass:()=>q3,createDiag:()=>Aw,createDiff:()=>Zc,createDiffTransform:()=>_O,createDistance:()=>DT,createDivide:()=>bT,createDivideScalar:()=>LD,createDot:()=>y2,createDotDivide:()=>KD,createDotMultiply:()=>$b,createDotPow:()=>XD,createE:()=>a3,createEfimovFactor:()=>H3,createEigs:()=>fT,createElectricConstant:()=>D3,createElectronMass:()=>I3,createElementaryCharge:()=>A3,createEqual:()=>wS,createEqualScalar:()=>F1,createEqualText:()=>SS,createErf:()=>dD,createEvaluate:()=>J2,createExp:()=>hb,createExpm:()=>cT,createExpm1:()=>vb,createFactorial:()=>GT,createFalse:()=>jF,createFaraday:()=>Q3,createFermiCoupling:()=>P3,createFft:()=>lD,createFibonacciHeapClass:()=>US,createFilter:()=>Cw,createFilterTransform:()=>vO,createFineStructure:()=>k3,createFirstRadiation:()=>X3,createFix:()=>gb,createFlatten:()=>_w,createFloor:()=>qc,createForEach:()=>Fw,createForEachTransform:()=>gO,createFormat:()=>SD,createFraction:()=>U1,createFractionClass:()=>r1,createFreqz:()=>ZF,createFunctionAssignmentNode:()=>R2,createFunctionNode:()=>H2,createGamma:()=>WT,createGasConstant:()=>K3,createGcd:()=>Sb,createGetMatrixDataType:()=>Bw,createGravitationConstant:()=>x3,createGravity:()=>sO,createHartreeEnergy:()=>R3,createHasNumericValue:()=>w1,createHelp:()=>K_,createHelpClass:()=>SA,createHex:()=>_D,createHypot:()=>d2,createI:()=>m3,createIdentity:()=>Pw,createIfft:()=>pD,createIm:()=>lw,createImmutableDenseMatrixClass:()=>RS,createIndex:()=>D2,createIndexClass:()=>qS,createIndexNode:()=>L2,createIndexTransform:()=>xO,createInfinity:()=>r3,createIntersect:()=>ST,createInv:()=>iT,createInverseConductanceQuantum:()=>M3,createInvmod:()=>Hb,createIsInteger:()=>f1,createIsNaN:()=>C1,createIsNegative:()=>g1,createIsNumeric:()=>y1,createIsPositive:()=>S1,createIsPrime:()=>PD,createIsZero:()=>A1,createKldivergence:()=>ZT,createKlitzing:()=>F3,createKron:()=>Rw,createLN10:()=>u3,createLN2:()=>s3,createLOG10E:()=>l3,createLOG2E:()=>f3,createLarger:()=>ES,createLargerEq:()=>CS,createLcm:()=>Ab,createLeafCount:()=>OF,createLeftShift:()=>uS,createLgamma:()=>YT,createLog:()=>YD,createLog10:()=>Cb,createLog1p:()=>GD,createLog2:()=>_b,createLoschmidt:()=>J3,createLsolve:()=>eS,createLsolveAll:()=>iS,createLup:()=>tA,createLusolve:()=>bA,createLyap:()=>yT,createMad:()=>_T,createMagneticConstant:()=>w3,createMagneticFluxQuantum:()=>_3,createMap:()=>qw,createMapTransform:()=>bO,createMatrix:()=>W1,createMatrixClass:()=>n1,createMatrixFromColumns:()=>Z1,createMatrixFromFunction:()=>Y1,createMatrixFromRows:()=>G1,createMax:()=>lp,createMaxTransform:()=>wO,createMean:()=>Lp,createMeanTransform:()=>DO,createMedian:()=>CT,createMin:()=>cp,createMinTransform:()=>SO,createMod:()=>Uc,createMode:()=>yD,createMolarMass:()=>aO,createMolarMassC12:()=>oO,createMolarPlanckConstant:()=>j3,createMolarVolume:()=>eO,createMultinomial:()=>XT,createMultiply:()=>Ob,createMultiplyScalar:()=>Tb,createNaN:()=>t3,createNeutronMass:()=>U3,createNode:()=>S2,createNorm:()=>g2,createNot:()=>hw,createNthRoot:()=>Ib,createNthRoots:()=>ZD,createNuclearMagneton:()=>T3,createNull:()=>e3,createNumber:()=>B1,createNumeric:()=>kD,createObjectNode:()=>q2,createOct:()=>CD,createOnes:()=>zw,createOperatorNode:()=>U2,createOr:()=>Hc,createOrTransform:()=>zO,createParenthesisNode:()=>z2,createParse:()=>$2,createParser:()=>eA,createParserClass:()=>K2,createPartitionSelect:()=>OS,createPermutations:()=>jT,createPhi:()=>o3,createPi:()=>n3,createPickRandom:()=>xF,createPinv:()=>oT,createPlanckCharge:()=>cO,createPlanckConstant:()=>y3,createPlanckLength:()=>uO,createPlanckMass:()=>fO,createPlanckTemperature:()=>pO,createPlanckTime:()=>lO,createPolynomialRoot:()=>DA,createPow:()=>UD,createPrint:()=>rp,createPrintTransform:()=>qO,createProd:()=>wD,createProtonMass:()=>L3,createQr:()=>iA,createQuantileSeq:()=>Up,createQuantileSeqTransform:()=>BO,createQuantumOfCirculation:()=>z3,createRandom:()=>bF,createRandomInt:()=>DF,createRange:()=>Jc,createRangeClass:()=>t1,createRangeNode:()=>W2,createRangeTransform:()=>NO,createRationalize:()=>YF,createRe:()=>pw,createReducedPlanckConstant:()=>b3,createRelationalNode:()=>V2,createReplacer:()=>XF,createReshape:()=>Yw,createResize:()=>Hw,createResolve:()=>LF,createResultSet:()=>Iy,createReviver:()=>QF,createRightArithShift:()=>lS,createRightLogShift:()=>pS,createRotate:()=>$w,createRotationMatrix:()=>Qw,createRound:()=>WD,createRow:()=>Kc,createRowTransform:()=>AO,createRydberg:()=>W3,createSQRT1_2:()=>c3,createSQRT2:()=>p3,createSackurTetrode:()=>rO,createSchur:()=>gT,createSec:()=>kN,createSech:()=>LN,createSecondRadiation:()=>tO,createSetCartesian:()=>$N,createSetDifference:()=>QN,createSetDistinct:()=>JN,createSetIntersect:()=>jN,createSetIsSubset:()=>r2,createSetMultiplicity:()=>n2,createSetPowerset:()=>a2,createSetSize:()=>s2,createSetSymDifference:()=>f2,createSetUnion:()=>c2,createSign:()=>kb,createSimplify:()=>IF,createSimplifyConstant:()=>PF,createSimplifyCore:()=>RF,createSin:()=>UN,createSinh:()=>WN,createSize:()=>Kw,createSlu:()=>xA,createSmaller:()=>NS,createSmallerEq:()=>AS,createSolveODE:()=>hD,createSort:()=>IS,createSpaClass:()=>zS,createSparse:()=>XS,createSparseMatrixClass:()=>O1,createSpeedOfLight:()=>g3,createSplitUnit:()=>X1,createSqrt:()=>Rb,createSqrtm:()=>mT,createSquare:()=>qb,createSqueeze:()=>eD,createStd:()=>zp,createStdTransform:()=>TO,createStefanBoltzmann:()=>nO,createStirlingS2:()=>NF,createString:()=>P1,createSubset:()=>jc,createSubsetTransform:()=>EO,createSubtract:()=>zb,createSubtractScalar:()=>sb,createSum:()=>Pp,createSumTransform:()=>OO,createSylvester:()=>dT,createSymbolNode:()=>Y2,createSymbolicEqual:()=>UF,createTan:()=>YN,createTanh:()=>HN,createTau:()=>i3,createThomsonCrossSection:()=>V3,createTo:()=>BD,createTrace:()=>b2,createTranspose:()=>iD,createTrue:()=>KF,createTypeOf:()=>_1,createTyped:()=>By,createUnaryMinus:()=>K1,createUnaryPlus:()=>eb,createUnequal:()=>TS,createUnitClass:()=>GS,createUnitFunction:()=>ZS,createUppercaseE:()=>d3,createUppercasePi:()=>h3,createUsolve:()=>tS,createUsolveAll:()=>oS,createVacuumImpedance:()=>S3,createVariance:()=>qp,createVarianceTransform:()=>RO,createVersion:()=>v3,createWeakMixingAngle:()=>Y3,createWienDisplacement:()=>iO,createXgcd:()=>Vb,createXor:()=>gw,createZeros:()=>uD,createZeta:()=>gD,createZpk2tf:()=>GF});var Kd=li(vc(),1);function He(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}var mi=Math.sign||function(e){return e>0?1:e<0?-1:0},iy=Math.log2||function(r){return Math.log(r)/Math.LN2},ay=Math.log10||function(r){return Math.log(r)/Math.LN10},gc=Math.log1p||function(e){return Math.log(e+1)},oy=Math.cbrt||function(r){if(r===0)return r;var t=r<0,n;return t&&(r=-r),isFinite(r)?(n=Math.exp(Math.log(r)/3),n=(r/(n*n)+2*n)/3):n=r,t?-n:n},sy=Math.expm1||function(r){return r>=2e-4||r<=-2e-4?Math.exp(r)-1:r+r*r/2+r*r*r/6};function Ld(e,r,t){var n={2:"0b",8:"0o",16:"0x"},i=n[r],a="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!He(t))throw new Error("size must be an integer");if(e>2**(t-1)-1||e<-(2**(t-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!He(e))throw new Error("Value must be an integer");e<0&&(e=e+2**t),a="i".concat(t)}var s="";return e<0&&(e=-e,s="-"),"".concat(s).concat(i).concat(e.toString(r)).concat(a)}function zi(e,r){if(typeof r=="function")return r(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:t,precision:n,wordSize:i}=qd(r);switch(t){case"fixed":return Ud(e,n);case"exponential":return uy(e,n);case"engineering":return ck(e,n);case"bin":return Ld(e,2,i);case"oct":return Ld(e,8,i);case"hex":return Ld(e,16,i);case"auto":return pk(e,n,r).replace(/((\\.\\d*?)(0+))($|e)/,function(){var a=arguments[2],s=arguments[4];return a!=="."?a+s:s});default:throw new Error('Unknown notation "'+t+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function qd(e){var r="auto",t,n;if(e!==void 0)if(ar(e))t=e;else if(je(e))t=e.toNumber();else if(ua(e))e.precision!==void 0&&(t=ty(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=ty(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(r=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:r,precision:t,wordSize:n}}function Qs(e){var r=String(e).toLowerCase().match(/^(-?)(\\d+\\.?\\d*)(e([+-]?\\d+))?$/);if(!r)throw new SyntaxError("Invalid number "+e);var t=r[1],n=r[2],i=parseFloat(r[4]||"0"),a=n.indexOf(".");i+=a!==-1?a-1:n.length-1;var s=n.replace(".","").replace(/^0*/,function(c){return i-=c.length,""}).replace(/0*$/,"").split("").map(function(c){return parseInt(c)});return s.length===0&&(s.push(0),i++),{sign:t,coefficients:s,exponent:i}}function ck(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Qs(e),n=xc(t,r),i=n.exponent,a=n.coefficients,s=i%3===0?i:i<0?i-3-i%3:i-i%3;if(ar(r))for(;r>a.length||i-s+1>a.length;)a.push(0);else for(var c=Math.abs(i-s)-(a.length-1),f=0;f0;)u++,o--;var p=a.slice(u).join(""),h=ar(r)&&p.length||p.match(/[1-9]/)?"."+p:"",d=a.slice(0,u).join("")+h+"e"+(i>=0?"+":"")+s.toString();return n.sign+d}function Ud(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Qs(e),n=typeof r=="number"?xc(t,t.exponent+1+r):t,i=n.coefficients,a=n.exponent+1,s=a+(r||0);return i.length0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function pk(e,r,t){if(isNaN(e)||!isFinite(e))return String(e);var n=ny(t?.lowerExp,-3),i=ny(t?.upperExp,5),a=Qs(e),s=r?xc(a,r):a;if(s.exponent=i)return uy(e,r);var c=s.coefficients,f=s.exponent;c.length0?f:0;return or){var i=n.splice(r,n.length-r);if(i[0]>=5){var a=r-1;for(n[a]++;n[a]===10;)n.pop(),a===0&&(n.unshift(0),t.exponent++,a++),a--,n[a]++}}return t}function Zs(e){for(var r=[],t=0;t0?!0:e<0?!1:1/e===1/0,n=r>0?!0:r<0?!1:1/r===1/0;return t^n?-e:e}function ty(e,r){if(ar(e))return e;if(je(e))return e.toNumber();r()}function ny(e,r){return ar(e)?e:je(e)?e.toNumber():r}function zd(e,r,t){var n=e.constructor,i=new n(2),a="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!He(t))throw new Error("size must be an integer");if(e.greaterThan(i.pow(t-1).sub(1))||e.lessThan(i.pow(t-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(t))),a="i".concat(t)}switch(r){case 2:return"".concat(e.toBinary()).concat(a);case 8:return"".concat(e.toOctal()).concat(a);case 16:return"".concat(e.toHexadecimal()).concat(a);default:throw new Error("Base ".concat(r," not supported "))}}function gy(e,r){if(typeof r=="function")return r(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:t,precision:n,wordSize:i}=qd(r);switch(t){case"fixed":return dk(e,n);case"exponential":return dy(e,n);case"engineering":return hk(e,n);case"bin":return zd(e,2,i);case"oct":return zd(e,8,i);case"hex":return zd(e,16,i);case"auto":{var a=vy(r?.lowerExp,-3),s=vy(r?.upperExp,5);if(e.isZero())return"0";var c,f=e.toSignificantDigits(n),o=f.e;return o>=a&&o=0?"+":"")+n.toString()}function dy(e,r){return r!==void 0?e.toExponential(r-1):e.toExponential()}function dk(e,r){return e.toFixed(r)}function vy(e,r){return ar(e)?e:je(e)?e.toNumber():r}function yy(e,r){var t=e.length-r.length,n=e.length;return e.substring(t,n)===r}function lr(e,r){var t=vk(e,r);return r&&typeof r=="object"&&"truncate"in r&&t.length>r.truncate?t.substring(0,r.truncate-3)+"...":t}function vk(e,r){if(typeof e=="number")return zi(e,r);if(je(e))return gy(e,r);if(gk(e))return!r||r.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return by(e,r);if(yt(e))return Jo(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(r);if(e&&e.toString(r)!=={}.toString())return e.toString(r);var t=Object.keys(e).map(n=>Jo(n)+": "+lr(e[n],r));return"{"+t.join(", ")+"}"}return String(e)}function Jo(e){for(var r=String(e),t="",n=0;n/g,">"),r}function by(e,r){if(Array.isArray(e)){for(var t="[",n=e.length,i=0;ir?1:-1}function pr(e,r,t){if(!(this instanceof pr))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=r,this.relation=t,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(r)?"["+r.join(", ")+"]":r)+")",this.stack=new Error().stack}pr.prototype=new RangeError;pr.prototype.constructor=RangeError;pr.prototype.name="DimensionError";pr.prototype.isDimensionError=!0;function Xt(e,r,t){if(!(this instanceof Xt))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=r):(this.min=r,this.max=t),this.min!==void 0&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}Xt.prototype=new RangeError;Xt.prototype.constructor=RangeError;Xt.prototype.name="IndexError";Xt.prototype.isIndexError=!0;function or(e){for(var r=[];Array.isArray(e);)r.push(e.length),e=e[0];return r}function wy(e,r,t){var n,i=e.length;if(i!==r[t])throw new pr(i,r[t]);if(t")}function Vd(e,r){var t=r.length===0;if(t){if(Array.isArray(e))throw new pr(e.length,0)}else wy(e,r,0)}function df(e,r){var t=e.isMatrix?e._size:or(e),n=r._sourceSize;n.forEach((i,a)=>{if(i!==null&&i!==t[a])throw new pr(i,t[a])})}function Xr(e,r){if(e!==void 0){if(!ar(e)||!He(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof r=="number"&&e>=r)throw new Xt(e,r)}}function Ko(e){for(var r=0;r=0,f=r%t===0;if(c)if(f)n[a]=-r/t;else throw new Error("Could not replace wildcard, since "+r+" is no multiple of "+-t);return n}function Dy(e){return e.reduce((r,t)=>r*t,1)}function xk(e,r){for(var t=e,n,i=r.length-1;i>0;i--){var a=r[i];n=[];for(var s=t.length/a,c=0;cr.test(t))}function Yd(e,r){return Array.prototype.join.call(e,r)}function Ia(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var r=[],t=0;r[0]={value:e[0],identifier:0};for(var n=1;n1)return e.slice(1).reduce(function(t,n){return Ay(t,n,r,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function yk(){for(var e=arguments.length,r=new Array(e),t=0;th.length),i=Math.max(...n),a=new Array(i).fill(null),s=0;sa[u]&&(a[u]=c[o])}for(var p=0;p1||e[i]>r[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(r[a]))}}function $d(e,r){var t=or(e);if(Ui(t,r))return e;xf(t,r);var n=yk(t,r),i=n.length,a=[...Array(i-t.length).fill(1),...t],s=wk(e);t.length!Sk(a)).every(a=>t[a]!==void 0);if(!n){var i=r.filter(a=>t[a]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(a=>'"'.concat(a,'"')).join(", "),"."))}}function Sk(e){return e&&e[0]==="?"}function Zd(e){return e&&e[0]==="?"?e.slice(1):e}function gt(e,r){if(_y(e)&&Cy(e,r))return e[r];throw typeof e[r]=="function"&&Nc(e,r)?new Error('Cannot access method "'+r+'" as a property'):new Error('No access to property "'+r+'"')}function la(e,r,t){if(_y(e)&&Cy(e,r))return e[r]=t,t;throw new Error('No access to property "'+r+'"')}function Ey(e,r){return r in e}function Cy(e,r){return!e||typeof e!="object"?!1:$e(Nk,r)?!0:!(r in Object.prototype||r in Function.prototype)}function My(e,r){if(!Nc(e,r))throw new Error('No access to method "'+r+'"');return e[r]}function Nc(e,r){return e==null||typeof e[r]!="function"||$e(e,r)&&Object.getPrototypeOf&&r in Object.getPrototypeOf(e)?!1:$e(Ak,r)?!0:!(r in Object.prototype||r in Function.prototype)}function _y(e){return typeof e=="object"&&e&&e.constructor===Object}var Nk={length:!0,name:!0},Ak={toString:!0,valueOf:!0,toLocaleString:!0};var es=class{constructor(r){this.wrappedObject=r,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(r){return gt(this.wrappedObject,r)}set(r,t){return la(this.wrappedObject,r,t),this}has(r){return Ey(this.wrappedObject,r)}entries(){return Ty(this.keys(),r=>[r,this.get(r)])}forEach(r){for(var t of this.keys())r(this.get(t),t,this)}delete(r){delete this.wrappedObject[r]}clear(){for(var r of this.keys())this.delete(r)}get size(){return Object.keys(this.wrappedObject).length}},js=class{constructor(r,t,n){this.a=r,this.b=t,this.bKeys=n,this[Symbol.iterator]=this.entries}get(r){return this.bKeys.has(r)?this.b.get(r):this.a.get(r)}set(r,t){return this.bKeys.has(r)?this.b.set(r,t):this.a.set(r,t),this}has(r){return this.b.has(r)||this.a.has(r)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return Ty(this.keys(),r=>[r,this.get(r)])}forEach(r){for(var t of this.keys())r(this.get(t),t,this)}delete(r){return this.bKeys.has(r)?this.b.delete(r):this.a.delete(r)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}};function Ty(e,r){return{next:()=>{var t=e.next();return t.done?t:{value:r(t.value),done:!1}}}}function vo(){return new Map}function Pa(e){if(!e)return vo();if(Qd(e))return e;if(ua(e))return new es(e);throw new Error("createMap can create maps from objects or Maps")}function Fy(e){if(e instanceof es)return e.wrappedObject;var r={};for(var t of e.keys()){var n=e.get(t);la(r,t,n)}return r}function Qd(e){return e?e instanceof Map||e instanceof es||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var Oy=function(){return Oy=Kd.default.create,Kd.default},Ek=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],By=T("typed",Ek,function(r){var{BigNumber:t,Complex:n,DenseMatrix:i,Fraction:a}=r,s=Oy();return s.clear(),s.addTypes([{name:"number",test:ar},{name:"Complex",test:Gt},{name:"BigNumber",test:je},{name:"Fraction",test:Xn},{name:"Unit",test:qt},{name:"identifier",test:c=>yt&&/^(?:[A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF40\\uDF42-\\uDF49\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDD70-\\uDD7A\\uDD7C-\\uDD8A\\uDD8C-\\uDD92\\uDD94\\uDD95\\uDD97-\\uDDA1\\uDDA3-\\uDDB1\\uDDB3-\\uDDB9\\uDDBB\\uDDBC\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67\\uDF80-\\uDF85\\uDF87-\\uDFB0\\uDFB2-\\uDFBA]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDE80-\\uDEA9\\uDEB0\\uDEB1\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45\\uDF70-\\uDF81\\uDFB0-\\uDFC4\\uDFE0-\\uDFF6]|\\uD804[\\uDC03-\\uDC37\\uDC71\\uDC72\\uDC75\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD47\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE3F\\uDE40\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD837[\\uDF00-\\uDF1E\\uDF25-\\uDF2A]|\\uD838[\\uDC30-\\uDC6D\\uDD00-\\uDD2C\\uDD37-\\uDD3D\\uDD4E\\uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDCD0-\\uDCEB\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])(?:[0-9A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF40\\uDF42-\\uDF49\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDD70-\\uDD7A\\uDD7C-\\uDD8A\\uDD8C-\\uDD92\\uDD94\\uDD95\\uDD97-\\uDDA1\\uDDA3-\\uDDB1\\uDDB3-\\uDDB9\\uDDBB\\uDDBC\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67\\uDF80-\\uDF85\\uDF87-\\uDFB0\\uDFB2-\\uDFBA]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDE80-\\uDEA9\\uDEB0\\uDEB1\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45\\uDF70-\\uDF81\\uDFB0-\\uDFC4\\uDFE0-\\uDFF6]|\\uD804[\\uDC03-\\uDC37\\uDC71\\uDC72\\uDC75\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD47\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE3F\\uDE40\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD837[\\uDF00-\\uDF1E\\uDF25-\\uDF2A]|\\uD838[\\uDC30-\\uDC6D\\uDD00-\\uDD2C\\uDD37-\\uDD3D\\uDD4E\\uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDCD0-\\uDCEB\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])*$/.test(c)},{name:"string",test:yt},{name:"Chain",test:Hs},{name:"Array",test:Ar},{name:"Matrix",test:Ge},{name:"DenseMatrix",test:Ba},{name:"SparseMatrix",test:Jn},{name:"Range",test:po},{name:"Index",test:sa},{name:"boolean",test:nc},{name:"ResultSet",test:ic},{name:"Help",test:Ys},{name:"function",test:ac},{name:"Date",test:oc},{name:"RegExp",test:sc},{name:"null",test:uc},{name:"undefined",test:fc},{name:"AccessorNode",test:Sn},{name:"ArrayNode",test:$t},{name:"AssignmentNode",test:lc},{name:"BlockNode",test:cc},{name:"ConditionalNode",test:pc},{name:"ConstantNode",test:yr},{name:"FunctionNode",test:fn},{name:"FunctionAssignmentNode",test:pi},{name:"IndexNode",test:kn},{name:"Node",test:Sr},{name:"ObjectNode",test:fa},{name:"OperatorNode",test:ut},{name:"ParenthesisNode",test:Zt},{name:"RangeNode",test:mc},{name:"RelationalNode",test:hc},{name:"SymbolNode",test:rt},{name:"Map",test:Qd},{name:"Object",test:ua}]),s.addConversions([{from:"number",to:"BigNumber",convert:function(f){if(t||Xd(f),fy(f)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+f+"). Use function bignumber(x) to convert to BigNumber.");return new t(f)}},{from:"number",to:"Complex",convert:function(f){return n||Ac(f),new n(f,0)}},{from:"BigNumber",to:"Complex",convert:function(f){return n||Ac(f),new n(f.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(f){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(f){return n||Ac(f),new n(f.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(f){a||Jd(f);var o=new a(f);if(o.valueOf()!==f)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+f+"). Use function fraction(x) to convert to Fraction.");return o}},{from:"string",to:"number",convert:function(f){var o=Number(f);if(isNaN(o))throw new Error('Cannot convert "'+f+'" to a number');return o}},{from:"string",to:"BigNumber",convert:function(f){t||Xd(f);try{return new t(f)}catch{throw new Error('Cannot convert "'+f+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(f){a||Jd(f);try{return new a(f)}catch{throw new Error('Cannot convert "'+f+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(f){n||Ac(f);try{return new n(f)}catch{throw new Error('Cannot convert "'+f+'" to Complex')}}},{from:"boolean",to:"number",convert:function(f){return+f}},{from:"boolean",to:"BigNumber",convert:function(f){return t||Xd(f),new t(+f)}},{from:"boolean",to:"Fraction",convert:function(f){return a||Jd(f),new a(+f)}},{from:"boolean",to:"string",convert:function(f){return String(f)}},{from:"Array",to:"Matrix",convert:function(f){return i||Ck(),new i(f)}},{from:"Matrix",to:"Array",convert:function(f){return f.valueOf()}}]),s.onMismatch=(c,f,o)=>{var u=s.createError(c,f,o);if(["wrongType","mismatch"].includes(u.data.category)&&f.length===1&&bt(f[0])&&o.some(h=>!h.params.includes(","))){var p=new TypeError("Function '".concat(c,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(c,")'."));throw p.data=u.data,p}throw u},s.onMismatch=(c,f,o)=>{var u=s.createError(c,f,o);if(["wrongType","mismatch"].includes(u.data.category)&&f.length===1&&bt(f[0])&&o.some(h=>!h.params.includes(","))){var p=new TypeError("Function '".concat(c,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(c,")'."));throw p.data=u.data,p}throw u},s});function Xd(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Ac(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function Ck(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Jd(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var Mk="ResultSet",_k=[],Iy=T(Mk,_k,()=>{function e(r){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=r||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(r){return new e(r.entries)},e},{isClass:!0});var eu=9e15,bo=1e9,jd="0123456789abcdef",Cc="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Mc="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",ev={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-eu,maxE:eu,crypto:!1},Ly,ka,Er=!0,Tc="[DecimalError] ",yo=Tc+"Invalid argument: ",qy=Tc+"Precision limit exceeded",Uy=Tc+"crypto unavailable",zy="[object Decimal]",mn=Math.floor,Jt=Math.pow,Tk=/^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,Fk=/^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,Ok=/^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,Wy=/^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,Yi=1e7,br=7,Bk=9007199254740991,Ik=Cc.length-1,rv=Mc.length-1,Ue={toStringTag:zy};Ue.absoluteValue=Ue.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),dr(e)};Ue.ceil=function(){return dr(new this.constructor(this),this.e+1,2)};Ue.clampedTo=Ue.clamp=function(e,r){var t,n=this,i=n.constructor;if(e=new i(e),r=new i(r),!e.s||!r.s)return new i(NaN);if(e.gt(r))throw Error(yo+r);return t=n.cmp(e),t<0?e:n.cmp(r)>0?r:new i(n)};Ue.comparedTo=Ue.cmp=function(e){var r,t,n,i,a=this,s=a.d,c=(e=new a.constructor(e)).d,f=a.s,o=e.s;if(!s||!c)return!f||!o?NaN:f!==o?f:s===c?0:!s^f<0?1:-1;if(!s[0]||!c[0])return s[0]?f:c[0]?-o:0;if(f!==o)return f;if(a.e!==e.e)return a.e>e.e^f<0?1:-1;for(n=s.length,i=c.length,r=0,t=nc[r]^f<0?1:-1;return n===i?0:n>i^f<0?1:-1};Ue.cosine=Ue.cos=function(){var e,r,t=this,n=t.constructor;return t.d?t.d[0]?(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+br,n.rounding=1,t=Pk(n,$y(n,t)),n.precision=e,n.rounding=r,dr(ka==2||ka==3?t.neg():t,e,r,!0)):new n(1):new n(NaN)};Ue.cubeRoot=Ue.cbrt=function(){var e,r,t,n,i,a,s,c,f,o,u=this,p=u.constructor;if(!u.isFinite()||u.isZero())return new p(u);for(Er=!1,a=u.s*Jt(u.s*u,1/3),!a||Math.abs(a)==1/0?(t=ln(u.d),e=u.e,(a=(e-t.length+1)%3)&&(t+=a==1||a==-2?"0":"00"),a=Jt(t,1/3),e=mn((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new p(t),n.s=u.s):n=new p(a.toString()),s=(e=p.precision)+3;;)if(c=n,f=c.times(c).times(c),o=f.plus(u),n=xt(o.plus(u).times(c),o.plus(f),s+2,1),ln(c.d).slice(0,s)===(t=ln(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!i&&t=="4999"){if(!i&&(dr(c,e+1,0),c.times(c).times(c).eq(u))){n=c;break}s+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(dr(n,e+1,1),r=!n.times(n).times(n).eq(u));break}return Er=!0,dr(n,e,p.rounding,r)};Ue.decimalPlaces=Ue.dp=function(){var e,r=this.d,t=NaN;if(r){if(e=r.length-1,t=(e-mn(this.e/br))*br,e=r[e],e)for(;e%10==0;e/=10)t--;t<0&&(t=0)}return t};Ue.dividedBy=Ue.div=function(e){return xt(this,new this.constructor(e))};Ue.dividedToIntegerBy=Ue.divToInt=function(e){var r=this,t=r.constructor;return dr(xt(r,new t(e),0,1,1),t.precision,t.rounding)};Ue.equals=Ue.eq=function(e){return this.cmp(e)===0};Ue.floor=function(){return dr(new this.constructor(this),this.e+1,3)};Ue.greaterThan=Ue.gt=function(e){return this.cmp(e)>0};Ue.greaterThanOrEqualTo=Ue.gte=function(e){var r=this.cmp(e);return r==1||r===0};Ue.hyperbolicCosine=Ue.cosh=function(){var e,r,t,n,i,a=this,s=a.constructor,c=new s(1);if(!a.isFinite())return new s(a.s?1/0:NaN);if(a.isZero())return c;t=s.precision,n=s.rounding,s.precision=t+Math.max(a.e,a.sd())+4,s.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),r=(1/Oc(4,e)).toString()):(e=16,r="2.3283064365386962890625e-10"),a=ru(s,1,a.times(r),new s(1),!0);for(var f,o=e,u=new s(8);o--;)f=a.times(a),a=c.minus(f.times(u.minus(f.times(u))));return dr(a,s.precision=t,s.rounding=n,!0)};Ue.hyperbolicSine=Ue.sinh=function(){var e,r,t,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(r=a.precision,t=a.rounding,a.precision=r+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=ru(a,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Oc(5,e)),i=ru(a,2,i,i,!0);for(var s,c=new a(5),f=new a(16),o=new a(20);e--;)s=i.times(i),i=i.times(c.plus(s.times(f.times(s).plus(o))))}return a.precision=r,a.rounding=t,dr(i,r,t,!0)};Ue.hyperbolicTangent=Ue.tanh=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+7,n.rounding=1,xt(t.sinh(),t.cosh(),n.precision=e,n.rounding=r)):new n(t.s)};Ue.inverseCosine=Ue.acos=function(){var e,r=this,t=r.constructor,n=r.abs().cmp(1),i=t.precision,a=t.rounding;return n!==-1?n===0?r.isNeg()?Vi(t,i,a):new t(0):new t(NaN):r.isZero()?Vi(t,i+4,a).times(.5):(t.precision=i+6,t.rounding=1,r=r.asin(),e=Vi(t,i+4,a).times(.5),t.precision=i,t.rounding=a,e.minus(r))};Ue.inverseHyperbolicCosine=Ue.acosh=function(){var e,r,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(e=n.precision,r=n.rounding,n.precision=e+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,Er=!1,t=t.times(t).minus(1).sqrt().plus(t),Er=!0,n.precision=e,n.rounding=r,t.ln()):new n(t)};Ue.inverseHyperbolicSine=Ue.asinh=function(){var e,r,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,Er=!1,t=t.times(t).plus(1).sqrt().plus(t),Er=!0,n.precision=e,n.rounding=r,t.ln())};Ue.inverseHyperbolicTangent=Ue.atanh=function(){var e,r,t,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,r=a.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?dr(new a(i),e,r,!0):(a.precision=t=n-i.e,i=xt(i.plus(1),new a(1).minus(i),t+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=r,i.times(.5))):new a(NaN)};Ue.inverseSine=Ue.asin=function(){var e,r,t,n,i=this,a=i.constructor;return i.isZero()?new a(i):(r=i.abs().cmp(1),t=a.precision,n=a.rounding,r!==-1?r===0?(e=Vi(a,t+4,n).times(.5),e.s=i.s,e):new a(NaN):(a.precision=t+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=t,a.rounding=n,i.times(2)))};Ue.inverseTangent=Ue.atan=function(){var e,r,t,n,i,a,s,c,f,o=this,u=o.constructor,p=u.precision,h=u.rounding;if(o.isFinite()){if(o.isZero())return new u(o);if(o.abs().eq(1)&&p+4<=rv)return s=Vi(u,p+4,h).times(.25),s.s=o.s,s}else{if(!o.s)return new u(NaN);if(p+4<=rv)return s=Vi(u,p+4,h).times(.5),s.s=o.s,s}for(u.precision=c=p+10,u.rounding=1,t=Math.min(28,c/br+2|0),e=t;e;--e)o=o.div(o.times(o).plus(1).sqrt().plus(1));for(Er=!1,r=Math.ceil(c/br),n=1,f=o.times(o),s=new u(o),i=o;e!==-1;)if(i=i.times(f),a=s.minus(i.div(n+=2)),i=i.times(f),s=a.plus(i.div(n+=2)),s.d[r]!==void 0)for(e=r;s.d[e]===a.d[e]&&e--;);return t&&(s=s.times(2<this.d.length-2};Ue.isNaN=function(){return!this.s};Ue.isNegative=Ue.isNeg=function(){return this.s<0};Ue.isPositive=Ue.isPos=function(){return this.s>0};Ue.isZero=function(){return!!this.d&&this.d[0]===0};Ue.lessThan=Ue.lt=function(e){return this.cmp(e)<0};Ue.lessThanOrEqualTo=Ue.lte=function(e){return this.cmp(e)<1};Ue.logarithm=Ue.log=function(e){var r,t,n,i,a,s,c,f,o=this,u=o.constructor,p=u.precision,h=u.rounding,d=5;if(e==null)e=new u(10),r=!0;else{if(e=new u(e),t=e.d,e.s<0||!t||!t[0]||e.eq(1))return new u(NaN);r=e.eq(10)}if(t=o.d,o.s<0||!t||!t[0]||o.eq(1))return new u(t&&!t[0]?-1/0:o.s!=1?NaN:t?0:1/0);if(r)if(t.length>1)a=!0;else{for(i=t[0];i%10===0;)i/=10;a=i!==1}if(Er=!1,c=p+d,s=xo(o,c),n=r?_c(u,c+10):xo(e,c),f=xt(s,n,c,1),yf(f.d,i=p,h))do if(c+=10,s=xo(o,c),n=r?_c(u,c+10):xo(e,c),f=xt(s,n,c,1),!a){+ln(f.d).slice(i+1,i+15)+1==1e14&&(f=dr(f,p+1,0));break}while(yf(f.d,i+=10,h));return Er=!0,dr(f,p,h)};Ue.minus=Ue.sub=function(e){var r,t,n,i,a,s,c,f,o,u,p,h,d=this,x=d.constructor;if(e=new x(e),!d.d||!e.d)return!d.s||!e.s?e=new x(NaN):d.d?e.s=-e.s:e=new x(e.d||d.s!==e.s?d:NaN),e;if(d.s!=e.s)return e.s=-e.s,d.plus(e);if(o=d.d,h=e.d,c=x.precision,f=x.rounding,!o[0]||!h[0]){if(h[0])e.s=-e.s;else if(o[0])e=new x(d);else return new x(f===3?-0:0);return Er?dr(e,c,f):e}if(t=mn(e.e/br),u=mn(d.e/br),o=o.slice(),a=u-t,a){for(p=a<0,p?(r=o,a=-a,s=h.length):(r=h,t=u,s=o.length),n=Math.max(Math.ceil(c/br),s)+2,a>n&&(a=n,r.length=1),r.reverse(),n=a;n--;)r.push(0);r.reverse()}else{for(n=o.length,s=h.length,p=n0;--n)o[s++]=0;for(n=h.length;n>a;){if(o[--n]s?a+1:s+1,i>s&&(i=s,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(s=o.length,i=u.length,s-i<0&&(i=s,t=u,u=o,o=t),r=0;i;)r=(o[--i]=o[i]+u[i]+r)/Yi|0,o[i]%=Yi;for(r&&(o.unshift(r),++n),s=o.length;o[--s]==0;)o.pop();return e.d=o,e.e=Fc(o,n),Er?dr(e,c,f):e};Ue.precision=Ue.sd=function(e){var r,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(yo+e);return t.d?(r=Vy(t.d),e&&t.e+1>r&&(r=t.e+1)):r=NaN,r};Ue.round=function(){var e=this,r=e.constructor;return dr(new r(e),e.e+1,r.rounding)};Ue.sine=Ue.sin=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+br,n.rounding=1,t=Rk(n,$y(n,t)),n.precision=e,n.rounding=r,dr(ka>2?t.neg():t,e,r,!0)):new n(NaN)};Ue.squareRoot=Ue.sqrt=function(){var e,r,t,n,i,a,s=this,c=s.d,f=s.e,o=s.s,u=s.constructor;if(o!==1||!c||!c[0])return new u(!o||o<0&&(!c||c[0])?NaN:c?s:1/0);for(Er=!1,o=Math.sqrt(+s),o==0||o==1/0?(r=ln(c),(r.length+f)%2==0&&(r+="0"),o=Math.sqrt(r),f=mn((f+1)/2)-(f<0||f%2),o==1/0?r="5e"+f:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+f),n=new u(r)):n=new u(o.toString()),t=(f=u.precision)+3;;)if(a=n,n=a.plus(xt(s,a,t+2,1)).times(.5),ln(a.d).slice(0,t)===(r=ln(n.d)).slice(0,t))if(r=r.slice(t-3,t+1),r=="9999"||!i&&r=="4999"){if(!i&&(dr(a,f+1,0),a.times(a).eq(s))){n=a;break}t+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(dr(n,f+1,1),e=!n.times(n).eq(s));break}return Er=!0,dr(n,f,u.rounding,e)};Ue.tangent=Ue.tan=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+10,n.rounding=1,t=t.sin(),t.s=1,t=xt(t,new n(1).minus(t.times(t)).sqrt(),e+10,0),n.precision=e,n.rounding=r,dr(ka==2||ka==4?t.neg():t,e,r,!0)):new n(NaN)};Ue.times=Ue.mul=function(e){var r,t,n,i,a,s,c,f,o,u=this,p=u.constructor,h=u.d,d=(e=new p(e)).d;if(e.s*=u.s,!h||!h[0]||!d||!d[0])return new p(!e.s||h&&!h[0]&&!d||d&&!d[0]&&!h?NaN:!h||!d?e.s/0:e.s*0);for(t=mn(u.e/br)+mn(e.e/br),f=h.length,o=d.length,f=0;){for(r=0,i=f+n;i>n;)c=a[i]+d[n]*h[i-n-1]+r,a[i--]=c%Yi|0,r=c/Yi|0;a[i]=(a[i]+r)%Yi|0}for(;!a[--s];)a.pop();return r?++t:a.shift(),e.d=a,e.e=Fc(a,t),Er?dr(e,p.precision,p.rounding):e};Ue.toBinary=function(e,r){return iv(this,2,e,r)};Ue.toDecimalPlaces=Ue.toDP=function(e,r){var t=this,n=t.constructor;return t=new n(t),e===void 0?t:(Ln(e,0,bo),r===void 0?r=n.rounding:Ln(r,0,8),dr(t,e+t.e+1,r))};Ue.toExponential=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=ca(n,!0):(Ln(e,0,bo),r===void 0?r=i.rounding:Ln(r,0,8),n=dr(new i(n),e+1,r),t=ca(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+t:t};Ue.toFixed=function(e,r){var t,n,i=this,a=i.constructor;return e===void 0?t=ca(i):(Ln(e,0,bo),r===void 0?r=a.rounding:Ln(r,0,8),n=dr(new a(i),e+i.e+1,r),t=ca(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};Ue.toFraction=function(e){var r,t,n,i,a,s,c,f,o,u,p,h,d=this,x=d.d,v=d.constructor;if(!x)return new v(d);if(o=t=new v(1),n=f=new v(0),r=new v(n),a=r.e=Vy(x)-d.e-1,s=a%br,r.d[0]=Jt(10,s<0?br+s:s),e==null)e=a>0?r:o;else{if(c=new v(e),!c.isInt()||c.lt(o))throw Error(yo+c);e=c.gt(r)?a>0?r:o:c}for(Er=!1,c=new v(ln(x)),u=v.precision,v.precision=a=x.length*br*2;p=xt(c,r,0,1,1),i=t.plus(p.times(n)),i.cmp(e)!=1;)t=n,n=i,i=o,o=f.plus(p.times(i)),f=i,i=r,r=c.minus(p.times(i)),c=i;return i=xt(e.minus(t),n,0,1,1),f=f.plus(i.times(o)),t=t.plus(i.times(n)),f.s=o.s=d.s,h=xt(o,n,a,1).minus(d).abs().cmp(xt(f,t,a,1).minus(d).abs())<1?[o,n]:[f,t],v.precision=u,Er=!0,h};Ue.toHexadecimal=Ue.toHex=function(e,r){return iv(this,16,e,r)};Ue.toNearest=function(e,r){var t=this,n=t.constructor;if(t=new n(t),e==null){if(!t.d)return t;e=new n(1),r=n.rounding}else{if(e=new n(e),r===void 0?r=n.rounding:Ln(r,0,8),!t.d)return e.s?t:e;if(!e.d)return e.s&&(e.s=t.s),e}return e.d[0]?(Er=!1,t=xt(t,e,0,r,1).times(e),Er=!0,dr(t)):(e.s=t.s,t=e),t};Ue.toNumber=function(){return+this};Ue.toOctal=function(e,r){return iv(this,8,e,r)};Ue.toPower=Ue.pow=function(e){var r,t,n,i,a,s,c=this,f=c.constructor,o=+(e=new f(e));if(!c.d||!e.d||!c.d[0]||!e.d[0])return new f(Jt(+c,o));if(c=new f(c),c.eq(1))return c;if(n=f.precision,a=f.rounding,e.eq(1))return dr(c,n,a);if(r=mn(e.e/br),r>=e.d.length-1&&(t=o<0?-o:o)<=Bk)return i=Yy(f,c,t,n),e.s<0?new f(1).div(i):dr(i,n,a);if(s=c.s,s<0){if(rf.maxE+1||r0?s/0:0):(Er=!1,f.rounding=c.s=1,t=Math.min(12,(r+"").length),i=tv(e.times(xo(c,n+t)),n),i.d&&(i=dr(i,n+5,1),yf(i.d,n,a)&&(r=n+10,i=dr(tv(e.times(xo(c,r+t)),r),r+5,1),+ln(i.d).slice(n+1,n+15)+1==1e14&&(i=dr(i,n+1,0)))),i.s=s,Er=!0,f.rounding=a,dr(i,n,a))};Ue.toPrecision=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=ca(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Ln(e,1,bo),r===void 0?r=i.rounding:Ln(r,0,8),n=dr(new i(n),e,r),t=ca(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+t:t};Ue.toSignificantDigits=Ue.toSD=function(e,r){var t=this,n=t.constructor;return e===void 0?(e=n.precision,r=n.rounding):(Ln(e,1,bo),r===void 0?r=n.rounding:Ln(r,0,8)),dr(new n(t),e,r)};Ue.toString=function(){var e=this,r=e.constructor,t=ca(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t};Ue.truncated=Ue.trunc=function(){return dr(new this.constructor(this),this.e+1,1)};Ue.valueOf=Ue.toJSON=function(){var e=this,r=e.constructor,t=ca(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};function ln(e){var r,t,n,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,r=1;rt)throw Error(yo+e)}function yf(e,r,t,n){var i,a,s,c;for(a=e[0];a>=10;a/=10)--r;return--r<0?(r+=br,i=0):(i=Math.ceil((r+1)/br),r%=br),a=Jt(10,br-r),c=e[i]%a|0,n==null?r<3?(r==0?c=c/100|0:r==1&&(c=c/10|0),s=t<4&&c==99999||t>3&&c==49999||c==5e4||c==0):s=(t<4&&c+1==a||t>3&&c+1==a/2)&&(e[i+1]/a/100|0)==Jt(10,r-2)-1||(c==a/2||c==0)&&(e[i+1]/a/100|0)==0:r<4?(r==0?c=c/1e3|0:r==1?c=c/100|0:r==2&&(c=c/10|0),s=(n||t<4)&&c==9999||!n&&t>3&&c==4999):s=((n||t<4)&&c+1==a||!n&&t>3&&c+1==a/2)&&(e[i+1]/a/1e3|0)==Jt(10,r-3)-1,s}function Ec(e,r,t){for(var n,i=[0],a,s=0,c=e.length;st-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}function Pk(e,r){var t,n,i;if(r.isZero())return r;n=r.d.length,n<32?(t=Math.ceil(n/3),i=(1/Oc(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),e.precision+=t,r=ru(e,1,r.times(i),new e(1));for(var a=t;a--;){var s=r.times(r);r=s.times(s).minus(s).times(8).plus(1)}return e.precision-=t,r}var xt=function(){function e(n,i,a){var s,c=0,f=n.length;for(n=n.slice();f--;)s=n[f]*i+c,n[f]=s%a|0,c=s/a|0;return c&&n.unshift(c),n}function r(n,i,a,s){var c,f;if(a!=s)f=a>s?1:-1;else for(c=f=0;ci[c]?1:-1;break}return f}function t(n,i,a,s){for(var c=0;a--;)n[a]-=c,c=n[a]1;)n.shift()}return function(n,i,a,s,c,f){var o,u,p,h,d,x,v,y,w,C,b,A,E,S,O,F,M,_,k,L,Y=n.constructor,$=n.s==i.s?1:-1,V=n.d,q=i.d;if(!V||!V[0]||!q||!q[0])return new Y(!n.s||!i.s||(V?q&&V[0]==q[0]:!q)?NaN:V&&V[0]==0||!q?$*0:$/0);for(f?(d=1,u=n.e-i.e):(f=Yi,d=br,u=mn(n.e/d)-mn(i.e/d)),k=q.length,M=V.length,w=new Y($),C=w.d=[],p=0;q[p]==(V[p]||0);p++);if(q[p]>(V[p]||0)&&u--,a==null?(S=a=Y.precision,s=Y.rounding):c?S=a+(n.e-i.e)+1:S=a,S<0)C.push(1),x=!0;else{if(S=S/d+2|0,p=0,k==1){for(h=0,q=q[0],S++;(p1&&(q=e(q,h,f),V=e(V,h,f),k=q.length,M=V.length),F=k,b=V.slice(0,k),A=b.length;A=f/2&&++_;do h=0,o=r(q,b,k,A),o<0?(E=b[0],k!=A&&(E=E*f+(b[1]||0)),h=E/_|0,h>1?(h>=f&&(h=f-1),v=e(q,h,f),y=v.length,A=b.length,o=r(v,b,y,A),o==1&&(h--,t(v,k=10;h/=10)p++;w.e=p+u*d-1,dr(w,c?a+w.e+1:a,s,x)}return w}}();function dr(e,r,t,n){var i,a,s,c,f,o,u,p,h,d=e.constructor;e:if(r!=null){if(p=e.d,!p)return e;for(i=1,c=p[0];c>=10;c/=10)i++;if(a=r-i,a<0)a+=br,s=r,u=p[h=0],f=u/Jt(10,i-s-1)%10|0;else if(h=Math.ceil((a+1)/br),c=p.length,h>=c)if(n){for(;c++<=h;)p.push(0);u=f=0,i=1,a%=br,s=a-br+1}else break e;else{for(u=c=p[h],i=1;c>=10;c/=10)i++;a%=br,s=a-br+i,f=s<0?0:u/Jt(10,i-s-1)%10|0}if(n=n||r<0||p[h+1]!==void 0||(s<0?u:u%Jt(10,i-s-1)),o=t<4?(f||n)&&(t==0||t==(e.s<0?3:2)):f>5||f==5&&(t==4||n||t==6&&(a>0?s>0?u/Jt(10,i-s):0:p[h-1])%10&1||t==(e.s<0?8:7)),r<1||!p[0])return p.length=0,o?(r-=e.e+1,p[0]=Jt(10,(br-r%br)%br),e.e=-r||0):p[0]=e.e=0,e;if(a==0?(p.length=h,c=1,h--):(p.length=h+1,c=Jt(10,br-a),p[h]=s>0?(u/Jt(10,i-s)%Jt(10,s)|0)*c:0),o)for(;;)if(h==0){for(a=1,s=p[0];s>=10;s/=10)a++;for(s=p[0]+=c,c=1;s>=10;s/=10)c++;a!=c&&(e.e++,p[0]==Yi&&(p[0]=1));break}else{if(p[h]+=c,p[h]!=Yi)break;p[h--]=0,c=1}for(a=p.length;p[--a]===0;)p.pop()}return Er&&(e.e>d.maxE?(e.d=null,e.e=NaN):e.e0?a=a.charAt(0)+"."+a.slice(1)+go(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+go(-i-1)+a,t&&(n=t-s)>0&&(a+=go(n))):i>=s?(a+=go(i+1-s),t&&(n=t-i-1)>0&&(a=a+"."+go(n))):((n=i+1)0&&(i+1===s&&(a+="."),a+=go(n))),a}function Fc(e,r){var t=e[0];for(r*=br;t>=10;t/=10)r++;return r}function _c(e,r,t){if(r>Ik)throw Er=!0,t&&(e.precision=t),Error(qy);return dr(new e(Cc),r,1,!0)}function Vi(e,r,t){if(r>rv)throw Error(qy);return dr(new e(Mc),r,t,!0)}function Vy(e){var r=e.length-1,t=r*br+1;if(r=e[r],r){for(;r%10==0;r/=10)t--;for(r=e[0];r>=10;r/=10)t++}return t}function go(e){for(var r="";e--;)r+="0";return r}function Yy(e,r,t,n){var i,a=new e(1),s=Math.ceil(n/br+4);for(Er=!1;;){if(t%2&&(a=a.times(r),ky(a.d,s)&&(i=!0)),t=mn(t/2),t===0){t=a.d.length-1,i&&a.d[t]===0&&++a.d[t];break}r=r.times(r),ky(r.d,s)}return Er=!0,a}function Py(e){return e.d[e.d.length-1]&1}function Hy(e,r,t){for(var n,i=new e(r[0]),a=0;++a17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(r==null?(Er=!1,f=x):f=r,c=new h(.03125);e.e>-2;)e=e.times(c),p+=5;for(n=Math.log(Jt(2,p))/Math.LN10*2+5|0,f+=n,t=a=s=new h(1),h.precision=f;;){if(a=dr(a.times(e),f,1),t=t.times(++u),c=s.plus(xt(a,t,f,1)),ln(c.d).slice(0,f)===ln(s.d).slice(0,f)){for(i=p;i--;)s=dr(s.times(s),f,1);if(r==null)if(o<3&&yf(s.d,f-n,d,o))h.precision=f+=10,t=a=c=new h(1),u=0,o++;else return dr(s,h.precision=x,d,Er=!0);else return h.precision=x,s}s=c}}function xo(e,r){var t,n,i,a,s,c,f,o,u,p,h,d=1,x=10,v=e,y=v.d,w=v.constructor,C=w.rounding,b=w.precision;if(v.s<0||!y||!y[0]||!v.e&&y[0]==1&&y.length==1)return new w(y&&!y[0]?-1/0:v.s!=1?NaN:y?0:v);if(r==null?(Er=!1,u=b):u=r,w.precision=u+=x,t=ln(y),n=t.charAt(0),Math.abs(a=v.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)v=v.times(e),t=ln(v.d),n=t.charAt(0),d++;a=v.e,n>1?(v=new w("0."+t),a++):v=new w(n+"."+t.slice(1))}else return o=_c(w,u+2,b).times(a+""),v=xo(new w(n+"."+t.slice(1)),u-x).plus(o),w.precision=b,r==null?dr(v,b,C,Er=!0):v;for(p=v,f=s=v=xt(v.minus(1),v.plus(1),u,1),h=dr(v.times(v),u,1),i=3;;){if(s=dr(s.times(h),u,1),o=f.plus(xt(s,new w(i),u,1)),ln(o.d).slice(0,u)===ln(f.d).slice(0,u))if(f=f.times(2),a!==0&&(f=f.plus(_c(w,u+2,b).times(a+""))),f=xt(f,new w(d),u,1),r==null)if(yf(f.d,u-x,C,c))w.precision=u+=x,o=s=v=xt(p.minus(1),p.plus(1),u,1),h=dr(v.times(v),u,1),i=c=1;else return dr(f,w.precision=b,C,Er=!0);else return w.precision=b,f;f=o,i+=2}}function Gy(e){return String(e.s*e.s/0)}function nv(e,r){var t,n,i;for((t=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(t<0&&(t=n),t+=+r.slice(n+1),r=r.substring(0,n)):t<0&&(t=r.length),n=0;r.charCodeAt(n)===48;n++);for(i=r.length;r.charCodeAt(i-1)===48;--i);if(r=r.slice(n,i),r){if(i-=n,e.e=t=t-n-1,e.d=[],n=(t+1)%br,t<0&&(n+=br),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(r=r.replace(/(\\d)_(?=\\d)/g,"$1"),Wy.test(r))return nv(e,r)}else if(r==="Infinity"||r==="NaN")return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if(Fk.test(r))t=16,r=r.toLowerCase();else if(Tk.test(r))t=2;else if(Ok.test(r))t=8;else throw Error(yo+r);for(a=r.search(/p/i),a>0?(f=+r.slice(a+1),r=r.substring(2,a)):r=r.slice(2),a=r.indexOf("."),s=a>=0,n=e.constructor,s&&(r=r.replace(".",""),c=r.length,a=c-a,i=Yy(n,new n(t),a,a*2)),o=Ec(r,t,Yi),u=o.length-1,a=u;o[a]===0;--a)o.pop();return a<0?new n(e.s*0):(e.e=Fc(o,u),e.d=o,Er=!1,s&&(e=xt(e,i,c*4)),f&&(e=e.times(Math.abs(f)<54?Jt(2,f):bf.pow(2,f))),Er=!0,e)}function Rk(e,r){var t,n=r.d.length;if(n<3)return r.isZero()?r:ru(e,2,r,r);t=1.4*Math.sqrt(n),t=t>16?16:t|0,r=r.times(1/Oc(5,t)),r=ru(e,2,r,r);for(var i,a=new e(5),s=new e(16),c=new e(20);t--;)i=r.times(r),r=r.times(a.plus(i.times(s.times(i).minus(c))));return r}function ru(e,r,t,n,i){var a,s,c,f,o=1,u=e.precision,p=Math.ceil(u/br);for(Er=!1,f=t.times(t),c=new e(n);;){if(s=xt(c.times(f),new e(r++*r++),u,1),c=i?n.plus(s):n.minus(s),n=xt(s.times(f),new e(r++*r++),u,1),s=c.plus(n),s.d[p]!==void 0){for(a=p;s.d[a]===c.d[a]&&a--;);if(a==-1)break}a=c,c=n,n=s,s=a,o++}return Er=!0,s.d.length=p+1,s}function Oc(e,r){for(var t=e;--r;)t*=e;return t}function $y(e,r){var t,n=r.s<0,i=Vi(e,e.precision,1),a=i.times(.5);if(r=r.abs(),r.lte(a))return ka=n?4:1,r;if(t=r.divToInt(i),t.isZero())ka=n?3:2;else{if(r=r.minus(t.times(i)),r.lte(a))return ka=Py(t)?n?2:3:n?4:1,r;ka=Py(t)?n?1:4:n?3:2}return r.minus(i).abs()}function iv(e,r,t,n){var i,a,s,c,f,o,u,p,h,d=e.constructor,x=t!==void 0;if(x?(Ln(t,1,bo),n===void 0?n=d.rounding:Ln(n,0,8)):(t=d.precision,n=d.rounding),!e.isFinite())u=Gy(e);else{for(u=ca(e),s=u.indexOf("."),x?(i=2,r==16?t=t*4-3:r==8&&(t=t*3-2)):i=r,s>=0&&(u=u.replace(".",""),h=new d(1),h.e=u.length-s,h.d=Ec(ca(h),10,i),h.e=h.d.length),p=Ec(u,10,i),a=f=p.length;p[--f]==0;)p.pop();if(!p[0])u=x?"0p+0":"0";else{if(s<0?a--:(e=new d(e),e.d=p,e.e=a,e=xt(e,h,t,n,0,i),p=e.d,a=e.e,o=Ly),s=p[t],c=i/2,o=o||p[t+1]!==void 0,o=n<4?(s!==void 0||o)&&(n===0||n===(e.s<0?3:2)):s>c||s===c&&(n===4||o||n===6&&p[t-1]&1||n===(e.s<0?8:7)),p.length=t,o)for(;++p[--t]>i-1;)p[t]=0,t||(++a,p.unshift(1));for(f=p.length;!p[f-1];--f);for(s=0,u="";s1)if(r==16||r==8){for(s=r==16?4:3,--f;f%s;f++)u+="0";for(p=Ec(u,i,r),f=p.length;!p[f-1];--f);for(s=1,u="1.";sf)for(a-=f;a--;)u+="0";else ar)return e.length=r,!0}function Lk(e){return new this(e).abs()}function qk(e){return new this(e).acos()}function Uk(e){return new this(e).acosh()}function zk(e,r){return new this(e).plus(r)}function Wk(e){return new this(e).asin()}function Vk(e){return new this(e).asinh()}function Yk(e){return new this(e).atan()}function Hk(e){return new this(e).atanh()}function Gk(e,r){e=new this(e),r=new this(r);var t,n=this.precision,i=this.rounding,a=n+4;return!e.s||!r.s?t=new this(NaN):!e.d&&!r.d?(t=Vi(this,a,1).times(r.s>0?.25:.75),t.s=e.s):!r.d||e.isZero()?(t=r.s<0?Vi(this,n,i):new this(0),t.s=e.s):!e.d||r.isZero()?(t=Vi(this,a,1).times(.5),t.s=e.s):r.s<0?(this.precision=a,this.rounding=1,t=this.atan(xt(e,r,a,1)),r=Vi(this,a,1),this.precision=n,this.rounding=i,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(xt(e,r,a,1)),t}function $k(e){return new this(e).cbrt()}function Zk(e){return dr(e=new this(e),e.e+1,2)}function Qk(e,r,t){return new this(e).clamp(r,t)}function Xk(e){if(!e||typeof e!="object")throw Error(Tc+"Object expected");var r,t,n,i=e.defaults===!0,a=["precision",1,bo,"rounding",0,8,"toExpNeg",-eu,0,"toExpPos",0,eu,"maxE",0,eu,"minE",-eu,0,"modulo",0,9];for(r=0;r=a[r+1]&&n<=a[r+2])this[t]=n;else throw Error(yo+t+": "+n);if(t="crypto",i&&(this[t]=ev[t]),(n=e[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(Uy);else this[t]=!1;else throw Error(yo+t+": "+n);return this}function Jk(e){return new this(e).cos()}function Kk(e){return new this(e).cosh()}function Zy(e){var r,t,n;function i(a){var s,c,f,o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,Ry(a)){o.s=a.s,Er?!a.d||a.e>i.maxE?(o.e=NaN,o.d=null):a.e=10;c/=10)s++;Er?s>i.maxE?(o.e=NaN,o.d=null):s=429e7?r[a]=crypto.getRandomValues(new Uint32Array(1))[0]:c[a++]=i%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(n*=4);a=214e7?crypto.randomBytes(4).copy(r,a):(c.push(i%1e7),a+=4);a=n/4}else throw Error(Uy);else for(;a=10;i/=10)n++;n{var{on:r,config:t}=e,n=rs.clone({precision:t.precision,modulo:rs.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(i){return new n(i.value)},r&&r("config",function(i,a){i.precision!==a.precision&&n.config({precision:i.precision})}),n},{isClass:!0});var tn=li(Jy(),1);var AR="Complex",ER=[],Ky=T(AR,ER,()=>(Object.defineProperty(tn.default,"name",{value:"Complex"}),tn.default.prototype.constructor=tn.default,tn.default.prototype.type="Complex",tn.default.prototype.isComplex=!0,tn.default.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},tn.default.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},tn.default.prototype.format=function(e){var r="",t=this.im,n=this.re,i=zi(this.re,e),a=zi(this.im,e),s=ar(e)?e:e?e.precision:null;if(s!==null){var c=Math.pow(10,-s);Math.abs(n/t)r.re?1:e.rer.im?1:e.im(Object.defineProperty(pa.default,"name",{value:"Fraction"}),pa.default.prototype.constructor=pa.default,pa.default.prototype.type="Fraction",pa.default.prototype.isFraction=!0,pa.default.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},pa.default.fromJSON=function(e){return new pa.default(e)},pa.default),{isClass:!0});var _R="Range",TR=[],t1=T(_R,TR,()=>{function e(r,t,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=r!=null,a=t!=null,s=n!=null;if(i){if(je(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter start must be a number")}if(a){if(je(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter end must be a number")}if(s){if(je(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(r):0,this.end=a?parseFloat(t):0,this.step=s?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(r){if(typeof r!="string")return null;var t=r.split(":"),n=t.map(function(a){return parseFloat(a)}),i=n.some(function(a){return isNaN(a)});if(i)return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var r=0,t=this.start,n=this.step,i=this.end,a=i-t;return mi(n)===mi(a)?r=Math.ceil(a/n):a===0&&(r=0),isNaN(r)&&(r=0),[r]},e.prototype.min=function(){var r=this.size()[0];if(r>0)return this.step>0?this.start:this.start+(r-1)*this.step},e.prototype.max=function(){var r=this.size()[0];if(r>0)return this.step>0?this.start+(r-1)*this.step:this.start},e.prototype.forEach=function(r){var t=this.start,n=this.step,i=this.end,a=0;if(n>0)for(;ti;)r(t,[a],this),t+=n,a++},e.prototype.map=function(r){var t=[];return this.forEach(function(n,i,a){t[i[0]]=r(n,i,a)}),t},e.prototype.toArray=function(){var r=[];return this.forEach(function(t,n){r[n[0]]=t}),r},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(r){var t=zi(this.start,r);return this.step!==1&&(t+=":"+zi(this.step,r)),t+=":"+zi(this.end,r),t},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(r){return new e(r.start,r.end,r.step)},e},{isClass:!0});var FR="Matrix",OR=[],n1=T(FR,OR,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(r,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(r,t,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(r){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(r,t,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(r,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(r,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(r,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(r){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(r){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function i1(e){var r=0,t=1,n=Object.create(null),i=Object.create(null),a=0,s=function(f){var o=i[f];if(!!o&&(delete n[o],delete i[f],--r,t===o)){if(!r){a=0,t=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++t););}};return e=Math.abs(e),{hit:function(f){var o=i[f],u=++a;if(n[u]=f,i[f]=u,!o)return++r,r<=e?void 0:(f=n[t],s(f),f);if(delete n[o],t===o)for(;!Object.prototype.hasOwnProperty.call(n,++t););},delete:s,clear:function(){r=a=0,t=1,n=Object.create(null),i=Object.create(null)}}}function ts(e){var{hasher:r,limit:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t=t??Number.POSITIVE_INFINITY,r=r??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:i1(t||Number.POSITIVE_INFINITY)});for(var i=[],a=0;a{var{Matrix:r}=e;function t(u,p){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(p&&!yt(p))throw new Error("Invalid datatype: "+p);if(Ge(u))u.type==="DenseMatrix"?(this._data=tr(u._data),this._size=tr(u._size),this._datatype=p||u._datatype):(this._data=u.toArray(),this._size=u.size(),this._datatype=p||u._datatype);else if(u&&Ar(u.data)&&Ar(u.size))this._data=u.data,this._size=u.size,Vd(this._data,this._size),this._datatype=p||u.datatype;else if(Ar(u))this._data=o(u),this._size=or(this._data),Vd(this._data,this._size),this._datatype=p;else{if(u)throw new TypeError("Unsupported type of data ("+_r(u)+")");this._data=[],this._size=[0],this._datatype=p}}t.prototype=new r,t.prototype.createDenseMatrix=function(u,p){return new t(u,p)},Object.defineProperty(t,"name",{value:"DenseMatrix"}),t.prototype.constructor=t,t.prototype.type="DenseMatrix",t.prototype.isDenseMatrix=!0,t.prototype.getDataType=function(){return ho(this._data,_r)},t.prototype.storage=function(){return"dense"},t.prototype.datatype=function(){return this._datatype},t.prototype.create=function(u,p){return new t(u,p)},t.prototype.subset=function(u,p,h){switch(arguments.length){case 1:return n(this,u);case 2:case 3:return a(this,u,p,h);default:throw new SyntaxError("Wrong number of arguments")}},t.prototype.get=function(u){if(!Ar(u))throw new TypeError("Array expected");if(u.length!==this._size.length)throw new pr(u.length,this._size.length);for(var p=0;p");var b=p.max().map(function(S){return S+1});f(u,b,d);var A=x.length,E=0;s(u._data,p,h,A,E)}return u}function s(u,p,h,d,x){var v=x===d-1,y=p.dimension(x);v?y.forEach(function(w,C){Xr(w),u[w]=h[C[0]]}):y.forEach(function(w,C){Xr(w),s(u[w],p,h[C[0]],d,x+1)})}t.prototype.resize=function(u,p,h){if(!bt(u))throw new TypeError("Array or Matrix expected");var d=u.valueOf().map(v=>Array.isArray(v)&&v.length===1?v[0]:v),x=h?this.clone():this;return c(x,d,p)};function c(u,p,h){if(p.length===0){for(var d=u._data;Ar(d);)d=d[0];return d}return u._size=p.slice(0),u._data=Wi(u._data,u._size,h),u}t.prototype.reshape=function(u,p){var h=p?this.clone():this;h._data=vf(h._data,u);var d=h._size.reduce((x,v)=>x*v);return h._size=gf(u,d),h};function f(u,p,h){for(var d=u._size.slice(0),x=!1;d.lengthd[v]&&(d[v]=p[v],x=!0);x&&c(u,d,h)}t.prototype.clone=function(){var u=new t({data:tr(this._data),size:tr(this._size),datatype:this._datatype});return u},t.prototype.size=function(){return this._size.slice(0)},t.prototype.map=function(u){var p=this,h=Bc(u),d=function y(w,C){return Ar(w)?w.map(function(b,A){return y(b,C.concat(A))}):h===1?u(w):h===2?u(w,C):u(w,C,p)},x=d(this._data,[]),v=this._datatype!==void 0?ho(x,_r):void 0;return new t(x,v)},t.prototype.forEach=function(u){var p=this,h=function d(x,v){Ar(x)?x.forEach(function(y,w){d(y,v.concat(w))}):u(x,v,p)};h(this._data,[])},t.prototype[Symbol.iterator]=function*(){var u=function*p(h,d){if(Ar(h))for(var x=0;x[b[w]]);p.push(new t(C,u._datatype))},v=0;v0?u:0,h=u<0?-u:0,d=this._size[0],x=this._size[1],v=Math.min(d-h,x-p),y=[],w=0;w0?h:0,v=h<0?-h:0,y=u[0],w=u[1],C=Math.min(y-v,w-x),b;if(Ar(p)){if(p.length!==C)throw new Error("Invalid value array length");b=function(F){return p[F]}}else if(Ge(p)){var A=p.size();if(A.length!==1||A[0]!==C)throw new Error("Invalid matrix length");b=function(F){return p.get([F])}}else b=function(){return p};d||(d=je(b(0))?b(0).mul(0):0);var E=[];if(u.length>0){E=Wi(E,u,d);for(var S=0;S{var{typed:r}=e;return r(o1,{any:tr})});function Ic(e){var r=e.length,t=e[0].length,n,i,a=[];for(i=0;i=n.length)throw new Xt(r,n.length);return Ge(e)?e.create(Pc(e.valueOf(),r,t)):Pc(e,r,t)}function Pc(e,r,t){var n,i,a,s;if(r<=0)if(Array.isArray(e[0])){for(s=Ic(e),i=[],n=0;n{var{typed:r}=e;return r(u1,{number:He,BigNumber:function(n){return n.isInt()},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var qn="number",Ra="number, number";function uv(e){return Math.abs(e)}uv.signature=qn;function fv(e,r){return e+r}fv.signature=Ra;function lv(e,r){return e-r}lv.signature=Ra;function cv(e,r){return e*r}cv.signature=Ra;function RR(e,r){return e/r}RR.signature=Ra;function pv(e){return-e}pv.signature=qn;function mv(e){return e}mv.signature=qn;function tu(e){return oy(e)}tu.signature=qn;function hv(e){return e*e*e}hv.signature=qn;function dv(e){return Math.exp(e)}dv.signature=qn;function vv(e){return sy(e)}vv.signature=qn;function LR(e,r){if(!He(e)||!He(r))throw new Error("Parameters in function gcd must be integer numbers");for(var t;r!==0;)t=e%r,e=r,r=t;return e<0?-e:e}LR.signature=Ra;function gv(e,r){if(!He(e)||!He(r))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||r===0)return 0;for(var t,n=e*r;r!==0;)t=r,r=e%t,e=t;return Math.abs(n/e)}gv.signature=Ra;function l1(e,r){return r?Math.log(e)/Math.log(r):Math.log(e)}function xv(e){return ay(e)}xv.signature=qn;function yv(e){return iy(e)}yv.signature=qn;function qR(e){return gc(e)}qR.signature=qn;function UR(e,r){return r===0?e:e-r*Math.floor(e/r)}UR.signature=Ra;function bv(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,t=r<0;if(t&&(r=-r),r===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(r)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return t?1/0:0;if(!isFinite(e))return t?0:e;var n=Math.pow(Math.abs(e),1/r);return n=e<0?-n:n,t?1/n:n}function kc(e){return mi(e)}kc.signature=qn;function zR(e){return Math.sqrt(e)}zR.signature=qn;function wv(e){return e*e}wv.signature=qn;function Dv(e,r){var t,n,i,a=0,s=1,c=1,f=0;if(!He(e)||!He(r))throw new Error("Parameters in function xgcd must be integer numbers");for(;r;)n=Math.floor(e/r),i=e-n*r,t=a,a=s-n*a,s=t,t=c,c=f-n*c,f=t,e=r,r=i;var o;return e<0?o=[-e,-s,-f]:o=[e,e?s:0,f],o}Dv.signature=Ra;function Sv(e,r){return e*e<1&&r===1/0||e*e>1&&r===-1/0?0:Math.pow(e,r)}Sv.signature=Ra;function nu(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!He(r)||r<0||r>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(Ud(e,r))}function WR(e){return Math.abs(e)}WR.signature=qn;var VR="number",iu="number, number";function Nv(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function bitAnd");return e&r}Nv.signature=iu;function Av(e){if(!He(e))throw new Error("Integer expected in function bitNot");return~e}Av.signature=VR;function Ev(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function bitOr");return e|r}Ev.signature=iu;function Cv(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function bitXor");return e^r}Cv.signature=iu;function Mv(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function leftShift");return e<>r}_v.signature=iu;function Tv(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function rightLogShift");return e>>>r}Tv.signature=iu;function Kn(e,r){if(r>1;return Kn(e,t)*Kn(t+1,r)}function Fv(e,r){if(!He(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!He(r)||r<0)throw new TypeError("Positive integer value expected in function combinations");if(r>e)throw new TypeError("k must be less than or equal to n");for(var t=e-r,n=1,i=r171?1/0:Kn(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*wf(1-e));if(e>=171.35)return 1/0;if(e>85){var t=e*e,n=t*e,i=n*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*t)-139/(51840*n)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,r=ns[0];for(var s=1;s=1;n--)t+=d1[n]/(e+n);return Lv+(e+.5)*Math.log(r)-r+Math.log(t)}Df.signature="number";var Dt="number",$R="number, number";function ZR(e){return Math.acos(e)}ZR.signature=Dt;function qv(e){return ly(e)}qv.signature=Dt;function Uv(e){return Math.atan(1/e)}Uv.signature=Dt;function zv(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}zv.signature=Dt;function Wv(e){return Math.asin(1/e)}Wv.signature=Dt;function Vv(e){var r=1/e;return Math.log(r+Math.sqrt(r*r+1))}Vv.signature=Dt;function Yv(e){return Math.acos(1/e)}Yv.signature=Dt;function Hv(e){var r=1/e,t=Math.sqrt(r*r-1);return Math.log(t+r)}Hv.signature=Dt;function QR(e){return Math.asin(e)}QR.signature=Dt;function Gv(e){return cy(e)}Gv.signature=Dt;function XR(e){return Math.atan(e)}XR.signature=Dt;function JR(e,r){return Math.atan2(e,r)}JR.signature=$R;function $v(e){return py(e)}$v.signature=Dt;function KR(e){return Math.cos(e)}KR.signature=Dt;function jR(e){return yc(e)}jR.signature=Dt;function Zv(e){return 1/Math.tan(e)}Zv.signature=Dt;function Qv(e){var r=Math.exp(2*e);return(r+1)/(r-1)}Qv.signature=Dt;function Xv(e){return 1/Math.sin(e)}Xv.signature=Dt;function Jv(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*mi(e)}Jv.signature=Dt;function Kv(e){return 1/Math.cos(e)}Kv.signature=Dt;function jv(e){return 2/(Math.exp(e)+Math.exp(-e))}jv.signature=Dt;function e9(e){return Math.sin(e)}e9.signature=Dt;function eg(e){return my(e)}eg.signature=Dt;function r9(e){return Math.tan(e)}r9.signature=Dt;function t9(e){return bc(e)}t9.signature=Dt;var Sf="number";function n9(e){return He(e)}n9.signature=Sf;function rg(e){return e<0}rg.signature=Sf;function tg(e){return e>0}tg.signature=Sf;function ng(e){return e===0}ng.signature=Sf;function ig(e){return Number.isNaN(e)}ig.signature=Sf;var v1="isNegative",i9=["typed"],g1=T(v1,i9,e=>{var{typed:r}=e;return r(v1,{number:rg,BigNumber:function(n){return n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s<0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var x1="isNumeric",a9=["typed"],y1=T(x1,a9,e=>{var{typed:r}=e;return r(x1,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var b1="hasNumericValue",o9=["typed","isNumeric"],w1=T(b1,o9,e=>{var{typed:r,isNumeric:t}=e;return r(b1,{boolean:()=>!0,string:function(i){return i.trim().length>0&&!isNaN(Number(i))},any:function(i){return t(i)}})});var D1="isPositive",s9=["typed"],S1=T(D1,s9,e=>{var{typed:r}=e;return r(D1,{number:tg,BigNumber:function(n){return!n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s>0&&n.n>0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var N1="isZero",u9=["typed"],A1=T(N1,u9,e=>{var{typed:r}=e;return r(N1,{number:ng,BigNumber:function(n){return n.isZero()},Complex:function(n){return n.re===0&&n.im===0},Fraction:function(n){return n.d===1&&n.n===0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var E1="isNaN",f9=["typed"],C1=T(E1,f9,e=>{var{typed:r}=e;return r(E1,{number:ig,BigNumber:function(n){return n.isNaN()},Fraction:function(n){return!1},Complex:function(n){return n.isNaN()},Unit:function(n){return Number.isNaN(n.value)},"Array | Matrix":function(n){return Je(n,Number.isNaN)}})});var M1="typeOf",l9=["typed"],_1=T(M1,l9,e=>{var{typed:r}=e;return r(M1,{any:_r})});function Ut(e,r,t){if(t==null)return e.eq(r);if(e.eq(r))return!0;if(e.isNaN()||r.isNaN())return!1;if(e.isFinite()&&r.isFinite()){var n=e.minus(r).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),r.abs());return n.lte(i.times(t))}return!1}function T1(e,r,t){return wt(e.re,r.re,t)&&wt(e.im,r.im,t)}var di=T("compareUnits",["typed"],e=>{var{typed:r}=e;return{"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return r.find(t,[n.valueType(),i.valueType()])(n.value,i.value)})}});var Rc="equalScalar",c9=["typed","config"],F1=T(Rc,c9,e=>{var{typed:r,config:t}=e,n=di({typed:r});return r(Rc,{"boolean, boolean":function(a,s){return a===s},"number, number":function(a,s){return wt(a,s,t.epsilon)},"BigNumber, BigNumber":function(a,s){return a.eq(s)||Ut(a,s,t.epsilon)},"Fraction, Fraction":function(a,s){return a.equals(s)},"Complex, Complex":function(a,s){return T1(a,s,t.epsilon)}},n)}),DX=T(Rc,["typed","config"],e=>{var{typed:r,config:t}=e;return r(Rc,{"number, number":function(i,a){return wt(i,a,t.epsilon)}})});var p9="SparseMatrix",m9=["typed","equalScalar","Matrix"],O1=T(p9,m9,e=>{var{typed:r,equalScalar:t,Matrix:n}=e;function i(v,y){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(y&&!yt(y))throw new Error("Invalid datatype: "+y);if(Ge(v))a(this,v,y);else if(v&&Ar(v.index)&&Ar(v.ptr)&&Ar(v.size))this._values=v.values,this._index=v.index,this._ptr=v.ptr,this._size=v.size,this._datatype=y||v.datatype;else if(Ar(v))s(this,v,y);else{if(v)throw new TypeError("Unsupported type of data ("+_r(v)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=y}}function a(v,y,w){y.type==="SparseMatrix"?(v._values=y._values?tr(y._values):void 0,v._index=tr(y._index),v._ptr=tr(y._ptr),v._size=tr(y._size),v._datatype=w||y._datatype):s(v,y.valueOf(),w||y._datatype)}function s(v,y,w){v._values=[],v._index=[],v._ptr=[],v._datatype=w;var C=y.length,b=0,A=t,E=0;if(yt(w)&&(A=r.find(t,[w,w])||t,E=r.convert(0,w)),C>0){var S=0;do{v._ptr.push(v._index.length);for(var O=0;O");if(b.length===1){var F=y.dimension(0);F.forEach(function(k,L){Xr(k),v.set([k,0],w[L[0]],C)})}else{var M=y.dimension(0),_=y.dimension(1);M.forEach(function(k,L){Xr(k),_.forEach(function(Y,$){Xr(Y),v.set([k,Y],w[L[0]][$[0]],C)})})}}return v}i.prototype.get=function(v){if(!Ar(v))throw new TypeError("Array expected");if(v.length!==this._size.length)throw new pr(v.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var y=v[0],w=v[1];Xr(y,this._size[0]),Xr(w,this._size[1]);var C=o(y,this._ptr[w],this._ptr[w+1],this._index);return CA-1||b>E-1)&&(h(this,Math.max(C+1,A),Math.max(b+1,E),w),A=this._size[0],E=this._size[1]),Xr(C,A),Xr(b,E);var F=o(C,this._ptr[b],this._ptr[b+1],this._index);return FArray.isArray(A)&&A.length===1?A[0]:A);if(C.length!==2)throw new Error("Only two dimensions matrix are supported");C.forEach(function(A){if(!ar(A)||!He(A)||A<0)throw new TypeError("Invalid size, must contain positive integers (size: "+lr(C)+")")});var b=w?this.clone():this;return h(b,C[0],C[1],y)};function h(v,y,w,C){var b=C||0,A=t,E=0;yt(v._datatype)&&(A=r.find(t,[v._datatype,v._datatype])||t,E=r.convert(0,v._datatype),b=r.convert(b,v._datatype));var S=!A(b,E),O=v._size[0],F=v._size[1],M,_,k;if(w>F){for(_=F;_O){if(S){var L=0;for(_=0;_y-1&&(v._values.splice(k,1),v._index.splice(k,1),$++)}v._ptr[_]=v._values.length}return v._size[0]=y,v._size[1]=w,v}i.prototype.reshape=function(v,y){if(!Ar(v))throw new TypeError("Array expected");if(v.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");v.forEach(function(U){if(!ar(U)||!He(U)||U<=-2||U===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+lr(v)+")")});var w=this._size[0]*this._size[1];v=gf(v,w);var C=v[0]*v[1];if(w!==C)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var b=y?this.clone():this;if(this._size[0]===v[0]&&this._size[1]===v[1])return b;for(var A=[],E=0;E=y&&q<=w&&k(v._values[V],q-y,L-C)}else{for(var R={},j=Y;j<$;j++){var U=v._index[j];R[U]=v._values[j]}for(var oe=y;oe<=w;oe++){var me=oe in R?R[oe]:0;k(me,oe-y,L-C)}}}return F.push(S.length),new i({values:S,index:O,ptr:F,size:[w-y+1,b-C+1]})}i.prototype.forEach=function(v,y){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var w=this,C=this._size[0],b=this._size[1],A=0;A=0;return(se?P?"+":"":"-")+Math.pow(10,Math.max(0,G)).toString().substr(1)+z}var U=/(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,oe=/(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,me={},ie={};function H(g,N,P,z){var G=z;typeof z=="string"&&(G=function(){return this[z]()}),g&&(ie[g]=G),N&&(ie[N[0]]=function(){return j(G.apply(this,arguments),N[1],N[2])}),P&&(ie[P]=function(){return this.localeData().ordinal(G.apply(this,arguments),g)})}function ce(g){return g.match(/\\[[\\s\\S]/)?g.replace(/^\\[|\\]$/g,""):g.replace(/\\\\/g,"")}function Me(g){var N=g.match(U),P,z;for(P=0,z=N.length;P=0&&oe.test(g);)g=g.replace(oe,z),oe.lastIndex=0,P-=1;return g}var Se={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function xe(g){var N=this._longDateFormat[g],P=this._longDateFormat[g.toUpperCase()];return N||!P?N:(this._longDateFormat[g]=P.match(U).map(function(z){return z==="MMMM"||z==="MM"||z==="DD"||z==="dddd"?z.slice(1):z}).join(""),this._longDateFormat[g])}var be="Invalid date";function De(){return this._invalidDate}var Ae="%d",ze=/\\d{1,2}/;function Ze(g){return this._ordinal.replace("%d",g)}var K={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function te(g,N,P,z){var G=this._relativeTime[P];return k(G)?G(g,N,P,z):G.replace(/%d/i,g)}function ye(g,N){var P=this._relativeTime[g>0?"future":"past"];return k(P)?P(N):P.replace(/%s/i,N)}var ee={};function ne(g,N){var P=g.toLowerCase();ee[P]=ee[P+"s"]=ee[N]=g}function ue(g){return typeof g=="string"?ee[g]||ee[g.toLowerCase()]:void 0}function Ee(g){var N={},P,z;for(z in g)a(g,z)&&(P=ue(z),P&&(N[P]=g[z]));return N}var Ce={};function Le(g,N){Ce[g]=N}function Ie(g){var N=[],P;for(P in g)a(g,P)&&N.push({unit:P,priority:Ce[P]});return N.sort(function(z,G){return z.priority-G.priority}),N}function sr(g){return g%4===0&&g%100!==0||g%400===0}function ir(g){return g<0?Math.ceil(g)||0:Math.floor(g)}function Xe(g){var N=+g,P=0;return N!==0&&isFinite(N)&&(P=ir(N)),P}function Or(g,N){return function(P){return P!=null?(le(this,g,P),r.updateOffset(this,N),this):re(this,g)}}function re(g,N){return g.isValid()?g._d["get"+(g._isUTC?"UTC":"")+N]():NaN}function le(g,N,P){g.isValid()&&!isNaN(P)&&(N==="FullYear"&&sr(g.year())&&g.month()===1&&g.date()===29?(P=Xe(P),g._d["set"+(g._isUTC?"UTC":"")+N](P,g.month(),Ga(P,g.month()))):g._d["set"+(g._isUTC?"UTC":"")+N](P))}function we(g){return g=ue(g),k(this[g])?this[g]():this}function Oe(g,N){if(typeof g=="object"){g=Ee(g);var P=Ie(g),z,G=P.length;for(z=0;z68?1900:2e3)};var Ou=Or("FullYear",!0);function am(){return sr(this.year())}function kf(g,N,P,z,G,se,Te){var mr;return g<100&&g>=0?(mr=new Date(g+400,N,P,z,G,se,Te),isFinite(mr.getFullYear())&&mr.setFullYear(g)):mr=new Date(g,N,P,z,G,se,Te),mr}function $a(g){var N,P;return g<100&&g>=0?(P=Array.prototype.slice.call(arguments),P[0]=g+400,N=new Date(Date.UTC.apply(null,P)),isFinite(N.getUTCFullYear())&&N.setUTCFullYear(g)):N=new Date(Date.UTC.apply(null,arguments)),N}function Za(g,N,P){var z=7+N-P,G=(7+$a(g,0,z).getUTCDay()-N)%7;return-G+z-1}function Rf(g,N,P,z,G){var se=(7+P-z)%7,Te=Za(g,z,G),mr=1+7*(N-1)+se+Te,Tr,et;return mr<=0?(Tr=g-1,et=Ji(Tr)+mr):mr>Ji(g)?(Tr=g+1,et=mr-Ji(g)):(Tr=g,et=mr),{year:Tr,dayOfYear:et}}function Qa(g,N,P){var z=Za(g.year(),N,P),G=Math.floor((g.dayOfYear()-z-1)/7)+1,se,Te;return G<1?(Te=g.year()-1,se=G+Vn(Te,N,P)):G>Vn(g.year(),N,P)?(se=G-Vn(g.year(),N,P),Te=g.year()+1):(Te=g.year(),se=G),{week:se,year:Te}}function Vn(g,N,P){var z=Za(g,N,P),G=Za(g+1,N,P);return(Ji(g)-z+G)/7}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),ne("week","w"),ne("isoWeek","W"),Le("week",5),Le("isoWeek",5),rr("w",Q),rr("ww",Q,_e),rr("W",Q),rr("WW",Q,_e),ga(["w","ww","W","WW"],function(g,N,P,z){N[z.substr(0,1)]=Xe(g)});function Bu(g){return Qa(g,this._week.dow,this._week.doy).week}var Xa={dow:0,doy:6};function Lf(){return this._week.dow}function qf(){return this._week.doy}function om(g){var N=this.localeData().week(this);return g==null?N:this.add((g-N)*7,"d")}function Uf(g){var N=Qa(this,1,4).week;return g==null?N:this.add((g-N)*7,"d")}H("d",0,"do","day"),H("dd",0,0,function(g){return this.localeData().weekdaysMin(this,g)}),H("ddd",0,0,function(g){return this.localeData().weekdaysShort(this,g)}),H("dddd",0,0,function(g){return this.localeData().weekdays(this,g)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),ne("day","d"),ne("weekday","e"),ne("isoWeekday","E"),Le("day",11),Le("weekday",11),Le("isoWeekday",11),rr("d",Q),rr("e",Q),rr("E",Q),rr("dd",function(g,N){return N.weekdaysMinRegex(g)}),rr("ddd",function(g,N){return N.weekdaysShortRegex(g)}),rr("dddd",function(g,N){return N.weekdaysRegex(g)}),ga(["dd","ddd","dddd"],function(g,N,P,z){var G=P._locale.weekdaysParse(g,z,P._strict);G!=null?N.d=G:x(P).invalidWeekday=g}),ga(["d","e","E"],function(g,N,P,z){N[z]=Xe(g)});function zf(g,N){return typeof g!="string"?g:isNaN(g)?(g=N.weekdaysParse(g),typeof g=="number"?g:null):parseInt(g,10)}function Wf(g,N){return typeof g=="string"?N.weekdaysParse(g)%7||7:isNaN(g)?null:g}function ms(g,N){return g.slice(N,7).concat(g.slice(0,N))}var sm="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Vf="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),um="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Yf=Ci,fm=Ci,lm=Ci;function cm(g,N){var P=n(this._weekdays)?this._weekdays:this._weekdays[g&&g!==!0&&this._weekdays.isFormat.test(N)?"format":"standalone"];return g===!0?ms(P,this._week.dow):g?P[g.day()]:P}function pm(g){return g===!0?ms(this._weekdaysShort,this._week.dow):g?this._weekdaysShort[g.day()]:this._weekdaysShort}function Iu(g){return g===!0?ms(this._weekdaysMin,this._week.dow):g?this._weekdaysMin[g.day()]:this._weekdaysMin}function mm(g,N,P){var z,G,se,Te=g.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],z=0;z<7;++z)se=h([2e3,1]).day(z),this._minWeekdaysParse[z]=this.weekdaysMin(se,"").toLocaleLowerCase(),this._shortWeekdaysParse[z]=this.weekdaysShort(se,"").toLocaleLowerCase(),this._weekdaysParse[z]=this.weekdays(se,"").toLocaleLowerCase();return P?N==="dddd"?(G=pt.call(this._weekdaysParse,Te),G!==-1?G:null):N==="ddd"?(G=pt.call(this._shortWeekdaysParse,Te),G!==-1?G:null):(G=pt.call(this._minWeekdaysParse,Te),G!==-1?G:null):N==="dddd"?(G=pt.call(this._weekdaysParse,Te),G!==-1||(G=pt.call(this._shortWeekdaysParse,Te),G!==-1)?G:(G=pt.call(this._minWeekdaysParse,Te),G!==-1?G:null)):N==="ddd"?(G=pt.call(this._shortWeekdaysParse,Te),G!==-1||(G=pt.call(this._weekdaysParse,Te),G!==-1)?G:(G=pt.call(this._minWeekdaysParse,Te),G!==-1?G:null)):(G=pt.call(this._minWeekdaysParse,Te),G!==-1||(G=pt.call(this._weekdaysParse,Te),G!==-1)?G:(G=pt.call(this._shortWeekdaysParse,Te),G!==-1?G:null))}function hm(g,N,P){var z,G,se;if(this._weekdaysParseExact)return mm.call(this,g,N,P);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),z=0;z<7;z++){if(G=h([2e3,1]).day(z),P&&!this._fullWeekdaysParse[z]&&(this._fullWeekdaysParse[z]=new RegExp("^"+this.weekdays(G,"").replace(".","\\\\.?")+"$","i"),this._shortWeekdaysParse[z]=new RegExp("^"+this.weekdaysShort(G,"").replace(".","\\\\.?")+"$","i"),this._minWeekdaysParse[z]=new RegExp("^"+this.weekdaysMin(G,"").replace(".","\\\\.?")+"$","i")),this._weekdaysParse[z]||(se="^"+this.weekdays(G,"")+"|^"+this.weekdaysShort(G,"")+"|^"+this.weekdaysMin(G,""),this._weekdaysParse[z]=new RegExp(se.replace(".",""),"i")),P&&N==="dddd"&&this._fullWeekdaysParse[z].test(g))return z;if(P&&N==="ddd"&&this._shortWeekdaysParse[z].test(g))return z;if(P&&N==="dd"&&this._minWeekdaysParse[z].test(g))return z;if(!P&&this._weekdaysParse[z].test(g))return z}}function dm(g){if(!this.isValid())return g!=null?this:NaN;var N=this._isUTC?this._d.getUTCDay():this._d.getDay();return g!=null?(g=zf(g,this.localeData()),this.add(g-N,"d")):N}function vm(g){if(!this.isValid())return g!=null?this:NaN;var N=(this.day()+7-this.localeData()._week.dow)%7;return g==null?N:this.add(g-N,"d")}function gm(g){if(!this.isValid())return g!=null?this:NaN;if(g!=null){var N=Wf(g,this.localeData());return this.day(this.day()%7?N:N-7)}else return this.day()||7}function dt(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Pu.call(this),g?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Yf),this._weekdaysStrictRegex&&g?this._weekdaysStrictRegex:this._weekdaysRegex)}function mt(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Pu.call(this),g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=fm),this._weekdaysShortStrictRegex&&g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function xm(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Pu.call(this),g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=lm),this._weekdaysMinStrictRegex&&g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Pu(){function g(sn,si){return si.length-sn.length}var N=[],P=[],z=[],G=[],se,Te,mr,Tr,et;for(se=0;se<7;se++)Te=h([2e3,1]).day(se),mr=nn(this.weekdaysMin(Te,"")),Tr=nn(this.weekdaysShort(Te,"")),et=nn(this.weekdays(Te,"")),N.push(mr),P.push(Tr),z.push(et),G.push(mr),G.push(Tr),G.push(et);N.sort(g),P.sort(g),z.sort(g),G.sort(g),this._weekdaysRegex=new RegExp("^("+G.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+z.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+P.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+N.join("|")+")","i")}function ku(){return this.hours()%12||12}function ym(){return this.hours()||24}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,ku),H("k",["kk",2],0,ym),H("hmm",0,0,function(){return""+ku.apply(this)+j(this.minutes(),2)}),H("hmmss",0,0,function(){return""+ku.apply(this)+j(this.minutes(),2)+j(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+j(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+j(this.minutes(),2)+j(this.seconds(),2)});function Hf(g,N){H(g,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),N)})}Hf("a",!0),Hf("A",!1),ne("hour","h"),Le("hour",13);function Gf(g,N){return N._meridiemParse}rr("a",Gf),rr("A",Gf),rr("H",Q),rr("h",Q),rr("k",Q),rr("HH",Q,_e),rr("hh",Q,_e),rr("kk",Q,_e),rr("hmm",ve),rr("hmmss",Be),rr("Hmm",ve),rr("Hmmss",Be),nt(["H","HH"],At),nt(["k","kk"],function(g,N,P){var z=Xe(g);N[At]=z===24?0:z}),nt(["a","A"],function(g,N,P){P._isPm=P._locale.isPM(g),P._meridiem=g}),nt(["h","hh"],function(g,N,P){N[At]=Xe(g),x(P).bigHour=!0}),nt("hmm",function(g,N,P){var z=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z)),x(P).bigHour=!0}),nt("hmmss",function(g,N,P){var z=g.length-4,G=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z,2)),N[Wn]=Xe(g.substr(G)),x(P).bigHour=!0}),nt("Hmm",function(g,N,P){var z=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z))}),nt("Hmmss",function(g,N,P){var z=g.length-4,G=g.length-2;N[At]=Xe(g.substr(0,z)),N[gn]=Xe(g.substr(z,2)),N[Wn]=Xe(g.substr(G))});function $f(g){return(g+"").toLowerCase().charAt(0)==="p"}var bm=/[ap]\\.?m?\\.?/i,Wt=Or("Hours",!0);function Ru(g,N,P){return g>11?P?"pm":"PM":P?"am":"AM"}var Ki={calendar:q,longDateFormat:Se,invalidDate:be,ordinal:Ae,dayOfMonthOrdinalParse:ze,relativeTime:K,months:Mu,monthsShort:fs,week:Xa,weekdays:sm,weekdaysMin:um,weekdaysShort:Vf,meridiemParse:bm},vt={},ya={},en;function Zf(g,N){var P,z=Math.min(g.length,N.length);for(P=0;P0;){if(G=To(se.slice(0,P).join("-")),G)return G;if(z&&z.length>=P&&Zf(se,z)>=P-1)break;P--}N++}return en}function Xf(g){return g.match("^[^/\\\\\\\\]*$")!=null}function To(g){var N=null,P;if(vt[g]===void 0&&typeof Ws<"u"&&Ws&&Ws.exports&&Xf(g))try{N=en._abbr,P=require,P("./locale/"+g),Ti(N)}catch{vt[g]=null}return vt[g]}function Ti(g,N){var P;return g&&(l(N)?P=Tt(g):P=an(g,N),P?en=P:typeof console<"u"&&console.warn&&console.warn("Locale "+g+" not found. Did you forget to load it?")),en._abbr}function an(g,N){if(N!==null){var P,z=Ki;if(N.abbr=g,vt[g]!=null)_("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),z=vt[g]._config;else if(N.parentLocale!=null)if(vt[N.parentLocale]!=null)z=vt[N.parentLocale]._config;else if(P=To(N.parentLocale),P!=null)z=P._config;else return ya[N.parentLocale]||(ya[N.parentLocale]=[]),ya[N.parentLocale].push({name:g,config:N}),null;return vt[g]=new $(Y(z,N)),ya[g]&&ya[g].forEach(function(G){an(G.name,G.config)}),Ti(g),vt[g]}else return delete vt[g],null}function wm(g,N){if(N!=null){var P,z,G=Ki;vt[g]!=null&&vt[g].parentLocale!=null?vt[g].set(Y(vt[g]._config,N)):(z=To(g),z!=null&&(G=z._config),N=Y(G,N),z==null&&(N.abbr=g),P=new $(N),P.parentLocale=vt[g],vt[g]=P),Ti(g)}else vt[g]!=null&&(vt[g].parentLocale!=null?(vt[g]=vt[g].parentLocale,g===Ti()&&Ti(g)):vt[g]!=null&&delete vt[g]);return vt[g]}function Tt(g){var N;if(g&&g._locale&&g._locale._abbr&&(g=g._locale._abbr),!g)return en;if(!n(g)){if(N=To(g),N)return N;g=[g]}return Qf(g)}function Dm(){return V(vt)}function hs(g){var N,P=g._a;return P&&x(g).overflow===-2&&(N=P[En]<0||P[En]>11?En:P[Cn]<1||P[Cn]>Ga(P[zt],P[En])?Cn:P[At]<0||P[At]>24||P[At]===24&&(P[gn]!==0||P[Wn]!==0||P[Mi]!==0)?At:P[gn]<0||P[gn]>59?gn:P[Wn]<0||P[Wn]>59?Wn:P[Mi]<0||P[Mi]>999?Mi:-1,x(g)._overflowDayOfYear&&(NCn)&&(N=Cn),x(g)._overflowWeeks&&N===-1&&(N=Eu),x(g)._overflowWeekday&&N===-1&&(N=Ha),x(g).overflow=N),g}var ji=/^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,ds=/^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,qu=/Z|[+-]\\d\\d(?::?\\d\\d)?/,ct=[["YYYYYY-MM-DD",/[+-]\\d{6}-\\d\\d-\\d\\d/],["YYYY-MM-DD",/\\d{4}-\\d\\d-\\d\\d/],["GGGG-[W]WW-E",/\\d{4}-W\\d\\d-\\d/],["GGGG-[W]WW",/\\d{4}-W\\d\\d/,!1],["YYYY-DDD",/\\d{4}-\\d{3}/],["YYYY-MM",/\\d{4}-\\d\\d/,!1],["YYYYYYMMDD",/[+-]\\d{10}/],["YYYYMMDD",/\\d{8}/],["GGGG[W]WWE",/\\d{4}W\\d{3}/],["GGGG[W]WW",/\\d{4}W\\d{2}/,!1],["YYYYDDD",/\\d{7}/],["YYYYMM",/\\d{6}/,!1],["YYYY",/\\d{4}/,!1]],ti=[["HH:mm:ss.SSSS",/\\d\\d:\\d\\d:\\d\\d\\.\\d+/],["HH:mm:ss,SSSS",/\\d\\d:\\d\\d:\\d\\d,\\d+/],["HH:mm:ss",/\\d\\d:\\d\\d:\\d\\d/],["HH:mm",/\\d\\d:\\d\\d/],["HHmmss.SSSS",/\\d\\d\\d\\d\\d\\d\\.\\d+/],["HHmmss,SSSS",/\\d\\d\\d\\d\\d\\d,\\d+/],["HHmmss",/\\d\\d\\d\\d\\d\\d/],["HHmm",/\\d\\d\\d\\d/],["HH",/\\d\\d/]],Uu=/^\\/?Date\\((-?\\d+)/i,Sm=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,zu={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Jf(g){var N,P,z=g._i,G=ji.exec(z)||ds.exec(z),se,Te,mr,Tr,et=ct.length,sn=ti.length;if(G){for(x(g).iso=!0,N=0,P=et;NJi(Te)||g._dayOfYear===0)&&(x(g)._overflowDayOfYear=!0),P=$a(Te,0,g._dayOfYear),g._a[En]=P.getUTCMonth(),g._a[Cn]=P.getUTCDate()),N=0;N<3&&g._a[N]==null;++N)g._a[N]=z[N]=G[N];for(;N<7;N++)g._a[N]=z[N]=g._a[N]==null?N===2?1:0:g._a[N];g._a[At]===24&&g._a[gn]===0&&g._a[Wn]===0&&g._a[Mi]===0&&(g._nextDay=!0,g._a[At]=0),g._d=(g._useUTC?$a:kf).apply(null,z),se=g._useUTC?g._d.getUTCDay():g._d.getDay(),g._tzm!=null&&g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),g._nextDay&&(g._a[At]=24),g._w&&typeof g._w.d<"u"&&g._w.d!==se&&(x(g).weekdayMismatch=!0)}}function rl(g){var N,P,z,G,se,Te,mr,Tr,et;N=g._w,N.GG!=null||N.W!=null||N.E!=null?(se=1,Te=4,P=ba(N.GG,g._a[zt],Qa(ht(),1,4).year),z=ba(N.W,1),G=ba(N.E,1),(G<1||G>7)&&(Tr=!0)):(se=g._locale._week.dow,Te=g._locale._week.doy,et=Qa(ht(),se,Te),P=ba(N.gg,g._a[zt],et.year),z=ba(N.w,et.week),N.d!=null?(G=N.d,(G<0||G>6)&&(Tr=!0)):N.e!=null?(G=N.e+se,(N.e<0||N.e>6)&&(Tr=!0)):G=se),z<1||z>Vn(P,se,Te)?x(g)._overflowWeeks=!0:Tr!=null?x(g)._overflowWeekday=!0:(mr=Rf(P,z,G,se,Te),g._a[zt]=mr.year,g._dayOfYear=mr.dayOfYear)}r.ISO_8601=function(){},r.RFC_2822=function(){};function Vu(g){if(g._f===r.ISO_8601){Jf(g);return}if(g._f===r.RFC_2822){jf(g);return}g._a=[],x(g).empty=!0;var N=""+g._i,P,z,G,se,Te,mr=N.length,Tr=0,et,sn;for(G=ge(g._f,g._locale).match(U)||[],sn=G.length,P=0;P0&&x(g).unusedInput.push(Te),N=N.slice(N.indexOf(z)+z.length),Tr+=z.length),ie[se]?(z?x(g).empty=!1:x(g).unusedTokens.push(se),Au(se,z,g)):g._strict&&!z&&x(g).unusedTokens.push(se);x(g).charsLeftOver=mr-Tr,N.length>0&&x(g).unusedInput.push(N),g._a[At]<=12&&x(g).bigHour===!0&&g._a[At]>0&&(x(g).bigHour=void 0),x(g).parsedDateParts=g._a.slice(0),x(g).meridiem=g._meridiem,g._a[At]=Yu(g._locale,g._a[At],g._meridiem),et=x(g).era,et!==null&&(g._a[zt]=g._locale.erasConvertYear(et,g._a[zt])),Fo(g),hs(g)}function Yu(g,N,P){var z;return P==null?N:g.meridiemHour!=null?g.meridiemHour(N,P):(g.isPM!=null&&(z=g.isPM(P),z&&N<12&&(N+=12),!z&&N===12&&(N=0)),N)}function Hu(g){var N,P,z,G,se,Te,mr=!1,Tr=g._f.length;if(Tr===0){x(g).invalidFormat=!0,g._d=new Date(NaN);return}for(G=0;Gthis?this:g:w()});function il(g,N){var P,z;if(N.length===1&&n(N[0])&&(N=N[0]),!N.length)return ht();for(P=N[0],z=1;zthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Fe(){if(!l(this._isDSTShifted))return this._isDSTShifted;var g={},N;return A(g,this),g=cn(g),g._a?(N=g._isUTC?h(g._a):ht(g._a),this._isDSTShifted=this.isValid()&&Bm(g._a,N.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Ne(){return this.isValid()?!this._isUTC:!1}function nr(){return this.isValid()?this._isUTC:!1}function Nr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var jr=/^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,Pt=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function kr(g,N){var P=g,z=null,G,se,Te;return Yn(g)?P={ms:g._milliseconds,d:g._days,M:g._months}:f(g)||!isNaN(+g)?(P={},N?P[N]=+g:P.milliseconds=+g):(z=jr.exec(g))?(G=z[1]==="-"?-1:1,P={y:0,d:Xe(z[Cn])*G,h:Xe(z[At])*G,m:Xe(z[gn])*G,s:Xe(z[Wn])*G,ms:Xe(ja(z[Mi]*1e3))*G}):(z=Pt.exec(g))?(G=z[1]==="-"?-1:1,P={y:Fi(z[2],G),M:Fi(z[3],G),w:Fi(z[4],G),d:Fi(z[5],G),h:Fi(z[6],G),m:Fi(z[7],G),s:Fi(z[8],G)}):P==null?P={}:typeof P=="object"&&("from"in P||"to"in P)&&(Te=Mn(ht(P.from),ht(P.to)),P={},P.ms=Te.milliseconds,P.M=Te.months),se=new Oo(P),Yn(g)&&a(g,"_locale")&&(se._locale=g._locale),Yn(g)&&a(g,"_isValid")&&(se._isValid=g._isValid),se}kr.fn=Oo.prototype,kr.invalid=$u;function Fi(g,N){var P=g&&parseFloat(g.replace(",","."));return(isNaN(P)?0:P)*N}function ol(g,N){var P={};return P.months=N.month()-g.month()+(N.year()-g.year())*12,g.clone().add(P.months,"M").isAfter(N)&&--P.months,P.milliseconds=+N-+g.clone().add(P.months,"M"),P}function Mn(g,N){var P;return g.isValid()&&N.isValid()?(N=xn(N,g),g.isBefore(N)?P=ol(g,N):(P=ol(N,g),P.milliseconds=-P.milliseconds,P.months=-P.months),P):{milliseconds:0,months:0}}function Bo(g,N){return function(P,z){var G,se;return z!==null&&!isNaN(+z)&&(_(N,"moment()."+N+"(period, number) is deprecated. Please use moment()."+N+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),se=P,P=z,z=se),G=kr(P,z),sl(this,G,g),this}}function sl(g,N,P,z){var G=N._milliseconds,se=ja(N._days),Te=ja(N._months);!g.isValid()||(z=z??!0,Te&&Xi(g,re(g,"Month")+Te*P),se&&le(g,"Date",re(g,"Date")+se*P),G&&g._d.setTime(g._d.valueOf()+G*P),z&&r.updateOffset(g,se||Te))}var eo=Bo(1,"add"),xs=Bo(-1,"subtract");function Io(g){return typeof g=="string"||g instanceof String}function at(g){return S(g)||o(g)||Io(g)||f(g)||ul(g)||Um(g)||g===null||g===void 0}function Um(g){var N=i(g)&&!s(g),P=!1,z=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],G,se,Te=z.length;for(G=0;GP.valueOf():P.valueOf()9999?pe(P,N?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):k(Date.prototype.toISOString)?N?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",pe(P,"Z")):pe(P,N?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Da(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var g="moment",N="",P,z,G,se;return this.isLocal()||(g=this.utcOffset()===0?"moment.utc":"moment.parseZone",N="Z"),P="["+g+'("]',z=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",G="-MM-DD[T]HH:mm:ss.SSS",se=N+'[")]',this.format(P+z+G+se)}function Ss(g){g||(g=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var N=pe(this,g);return this.localeData().postformat(N)}function Ym(g,N){return this.isValid()&&(S(g)&&g.isValid()||ht(g).isValid())?kr({to:this,from:g}).locale(this.locale()).humanize(!N):this.localeData().invalidDate()}function Hm(g){return this.from(ht(),g)}function Gm(g,N){return this.isValid()&&(S(g)&&g.isValid()||ht(g).isValid())?kr({from:this,to:g}).locale(this.locale()).humanize(!N):this.localeData().invalidDate()}function Ns(g){return this.to(ht(),g)}function ko(g){var N;return g===void 0?this._locale._abbr:(N=Tt(g),N!=null&&(this._locale=N),this)}var As=F("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(g){return g===void 0?this.localeData():this.locale(g)});function ml(){return this._locale}var Ro=1e3,ro=60*Ro,Es=60*ro,Ft=(365*400+97)*24*Es;function Et(g,N){return(g%N+N)%N}function hl(g,N,P){return g<100&&g>=0?new Date(g+400,N,P)-Ft:new Date(g,N,P).valueOf()}function dl(g,N,P){return g<100&&g>=0?Date.UTC(g+400,N,P)-Ft:Date.UTC(g,N,P)}function vl(g){var N,P;if(g=ue(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(P=this._isUTC?dl:hl,g){case"year":N=P(this.year(),0,1);break;case"quarter":N=P(this.year(),this.month()-this.month()%3,1);break;case"month":N=P(this.year(),this.month(),1);break;case"week":N=P(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":N=P(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":N=P(this.year(),this.month(),this.date());break;case"hour":N=this._d.valueOf(),N-=Et(N+(this._isUTC?0:this.utcOffset()*ro),Es);break;case"minute":N=this._d.valueOf(),N-=Et(N,ro);break;case"second":N=this._d.valueOf(),N-=Et(N,Ro);break}return this._d.setTime(N),r.updateOffset(this,!0),this}function $m(g){var N,P;if(g=ue(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(P=this._isUTC?dl:hl,g){case"year":N=P(this.year()+1,0,1)-1;break;case"quarter":N=P(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":N=P(this.year(),this.month()+1,1)-1;break;case"week":N=P(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":N=P(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":N=P(this.year(),this.month(),this.date()+1)-1;break;case"hour":N=this._d.valueOf(),N+=Es-Et(N+(this._isUTC?0:this.utcOffset()*ro),Es)-1;break;case"minute":N=this._d.valueOf(),N+=ro-Et(N,ro)-1;break;case"second":N=this._d.valueOf(),N+=Ro-Et(N,Ro)-1;break}return this._d.setTime(N),r.updateOffset(this,!0),this}function Zu(){return this._d.valueOf()-(this._offset||0)*6e4}function Lo(){return Math.floor(this.valueOf()/1e3)}function Qu(){return new Date(this.valueOf())}function to(){var g=this;return[g.year(),g.month(),g.date(),g.hour(),g.minute(),g.second(),g.millisecond()]}function qo(){var g=this;return{years:g.year(),months:g.month(),date:g.date(),hours:g.hours(),minutes:g.minutes(),seconds:g.seconds(),milliseconds:g.milliseconds()}}function Uo(){return this.isValid()?this.toISOString():null}function Cs(){return y(this)}function no(){return p({},x(this))}function Zm(){return x(this).overflow}function Qm(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),rr("N",Ir),rr("NN",Ir),rr("NNN",Ir),rr("NNNN",jm),rr("NNNNN",eh),nt(["N","NN","NNN","NNNN","NNNNN"],function(g,N,P,z){var G=P._locale.erasParse(g,z,P._strict);G?x(P).era=G:x(P).invalidEra=g}),rr("y",_t),rr("yy",_t),rr("yyy",_t),rr("yyyy",_t),rr("yo",rh),nt(["y","yy","yyy","yyyy"],zt),nt(["yo"],function(g,N,P,z){var G;P._locale._eraYearOrdinalRegex&&(G=g.match(P._locale._eraYearOrdinalRegex)),P._locale.eraYearOrdinalParse?N[zt]=P._locale.eraYearOrdinalParse(g,G):N[zt]=parseInt(g,10)});function Xm(g,N){var P,z,G,se=this._eras||Tt("en")._eras;for(P=0,z=se.length;P=0)return se[z]}function Km(g,N){var P=g.since<=g.until?1:-1;return N===void 0?r(g.since).year():r(g.since).year()+(N-g.offset)*P}function Ms(){var g,N,P,z=this.localeData().eras();for(g=0,N=z.length;gse&&(N=se),sh.call(this,g,N,P,z,G))}function sh(g,N,P,z,G){var se=Rf(g,N,P,z,G),Te=$a(se.year,0,se.dayOfYear);return this.year(Te.getUTCFullYear()),this.month(Te.getUTCMonth()),this.date(Te.getUTCDate()),this}H("Q",0,"Qo","quarter"),ne("quarter","Q"),Le("quarter",7),rr("Q",ke),nt("Q",function(g,N){N[En]=(Xe(g)-1)*3});function uh(g){return g==null?Math.ceil((this.month()+1)/3):this.month((g-1)*3+this.month()%3)}H("D",["DD",2],"Do","date"),ne("date","D"),Le("date",9),rr("D",Q),rr("DD",Q,_e),rr("Do",function(g,N){return g?N._dayOfMonthOrdinalParse||N._ordinalParse:N._dayOfMonthOrdinalParseLenient}),nt(["D","DD"],Cn),nt("Do",function(g,N){N[Cn]=Xe(g.match(Q)[0])});var yl=Or("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),ne("dayOfYear","DDD"),Le("dayOfYear",4),rr("DDD",er),rr("DDDD",Pe),nt(["DDD","DDDD"],function(g,N,P){P._dayOfYear=Xe(g)});function Ii(g){var N=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return g==null?N:this.add(g-N,"d")}H("m",["mm",2],0,"minute"),ne("minute","m"),Le("minute",14),rr("m",Q),rr("mm",Q,_e),nt(["m","mm"],gn);var fh=Or("Minutes",!1);H("s",["ss",2],0,"second"),ne("second","s"),Le("second",15),rr("s",Q),rr("ss",Q,_e),nt(["s","ss"],Wn);var lh=Or("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return this.millisecond()*10}),H(0,["SSSSS",5],0,function(){return this.millisecond()*100}),H(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),H(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),H(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),H(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ne("millisecond","ms"),Le("millisecond",16),rr("S",er,ke),rr("SS",er,_e),rr("SSS",er,Pe);var na,bl;for(na="SSSS";na.length<=9;na+="S")rr(na,_t);function ch(g,N){N[Mi]=Xe(("0."+g)*1e3)}for(na="S";na.length<=9;na+="S")nt(na,ch);bl=Or("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");function Sa(){return this._isUTC?"UTC":""}function ph(){return this._isUTC?"Coordinated Universal Time":""}var Ye=E.prototype;Ye.add=eo,Ye.calendar=Wm,Ye.clone=Vm,Ye.diff=cl,Ye.endOf=$m,Ye.format=Ss,Ye.from=Ym,Ye.fromNow=Hm,Ye.to=Gm,Ye.toNow=Ns,Ye.get=we,Ye.invalidAt=Zm,Ye.isAfter=bs,Ye.isBefore=ta,Ye.isBetween=ws,Ye.isSame=fl,Ye.isSameOrAfter=Ds,Ye.isSameOrBefore=ll,Ye.isValid=Cs,Ye.lang=As,Ye.locale=ko,Ye.localeData=ml,Ye.max=Cm,Ye.min=nl,Ye.parsingFlags=no,Ye.set=Oe,Ye.startOf=vl,Ye.subtract=xs,Ye.toArray=to,Ye.toObject=qo,Ye.toDate=Qu,Ye.toISOString=Po,Ye.inspect=Da,typeof Symbol<"u"&&Symbol.for!=null&&(Ye[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Ye.toJSON=Uo,Ye.toString=pl,Ye.unix=Lo,Ye.valueOf=Zu,Ye.creationData=Qm,Ye.eraName=Ms,Ye.eraNarrow=zo,Ye.eraAbbr=gl,Ye.eraYear=Z,Ye.year=Ou,Ye.isLeapYear=am,Ye.weekYear=th,Ye.isoWeekYear=nh,Ye.quarter=Ye.quarters=uh,Ye.month=_i,Ye.daysInMonth=ps,Ye.week=Ye.weeks=om,Ye.isoWeek=Ye.isoWeeks=Uf,Ye.weeksInYear=Bi,Ye.weeksInWeekYear=oh,Ye.isoWeeksInYear=ih,Ye.isoWeeksInISOWeekYear=ah,Ye.date=yl,Ye.day=Ye.days=dm,Ye.weekday=vm,Ye.isoWeekday=gm,Ye.dayOfYear=Ii,Ye.hour=Ye.hours=Wt,Ye.minute=Ye.minutes=fh,Ye.second=Ye.seconds=lh,Ye.millisecond=Ye.milliseconds=bl,Ye.utcOffset=Pm,Ye.utc=Rm,Ye.local=Lm,Ye.parseZone=qm,Ye.hasAlignedHourOffset=ra,Ye.isDST=he,Ye.isLocal=Ne,Ye.isUtcOffset=nr,Ye.isUtc=Nr,Ye.isUTC=Nr,Ye.zoneAbbr=Sa,Ye.zoneName=ph,Ye.dates=F("dates accessor is deprecated. Use date instead.",yl),Ye.months=F("months accessor is deprecated. Use month instead",_i),Ye.years=F("years accessor is deprecated. Use year instead",Ou),Ye.zone=F("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",km),Ye.isDSTShifted=F("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Fe);function Hn(g){return ht(g*1e3)}function mh(){return ht.apply(null,arguments).parseZone()}function wl(g){return g}var Qr=$.prototype;Qr.calendar=R,Qr.longDateFormat=xe,Qr.invalidDate=De,Qr.ordinal=Ze,Qr.preparse=wl,Qr.postformat=wl,Qr.relativeTime=te,Qr.pastFuture=ye,Qr.set=L,Qr.eras=Xm,Qr.erasParse=Jm,Qr.erasConvertYear=Km,Qr.erasAbbrRegex=_s,Qr.erasNameRegex=io,Qr.erasNarrowRegex=_n,Qr.months=xa,Qr.monthsShort=Kr,Qr.monthsParse=_u,Qr.monthsRegex=im,Qr.monthsShortRegex=Tu,Qr.week=Bu,Qr.firstDayOfYear=qf,Qr.firstDayOfWeek=Lf,Qr.weekdays=cm,Qr.weekdaysMin=Iu,Qr.weekdaysShort=pm,Qr.weekdaysParse=hm,Qr.weekdaysRegex=dt,Qr.weekdaysShortRegex=mt,Qr.weekdaysMinRegex=xm,Qr.isPM=$f,Qr.meridiem=Ru;function Fs(g,N,P,z){var G=Tt(),se=h().set(z,N);return G[P](se,g)}function Dl(g,N,P){if(f(g)&&(N=g,g=void 0),g=g||"",N!=null)return Fs(g,N,P,"month");var z,G=[];for(z=0;z<12;z++)G[z]=Fs(g,z,P,"month");return G}function Os(g,N,P,z){typeof g=="boolean"?(f(N)&&(P=N,N=void 0),N=N||""):(N=g,P=N,g=!1,f(N)&&(P=N,N=void 0),N=N||"");var G=Tt(),se=g?G._week.dow:0,Te,mr=[];if(P!=null)return Fs(N,(P+se)%7,z,"day");for(Te=0;Te<7;Te++)mr[Te]=Fs(N,(Te+se)%7,z,"day");return mr}function Sl(g,N){return Dl(g,N,"months")}function hh(g,N){return Dl(g,N,"monthsShort")}function dh(g,N,P){return Os(g,N,P,"weekdays")}function Xu(g,N,P){return Os(g,N,P,"weekdaysShort")}function Wo(g,N,P){return Os(g,N,P,"weekdaysMin")}Ti("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\\d{1,2}(th|st|nd|rd)/,ordinal:function(g){var N=g%10,P=Xe(g%100/10)===1?"th":N===1?"st":N===2?"nd":N===3?"rd":"th";return g+P}}),r.lang=F("moment.lang is deprecated. Use moment.locale instead.",Ti),r.langData=F("moment.langData is deprecated. Use moment.localeData instead.",Tt);var Tn=Math.abs;function vh(){var g=this._data;return this._milliseconds=Tn(this._milliseconds),this._days=Tn(this._days),this._months=Tn(this._months),g.milliseconds=Tn(g.milliseconds),g.seconds=Tn(g.seconds),g.minutes=Tn(g.minutes),g.hours=Tn(g.hours),g.months=Tn(g.months),g.years=Tn(g.years),this}function Ju(g,N,P,z){var G=kr(N,P);return g._milliseconds+=z*G._milliseconds,g._days+=z*G._days,g._months+=z*G._months,g._bubble()}function gh(g,N){return Ju(this,g,N,1)}function Pi(g,N){return Ju(this,g,N,-1)}function Bs(g){return g<0?Math.floor(g):Math.ceil(g)}function Na(){var g=this._milliseconds,N=this._days,P=this._months,z=this._data,G,se,Te,mr,Tr;return g>=0&&N>=0&&P>=0||g<=0&&N<=0&&P<=0||(g+=Bs(Ku(P)+N)*864e5,N=0,P=0),z.milliseconds=g%1e3,G=ir(g/1e3),z.seconds=G%60,se=ir(G/60),z.minutes=se%60,Te=ir(se/60),z.hours=Te%24,N+=ir(Te/24),Tr=ir(yn(N)),P+=Tr,N-=Bs(Ku(Tr)),mr=ir(P/12),P%=12,z.days=N,z.months=P,z.years=mr,this}function yn(g){return g*4800/146097}function Ku(g){return g*146097/4800}function Nl(g){if(!this.isValid())return NaN;var N,P,z=this._milliseconds;if(g=ue(g),g==="month"||g==="quarter"||g==="year")switch(N=this._days+z/864e5,P=this._months+yn(N),g){case"month":return P;case"quarter":return P/3;case"year":return P/12}else switch(N=this._days+Math.round(Ku(this._months)),g){case"week":return N/7+z/6048e5;case"day":return N+z/864e5;case"hour":return N*24+z/36e5;case"minute":return N*1440+z/6e4;case"second":return N*86400+z/1e3;case"millisecond":return Math.floor(N*864e5)+z;default:throw new Error("Unknown unit "+g)}}function Al(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Xe(this._months/12)*31536e6:NaN}function bn(g){return function(){return this.as(g)}}var ia=bn("ms"),El=bn("s"),xh=bn("m"),Is=bn("h"),yh=bn("d"),Cl=bn("w"),Ht=bn("M"),ju=bn("Q"),Ml=bn("y");function ii(){return kr(this)}function ef(g){return g=ue(g),this.isValid()?this[g+"s"]():NaN}function ai(g){return function(){return this.isValid()?this._data[g]:NaN}}var Aa=ai("milliseconds"),_l=ai("seconds"),on=ai("minutes"),rf=ai("hours"),bh=ai("days"),wh=ai("months"),Dh=ai("years");function tf(){return ir(this.days()/7)}var ki=Math.round,oi={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Tl(g,N,P,z,G){return G.relativeTime(N||1,!!P,g,z)}function Sh(g,N,P,z){var G=kr(g).abs(),se=ki(G.as("s")),Te=ki(G.as("m")),mr=ki(G.as("h")),Tr=ki(G.as("d")),et=ki(G.as("M")),sn=ki(G.as("w")),si=ki(G.as("y")),Ri=se<=P.ss&&["s",se]||se0,Ri[4]=z,Tl.apply(null,Ri)}function Nh(g){return g===void 0?ki:typeof g=="function"?(ki=g,!0):!1}function Vo(g,N){return oi[g]===void 0?!1:N===void 0?oi[g]:(oi[g]=N,g==="s"&&(oi.ss=N-1),!0)}function Ah(g,N){if(!this.isValid())return this.localeData().invalidDate();var P=!1,z=oi,G,se;return typeof g=="object"&&(N=g,g=!1),typeof g=="boolean"&&(P=g),typeof N=="object"&&(z=Object.assign({},oi,N),N.s!=null&&N.ss==null&&(z.ss=N.s-1)),G=this.localeData(),se=Sh(this,!P,z,G),P&&(se=G.pastFuture(+this,se)),G.postformat(se)}var nf=Math.abs;function aa(g){return(g>0)-(g<0)||+g}function Yo(){if(!this.isValid())return this.localeData().invalidDate();var g=nf(this._milliseconds)/1e3,N=nf(this._days),P=nf(this._months),z,G,se,Te,mr=this.asSeconds(),Tr,et,sn,si;return mr?(z=ir(g/60),G=ir(z/60),g%=60,z%=60,se=ir(P/12),P%=12,Te=g?g.toFixed(3).replace(/\\.?0+$/,""):"",Tr=mr<0?"-":"",et=aa(this._months)!==aa(mr)?"-":"",sn=aa(this._days)!==aa(mr)?"-":"",si=aa(this._milliseconds)!==aa(mr)?"-":"",Tr+"P"+(se?et+se+"Y":"")+(P?et+P+"M":"")+(N?sn+N+"D":"")+(G||z||g?"T":"")+(G?si+G+"H":"")+(z?si+z+"M":"")+(g?si+Te+"S":"")):"P0D"}var Wr=Oo.prototype;Wr.isValid=Om,Wr.abs=vh,Wr.add=gh,Wr.subtract=Pi,Wr.as=Nl,Wr.asMilliseconds=ia,Wr.asSeconds=El,Wr.asMinutes=xh,Wr.asHours=Is,Wr.asDays=yh,Wr.asWeeks=Cl,Wr.asMonths=Ht,Wr.asQuarters=ju,Wr.asYears=Ml,Wr.valueOf=Al,Wr._bubble=Na,Wr.clone=ii,Wr.get=ef,Wr.milliseconds=Aa,Wr.seconds=_l,Wr.minutes=on,Wr.hours=rf,Wr.days=bh,Wr.weeks=tf,Wr.months=wh,Wr.years=Dh,Wr.humanize=Ah,Wr.toISOString=Yo,Wr.toString=Yo,Wr.toJSON=Yo,Wr.locale=ko,Wr.localeData=ml,Wr.toIsoString=F("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Yo),Wr.lang=As,H("X",0,0,"unix"),H("x",0,0,"valueOf"),rr("x",Yt),rr("X",Du),nt("X",function(g,N,P){P._d=new Date(parseFloat(g)*1e3)}),nt("x",function(g,N,P){P._d=new Date(Xe(g))});return r.version="2.29.4",t(ht),r.fn=Ye,r.min=Mm,r.max=_m,r.now=Tm,r.utc=h,r.unix=Hn,r.months=Sl,r.isDate=o,r.locale=Ti,r.invalid=w,r.duration=kr,r.isMoment=S,r.weekdays=dh,r.parseZone=mh,r.localeData=Tt,r.isDuration=Yn,r.monthsShort=hh,r.weekdaysMin=Wo,r.defineLocale=an,r.updateLocale=wm,r.locales=Dm,r.weekdaysShort=Xu,r.normalizeUnits=ue,r.relativeTimeRounding=Nh,r.relativeTimeThreshold=Vo,r.calendarFormat=zm,r.prototype=Ye,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r})});var gc=un((Rd,Ld)=>{(function(e,r){typeof Rd=="object"&&typeof Ld<"u"?Ld.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e["'typed'"]=r())})(Rd,function(){"use strict";function e(){return!0}function r(){return!1}function t(){}let n="Argument is not a typed-function.";function i(){function s(re){return typeof re=="object"&&re!==null&&re.constructor===Object}let l=[{name:"number",test:function(re){return typeof re=="number"}},{name:"string",test:function(re){return typeof re=="string"}},{name:"boolean",test:function(re){return typeof re=="boolean"}},{name:"Function",test:function(re){return typeof re=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(re){return re instanceof Date}},{name:"RegExp",test:function(re){return re instanceof RegExp}},{name:"Object",test:s},{name:"null",test:function(re){return re===null}},{name:"undefined",test:function(re){return re===void 0}}],f={name:"any",test:e,isAny:!0},o,u,p=0,h={createCount:0};function d(re){let le=o.get(re);if(le)return le;let we='Unknown type "'+re+'"',Oe=re.toLowerCase(),ke;for(ke of u)if(ke.toLowerCase()===Oe){we+='. Did you mean "'+ke+'" ?';break}throw new TypeError(we)}function x(re){let le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",we=le?d(le).index:u.length,Oe=[];for(let _e=0;_e{let Oe=o.get(we);return!Oe.isAny&&Oe.test(re)});return le.length?le:["any"]}function C(re){return re&&typeof re=="function"&&"_typedFunctionData"in re}function b(re,le,we){if(!C(re))throw new TypeError(n);let Oe=we&&we.exact,ke=Array.isArray(le)?le.join(","):le,_e=_(ke),Pe=S(_e);if(!Oe||Pe in re.signatures){let ve=re._typedFunctionData.signatureMap.get(Pe);if(ve)return ve}let We=_e.length,B;if(Oe){B=[];let ve;for(ve in re.signatures)B.push(re._typedFunctionData.signatureMap.get(ve))}else B=re._typedFunctionData.signatures;for(let ve=0;ve!_t.has(Yt.name)))continue}er.push(fr)}}if(B=er,B.length===0)break}let Q;for(Q of B)if(Q.params.length<=We)return Q;throw new TypeError("Signature not found (signature: "+(re.name||"unnamed")+"("+S(_e,", ")+"))")}function A(re,le,we){return b(re,le,we).implementation}function E(re,le){let we=d(le);if(we.test(re))return re;let Oe=we.conversionsTo;if(Oe.length===0)throw new Error("There are no conversions to "+le+" defined.");for(let ke=0;ke1&&arguments[1]!==void 0?arguments[1]:",";return re.map(we=>we.name).join(le)}function O(re){let le=re.indexOf("...")===0,Oe=(le?re.length>3?re.slice(3):"any":re).split("|").map(We=>d(We.trim())),ke=!1,_e=le?"...":"";return{types:Oe.map(function(We){return ke=We.isAny||ke,_e+=We.name+"|",{name:We.name,typeIndex:We.index,test:We.test,isAny:We.isAny,conversion:null,conversionIndex:-1}}),name:_e.slice(0,-1),hasAny:ke,hasConversion:!1,restParam:le}}function F(re){let le=re.types.map(Pe=>Pe.name),we=H(le),Oe=re.hasAny,ke=re.name,_e=we.map(function(Pe){let We=d(Pe.from);return Oe=We.isAny||Oe,ke+="|"+Pe.from,{name:Pe.from,typeIndex:We.index,test:We.test,isAny:We.isAny,conversion:Pe,conversionIndex:Pe.index}});return{types:re.types.concat(_e),name:ke,hasAny:Oe,hasConversion:_e.length>0,restParam:re.restParam}}function M(re){return re.typeSet||(re.typeSet=new Set,re.types.forEach(le=>re.typeSet.add(le.name))),re.typeSet}function _(re){let le=[];if(typeof re!="string")throw new TypeError("Signatures must be strings");let we=re.trim();if(we==="")return le;let Oe=we.split(",");for(let ke=0;ke=ke+1}}else return re.length===0?function(_e){return _e.length===0}:re.length===1?(we=L(re[0]),function(_e){return we(_e[0])&&_e.length===1}):re.length===2?(we=L(re[0]),Oe=L(re[1]),function(_e){return we(_e[0])&&Oe(_e[1])&&_e.length===2}):(le=re.map(L),function(_e){for(let Pe=0;Pe{let ke=V(Oe.params,le),_e;for(_e of ke)we.add(_e)}),we.has("any")?["any"]:Array.from(we)}function j(re,le,we){let Oe,ke,_e=re||"unnamed",Pe=we,We;for(We=0;We{let fr=$(er.params,We),Zr=L(fr);(We0){let er=w(le[We]);return Oe=new TypeError("Unexpected type of argument in function "+_e+" (expected: "+ke.join(" or ")+", actual: "+er.join(" | ")+", index: "+We+")"),Oe.data={category:"wrongType",fn:_e,index:We,actual:er,expected:ke},Oe}}else Pe=Be}let B=Pe.map(function(Be){return k(Be.params)?1/0:Be.params.length});if(le.lengthQ)return Oe=new TypeError("Too many arguments in function "+_e+" (expected: "+Q+", actual: "+le.length+")"),Oe.data={category:"tooManyArgs",fn:_e,index:le.length,expectedLength:Q},Oe;let ve=[];for(let Be=0;Be0)return 1;let Oe=oe(re)-oe(le);return Oe<0?-1:Oe>0?1:0}function ie(re,le){let we=re.params,Oe=le.params,ke=K(we),_e=K(Oe),Pe=k(we),We=k(Oe);if(Pe&&ke.hasAny){if(!We||!_e.hasAny)return 1}else if(We&&_e.hasAny)return-1;let B=0,Q=0,ve;for(ve of we)ve.hasAny&&++B,ve.hasConversion&&++Q;let Be=0,er=0;for(ve of Oe)ve.hasAny&&++Be,ve.hasConversion&&++er;if(B!==Be)return B-Be;if(Pe&&ke.hasConversion){if(!We||!_e.hasConversion)return 1}else if(We&&_e.hasConversion)return-1;if(Q!==er)return Q-er;if(Pe){if(!We)return 1}else if(We)return-1;let fr=(we.length-Oe.length)*(Pe?-1:1);if(fr!==0)return fr;let Zr=[],_t=0;for(let Qi=0;Qi1&&le.sort((ke,_e)=>ke.index-_e.index);let we=le[0].conversionsTo;if(re.length===1)return we;we=we.concat([]);let Oe=new Set(re);for(let ke=1;keke.hasConversion)){let ke=k(re),_e=re.map(Me);we=function(){let We=[],B=ke?arguments.length-1:arguments.length;for(let Q=0;QB.name).join("|"),hasAny:We.some(B=>B.isAny),hasConversion:!1,restParam:!0}),Pe.push(_e)}else Pe=_e.types.map(function(We){return{types:[We],name:We.name,hasAny:We.isAny,hasConversion:We.conversion,restParam:!1}});return ee(Pe,function(We){return le(we,Oe+1,ke.concat([We]))})}else return[ke]}return le(re,0,[])}function ge(re,le){let we=Math.max(re.length,le.length);for(let We=0;We=Oe:Pe?Oe>=ke:Oe===ke}function Se(re){return re.map(le=>Le(le)?Ee(le.referToSelf.callback):Ce(le)?ue(le.referTo.references,le.referTo.callback):le)}function xe(re,le,we){let Oe=[],ke;for(ke of re){let _e=we[ke];if(typeof _e!="number")throw new TypeError('No definition for referenced signature "'+ke+'"');if(_e=le[_e],typeof _e!="function")return!1;Oe.push(_e)}return Oe}function be(re,le,we){let Oe=Se(re),ke=new Array(Oe.length).fill(!1),_e=!0;for(;_e;){_e=!1;let Pe=!0;for(let We=0;We{let Oe=re[we];if(le.test(Oe.toString()))throw new SyntaxError("Using \`this\` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function Ae(re,le){if(h.createCount++,Object.keys(le).length===0)throw new SyntaxError("No signatures provided");h.warnAgainstDeprecatedThis&&De(le);let we=[],Oe=[],ke={},_e=[],Pe;for(Pe in le){if(!Object.prototype.hasOwnProperty.call(le,Pe))continue;let Kr=_(Pe);if(!Kr)continue;we.forEach(function(_i){if(ge(_i,Kr))throw new TypeError('Conflicting signatures "'+S(_i)+'" and "'+S(Kr)+'".')}),we.push(Kr);let jt=Oe.length;Oe.push(le[Pe]);let _u=Kr.map(F),Xi;for(Xi of pe(_u)){let _i=S(Xi);_e.push({params:Xi,name:_i,fn:jt}),Xi.every(ps=>!ps.hasConversion)&&(ke[_i]=jt)}}_e.sort(ie);let We=be(Oe,ke,xa),B;for(B in ke)Object.prototype.hasOwnProperty.call(ke,B)&&(ke[B]=We[ke[B]]);let Q=[],ve=new Map;for(B of _e)ve.has(B.name)||(B.fn=We[B.fn],Q.push(B),ve.set(B.name,B));let Be=Q[0]&&Q[0].params.length<=2&&!k(Q[0].params),er=Q[1]&&Q[1].params.length<=2&&!k(Q[1].params),fr=Q[2]&&Q[2].params.length<=2&&!k(Q[2].params),Zr=Q[3]&&Q[3].params.length<=2&&!k(Q[3].params),_t=Q[4]&&Q[4].params.length<=2&&!k(Q[4].params),Yt=Q[5]&&Q[5].params.length<=2&&!k(Q[5].params),Qi=Be&&er&&fr&&Zr&&_t&&Yt;for(let Kr=0;KrKr.test),ls=Q.map(Kr=>Kr.implementation),cs=function(){for(let jt=Mu;jtS(_(we))),le=K(arguments);if(typeof le!="function")throw new TypeError("Callback function expected as last argument");return ue(re,le)}function ue(re,le){return{referTo:{references:re,callback:le}}}function Ee(re){if(typeof re!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:re}}}function Ce(re){return re&&typeof re.referTo=="object"&&Array.isArray(re.referTo.references)&&typeof re.referTo.callback=="function"}function Le(re){return re&&typeof re.referToSelf=="object"&&typeof re.referToSelf.callback=="function"}function Ie(re,le){if(!re)return le;if(le&&le!==re){let we=new Error("Function names do not match (expected: "+re+", actual: "+le+")");throw we.data={actual:le,expected:re},we}return re}function sr(re){let le;for(let we in re)Object.prototype.hasOwnProperty.call(re,we)&&(C(re[we])||typeof re[we].signature=="string")&&(le=Ie(le,re[we].name));return le}function ir(re,le){let we;for(we in le)if(Object.prototype.hasOwnProperty.call(le,we)){if(we in re&&le[we]!==re[we]){let Oe=new Error('Signature "'+we+'" is defined twice');throw Oe.data={signature:we,sourceFunction:le[we],destFunction:re[we]},Oe}re[we]=le[we]}}let Xe=h;h=function(re){let le=typeof re=="string",we=le?1:0,Oe=le?re:"",ke={};for(let _e=we;_eke.from===re.from);if(!we)throw new Error("Attempt to remove nonexistent conversion from "+re.from+" to "+re.to);if(we.convert!==re.convert)throw new Error("Conversion to remove does not match existing conversion");let Oe=le.conversionsTo.indexOf(we);le.conversionsTo.splice(Oe,1)},h.resolve=function(re,le){if(!C(re))throw new TypeError(n);let we=re._typedFunctionData.signatures;for(let Oe=0;Oe{(function(e){"use strict";var r=Math.cosh||function(o){return Math.abs(o)<1e-9?1-o:(Math.exp(o)+Math.exp(-o))*.5},t=Math.sinh||function(o){return Math.abs(o)<1e-9?o:(Math.exp(o)-Math.exp(-o))*.5},n=function(o){var u=Math.PI/4;if(-u>o||o>u)return Math.cos(o)-1;var p=o*o;return p*(p*(p*(p*(p*(p*(p*(p/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},i=function(o,u){var p=Math.abs(o),h=Math.abs(u);return p<3e3&&h<3e3?Math.sqrt(p*p+h*h):(p0&&a();break;case"number":p.im=0,p.re=o;break;default:a()}return isNaN(p.re)||isNaN(p.im),p};function f(o,u){if(!(this instanceof f))return new f(o,u);var p=l(o,u);this.re=p.re,this.im=p.im}f.prototype={re:0,im:0,sign:function(){var o=this.abs();return new f(this.re/o,this.im/o)},add:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:new f(this.re+p.re,this.im+p.im)},sub:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:new f(this.re-p.re,this.im-p.im)},mul:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isZero()||this.isZero()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:p.im===0&&this.im===0?new f(this.re*p.re,0):new f(this.re*p.re-this.im*p.im,this.re*p.im+this.im*p.re)},div:function(o,u){var p=new f(o,u);if(this.isZero()&&p.isZero()||this.isInfinite()&&p.isInfinite())return f.NAN;if(this.isInfinite()||p.isZero())return f.INFINITY;if(this.isZero()||p.isInfinite())return f.ZERO;o=this.re,u=this.im;var h=p.re,d=p.im,x,v;return d===0?new f(o/h,u/h):Math.abs(h)0)return new f(Math.pow(o,p.re),0);if(o===0)switch((p.re%4+4)%4){case 0:return new f(Math.pow(u,p.re),0);case 1:return new f(0,Math.pow(u,p.re));case 2:return new f(-Math.pow(u,p.re),0);case 3:return new f(0,-Math.pow(u,p.re))}}if(o===0&&u===0&&p.re>0&&p.im>=0)return f.ZERO;var h=Math.atan2(u,o),d=s(o,u);return o=Math.exp(p.re*d-p.im*h),u=p.im*d+p.re*h,new f(o*Math.cos(u),o*Math.sin(u))},sqrt:function(){var o=this.re,u=this.im,p=this.abs(),h,d;if(o>=0){if(u===0)return new f(Math.sqrt(o),0);h=.5*Math.sqrt(2*(p+o))}else h=Math.abs(u)/Math.sqrt(2*(p-o));return o<=0?d=.5*Math.sqrt(2*(p-o)):d=Math.abs(u)/Math.sqrt(2*(p+o)),new f(h,u<0?-d:d)},exp:function(){var o=Math.exp(this.re);return this.im,new f(o*Math.cos(this.im),o*Math.sin(this.im))},expm1:function(){var o=this.re,u=this.im;return new f(Math.expm1(o)*Math.cos(u)+n(u),Math.exp(o)*Math.sin(u))},log:function(){var o=this.re,u=this.im;return u===0&&o>0,new f(s(o,u),Math.atan2(u,o))},abs:function(){return i(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var o=this.re,u=this.im;return new f(Math.sin(o)*r(u),Math.cos(o)*t(u))},cos:function(){var o=this.re,u=this.im;return new f(Math.cos(o)*r(u),-Math.sin(o)*t(u))},tan:function(){var o=2*this.re,u=2*this.im,p=Math.cos(o)+r(u);return new f(Math.sin(o)/p,t(u)/p)},cot:function(){var o=2*this.re,u=2*this.im,p=Math.cos(o)-r(u);return new f(-Math.sin(o)/p,t(u)/p)},sec:function(){var o=this.re,u=this.im,p=.5*r(2*u)+.5*Math.cos(2*o);return new f(Math.cos(o)*r(u)/p,Math.sin(o)*t(u)/p)},csc:function(){var o=this.re,u=this.im,p=.5*r(2*u)-.5*Math.cos(2*o);return new f(Math.sin(o)*r(u)/p,-Math.cos(o)*t(u)/p)},asin:function(){var o=this.re,u=this.im,p=new f(u*u-o*o+1,-2*o*u).sqrt(),h=new f(p.re-u,p.im+o).log();return new f(h.im,-h.re)},acos:function(){var o=this.re,u=this.im,p=new f(u*u-o*o+1,-2*o*u).sqrt(),h=new f(p.re-u,p.im+o).log();return new f(Math.PI/2-h.im,h.re)},atan:function(){var o=this.re,u=this.im;if(o===0){if(u===1)return new f(0,1/0);if(u===-1)return new f(0,-1/0)}var p=o*o+(1-u)*(1-u),h=new f((1-u*u-o*o)/p,-2*o/p).log();return new f(-.5*h.im,.5*h.re)},acot:function(){var o=this.re,u=this.im;if(u===0)return new f(Math.atan2(1,o),0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).atan():new f(o!==0?o/0:0,u!==0?-u/0:0).atan()},asec:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(0,1/0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).acos():new f(o!==0?o/0:0,u!==0?-u/0:0).acos()},acsc:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(Math.PI/2,1/0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).asin():new f(o!==0?o/0:0,u!==0?-u/0:0).asin()},sinh:function(){var o=this.re,u=this.im;return new f(t(o)*Math.cos(u),r(o)*Math.sin(u))},cosh:function(){var o=this.re,u=this.im;return new f(r(o)*Math.cos(u),t(o)*Math.sin(u))},tanh:function(){var o=2*this.re,u=2*this.im,p=r(o)+Math.cos(u);return new f(t(o)/p,Math.sin(u)/p)},coth:function(){var o=2*this.re,u=2*this.im,p=r(o)-Math.cos(u);return new f(t(o)/p,-Math.sin(u)/p)},csch:function(){var o=this.re,u=this.im,p=Math.cos(2*u)-r(2*o);return new f(-2*t(o)*Math.cos(u)/p,2*r(o)*Math.sin(u)/p)},sech:function(){var o=this.re,u=this.im,p=Math.cos(2*u)+r(2*o);return new f(2*r(o)*Math.cos(u)/p,-2*t(o)*Math.sin(u)/p)},asinh:function(){var o=this.im;this.im=-this.re,this.re=o;var u=this.asin();return this.re=-this.im,this.im=o,o=u.re,u.re=-u.im,u.im=o,u},acosh:function(){var o=this.acos();if(o.im<=0){var u=o.re;o.re=-o.im,o.im=u}else{var u=o.im;o.im=-o.re,o.re=u}return o},atanh:function(){var o=this.re,u=this.im,p=o>1&&u===0,h=1-o,d=1+o,x=h*h+u*u,v=x!==0?new f((d*h-u*u)/x,(u*h+d*u)/x):new f(o!==-1?o/0:0,u!==0?u/0:0),y=v.re;return v.re=s(v.re,v.im)/2,v.im=Math.atan2(v.im,y)/2,p&&(v.im=-v.im),v},acoth:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(0,Math.PI/2);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).atanh():new f(o!==0?o/0:0,u!==0?-u/0:0).atanh()},acsch:function(){var o=this.re,u=this.im;if(u===0)return new f(o!==0?Math.log(o+Math.sqrt(o*o+1)):1/0,0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).asinh():new f(o!==0?o/0:0,u!==0?-u/0:0).asinh()},asech:function(){var o=this.re,u=this.im;if(this.isZero())return f.INFINITY;var p=o*o+u*u;return p!==0?new f(o/p,-u/p).acosh():new f(o!==0?o/0:0,u!==0?-u/0:0).acosh()},inverse:function(){if(this.isZero())return f.INFINITY;if(this.isInfinite())return f.ZERO;var o=this.re,u=this.im,p=o*o+u*u;return new f(o/p,-u/p)},conjugate:function(){return new f(this.re,-this.im)},neg:function(){return new f(-this.re,-this.im)},ceil:function(o){return o=Math.pow(10,o||0),new f(Math.ceil(this.re*o)/o,Math.ceil(this.im*o)/o)},floor:function(o){return o=Math.pow(10,o||0),new f(Math.floor(this.re*o)/o,Math.floor(this.im*o)/o)},round:function(o){return o=Math.pow(10,o||0),new f(Math.round(this.re*o)/o,Math.round(this.im*o)/o)},equals:function(o,u){var p=new f(o,u);return Math.abs(p.re-this.re)<=f.EPSILON&&Math.abs(p.im-this.im)<=f.EPSILON},clone:function(){return new f(this.re,this.im)},toString:function(){var o=this.re,u=this.im,p="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(o){(function(e){"use strict";var r=2e3,t={s:1,n:0,d:1};function n(v,y){if(isNaN(v=parseInt(v,10)))throw d();return v*y}function i(v,y){if(y===0)throw h();var w=Object.create(p.prototype);w.s=v<0?-1:1,v=v<0?-v:v;var C=u(v,y);return w.n=v/C,w.d=y/C,w}function a(v){for(var y={},w=v,C=2,b=4;b<=w;){for(;w%C===0;)w/=C,y[C]=(y[C]||0)+1;b+=1+2*C++}return w!==v?w>1&&(y[w]=(y[w]||0)+1):y[v]=(y[v]||0)+1,y}var s=function(v,y){var w=0,C=1,b=1,A=0,E=0,S=0,O=1,F=1,M=0,_=1,k=1,L=1,Y=1e7,$;if(v!=null)if(y!==void 0){if(w=v,C=y,b=w*C,w%1!==0||C%1!==0)throw x()}else switch(typeof v){case"object":{if("d"in v&&"n"in v)w=v.n,C=v.d,"s"in v&&(w*=v.s);else if(0 in v)w=v[0],1 in v&&(C=v[1]);else throw d();b=w*C;break}case"number":{if(v<0&&(b=v,v=-v),v%1===0)w=v;else if(v>0){for(v>=1&&(F=Math.pow(10,Math.floor(1+Math.log(v)/Math.LN10)),v/=F);_<=Y&&L<=Y;)if($=(M+k)/(_+L),v===$){_+L<=Y?(w=M+k,C=_+L):L>_?(w=k,C=L):(w=M,C=_);break}else v>$?(M+=k,_+=L):(k+=M,L+=_),_>Y?(w=k,C=L):(w=M,C=_);w*=F}else(isNaN(v)||isNaN(y))&&(C=w=NaN);break}case"string":{if(_=v.match(/\\d+|./g),_===null)throw d();if(_[M]==="-"?(b=-1,M++):_[M]==="+"&&M++,_.length===M+1?E=n(_[M++],b):_[M+1]==="."||_[M]==="."?(_[M]!=="."&&(A=n(_[M++],b)),M++,(M+1===_.length||_[M+1]==="("&&_[M+3]===")"||_[M+1]==="'"&&_[M+3]==="'")&&(E=n(_[M],b),O=Math.pow(10,_[M].length),M++),(_[M]==="("&&_[M+2]===")"||_[M]==="'"&&_[M+2]==="'")&&(S=n(_[M+1],b),F=Math.pow(10,_[M+1].length)-1,M+=3)):_[M+1]==="/"||_[M+1]===":"?(E=n(_[M],b),O=n(_[M+2],1),M+=3):_[M+3]==="/"&&_[M+1]===" "&&(A=n(_[M],b),E=n(_[M+2],b),O=n(_[M+4],1),M+=5),_.length<=M){C=O*F,b=w=S+C*A+F*E;break}}default:throw d()}if(C===0)throw h();t.s=b<0?-1:1,t.n=Math.abs(w),t.d=Math.abs(C)};function l(v,y,w){for(var C=1;y>0;v=v*v%w,y>>=1)y&1&&(C=C*v%w);return C}function f(v,y){for(;y%2===0;y/=2);for(;y%5===0;y/=5);if(y===1)return 0;for(var w=10%y,C=1;w!==1;C++)if(w=w*10%y,C>r)return 0;return C}function o(v,y,w){for(var C=1,b=l(10,w,y),A=0;A<300;A++){if(C===b)return A;C=C*10%y,b=b*10%y}return 0}function u(v,y){if(!v)return y;if(!y)return v;for(;;){if(v%=y,!v)return y;if(y%=v,!y)return v}}function p(v,y){if(s(v,y),this instanceof p)v=u(t.d,t.n),this.s=t.s,this.n=t.n/v,this.d=t.d/v;else return i(t.s*t.n,t.d)}var h=function(){return new Error("Division by Zero")},d=function(){return new Error("Invalid argument")},x=function(){return new Error("Parameters must be integer")};p.prototype={s:1,n:0,d:1,abs:function(){return i(this.n,this.d)},neg:function(){return i(-this.s*this.n,this.d)},add:function(v,y){return s(v,y),i(this.s*this.n*t.d+t.s*this.d*t.n,this.d*t.d)},sub:function(v,y){return s(v,y),i(this.s*this.n*t.d-t.s*this.d*t.n,this.d*t.d)},mul:function(v,y){return s(v,y),i(this.s*t.s*this.n*t.n,this.d*t.d)},div:function(v,y){return s(v,y),i(this.s*t.s*this.n*t.d,this.d*t.n)},clone:function(){return i(this.s*this.n,this.d)},mod:function(v,y){if(isNaN(this.n)||isNaN(this.d))return new p(NaN);if(v===void 0)return i(this.s*this.n%this.d,1);if(s(v,y),t.n===0&&this.d===0)throw h();return i(this.s*(t.d*this.n)%(t.n*this.d),t.d*this.d)},gcd:function(v,y){return s(v,y),i(u(t.n,this.n)*u(t.d,this.d),t.d*this.d)},lcm:function(v,y){return s(v,y),t.n===0&&this.n===0?i(0,1):i(t.n*this.n,u(t.n,this.n)*u(t.d,this.d))},ceil:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.ceil(v*this.s*this.n/this.d),v)},floor:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.floor(v*this.s*this.n/this.d),v)},round:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.round(v*this.s*this.n/this.d),v)},inverse:function(){return i(this.s*this.d,this.n)},pow:function(v,y){if(s(v,y),t.d===1)return t.s<0?i(Math.pow(this.s*this.d,t.n),Math.pow(this.n,t.n)):i(Math.pow(this.s*this.n,t.n),Math.pow(this.d,t.n));if(this.s<0)return null;var w=a(this.n),C=a(this.d),b=1,A=1;for(var E in w)if(E!=="1"){if(E==="0"){b=0;break}if(w[E]*=t.n,w[E]%t.d===0)w[E]/=t.d;else return null;b*=Math.pow(E,w[E])}for(var E in C)if(E!=="1"){if(C[E]*=t.n,C[E]%t.d===0)C[E]/=t.d;else return null;A*=Math.pow(E,C[E])}return t.s<0?i(A,b):i(b,A)},equals:function(v,y){return s(v,y),this.s*this.n*t.d===t.s*t.n*this.d},compare:function(v,y){s(v,y);var w=this.s*this.n*t.d-t.s*t.n*this.d;return(0=0;A--)b=b.inverse().add(w[A]);if(Math.abs(b.sub(y).valueOf())0&&(w+=y,w+=" ",C%=b),w+=C,w+="/",w+=b),w},toLatex:function(v){var y,w="",C=this.n,b=this.d;return this.s<0&&(w+="-"),b===1?w+=C:(v&&(y=Math.floor(C/b))>0&&(w+=y,C%=b),w+="\\\\frac{",w+=C,w+="}{",w+=b,w+="}"),w},toContinued:function(){var v,y=this.n,w=this.d,C=[];if(isNaN(y)||isNaN(w))return C;do C.push(Math.floor(y/w)),v=y%w,y=w,w=v;while(y!==1);return C},toString:function(v){var y=this.n,w=this.d;if(isNaN(y)||isNaN(w))return"NaN";v=v||15;var C=f(y,w),b=o(y,w,C),A=this.s<0?"-":"";if(A+=y/w|0,y%=w,y*=10,y&&(A+="."),C){for(var E=b;E--;)A+=y/w|0,y%=w,y*=10;A+="(";for(var E=C;E--;)A+=y/w|0,y%=w,y*=10;A+=")"}else for(var E=v;y&&E--;)A+=y/w|0,y%=w,y*=10;return A}},typeof sv=="object"?(Object.defineProperty(p,"__esModule",{value:!0}),p.default=p,p.Fraction=p,e1.exports=p):e.Fraction=p})(sv)});var gS=un((Voe,vS)=>{vS.exports=function e(r,t){"use strict";var n=/(^([+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)?$|^0x[0-9a-f]+$|\\d+)/gi,i=/(^[ ]*|[ ]*$)/g,a=/(^([\\w ]+,?[\\w ]+)?[\\w ]+,?[\\w ]+\\d+:\\d+(:\\d+)?[\\w ]?|^\\d{1,4}[\\/\\-]\\d{1,4}[\\/\\-]\\d{1,4}|^\\w+, \\w+ \\d+, \\d{4})/,s=/^0x[0-9a-f]+$/i,l=/^0/,f=function(b){return e.insensitive&&(""+b).toLowerCase()||""+b},o=f(r).replace(i,"")||"",u=f(t).replace(i,"")||"",p=o.replace(n,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0"),h=u.replace(n,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0"),d=parseInt(o.match(s),16)||p.length!==1&&o.match(a)&&Date.parse(o),x=parseInt(u.match(s),16)||d&&u.match(a)&&Date.parse(u)||null,v,y;if(x){if(dx)return 1}for(var w=0,C=Math.max(p.length,h.length);wy)return 1}return 0}});var B2=un((ope,O2)=>{"use strict";var pg=Object.assign||function(e){for(var r=1;r1&&arguments[1]!==void 0?arguments[1]:{},t=r.preserveFormatting,n=t===void 0?!1:t,i=r.escapeMapFn,a=i===void 0?nz:i,s=String(e),l="",f=a(pg({},rz),n?pg({},tz):{}),o=Object.keys(f),u=function(){var h=!1;o.forEach(function(d,x){h||s.length>=d.length&&s.slice(0,d.length)===d&&(l+=f[o[x]],s=s.slice(d.length,s.length),h=!0)}),h||(l+=s.slice(0,1),s=s.slice(1,s.length))};s;)u();return l}});var tF=un((rF,bg)=>{(function(e,r,t){function n(l){var f=this,o=s();f.next=function(){var u=2091639*f.s0+f.c*23283064365386963e-26;return f.s0=f.s1,f.s1=f.s2,f.s2=u-(f.c=u|0)},f.c=1,f.s0=o(" "),f.s1=o(" "),f.s2=o(" "),f.s0-=o(l),f.s0<0&&(f.s0+=1),f.s1-=o(l),f.s1<0&&(f.s1+=1),f.s2-=o(l),f.s2<0&&(f.s2+=1),o=null}function i(l,f){return f.c=l.c,f.s0=l.s0,f.s1=l.s1,f.s2=l.s2,f}function a(l,f){var o=new n(l),u=f&&f.state,p=o.next;return p.int32=function(){return o.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,u&&(typeof u=="object"&&i(u,o),p.state=function(){return i(o,{})}),p}function s(){var l=4022871197,f=function(o){o=String(o);for(var u=0;u>>0,p-=l,p*=l,l=p>>>0,p-=l,l+=p*4294967296}return(l>>>0)*23283064365386963e-26};return f}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.alea=a})(rF,typeof bg=="object"&&bg,typeof define=="function"&&define)});var iF=un((nF,wg)=>{(function(e,r,t){function n(s){var l=this,f="";l.x=0,l.y=0,l.z=0,l.w=0,l.next=function(){var u=l.x^l.x<<11;return l.x=l.y,l.y=l.z,l.z=l.w,l.w^=l.w>>>19^u^u>>>8},s===(s|0)?l.x=s:f+=s;for(var o=0;o>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xor128=a})(nF,typeof wg=="object"&&wg,typeof define=="function"&&define)});var oF=un((aF,Dg)=>{(function(e,r,t){function n(s){var l=this,f="";l.next=function(){var u=l.x^l.x>>>2;return l.x=l.y,l.y=l.z,l.z=l.w,l.w=l.v,(l.d=l.d+362437|0)+(l.v=l.v^l.v<<4^(u^u<<1))|0},l.x=0,l.y=0,l.z=0,l.w=0,l.v=0,s===(s|0)?l.x=s:f+=s;for(var o=0;o>>4),l.next()}function i(s,l){return l.x=s.x,l.y=s.y,l.z=s.z,l.w=s.w,l.v=s.v,l.d=s.d,l}function a(s,l){var f=new n(s),o=l&&l.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xorwow=a})(aF,typeof Dg=="object"&&Dg,typeof define=="function"&&define)});var uF=un((sF,Sg)=>{(function(e,r,t){function n(s){var l=this;l.next=function(){var o=l.x,u=l.i,p,h,d;return p=o[u],p^=p>>>7,h=p^p<<24,p=o[u+1&7],h^=p^p>>>10,p=o[u+3&7],h^=p^p>>>3,p=o[u+4&7],h^=p^p<<7,p=o[u+7&7],p=p^p<<13,h^=p^p<<9,o[u]=h,l.i=u+1&7,h};function f(o,u){var p,h,d=[];if(u===(u|0))h=d[0]=u;else for(u=""+u,p=0;p0;--p)o.next()}f(l,s)}function i(s,l){return l.x=s.x.slice(),l.i=s.i,l}function a(s,l){s==null&&(s=+new Date);var f=new n(s),o=l&&l.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(o.x&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xorshift7=a})(sF,typeof Sg=="object"&&Sg,typeof define=="function"&&define)});var lF=un((fF,Ng)=>{(function(e,r,t){function n(s){var l=this;l.next=function(){var o=l.w,u=l.X,p=l.i,h,d;return l.w=o=o+1640531527|0,d=u[p+34&127],h=u[p=p+1&127],d^=d<<13,h^=h<<17,d^=d>>>15,h^=h>>>12,d=u[p]=d^h,l.i=p,d+(o^o>>>16)|0};function f(o,u){var p,h,d,x,v,y=[],w=128;for(u===(u|0)?(h=u,u=null):(u=u+"\\0",h=0,w=Math.max(w,u.length)),d=0,x=-32;x>>15,h^=h<<4,h^=h>>>13,x>=0&&(v=v+1640531527|0,p=y[x&127]^=h+v,d=p==0?d+1:0);for(d>=128&&(y[(u&&u.length||0)&127]=-1),d=127,x=4*128;x>0;--x)h=y[d+34&127],p=y[d=d+1&127],h^=h<<13,p^=p<<17,h^=h>>>15,p^=p>>>12,y[d]=h^p;o.w=v,o.X=y,o.i=d}f(l,s)}function i(s,l){return l.i=s.i,l.w=s.w,l.X=s.X.slice(),l}function a(s,l){s==null&&(s=+new Date);var f=new n(s),o=l&&l.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(o.X&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xor4096=a})(fF,typeof Ng=="object"&&Ng,typeof define=="function"&&define)});var pF=un((cF,Ag)=>{(function(e,r,t){function n(s){var l=this,f="";l.next=function(){var u=l.b,p=l.c,h=l.d,d=l.a;return u=u<<25^u>>>7^p,p=p-h|0,h=h<<24^h>>>8^d,d=d-u|0,l.b=u=u<<20^u>>>12^p,l.c=p=p-h|0,l.d=h<<16^p>>>16^d,l.a=d-u|0},l.a=0,l.b=0,l.c=-1640531527,l.d=1367130551,s===Math.floor(s)?(l.a=s/4294967296|0,l.b=s|0):f+=s;for(var o=0;o>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,h=(f.next()>>>0)/4294967296,d=(p+h)/(1<<21);while(d===0);return d},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.tychei=a})(cF,typeof Ag=="object"&&Ag,typeof define=="function"&&define)});var mF=un(()=>{});var dF=un((hF,Vp)=>{(function(e,r,t){var n=256,i=6,a=52,s="random",l=t.pow(n,i),f=t.pow(2,a),o=f*2,u=n-1,p;function h(b,A,E){var S=[];A=A==!0?{entropy:!0}:A||{};var O=y(v(A.entropy?[b,C(r)]:b??w(),3),S),F=new d(S),M=function(){for(var _=F.g(i),k=l,L=0;_=o;)_/=2,k/=2,L>>>=1;return(_+L)/k};return M.int32=function(){return F.g(4)|0},M.quick=function(){return F.g(4)/4294967296},M.double=M,y(C(F.S),r),(A.pass||E||function(_,k,L,Y){return Y&&(Y.S&&x(Y,F),_.state=function(){return x(F,{})}),L?(t[s]=_,k):_})(M,O,"global"in A?A.global:this==t,A.state)}function d(b){var A,E=b.length,S=this,O=0,F=S.i=S.j=0,M=S.S=[];for(E||(b=[E++]);O{var bW=tF(),wW=iF(),DW=oF(),SW=uF(),NW=lF(),AW=pF(),ss=dF();ss.alea=bW;ss.xor128=wW;ss.xorwow=DW;ss.xorshift7=SW;ss.xor4096=NW;ss.tychei=AW;vF.exports=ss});var HO=un((L3e,Og)=>{function Fg(){}Fg.prototype={on:function(e,r,t){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:r,ctx:t}),this},once:function(e,r,t){var n=this;function i(){n.off(e,i),r.apply(t,arguments)}return i._=r,this.on(e,i,t)},emit:function(e){var r=[].slice.call(arguments,1),t=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=t.length;for(n;n[...new Set(e)];var fo="File";function fd(e){return Array.isArray(e)?e:typeof e=="string"?[e]:[]}function xx(e){return e?typeof e!="string"?e.toString():e:""}var yx=(e,r)=>r.indexOf(e)>0?r.indexOf(e):r.length;function pi(e){return pi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},pi(e)}function Pn(e){if(e===null||e===!0||e===!1)return NaN;var r=Number(e);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}function ot(e,r){if(r.length1?"s":"")+" required, but only "+r.length+" present")}function Lt(e){ot(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||pi(e)==="object"&&r==="[object Date]"?new Date(e.getTime()):typeof e=="number"||r==="[object Number]"?new Date(e):((typeof e=="string"||r==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use \`parseISO\` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function ld(e,r){ot(2,arguments);var t=Lt(e).getTime(),n=Pn(r);return new Date(t+n)}var l8={};function lo(){return l8}function cd(e){var r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),e.getTime()-r.getTime()}function pd(e){return ot(1,arguments),e instanceof Date||pi(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function md(e){if(ot(1,arguments),!pd(e)&&typeof e!="number")return!1;var r=Lt(e);return!isNaN(Number(r))}function hd(e,r){ot(2,arguments);var t=Pn(r);return ld(e,-t)}var c8=864e5;function dd(e){ot(1,arguments);var r=Lt(e),t=r.getTime();r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0);var n=r.getTime(),i=t-n;return Math.floor(i/c8)+1}function co(e){ot(1,arguments);var r=1,t=Lt(e),n=t.getUTCDay(),i=(n=i.getTime()?t+1:r.getTime()>=s.getTime()?t:t-1}function vd(e){ot(1,arguments);var r=cf(e),t=new Date(0);t.setUTCFullYear(r,0,4),t.setUTCHours(0,0,0,0);var n=co(t);return n}var p8=6048e5;function gd(e){ot(1,arguments);var r=Lt(e),t=co(r).getTime()-vd(r).getTime();return Math.round(t/p8)+1}function po(e,r){var t,n,i,a,s,l,f,o;ot(1,arguments);var u=lo(),p=Pn((t=(n=(i=(a=r?.weekStartsOn)!==null&&a!==void 0?a:r==null||(s=r.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&n!==void 0?n:(f=u.locale)===null||f===void 0||(o=f.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&t!==void 0?t:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=Lt(e),d=h.getUTCDay(),x=(d=1&&d<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(p+1,0,d),x.setUTCHours(0,0,0,0);var v=po(x,r),y=new Date(0);y.setUTCFullYear(p,0,d),y.setUTCHours(0,0,0,0);var w=po(y,r);return u.getTime()>=v.getTime()?p+1:u.getTime()>=w.getTime()?p:p-1}function xd(e,r){var t,n,i,a,s,l,f,o;ot(1,arguments);var u=lo(),p=Pn((t=(n=(i=(a=r?.firstWeekContainsDate)!==null&&a!==void 0?a:r==null||(s=r.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&n!==void 0?n:(f=u.locale)===null||f===void 0||(o=f.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&t!==void 0?t:1),h=pf(e,r),d=new Date(0);d.setUTCFullYear(h,0,p),d.setUTCHours(0,0,0,0);var x=po(d,r);return x}var m8=6048e5;function yd(e,r){ot(1,arguments);var t=Lt(e),n=po(t,r).getTime()-xd(t,r).getTime();return Math.round(n/m8)+1}function it(e,r){for(var t=e<0?"-":"",n=Math.abs(e).toString();n.length0?n:1-n;return it(t==="yy"?i%100:i,t.length)},M:function(r,t){var n=r.getUTCMonth();return t==="M"?String(n+1):it(n+1,2)},d:function(r,t){return it(r.getUTCDate(),t.length)},a:function(r,t){var n=r.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(r,t){return it(r.getUTCHours()%12||12,t.length)},H:function(r,t){return it(r.getUTCHours(),t.length)},m:function(r,t){return it(r.getUTCMinutes(),t.length)},s:function(r,t){return it(r.getUTCSeconds(),t.length)},S:function(r,t){var n=t.length,i=r.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return it(a,t.length)}},Oa=h8;var zs={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},d8={G:function(r,t,n){var i=r.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(r,t,n){if(t==="yo"){var i=r.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return Oa.y(r,t)},Y:function(r,t,n,i){var a=pf(r,i),s=a>0?a:1-a;if(t==="YY"){var l=s%100;return it(l,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):it(s,t.length)},R:function(r,t){var n=cf(r);return it(n,t.length)},u:function(r,t){var n=r.getUTCFullYear();return it(n,t.length)},Q:function(r,t,n){var i=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return it(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(r,t,n){var i=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return it(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(r,t,n){var i=r.getUTCMonth();switch(t){case"M":case"MM":return Oa.M(r,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(r,t,n){var i=r.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return it(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(r,t,n,i){var a=yd(r,i);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):it(a,t.length)},I:function(r,t,n){var i=gd(r);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):it(i,t.length)},d:function(r,t,n){return t==="do"?n.ordinalNumber(r.getUTCDate(),{unit:"date"}):Oa.d(r,t)},D:function(r,t,n){var i=dd(r);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):it(i,t.length)},E:function(r,t,n){var i=r.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(r,t,n,i){var a=r.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return it(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(r,t,n,i){var a=r.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return it(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(r,t,n){var i=r.getUTCDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return it(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(r,t,n){var i=r.getUTCHours(),a=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(r,t,n){var i=r.getUTCHours(),a;switch(i===12?a=zs.noon:i===0?a=zs.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(r,t,n){var i=r.getUTCHours(),a;switch(i>=17?a=zs.evening:i>=12?a=zs.afternoon:i>=4?a=zs.morning:a=zs.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(r,t,n){if(t==="ho"){var i=r.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Oa.h(r,t)},H:function(r,t,n){return t==="Ho"?n.ordinalNumber(r.getUTCHours(),{unit:"hour"}):Oa.H(r,t)},K:function(r,t,n){var i=r.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):it(i,t.length)},k:function(r,t,n){var i=r.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):it(i,t.length)},m:function(r,t,n){return t==="mo"?n.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):Oa.m(r,t)},s:function(r,t,n){return t==="so"?n.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):Oa.s(r,t)},S:function(r,t){return Oa.S(r,t)},X:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return wx(s);case"XXXX":case"XX":return Zo(s);case"XXXXX":case"XXX":default:return Zo(s,":")}},x:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"x":return wx(s);case"xxxx":case"xx":return Zo(s);case"xxxxx":case"xxx":default:return Zo(s,":")}},O:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+bx(s,":");case"OOOO":default:return"GMT"+Zo(s,":")}},z:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+bx(s,":");case"zzzz":default:return"GMT"+Zo(s,":")}},t:function(r,t,n,i){var a=i._originalDate||r,s=Math.floor(a.getTime()/1e3);return it(s,t.length)},T:function(r,t,n,i){var a=i._originalDate||r,s=a.getTime();return it(s,t.length)}};function bx(e,r){var t=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return t+String(i);var s=r||"";return t+String(i)+s+it(a,2)}function wx(e,r){if(e%60===0){var t=e>0?"-":"+";return t+it(Math.abs(e)/60,2)}return Zo(e,r)}function Zo(e,r){var t=r||"",n=e>0?"-":"+",i=Math.abs(e),a=it(Math.floor(i/60),2),s=it(i%60,2);return n+a+t+s}var Dx=d8;var Sx=function(r,t){switch(r){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Nx=function(r,t){switch(r){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},v8=function(r,t){var n=r.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return Sx(r,t);var s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Sx(i,t)).replace("{{time}}",Nx(a,t))},g8={p:Nx,P:v8},Ax=g8;var x8=["D","DD"],y8=["YY","YYYY"];function Ex(e){return x8.indexOf(e)!==-1}function Cx(e){return y8.indexOf(e)!==-1}function bd(e,r,t){if(e==="YYYY")throw new RangeError("Use \`yyyy\` instead of \`YYYY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use \`yy\` instead of \`YY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use \`d\` instead of \`D\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use \`dd\` instead of \`DD\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var b8={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},w8=function(r,t,n){var i,a=b8[r];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},Mx=w8;function mf(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.width?String(r.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var D8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},S8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},N8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},A8={date:mf({formats:D8,defaultWidth:"full"}),time:mf({formats:S8,defaultWidth:"full"}),dateTime:mf({formats:N8,defaultWidth:"full"})},_x=A8;var E8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},C8=function(r,t,n,i){return E8[r]},Tx=C8;function Qo(e){return function(r,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,s=t!=null&&t.width?String(t.width):a;i=e.formattingValues[s]||e.formattingValues[a]}else{var l=e.defaultWidth,f=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[f]||e.values[l]}var o=e.argumentCallback?e.argumentCallback(r):r;return i[o]}}var M8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},T8={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},F8={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},O8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},B8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},I8=function(r,t){var n=Number(r),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},P8={ordinalNumber:I8,era:Qo({values:M8,defaultWidth:"wide"}),quarter:Qo({values:_8,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:Qo({values:T8,defaultWidth:"wide"}),day:Qo({values:F8,defaultWidth:"wide"}),dayPeriod:Qo({values:O8,defaultWidth:"wide",formattingValues:B8,defaultFormattingWidth:"wide"})},Fx=P8;function Xo(e){return function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=r.match(i);if(!a)return null;var s=a[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],f=Array.isArray(l)?R8(l,function(p){return p.test(s)}):k8(l,function(p){return p.test(s)}),o;o=e.valueCallback?e.valueCallback(f):f,o=t.valueCallback?t.valueCallback(o):o;var u=r.slice(s.length);return{value:o,rest:u}}}function k8(e,r){for(var t in e)if(e.hasOwnProperty(t)&&r(e[t]))return t}function R8(e,r){for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:{},n=r.match(e.matchPattern);if(!n)return null;var i=n[0],a=r.match(e.parsePattern);if(!a)return null;var s=e.valueCallback?e.valueCallback(a[0]):a[0];s=t.valueCallback?t.valueCallback(s):s;var l=r.slice(i.length);return{value:s,rest:l}}}var L8=/^(\\d+)(th|st|nd|rd)?/i,q8=/\\d+/i,U8={narrow:/^(b|a)/i,abbreviated:/^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},z8={any:[/^b/i,/^(a|c)/i]},W8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},V8={any:[/1/i,/2/i,/3/i,/4/i]},Y8={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},H8={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},G8={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},$8={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Z8={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Q8={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},X8={ordinalNumber:wd({matchPattern:L8,parsePattern:q8,valueCallback:function(r){return parseInt(r,10)}}),era:Xo({matchPatterns:U8,defaultMatchWidth:"wide",parsePatterns:z8,defaultParseWidth:"any"}),quarter:Xo({matchPatterns:W8,defaultMatchWidth:"wide",parsePatterns:V8,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:Xo({matchPatterns:Y8,defaultMatchWidth:"wide",parsePatterns:H8,defaultParseWidth:"any"}),day:Xo({matchPatterns:G8,defaultMatchWidth:"wide",parsePatterns:$8,defaultParseWidth:"any"}),dayPeriod:Xo({matchPatterns:Z8,defaultMatchWidth:"any",parsePatterns:Q8,defaultParseWidth:"any"})},Ox=X8;var J8={code:"en-US",formatDistance:Mx,formatLong:_x,formatRelative:Tx,localize:Fx,match:Ox,options:{weekStartsOn:0,firstWeekContainsDate:1}},Bx=J8;var Ix=Bx;var K8=/[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g,j8=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ek=/^'([^]*?)'?$/,rk=/''/g,tk=/[a-zA-Z]/;function Ba(e,r,t){var n,i,a,s,l,f,o,u,p,h,d,x,v,y,w,C,b,A;ot(2,arguments);var E=String(r),S=lo(),O=(n=(i=t?.locale)!==null&&i!==void 0?i:S.locale)!==null&&n!==void 0?n:Ix,F=Pn((a=(s=(l=(f=t?.firstWeekContainsDate)!==null&&f!==void 0?f:t==null||(o=t.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&l!==void 0?l:S.firstWeekContainsDate)!==null&&s!==void 0?s:(p=S.locale)===null||p===void 0||(h=p.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(F>=1&&F<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=Pn((d=(x=(v=(y=t?.weekStartsOn)!==null&&y!==void 0?y:t==null||(w=t.locale)===null||w===void 0||(C=w.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&v!==void 0?v:S.weekStartsOn)!==null&&x!==void 0?x:(b=S.locale)===null||b===void 0||(A=b.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&d!==void 0?d:0);if(!(M>=0&&M<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!O.localize)throw new RangeError("locale must contain localize property");if(!O.formatLong)throw new RangeError("locale must contain formatLong property");var _=Lt(e);if(!md(_))throw new RangeError("Invalid time value");var k=cd(_),L=hd(_,k),Y={firstWeekContainsDate:F,weekStartsOn:M,locale:O,_originalDate:_},$=E.match(j8).map(function(V){var q=V[0];if(q==="p"||q==="P"){var R=Ax[q];return R(V,O.formatLong)}return V}).join("").match(K8).map(function(V){if(V==="''")return"'";var q=V[0];if(q==="'")return nk(V);var R=Dx[q];if(R)return!(t!=null&&t.useAdditionalWeekYearTokens)&&Cx(V)&&bd(V,r,String(e)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&Ex(V)&&bd(V,r,String(e)),R(L,V,O.localize,Y);if(q.match(tk))throw new RangeError("Format string contains an unescaped latin alphabet character \`"+q+"\`");return V}).join("");return $}function nk(e){var r=e.match(ek);return r?r[1].replace(rk,"'"):e}function Dd(e,r){if(pi(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Sd(e){var r=Dd(e,"string");return pi(r)=="symbol"?r:r+""}function Ur(e,r,t){return r=Sd(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var Nd=(e,r)=>{if(e instanceof Date)return"date";if(typeof e=="string"){if(/\\/\\/(\\S+?(?:jpe?g|png|gif|svg))/gi.test(e)||e.includes("unsplash"))return"image";if(/^\\d{4}-\\d{2}-\\d{2}$/.test(e))return"date";if(r=="tag"||r=="tags")return"tag";if(/\\[\\[.*?\\]\\]/.test(e))return"link"}else{if(typeof e=="number")return"number";if(typeof e=="boolean")return"boolean";if(e)if(Array.isArray(e)||typeof e=="string"&&e.indexOf(",")>-1){let t=Array.isArray(e)?e:[];if(typeof e=="string"&&e.indexOf(",")>-1&&(t=Ui(e)),r=="tag"||r=="tags")return"tag-multi";if(t.length==1&&Array.isArray(t[0])&&t[0].length==1&&typeof t[0][0]=="string")return"link";let n=Ql(t.map(i=>Nd(i,r)));return n.length==1&&n[0]=="link"?"link-multi":n.some(i=>i=="object")?"object-multi":"option-multi"}else{if(e.isLuxonDateTime)return"date";if(e.isLuxonDuration)return"duration";if(e.type=="file")return"link";if(typeof e=="object"&&!Array.isArray(e)&&e!==null)return"object"}else return"unknown"}return"text"};var Px=e=>e.map(r=>r.replace(",","\\\\,")).join(", "),Jo=e=>e.map(r=>r.replace(",","\\\\,")).join(", ");var Ui=e=>(e?.replace("\\\\,",",").match(/(\\\\.|[^,])+/g)??[]).map(r=>r.trim()),Kl=(e,r)=>{switch(Nd(r,e)){case"object":return JSON.stringify(r);case"number":return r.toString();case"boolean":return r?"true":"false";case"date":{if(r instanceof Date){let n=Ba(new Date(r),"yyyy-MM-dd");if(typeof n=="string")return n}return typeof r!="string"?"":r}break;case"duration":return Px(Object.keys(r.values).reduce((n,i)=>[...n,...r.values[i]>0?[r.values[i]+" "+i]:[]],[]));case"option-multi":case"link-multi":return typeof r=="string"?Jl(r):Jo(r.map(n=>n?typeof n=="string"?Jl(n):n.path?n.path:Array.isArray(r)&&n.length==1&&Array.isArray(n[0])&&n[0].length==1&&typeof n[0][0]=="string"?n[0][0]:JSON.stringify(n):""));case"link":return Array.isArray(r)&&r.length==1&&Array.isArray(r[0])&&r[0].length==1&&typeof r[0][0]=="string"?r[0][0]:typeof r=="string"?Jl(r):r.path;case"text":case"tag":case"image":return r}return""},Xl=e=>{let r;try{r=JSON.parse(e)}catch{}return r};var Jl=e=>{if(!e)return"";let r=/\\[\\[(.*?)\\]\\]/g.exec(e),t=r?.length>1?r[1].substring(0,yx("|",r[1])):e;return t||e};var jl=(e,r)=>e==r,Ad=(e,r)=>(e??"").length==0,Ed=(e,r)=>(e??"").toLowerCase().includes((r??"").toLowerCase()),Cd=(e,r)=>parseFloat(e)>parseFloat(r),Md=(e,r)=>parseInt(e)>parseInt(r),kx=(e,r)=>{let t=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),n=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return t.valueOf()>n.valueOf()},Rx=(e,r)=>{let t=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),n=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return t.valueOf(){let t=e?Ui(e):[];return(r?Ui(r):[]).some(i=>t.some(a=>a==i))},Lx=(e,r)=>{if(!e)return!1;let t=new Date(\`\${e.toString().replace(".",":")}\`),n=new Date(\`\${r}\`);return t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()},qx=e=>{if(!e)return!1;let r=new Date(\`\${e.toString()}T00:00\`),t=new Date;return r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()};var hf={isNotEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>!Ad(e,""),valueType:"none"},isEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>Ad(e,""),valueType:"none"},include:{fn:(e,r)=>Ed(e,r),type:["text","file","link","link-multi","fileprop","image"],valueType:"text"},notInclude:{type:["text","file","link","link-multi","fileprop","image"],fn:(e,r)=>!Ed(e,r),valueType:"text"},is:{type:["text","file","link","context","fileprop"],fn:(e,r)=>jl(e,r),valueType:"text"},isNot:{type:["text","file","link","context","fileprop"],fn:(e,r)=>!jl(e,r),valueType:"text"},equal:{type:["number"],fn:(e,r)=>jl(e,r),valueType:"number"},isGreatThan:{type:["number"],fn:(e,r)=>Cd(e,r),valueType:"number"},isLessThan:{type:["number"],fn:(e,r)=>Md(e,r),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(e,r)=>!Cd(e,r),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(e,r)=>!Md(e,r),valueType:"number"},dateBefore:{type:["date","fileprop"],fn:(e,r)=>Rx(e,r),valueType:"date"},dateAfter:{type:["date","fileprop"],fn:(e,r)=>kx(e,r),valueType:"date"},isSameDate:{type:["date"],fn:(e,r)=>Lx(e,r),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(e,r)=>qx(e,r),valueType:"none"},isAnyInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(e,r)=>_d(e,r),valueType:"list"},isNoneInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(e,r)=>!_d(e,r),valueType:"list"},isTrue:{type:["boolean"],fn:(e,r)=>e=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(e,r)=>e!="true",valueType:"none"}};var ik=(e,r)=>r.reduce((n,i)=>{let[a,s]=n,l=i.type=="path"?zx(s,i):i.type=="frontmatter"?Ux(s,i):Wx(s,i),f=s.filter(o=>!l.includes(o));return[[...a,...l],f]},[[],e])[0],ak=(e,r)=>r.reduce((t,n)=>n.type=="path"?zx(t,n):n.type=="frontmatter"?Ux(t,n):Wx(t,n),e),Ux=(e,r)=>e.filter(t=>{let n=t.metadata?.property;if(!n||!n[r.field])return!1;let i=hf[r.fn],a=!0;return i&&(a=i.fn(Kl(r.field,n[r.field]),r.value)),a}),zx=(e,r)=>e.filter(t=>{let n="";r.field=="outlinks"?n=Jo(t.outlinks??[]):r.field=="inlinks"?n=Jo(t.inlinks??[]):r.field=="tags"&&(n=Jo(t.tags??[]));let i=hf[r.fn],a=!0;return i&&(a=i.fn(n,r.value)),a}),Wx=(e,r)=>e.filter(t=>{let n=hf[r.fn],i=!0;return n&&(i=n.fn(t.metadata?.[r.type]?.[r.field],r.value)),i}),Td=(e,r)=>e.reduce((n,i)=>!n||i.filters.length==0?!1:i.type=="any"?ik([r],i.filters).length>0:ak([r],i.filters).length>0,!0);var Yx=ci(Vx()),Od=class{constructor(){this.lang="en";this.all={en:{hintText:{dragDropModifierKeys:"Hold \${1} to Pin and \${2} to Copy",createListItem:"Select/Create List Item Frame",dragDropProperties:"Drag and drop properties to link them into the list",newItem:"+ New",selectNote:"Select Note...",newFrame:"New"},defaults:{spaceNote:"Current Note",spaceContext:"Current Space"},commands:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",columns:"Columns",button:"Button",label:"Label",column:"Column",idea:"New",group:"Group",paragraph:"Text",card:"Card",progress:"Progress",rating:"Rating",circularProgress:"Circular Progress",list:"Bullet List","ordered-list":"Numbered List",todo:"To-do List",quote:"Quote",divider:"Divider",note:"Link to Note",link:"Link",callout:"Callout",bookmark:"Bookmark",table:"Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",flow:"Linked Note",newNote:"New Note",tag:"Tag",makeMenu:"Flow Menu",selectStyle:"Style",toggleKeyboard:"Toggle Keyboard",rows:"Rows",masonry:"Gallery"},styles:{bold:"Bold",italics:"Italics",strikethrough:"Strikethrough",code:"Code",link:"Web Link",blocklink:"Link to Note",textColor:"Text Color",highlight:"Highlight"},commandsSuggest:{noResult:"No result"},commandPalette:{enable:"Enable",disabled:"Disable",openFlow:"Open Flow Blocks in Selection",closeFlow:"Close Flow Blocks in Selection",toggleBold:"Toggle Bold",toggleItalics:"Toggle Italics",openSpaces:"Open Spaces",migrateData:"Migrate Spaces From 0.7",blink:"Blink",openFileContext:"Open Explorer",convertPathToSpace:"Convert to Space",revealFile:"Reveal File in Spaces",releaseNotes:"Release Notes",toggleBacklinks:"Toggle Backlinks",collapseAllFolders:"Collapse All Folders",addFileSpace:"Add File to Space",removeFileSpace:"Remove File from Space"},frames:{sections:{kit:"Kit",paths:"Paths"},label:{label:"Label",description:"Label"},note:{label:"Note",description:"Link to a note"},table:{label:"Table",description:"Table"},context:{label:"Context",description:"Display a context view from another space"},calendar:{label:"Calendar View"},field:{label:"Field",description:"Dynamic node that displays a value based on property type"},event:{label:"Event"},divider:{label:"Divider",description:"Divider to separate your content"},button:{label:"Button",description:"Buttons can perform actions and open links"},callout:{label:"Callout",description:"Callout to highlight important information"},toggle:{label:"Toggle",description:"Toggle to show/hide content"}},menu:{newView:"New View",customView:"Custom View",detailsView:"Details View",catalogView:"Catalog View",galleryView:"Gallery View",deleteContext:"Delete Context",openSpace:"Open Space",revealInDefault:"Reveal in Finder",setNone:"None",fileMetadataDescription:"This note only",openFilePane:"Open in a new pane",rename:"Rename",changeToFolderNote:"New Space from Note",moveFile:"Move file to...",moveFolder:"Move folder to...",duplicate:"Make a copy",edit:"Edit",delete:"Delete",getHelp:"Make.md Community",vault:"Vault",openVault:"Open Another Vault",openVaultInFolder:"Open Vault Folder",obSettings:"Obsidian Settings",commandPalette:"Command Palette",backToSpace:"Back to Spaces",collapseAllSections:"Collapse All Spaces",expandAllSections:"Expand All Spaces",collapseAllFolders:"Collapse All Folders",expandAllFolders:"Expand All Folders",spaceTitle:"Add/Remove in Space",home:"Home",waypoints:"Waypoints",none:"None",tableView:"Table View",cardView:"Card View",boardView:"Board View",listView:"List View",flowView:"Flow View",groupBy:"Group By",sortBy:"Sort By",newFilter:"New Filter",clearFilters:"Clear Filters",hide:"Hide",unhideFields:"Unhide All Properties",importDataview:"Import All Dataview Properties",saveAllProperties:"Save All Properties to Files",mergeProperties:"Merge Properties",removeFromSpace:"Unpin from Space",removeFromWaypoints:"Unpin from Waypoints",editCode:"Edit Code",deleteProperty:"Delete Property",hideProperty:"Hide Property",unhideProperty:"Unhide Property",saveProperty:"Save Property",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",deleteRow:"Delete Item",collapseAll:"Collapse All",customSort:"Custom Sort",groupSpaces:"Group Spaces",fileNameSortAlphaAsc:"File Name (A to Z)",fileNameSortAlphaDesc:"File Name (Z to A)",createdTimeSortAsc:"Created Time (new to old)",createdTimeSortDesc:"Created Time (old to new)",modifiedTimeSortAsc:"Modified Time (new to old)",modifiedTimeSortDesc:"Modified Time (old to new)",sizeSortAsc:"Size (smallest to largest)",sizeSortDesc:"Size (largest to smallest)",spaces:"Spaces",tags:"Tags",manageHiddenFiles:"Manage Hidden Files",manageActions:"Manage Actions",deleteSpace:"Delete",changeColor:"Change Color",changePropertyType:"Change Type",deleteFiles:"Delete Files",createFolderSpace:"Create Space from Folder",folder:"Folder",syncToContext:"Add Property to Context",setIcon:"Set Icon",copyEmbedLink:"Copy Embed Link",moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",groupNodes:"Group Nodes",moveFrame:"Move Frame",renameFrame:"Rename Frame",deleteFrame:"Delete Frame"},editor:{rows:"Rows",columns:"Columns",catalog:"Catalog",gallery:"Gallery",grid:"Grid",scaleToFit:"Change to Fit",scaleToFill:"Change to Fill",fit:"Fit",strokeNone:"None",strokeSolid:"Solid",strokeDotted:"Dotted",strokeDashed:"Dashed",size:"Size",gap:"Gap",marginLeft:"Left",marginTop:"Top",marginRight:"Right",marginBottom:"Bottom",minimize:"Minimize",paddingLeft:"Left",paddingTop:"Top",paddingRight:"Right",paddingBottom:"Bottom",unlinkProperty:"Unlink Property",linkedProperty:"Linked Property",linkProperty:"Link Property",currentSpace:"Current Space",linkName:"\${1} Link",linkThumbnail:"\${1} Thumbnail",linkSticker:"\${1} Sticker",opacity:"Opacity",shadowSpread:"Spread",shadowBlur:"Blur",width:"Width",height:"Height",margin:"Margin",padding:"Padding",bold:"Bold",italic:"Italic",underline:"Underline",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",numberOfLines:"Lines",createVerticalSection:"Create Vertical Section",createHorizontalSection:"Create Horizontal Section",themeColors:"Theme Colors",uiColors:"UI Colors",hex:"Hex"},buttons:{add:"Add",addFilter:"Add Filter",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",changeBanner:"Change Cover",changeBannerShort:"Cover",saveChanges:"Save Changes",removeBanner:"Remove Cover",rename:"Change Name",editFrame:"Edit Frame",saveSpace:"Save Space",createSpace:"New Space",createFolder:"New Folder",createNote:"New Note",createCanvas:"New Canvas",addIntoSpace:"New Pin",addSmartSearch:"Add Smart Search",addItem:"Add Item",addProperty:"Add Property",addContext:"Add Context",cancel:"Cancel",search:"Search",delete:"Delete",toggleFlow:"Toggle Flow",openFlow:"Open Flow",hideFlow:"Hide Flow",openLink:"Open Link",addToSpace:"Add to Space",addToSpaceShort:"Pin",addTag:"Add Tag",tag:"Tag",syncFields:"Sync Properties",convertTable:"Convert to Markdown",cutTable:"Cut Table",deleteTable:"Delete Table",blink:"Blink",addFile:"Add Item",merge:"Merge",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",deleteView:"Delete View",renameTable:"Rename Table",renameTag:"Rename Tag",createTag:"Create Tag",currentFolder:"Current Folder",sync:"Sync",pasteCSS:"Paste CSS",save:"Save",run:"Run"},metadataTypes:{fileName:"File Name",path:"Path",folder:"Folder",sticker:"Sticker",color:"Color",created:"Created",lastModified:"Last Modified",extension:"Extension",size:"Size",tags:"Tags",inlinks:"Linked Mentions",outlinks:"Links",label:"Label",fileMetadata:"File Metadata",frontmatter:"Frontmatter"},filterTypes:{contains:"contains",notContains:"does not contain",is:"is",isNot:"is not",before:"before",after:"after",anyOf:"is any of",noneOf:"is none of",checked:"is checked",unchecked:"is unchecked",isEmpty:"is empty",isNotEmpty:"is not empty",isSameDate:"is same date",isSameDateAsToday:"today"},sortTypes:{alphaAsc:"A to Z",alphaDesc:"Z to A",earliest:"Earliest",latest:"Latest",checkAsc:"Checked \\u2192 Unchecked",checkDesc:"Unchecked \\u2192 Checked",itemsAsc:"Least Items",itemsDesc:"Most Items"},properties:{defaultField:"Name",audio:{label:"Audio",description:"Audio"},text:{label:"Text",description:"Text field"},number:{label:"Number",description:"Number field with optional unit"},boolean:{label:"Yes/No",description:"Yes or No toggle to indicate the status"},date:{label:"Date",description:"Select a date from a calendar"},option:{label:"Option",description:"Select one or multiple option from a list"},file:{label:"File"},link:{label:"Link",description:"Link to another note or a website"},tags:{label:"Tags",description:"Use tags to quickly organize your items"},object:{label:"Object",description:"Store any complex objects"},context:{label:"Relation",description:"Connect to another context property and create a relation"},image:{label:"Image",description:"Select any image from your system or from the internet"},color:{label:"Color",description:"Use colors to label your items or status"},space:{label:"Context",description:"Link to a context"},icon:{label:"Sticker",description:"Use stickers to uniquely label your items or status"},super:{label:"Super Property",links:"Open Link",properties:"Update Property",api:"API",obsidianCommands:"Run Command",runCommand:"Run Command",performAction:"Perform Action",whenClicked:"When Clicked"},fileProperty:{name:"Name",label:"Formula",createdTime:"Created",modifiedTime:"Last Edited",sticker:"Sticker",links:"Links",tags:"Tags",spaces:"Spaces",extension:"Extension",size:"Size",preview:"Note Preview",parentFolder:"Folder",description:"Use a formula to dynamically display a property"}},views:{navigator:"Navigator",explorer:"Explorer",space:"Space"},subViews:{spaceItems:"Items",spaceContext:"Context",spaceLists:"Lists",spaceActions:"Actions",spaceTemplates:"Templates",smartSearch:"Smart Search",filesAndFolders:"Files and Folders"},labels:{properties:"Properties",newAction:"New Action",newTable:"New Table",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSectionSmart:"Edit Smart Space",renameSection:"Edit Space",createSectionSmart:"New Smart Space",createSection:"New Folder",createNote:"New Note",contextMaker:"Context Maker",select:"Select",pinnedItems:"Pinned Items",collapse:"Collapse",expand:"Expand",all:"All",none:"None",view:"View",findStickers:"Find Sticker",mergeProperties:"Merge Properties",placeholder:"Type '\${1}' for commands",itemsSelected:"\${1} Selected",selectNote:"Select Note",selectIcon:"Select Icon",selectImage:"Select Image",selectSpace:"Select Space",styleSmall:"Small",styleMedium:"Medium",styleLarge:"Large",hiddenFilePattern:"Name, Suffixes and Extension",hiddenFileSpecific:"Exclude specific files and folders",textPlaceholder:"Enter Text",noFile:"is not created yet. Click to create.",navigatorSearchPlaceholder:"Search by Text or Filters",blinkPlaceholder:"Quickly Search a File, Folder, Tag... Press Tab to Edit",searchPlaceholder:"Type to search...",contextItemSelectPlaceholder:"Find Item",linkItemSelectPlaceholder:"Find or Create Note",pinNotePlaceholder:"Select a Note or Space to Pin",optionItemSelectPlaceholder:"Select Option",viewItemSelectPlaceholder:"Select View",tagItemSelectPlaceholder:"Find Tag",spaceSelectPlaceholder:"Select any Folder or Tag",propertyItemSelectPlaceholder:"Select Property",sortItemSelectPlaceholder:"Select Sort",filterItemSelectPlaceholder:"Select Filter",imageSelectPlaceholder:"Select an image or paste a URL",imageNotFoundPlaceholder:"No Images Found",syncFrontmatterProperty:"Sync Frontmatter Property",newProperty:"New Property",newPropertyShort:"New Property",propertyType:"Type",propertyDynamic:"Dyanmic",propertyValueSpace:"Space",propertyValueProperty:"Property",propertyLookup:"Edit Formula",dateFormat:"Date Format",propertyFileProp:"Property",multiple:"Multiple",filesCount:"{$1} Files",hiddenFiles:"Hidden Files",addExtension:"Add Rule",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",renameTable:"Rename Table",syncMetadata:"Sync Metadata",syncProperties:"Sync Properties",selectContext:"Select Context",metadata:"Metadata",backlinks:"Backlinks",spaces:"Spaces",context:"Context",content:"Content",deleteSpace:"Delete Space",deleteFiles:"Delete Files",outgoingLinks:"Outgoing Links",moveTo:"Move to",addTo:"Pin to",copyTo:"Copy to",reorderIn:"Reorder in",border:"Border",corners:"Corners",color:"Color",backgroundColor:"Background",cornerRadius:"Radius",onClick:"On Click",layout:"Layout",element:"Element",name:"Name",display:"Display",alignment:"Alignment",margin:"Margin",padding:"Padding",gap:"Gap",width:"Width",height:"Height",opacity:"Opacity",shadow:"Shadow",shadowBlur:"Blur",shadowSpread:"Spread",typography:"Typography",layers:"Layers",fontSize:"Size",props:"Props",styles:"Styles",events:"Events",code:"Code",selectedLayers:"\${1} Layers"},descriptions:{spaceActions:"Create actions that runs when you press a button",spaceLists:"Create lists to track data and organize them in your space",spaceItems:"Add new items to the space or pin items to the space",smartSearch:"Automatically pin notes to this space based on a set of searches",hiddenFileOptions:"Exclude any files and folders by name, suffix or extension.",deleteSpace:"Deleting the space will also delete the folder and its contents.",deleteFiles:"Delete \${1} files/folders and their contents?",addContext:"Contexts lets you connect properties from your tags",spaceProperties:"Define Properties for your Space Items",syncMetadata:"Select which fields from your notes to start syncing with the context.",syncProperties:"Contexts defines and syncs the same fields across your notes depending on their folder or tag.",selectContext:"Select which folder or tag context you want to sync the fields."},flowView:{emptyDoc:"Empty Document",itemsCount:" Items",emptyFolder:"This Folder is Empty"},notice:{duplicateFile:"Folder already contains note with same name",addedToSection:"Added to Space",fileExists:"File Already Exists",folderExists:"Folder Already Exists",noPropertyName:"Property Name is Required",duplicatePropertyName:"Duplicate Property Name",newSpaceName:"Enter a name for your space",duplicateSpaceName:"Space name already exists",cantConvertNoteToSpace:"The view is not a note",templateSaved:"Template saved to space: "},settings:{layoutVertical:"Vertical",layoutHorizontal:"Horizontal",sectionSidebar:"Spaces",sectionEditor:"Maker Mode",sectionFlow:"Flow",sectionAdvanced:"Advanced",sectionDataview:"Dataview",sectionContext:"Context",sectionStickers:"Stickers",sectionNavigator:"Navigator",sectionDefault:"Default Spaces",sectionSpaceView:"Space View",sectionBlink:"Blink",sectionInlineContext:"Inline Context",sectionFlowBlock:"Flow Block",sectionFlowMenu:"Flow Menu",sectionFlowStyler:"Flow Styler",experimental:{name:"Experimental",desc:"Experimental features that are subject to change and may not be optimized for performance"},generateThumbnails:{name:"Generate Thumbnails",desc:"Create thumbnails for images to speed up performance"},minimalThemeFix:{name:"Minimal Theme Fix",description:"Apply fixes for the popular theme Minimal"},inlineStickerMenu:{name:"Inline Stickers",desc:"Add inline stickers by typing :"},openSpacesOnLaunch:{name:"Open Spaces as Default Tab",desc:"Open the Spaces tab when Obsidian launches"},defaultSpaceTemplate:{name:"Default Space Template",desc:"Select the default template for new spaces"},defaultDateFormat:{name:"Default Date Format",desc:"Set the default date format, example: yyyy-MM-dd (see https://date-fns.org/v2.30.0/docs/format)"},newNotePlaceholder:{name:"New Note Placeholder",desc:"Default name for new notes"},folderIndentationLines:{name:"Show Folder Indentation Lines",desc:"Turn on to show a line on the left of folders to indicate indentation"},folderNoteLocation:{name:"Folder Note Location Inside Folder",desc:"Turn on to have folder notes inside the folder, turn off to have it outside"},folderViewDefault:{name:"Show Folder Note by Default",desc:"Show the folder note by default when opening a folder"},internalLinkFlowEditor:{name:"Open Flow Blocks on Internal Link Click",desc:"Turn on to toggle Flow Blocks directly by clicking on internal links, otherwise a tooltip will be shown"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},inlineBacklinks:{name:"Show Inline Backlinks (Inline Context required)",desc:"Show editable backlinks at the bottom of your notes"},dataviewInlineContext:{name:"Show Dataview in Inline Context",desc:"Show dataview when inline context is enabled"},inlineContextExplorer:{name:"Inline Context",desc:"Display the context and a banner at the top of your notes"},inlineContextExpanded:{name:"Auto Expand Inline Context",desc:"Expand the inline context sections when opening a note"},inlineContextHorizontal:{name:"Inline Title and Sticker Layout",desc:"Layout for inline title and sticker in Inline Context"},hideFrontmatter:{name:"Hide Frontmatter Properties",desc:"Hide the frontmatter properties in inline context"},openFileContext:{name:"Auto Open Explorer",desc:"Automatically open explorer panel in the right panel"},folderNote:{name:"Enable Folder Note",desc:"Access the folder note in the folder page and hide the folder note from spaces"},expandFolder:{name:"Auto Expand Folder",desc:"Auto expand folders on click"},hoverPreview:{name:"Preview on Hover",desc:"Preview on Hover while holding Control/Command key"},activeFile:{name:"Reveal Active File",desc:"Automatically reveal the active file in Spaces"},contexts:{name:"Contexts",desc:"Contexts allows you to have full control over the metadata of your files"},spaces:{name:"Navigator",desc:"The navigator lets you create and organize your spaces"},spacesStickers:{name:"Stickers",desc:"Use Emojis to make it easier to find your notes"},spacesAlias:{name:"Alias",desc:"Use the alias metadata to show in Spaces"},spacesFileExplorerDual:{name:"Compatibility Mode",desc:"This will improve the compatibility of plugins while using Spaces"},spacesDeleteOption:{name:"Delete File Option",desc:"Select how you want files to be deleted"},spacesDeleteOptions:{permanant:"Delete Permanently",trash:"Move to Obsidian Trash","system-trash":"Move to System Trash"},hideRibbon:{name:"App Ribbon",desc:"Show/hide the left menu aka. ribbon"},spaceView:{name:"Space View",desc:"Open the space view when you click on a space"},defaultSpaces:{name:"Default Spaces",desc:"Recommended spaces for quickly organizing your vault"},homeSpace:{name:"Home Space",desc:"An easy-to-access space where you can add/organize your other spaces"},tagSpaces:{name:"Tag Spaces",desc:"Automatically create spaces for each of your tags"},readableLineWidth:{name:"Readable Line Width",desc:"Use Readable Line Width"},sidebarTabs:{name:"Sidebar Tabs",desc:"Show/hide other sidebar tabs"},spacesPerformance:{name:"Performance Mode",desc:"Turn on performance mode for Spaces, may affect scrolling appearance. Requires Restart"},indexSVG:{name:"Use SVGs as Stickers",desc:"Use any svg file in your vault as a sticker"},inlineStyler:{name:"Flow Styler",desc:"Select text to add styling"},inlineStylerColor:{name:"Text and Highlight Colors \\u{1F9EA}",desc:"Select text color and highlight color, (this may change in the future because of the limitations with HTML and Obsidian)"},spaceRowHeight:{name:"Row Height",desc:"The height for each row in spaces (in pixels), default is 28"},makeChar:{name:"Flow Menu Trigger",desc:"Character to open the Flow Menu"},mobileMakeBar:{name:"Flow Styler (Mobile)",desc:"Replaces the mobile toolbar"},editorMarkSans:{name:"Mark Sans \\u{1F9EA}",desc:"Use the editor without Markdown."},editorMakerMode:{name:"Flow (Beta)",desc:"An integrated and intuitive editor experience"},editorMakePlacholder:{name:"Flow Menu Hint Text",desc:"Show a hint text on how to open the Flow Menu Shortcut"},blink:{name:"Blink",desc:"A faster way to search and edit your notes"},editorMakeMenu:{name:"Flow Menu",desc:"Open the Flow menu to quickly add content"},editorMakeMenuTrigger:{name:"Flow Menu Shortcut",desc:"Trigger key to use flow menu"},editorFlowReplace:{name:"Flow Block",desc:"Open your internal links or toggle your embeds in the flow block."},editorFlowStyle:{name:"Flow Block Style",desc:"Select a theme for your flow block",seamless:"Seamless",classic:"Classic",minimal:"Minimal"}}}};this.lang="en";let r=Yx.default.locale();["en"].includes(r)&&(this.lang=r)}get texts(){return this.all.en}},Vr=new Od().texts;var Hx=(e,r)=>r==fo?Vs.find(t=>t.type=="file"):r=="tags"?Vs.find(t=>t.type=="tags"):r=="aliases"?Vs.find(t=>t.type=="option-multi"):r=="sticker"?Vs.find(t=>e=="icon"):Vs.find(t=>e==t.type)||Vs.find(t=>e==t.multiType),Vs=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"text",label:Vr.properties.text.label,metadata:!0,icon:"ui//text",description:Vr.properties.text.description},{type:"number",label:Vr.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],description:Vr.properties.number.description},{type:"boolean",label:Vr.properties.boolean.label,metadata:!0,icon:"ui//check-square",description:Vr.properties.boolean.description},{type:"date",label:Vr.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],description:Vr.properties.date.description},{type:"option",label:Vr.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options"],description:Vr.properties.option.description},{type:"tags",label:Vr.properties.tags.label,icon:"ui//tags",description:Vr.properties.tags.description},{type:"file",label:Vr.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:Vr.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value"],description:Vr.properties.fileProperty.description},{type:"link",label:Vr.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",description:Vr.properties.link.description},{type:"context",label:Vr.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:Vr.properties.context.description},{type:"object",label:Vr.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type"],description:Vr.properties.object.description},{type:"icon",label:Vr.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",description:Vr.properties.icon.description},{type:"image",label:Vr.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",description:Vr.properties.image.description},{type:"color",label:Vr.properties.color.label,icon:"ui//mk-make-image",description:Vr.properties.color.description},{type:"space",label:Vr.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Vr.properties.space.description},{type:"table",label:Vr.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Vr.properties.space.description},{type:"super",label:Vr.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:Vr.properties.super.label,icon:"ui//input",restricted:!0}];var Ys="files",tc={id:Ys,name:"Files",type:"db",primary:"true"},ok="filesView",sk={id:ok,name:"All",type:"view",def:JSON.stringify({db:Ys,icon:"ui//file-stack"})},uk="main",fk=e=>({id:e,name:e,type:"frame",def:"",predicate:"",primary:"true"}),M$={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[fk(uk),sk]},ec={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[tc]},Gx={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},rc={...Gx,rows:[{name:fo,schemaId:Ys,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:Vr.properties.fileProperty.createdTime,schemaId:Ys,type:"fileprop",value:fo+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var _$=[{name:Vr.properties.defaultField,schemaId:"",type:"text",primary:"true"}],Bd={...Gx,rows:[{name:fo,schemaId:Ys,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var T$={schema:tc,cols:rc.rows,rows:[]},F$={schema:tc,cols:rc.rows,rows:[]},O$={schema:tc,cols:Bd.rows,rows:[]},$x=(e,r)=>e.filter(t=>r.find(n=>n.id==t.schemaId&&n.type=="db")).reduce((t,n)=>({...t,...t[n.schemaId]?{[n.schemaId]:{uniques:n.unique=="true"?[...t[n.schemaId].uniques,n.name]:t[n.schemaId].uniques,cols:[...t[n.schemaId].cols,n.name],rows:[]}}:{[n.schemaId]:{uniques:n.unique=="true"?[n.name]:[],cols:[n.name],rows:[]}}}),{});var B$={m_schema:ec,m_fields:rc,...$x(rc.rows,ec.rows)},I$={m_schema:ec,m_fields:Bd,...$x(Bd.rows,ec.rows)};var ck=(e,r)=>{let t=n=>n=="builtin"?"Builtin":n=="api"?"Spaces":"Action";return[...(e.actionsIndex.get(r)??[]).map(n=>({name:n.schema.name,description:"Action",value:\`\${r}/#;\${n.schema.id}\`,section:"Action"}))??[],...[...e.cli.allCommands()].map(n=>({name:n.schema.name,description:t(n.schema.type),value:n.path,section:t(n.schema.type)}))]};var Zx=({field:e,value:r})=>r=="ctime"?{value:\`parseDate(prop('\${e}')['metadata']['file']['\${r}'])\`}:{value:\`prop('\${e}')['metadata']['file']['\${r}']\`},Id=(e,r,t,n)=>{let i=Xl(e);if(i)return r=="fileprop"&&i.field?Zx(i):(r=="option"&&i.source?.length>0&&(i.source=="$commands"?i.options=t.cli.allCommands():i.source=="$links"?i.options=t.spaceManager.allPaths().map(a=>({name:a,value:a})):i.source=="$super"&&(i.options=ck(t,n))),[...Hx(r).configKeys??[],"alias","default"].reduce((a,s)=>({...a,[s]:i[s]}),{}));if(!r)return{};if(!i)if(r=="context")e?.length>0?i={space:e}:i={};else if(r.startsWith("date"))e?.length>0?i={format:e}:i={};else if(r.startsWith("fileprop"))if(e?.length>0){let[a,s]=e.split(".");i=Zx({field:a,value:s})}else i={};else r.startsWith("option")&&(e?.length>0?i={options:Ui(e).map(s=>({name:s,value:s}))}:i={});return i??{}};function Mt(){return Mt=Object.assign?Object.assign.bind():function(e){for(var r=1;re[r])}var jx=["Matrix","Array"],ey=["number","BigNumber","Fraction"];function ty(e,r){function t(n){if(n){var i=$s(e,tr);ry(n,"matrix",jx),ry(n,"number",ey),Pd(e,n);var a=$s(e,tr),s=$s(n,tr);return r("config",a,i,s),a}else return $s(e,tr)}return t.MATRIX_OPTIONS=jx,t.NUMBER_OPTIONS=ey,Object.keys(nc).forEach(n=>{Object.defineProperty(t,n,{get:()=>e[n],enumerable:!0,configurable:!0})}),t}function pk(e,r){return e.indexOf(r)!==-1}function ry(e,r,t){e[r]!==void 0&&!pk(t,e[r])&&console.warn('Warning: Unknown value "'+e[r]+'" for configuration option "'+r+'". Available options: '+t.map(n=>JSON.stringify(n)).join(", ")+".")}var _g={};s8(_g,{createAbs:()=>nb,createAccessorNode:()=>A2,createAcos:()=>rN,createAcosh:()=>nN,createAcot:()=>aN,createAcoth:()=>sN,createAcsc:()=>fN,createAcsch:()=>cN,createAdd:()=>h2,createAddScalar:()=>ob,createAnd:()=>np,createAndTransform:()=>zO,createApply:()=>ou,createApplyTransform:()=>hO,createArg:()=>sw,createArrayNode:()=>E2,createAsec:()=>mN,createAsech:()=>dN,createAsin:()=>gN,createAsinh:()=>xN,createAssignmentNode:()=>_2,createAtan:()=>yN,createAtan2:()=>wN,createAtanh:()=>SN,createAtomicMass:()=>$3,createAvogadro:()=>Z3,createBellNumbers:()=>CF,createBigNumberClass:()=>Xy,createBignumber:()=>q1,createBin:()=>ED,createBitAnd:()=>Yc,createBitAndTransform:()=>VO,createBitNot:()=>tw,createBitOr:()=>Hc,createBitOrTransform:()=>YO,createBitXor:()=>aw,createBlockNode:()=>T2,createBohrMagneton:()=>C3,createBohrRadius:()=>B3,createBoltzmann:()=>Q3,createBoolean:()=>L1,createCatalan:()=>_F,createCbrt:()=>lb,createCeil:()=>cb,createChain:()=>rT,createChainClass:()=>AA,createClassicalElectronRadius:()=>I3,createClone:()=>u1,createColumn:()=>Zc,createColumnTransform:()=>dO,createCombinations:()=>LT,createCombinationsWithRep:()=>zT,createCompare:()=>dS,createCompareNatural:()=>yS,createCompareText:()=>wS,createCompile:()=>X2,createComplex:()=>U1,createComplexClass:()=>jy,createComposition:()=>FF,createConcat:()=>$c,createConcatTransform:()=>MO,createConditionalNode:()=>F2,createConductanceQuantum:()=>M3,createConj:()=>fw,createConstantNode:()=>R2,createCorr:()=>PT,createCos:()=>AN,createCosh:()=>CN,createCot:()=>_N,createCoth:()=>FN,createCoulomb:()=>A3,createCount:()=>Dw,createCreateUnit:()=>jS,createCross:()=>Nw,createCsc:()=>BN,createCsch:()=>PN,createCtranspose:()=>sD,createCube:()=>mb,createCumSum:()=>Lp,createCumSumTransform:()=>kO,createDeepEqual:()=>TS,createDenseMatrixClass:()=>o1,createDerivative:()=>VF,createDet:()=>nT,createDeuteronMass:()=>U3,createDiag:()=>Ew,createDiff:()=>Qc,createDiffTransform:()=>TO,createDistance:()=>ST,createDivide:()=>wT,createDivideScalar:()=>qD,createDot:()=>b2,createDotDivide:()=>jD,createDotMultiply:()=>Zb,createDotPow:()=>JD,createE:()=>o3,createEfimovFactor:()=>G3,createEigs:()=>lT,createElectricConstant:()=>S3,createElectronMass:()=>P3,createElementaryCharge:()=>E3,createEqual:()=>DS,createEqualScalar:()=>O1,createEqualText:()=>NS,createErf:()=>vD,createEvaluate:()=>K2,createExp:()=>db,createExpm:()=>pT,createExpm1:()=>gb,createFactorial:()=>$T,createFalse:()=>e3,createFaraday:()=>X3,createFermiCoupling:()=>k3,createFft:()=>cD,createFibonacciHeapClass:()=>zS,createFilter:()=>Mw,createFilterTransform:()=>gO,createFineStructure:()=>R3,createFirstRadiation:()=>J3,createFix:()=>xb,createFlatten:()=>Tw,createFloor:()=>Uc,createForEach:()=>Ow,createForEachTransform:()=>xO,createFormat:()=>ND,createFraction:()=>z1,createFractionClass:()=>t1,createFreqz:()=>QF,createFunctionAssignmentNode:()=>L2,createFunctionNode:()=>G2,createGamma:()=>VT,createGasConstant:()=>j3,createGcd:()=>Nb,createGetMatrixDataType:()=>Iw,createGravitationConstant:()=>y3,createGravity:()=>uO,createHartreeEnergy:()=>L3,createHasNumericValue:()=>D1,createHelp:()=>j_,createHelpClass:()=>NA,createHex:()=>TD,createHypot:()=>v2,createI:()=>h3,createIdentity:()=>kw,createIfft:()=>mD,createIm:()=>cw,createImmutableDenseMatrixClass:()=>LS,createIndex:()=>S2,createIndexClass:()=>US,createIndexNode:()=>q2,createIndexTransform:()=>yO,createInfinity:()=>t3,createIntersect:()=>NT,createInv:()=>aT,createInverseConductanceQuantum:()=>_3,createInvmod:()=>Gb,createIsInteger:()=>l1,createIsNaN:()=>M1,createIsNegative:()=>x1,createIsNumeric:()=>b1,createIsPositive:()=>N1,createIsPrime:()=>kD,createIsZero:()=>E1,createKldivergence:()=>QT,createKlitzing:()=>O3,createKron:()=>Lw,createLN10:()=>f3,createLN2:()=>u3,createLOG10E:()=>c3,createLOG2E:()=>l3,createLarger:()=>CS,createLargerEq:()=>MS,createLcm:()=>Eb,createLeafCount:()=>BF,createLeftShift:()=>fS,createLgamma:()=>HT,createLog:()=>HD,createLog10:()=>Mb,createLog1p:()=>$D,createLog2:()=>Tb,createLoschmidt:()=>K3,createLsolve:()=>rS,createLsolveAll:()=>aS,createLup:()=>nA,createLusolve:()=>wA,createLyap:()=>bT,createMad:()=>TT,createMagneticConstant:()=>D3,createMagneticFluxQuantum:()=>T3,createMap:()=>Uw,createMapTransform:()=>wO,createMatrix:()=>V1,createMatrixClass:()=>i1,createMatrixFromColumns:()=>Q1,createMatrixFromFunction:()=>H1,createMatrixFromRows:()=>$1,createMax:()=>cp,createMaxTransform:()=>DO,createMean:()=>qp,createMeanTransform:()=>SO,createMedian:()=>MT,createMin:()=>pp,createMinTransform:()=>NO,createMod:()=>zc,createMode:()=>bD,createMolarMass:()=>oO,createMolarMassC12:()=>sO,createMolarPlanckConstant:()=>eO,createMolarVolume:()=>rO,createMultinomial:()=>JT,createMultiply:()=>Bb,createMultiplyScalar:()=>Fb,createNaN:()=>n3,createNeutronMass:()=>z3,createNode:()=>N2,createNorm:()=>x2,createNot:()=>dw,createNthRoot:()=>Pb,createNthRoots:()=>QD,createNuclearMagneton:()=>F3,createNull:()=>r3,createNumber:()=>I1,createNumeric:()=>RD,createObjectNode:()=>U2,createOct:()=>MD,createOnes:()=>Ww,createOperatorNode:()=>z2,createOr:()=>Gc,createOrTransform:()=>WO,createParenthesisNode:()=>W2,createParse:()=>Z2,createParser:()=>rA,createParserClass:()=>j2,createPartitionSelect:()=>BS,createPermutations:()=>eF,createPhi:()=>s3,createPi:()=>i3,createPickRandom:()=>yF,createPinv:()=>sT,createPlanckCharge:()=>pO,createPlanckConstant:()=>b3,createPlanckLength:()=>fO,createPlanckMass:()=>lO,createPlanckTemperature:()=>mO,createPlanckTime:()=>cO,createPolynomialRoot:()=>SA,createPow:()=>zD,createPrint:()=>tp,createPrintTransform:()=>UO,createProd:()=>DD,createProtonMass:()=>q3,createQr:()=>aA,createQuantileSeq:()=>zp,createQuantileSeqTransform:()=>IO,createQuantumOfCirculation:()=>W3,createRandom:()=>wF,createRandomInt:()=>SF,createRange:()=>Kc,createRangeClass:()=>n1,createRangeNode:()=>V2,createRangeTransform:()=>AO,createRationalize:()=>HF,createRe:()=>mw,createReducedPlanckConstant:()=>w3,createRelationalNode:()=>Y2,createReplacer:()=>JF,createReshape:()=>Hw,createResize:()=>Gw,createResolve:()=>qF,createResultSet:()=>Py,createReviver:()=>XF,createRightArithShift:()=>cS,createRightLogShift:()=>mS,createRotate:()=>Zw,createRotationMatrix:()=>Xw,createRound:()=>VD,createRow:()=>jc,createRowTransform:()=>EO,createRydberg:()=>V3,createSQRT1_2:()=>p3,createSQRT2:()=>m3,createSackurTetrode:()=>tO,createSchur:()=>xT,createSec:()=>RN,createSech:()=>qN,createSecondRadiation:()=>nO,createSetCartesian:()=>ZN,createSetDifference:()=>XN,createSetDistinct:()=>KN,createSetIntersect:()=>e2,createSetIsSubset:()=>t2,createSetMultiplicity:()=>i2,createSetPowerset:()=>o2,createSetSize:()=>u2,createSetSymDifference:()=>l2,createSetUnion:()=>p2,createSign:()=>Rb,createSimplify:()=>PF,createSimplifyConstant:()=>kF,createSimplifyCore:()=>LF,createSin:()=>zN,createSinh:()=>VN,createSize:()=>jw,createSlu:()=>yA,createSmaller:()=>AS,createSmallerEq:()=>ES,createSolveODE:()=>dD,createSort:()=>PS,createSpaClass:()=>WS,createSparse:()=>JS,createSparseMatrixClass:()=>B1,createSpeedOfLight:()=>x3,createSplitUnit:()=>J1,createSqrt:()=>Lb,createSqrtm:()=>hT,createSquare:()=>Ub,createSqueeze:()=>rD,createStd:()=>Wp,createStdTransform:()=>FO,createStefanBoltzmann:()=>iO,createStirlingS2:()=>AF,createString:()=>k1,createSubset:()=>ep,createSubsetTransform:()=>CO,createSubtract:()=>Wb,createSubtractScalar:()=>ub,createSum:()=>kp,createSumTransform:()=>BO,createSylvester:()=>vT,createSymbolNode:()=>H2,createSymbolicEqual:()=>zF,createTan:()=>HN,createTanh:()=>GN,createTau:()=>a3,createThomsonCrossSection:()=>Y3,createTo:()=>ID,createTrace:()=>w2,createTranspose:()=>aD,createTrue:()=>jF,createTypeOf:()=>T1,createTyped:()=>Iy,createUnaryMinus:()=>j1,createUnaryPlus:()=>rb,createUnequal:()=>FS,createUnitClass:()=>$S,createUnitFunction:()=>QS,createUppercaseE:()=>v3,createUppercasePi:()=>d3,createUsolve:()=>nS,createUsolveAll:()=>sS,createVacuumImpedance:()=>N3,createVariance:()=>Up,createVarianceTransform:()=>LO,createVersion:()=>g3,createWeakMixingAngle:()=>H3,createWienDisplacement:()=>aO,createXgcd:()=>Yb,createXor:()=>xw,createZeros:()=>fD,createZeta:()=>xD,createZpk2tf:()=>$F});var jd=ci(gc(),1);function He(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}var hi=Math.sign||function(e){return e>0?1:e<0?-1:0},ay=Math.log2||function(r){return Math.log(r)/Math.LN2},oy=Math.log10||function(r){return Math.log(r)/Math.LN10},xc=Math.log1p||function(e){return Math.log(e+1)},sy=Math.cbrt||function(r){if(r===0)return r;var t=r<0,n;return t&&(r=-r),isFinite(r)?(n=Math.exp(Math.log(r)/3),n=(r/(n*n)+2*n)/3):n=r,t?-n:n},uy=Math.expm1||function(r){return r>=2e-4||r<=-2e-4?Math.exp(r)-1:r+r*r/2+r*r*r/6};function qd(e,r,t){var n={2:"0b",8:"0o",16:"0x"},i=n[r],a="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!He(t))throw new Error("size must be an integer");if(e>2**(t-1)-1||e<-(2**(t-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!He(e))throw new Error("Value must be an integer");e<0&&(e=e+2**t),a="i".concat(t)}var s="";return e<0&&(e=-e,s="-"),"".concat(s).concat(i).concat(e.toString(r)).concat(a)}function Wi(e,r){if(typeof r=="function")return r(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:t,precision:n,wordSize:i}=Ud(r);switch(t){case"fixed":return zd(e,n);case"exponential":return fy(e,n);case"engineering":return mk(e,n);case"bin":return qd(e,2,i);case"oct":return qd(e,8,i);case"hex":return qd(e,16,i);case"auto":return hk(e,n,r).replace(/((\\.\\d*?)(0+))($|e)/,function(){var a=arguments[2],s=arguments[4];return a!=="."?a+s:s});default:throw new Error('Unknown notation "'+t+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Ud(e){var r="auto",t,n;if(e!==void 0)if(ar(e))t=e;else if(je(e))t=e.toNumber();else if(fa(e))e.precision!==void 0&&(t=ny(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=ny(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(r=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:r,precision:t,wordSize:n}}function Xs(e){var r=String(e).toLowerCase().match(/^(-?)(\\d+\\.?\\d*)(e([+-]?\\d+))?$/);if(!r)throw new SyntaxError("Invalid number "+e);var t=r[1],n=r[2],i=parseFloat(r[4]||"0"),a=n.indexOf(".");i+=a!==-1?a-1:n.length-1;var s=n.replace(".","").replace(/^0*/,function(l){return i-=l.length,""}).replace(/0*$/,"").split("").map(function(l){return parseInt(l)});return s.length===0&&(s.push(0),i++),{sign:t,coefficients:s,exponent:i}}function mk(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Xs(e),n=yc(t,r),i=n.exponent,a=n.coefficients,s=i%3===0?i:i<0?i-3-i%3:i-i%3;if(ar(r))for(;r>a.length||i-s+1>a.length;)a.push(0);else for(var l=Math.abs(i-s)-(a.length-1),f=0;f0;)u++,o--;var p=a.slice(u).join(""),h=ar(r)&&p.length||p.match(/[1-9]/)?"."+p:"",d=a.slice(0,u).join("")+h+"e"+(i>=0?"+":"")+s.toString();return n.sign+d}function zd(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Xs(e),n=typeof r=="number"?yc(t,t.exponent+1+r):t,i=n.coefficients,a=n.exponent+1,s=a+(r||0);return i.length0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function hk(e,r,t){if(isNaN(e)||!isFinite(e))return String(e);var n=iy(t?.lowerExp,-3),i=iy(t?.upperExp,5),a=Xs(e),s=r?yc(a,r):a;if(s.exponent=i)return fy(e,r);var l=s.coefficients,f=s.exponent;l.length0?f:0;return or){var i=n.splice(r,n.length-r);if(i[0]>=5){var a=r-1;for(n[a]++;n[a]===10;)n.pop(),a===0&&(n.unshift(0),t.exponent++,a++),a--,n[a]++}}return t}function Qs(e){for(var r=[],t=0;t0?!0:e<0?!1:1/e===1/0,n=r>0?!0:r<0?!1:1/r===1/0;return t^n?-e:e}function ny(e,r){if(ar(e))return e;if(je(e))return e.toNumber();r()}function iy(e,r){return ar(e)?e:je(e)?e.toNumber():r}function Wd(e,r,t){var n=e.constructor,i=new n(2),a="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!He(t))throw new Error("size must be an integer");if(e.greaterThan(i.pow(t-1).sub(1))||e.lessThan(i.pow(t-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(t))),a="i".concat(t)}switch(r){case 2:return"".concat(e.toBinary()).concat(a);case 8:return"".concat(e.toOctal()).concat(a);case 16:return"".concat(e.toHexadecimal()).concat(a);default:throw new Error("Base ".concat(r," not supported "))}}function xy(e,r){if(typeof r=="function")return r(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:t,precision:n,wordSize:i}=Ud(r);switch(t){case"fixed":return gk(e,n);case"exponential":return vy(e,n);case"engineering":return vk(e,n);case"bin":return Wd(e,2,i);case"oct":return Wd(e,8,i);case"hex":return Wd(e,16,i);case"auto":{var a=gy(r?.lowerExp,-3),s=gy(r?.upperExp,5);if(e.isZero())return"0";var l,f=e.toSignificantDigits(n),o=f.e;return o>=a&&o=0?"+":"")+n.toString()}function vy(e,r){return r!==void 0?e.toExponential(r-1):e.toExponential()}function gk(e,r){return e.toFixed(r)}function gy(e,r){return ar(e)?e:je(e)?e.toNumber():r}function by(e,r){var t=e.length-r.length,n=e.length;return e.substring(t,n)===r}function lr(e,r){var t=xk(e,r);return r&&typeof r=="object"&&"truncate"in r&&t.length>r.truncate?t.substring(0,r.truncate-3)+"...":t}function xk(e,r){if(typeof e=="number")return Wi(e,r);if(je(e))return xy(e,r);if(yk(e))return!r||r.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return wy(e,r);if(yt(e))return Ko(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(r);if(e&&e.toString(r)!=={}.toString())return e.toString(r);var t=Object.keys(e).map(n=>Ko(n)+": "+lr(e[n],r));return"{"+t.join(", ")+"}"}return String(e)}function Ko(e){for(var r=String(e),t="",n=0;n/g,">"),r}function wy(e,r){if(Array.isArray(e)){for(var t="[",n=e.length,i=0;ir?1:-1}function pr(e,r,t){if(!(this instanceof pr))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=r,this.relation=t,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(r)?"["+r.join(", ")+"]":r)+")",this.stack=new Error().stack}pr.prototype=new RangeError;pr.prototype.constructor=RangeError;pr.prototype.name="DimensionError";pr.prototype.isDimensionError=!0;function Xt(e,r,t){if(!(this instanceof Xt))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=r):(this.min=r,this.max=t),this.min!==void 0&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}Xt.prototype=new RangeError;Xt.prototype.constructor=RangeError;Xt.prototype.name="IndexError";Xt.prototype.isIndexError=!0;function or(e){for(var r=[];Array.isArray(e);)r.push(e.length),e=e[0];return r}function Dy(e,r,t){var n,i=e.length;if(i!==r[t])throw new pr(i,r[t]);if(t")}function Yd(e,r){var t=r.length===0;if(t){if(Array.isArray(e))throw new pr(e.length,0)}else Dy(e,r,0)}function vf(e,r){var t=e.isMatrix?e._size:or(e),n=r._sourceSize;n.forEach((i,a)=>{if(i!==null&&i!==t[a])throw new pr(i,t[a])})}function Xr(e,r){if(e!==void 0){if(!ar(e)||!He(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof r=="number"&&e>=r)throw new Xt(e,r)}}function jo(e){for(var r=0;r=0,f=r%t===0;if(l)if(f)n[a]=-r/t;else throw new Error("Could not replace wildcard, since "+r+" is no multiple of "+-t);return n}function Sy(e){return e.reduce((r,t)=>r*t,1)}function bk(e,r){for(var t=e,n,i=r.length-1;i>0;i--){var a=r[i];n=[];for(var s=t.length/a,l=0;lr.test(t))}function Hd(e,r){return Array.prototype.join.call(e,r)}function Pa(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var r=[],t=0;r[0]={value:e[0],identifier:0};for(var n=1;n1)return e.slice(1).reduce(function(t,n){return Ey(t,n,r,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function wk(){for(var e=arguments.length,r=new Array(e),t=0;th.length),i=Math.max(...n),a=new Array(i).fill(null),s=0;sa[u]&&(a[u]=l[o])}for(var p=0;p1||e[i]>r[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(r[a]))}}function Zd(e,r){var t=or(e);if(zi(t,r))return e;yf(t,r);var n=wk(t,r),i=n.length,a=[...Array(i-t.length).fill(1),...t],s=Sk(e);t.length!Ak(a)).every(a=>t[a]!==void 0);if(!n){var i=r.filter(a=>t[a]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(a=>'"'.concat(a,'"')).join(", "),"."))}}function Ak(e){return e&&e[0]==="?"}function Qd(e){return e&&e[0]==="?"?e.slice(1):e}function gt(e,r){if(Ty(e)&&My(e,r))return e[r];throw typeof e[r]=="function"&&Ac(e,r)?new Error('Cannot access method "'+r+'" as a property'):new Error('No access to property "'+r+'"')}function ca(e,r,t){if(Ty(e)&&My(e,r))return e[r]=t,t;throw new Error('No access to property "'+r+'"')}function Cy(e,r){return r in e}function My(e,r){return!e||typeof e!="object"?!1:$e(Ek,r)?!0:!(r in Object.prototype||r in Function.prototype)}function _y(e,r){if(!Ac(e,r))throw new Error('No access to method "'+r+'"');return e[r]}function Ac(e,r){return e==null||typeof e[r]!="function"||$e(e,r)&&Object.getPrototypeOf&&r in Object.getPrototypeOf(e)?!1:$e(Ck,r)?!0:!(r in Object.prototype||r in Function.prototype)}function Ty(e){return typeof e=="object"&&e&&e.constructor===Object}var Ek={length:!0,name:!0},Ck={toString:!0,valueOf:!0,toLocaleString:!0};var rs=class{constructor(r){this.wrappedObject=r,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(r){return gt(this.wrappedObject,r)}set(r,t){return ca(this.wrappedObject,r,t),this}has(r){return Cy(this.wrappedObject,r)}entries(){return Fy(this.keys(),r=>[r,this.get(r)])}forEach(r){for(var t of this.keys())r(this.get(t),t,this)}delete(r){delete this.wrappedObject[r]}clear(){for(var r of this.keys())this.delete(r)}get size(){return Object.keys(this.wrappedObject).length}},eu=class{constructor(r,t,n){this.a=r,this.b=t,this.bKeys=n,this[Symbol.iterator]=this.entries}get(r){return this.bKeys.has(r)?this.b.get(r):this.a.get(r)}set(r,t){return this.bKeys.has(r)?this.b.set(r,t):this.a.set(r,t),this}has(r){return this.b.has(r)||this.a.has(r)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return Fy(this.keys(),r=>[r,this.get(r)])}forEach(r){for(var t of this.keys())r(this.get(t),t,this)}delete(r){return this.bKeys.has(r)?this.b.delete(r):this.a.delete(r)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}};function Fy(e,r){return{next:()=>{var t=e.next();return t.done?t:{value:r(t.value),done:!1}}}}function go(){return new Map}function ka(e){if(!e)return go();if(Xd(e))return e;if(fa(e))return new rs(e);throw new Error("createMap can create maps from objects or Maps")}function Oy(e){if(e instanceof rs)return e.wrappedObject;var r={};for(var t of e.keys()){var n=e.get(t);ca(r,t,n)}return r}function Xd(e){return e?e instanceof Map||e instanceof rs||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var By=function(){return By=jd.default.create,jd.default},Mk=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],Iy=T("typed",Mk,function(r){var{BigNumber:t,Complex:n,DenseMatrix:i,Fraction:a}=r,s=By();return s.clear(),s.addTypes([{name:"number",test:ar},{name:"Complex",test:Gt},{name:"BigNumber",test:je},{name:"Fraction",test:Xn},{name:"Unit",test:qt},{name:"identifier",test:l=>yt&&/^(?:[A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF40\\uDF42-\\uDF49\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDD70-\\uDD7A\\uDD7C-\\uDD8A\\uDD8C-\\uDD92\\uDD94\\uDD95\\uDD97-\\uDDA1\\uDDA3-\\uDDB1\\uDDB3-\\uDDB9\\uDDBB\\uDDBC\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67\\uDF80-\\uDF85\\uDF87-\\uDFB0\\uDFB2-\\uDFBA]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDE80-\\uDEA9\\uDEB0\\uDEB1\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45\\uDF70-\\uDF81\\uDFB0-\\uDFC4\\uDFE0-\\uDFF6]|\\uD804[\\uDC03-\\uDC37\\uDC71\\uDC72\\uDC75\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD47\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE3F\\uDE40\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD837[\\uDF00-\\uDF1E\\uDF25-\\uDF2A]|\\uD838[\\uDC30-\\uDC6D\\uDD00-\\uDD2C\\uDD37-\\uDD3D\\uDD4E\\uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDCD0-\\uDCEB\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])(?:[0-9A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF40\\uDF42-\\uDF49\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDD70-\\uDD7A\\uDD7C-\\uDD8A\\uDD8C-\\uDD92\\uDD94\\uDD95\\uDD97-\\uDDA1\\uDDA3-\\uDDB1\\uDDB3-\\uDDB9\\uDDBB\\uDDBC\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67\\uDF80-\\uDF85\\uDF87-\\uDFB0\\uDFB2-\\uDFBA]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDE80-\\uDEA9\\uDEB0\\uDEB1\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45\\uDF70-\\uDF81\\uDFB0-\\uDFC4\\uDFE0-\\uDFF6]|\\uD804[\\uDC03-\\uDC37\\uDC71\\uDC72\\uDC75\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD47\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE3F\\uDE40\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD837[\\uDF00-\\uDF1E\\uDF25-\\uDF2A]|\\uD838[\\uDC30-\\uDC6D\\uDD00-\\uDD2C\\uDD37-\\uDD3D\\uDD4E\\uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDCD0-\\uDCEB\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])*$/.test(l)},{name:"string",test:yt},{name:"Chain",test:Gs},{name:"Array",test:Ar},{name:"Matrix",test:Ge},{name:"DenseMatrix",test:Ia},{name:"SparseMatrix",test:Jn},{name:"Range",test:mo},{name:"Index",test:ua},{name:"boolean",test:ic},{name:"ResultSet",test:ac},{name:"Help",test:Hs},{name:"function",test:oc},{name:"Date",test:sc},{name:"RegExp",test:uc},{name:"null",test:fc},{name:"undefined",test:lc},{name:"AccessorNode",test:Sn},{name:"ArrayNode",test:$t},{name:"AssignmentNode",test:cc},{name:"BlockNode",test:pc},{name:"ConditionalNode",test:mc},{name:"ConstantNode",test:yr},{name:"FunctionNode",test:fn},{name:"FunctionAssignmentNode",test:mi},{name:"IndexNode",test:kn},{name:"Node",test:Sr},{name:"ObjectNode",test:la},{name:"OperatorNode",test:ut},{name:"ParenthesisNode",test:Zt},{name:"RangeNode",test:hc},{name:"RelationalNode",test:dc},{name:"SymbolNode",test:rt},{name:"Map",test:Xd},{name:"Object",test:fa}]),s.addConversions([{from:"number",to:"BigNumber",convert:function(f){if(t||Jd(f),ly(f)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+f+"). Use function bignumber(x) to convert to BigNumber.");return new t(f)}},{from:"number",to:"Complex",convert:function(f){return n||Ec(f),new n(f,0)}},{from:"BigNumber",to:"Complex",convert:function(f){return n||Ec(f),new n(f.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(f){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(f){return n||Ec(f),new n(f.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(f){a||Kd(f);var o=new a(f);if(o.valueOf()!==f)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+f+"). Use function fraction(x) to convert to Fraction.");return o}},{from:"string",to:"number",convert:function(f){var o=Number(f);if(isNaN(o))throw new Error('Cannot convert "'+f+'" to a number');return o}},{from:"string",to:"BigNumber",convert:function(f){t||Jd(f);try{return new t(f)}catch{throw new Error('Cannot convert "'+f+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(f){a||Kd(f);try{return new a(f)}catch{throw new Error('Cannot convert "'+f+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(f){n||Ec(f);try{return new n(f)}catch{throw new Error('Cannot convert "'+f+'" to Complex')}}},{from:"boolean",to:"number",convert:function(f){return+f}},{from:"boolean",to:"BigNumber",convert:function(f){return t||Jd(f),new t(+f)}},{from:"boolean",to:"Fraction",convert:function(f){return a||Kd(f),new a(+f)}},{from:"boolean",to:"string",convert:function(f){return String(f)}},{from:"Array",to:"Matrix",convert:function(f){return i||_k(),new i(f)}},{from:"Matrix",to:"Array",convert:function(f){return f.valueOf()}}]),s.onMismatch=(l,f,o)=>{var u=s.createError(l,f,o);if(["wrongType","mismatch"].includes(u.data.category)&&f.length===1&&bt(f[0])&&o.some(h=>!h.params.includes(","))){var p=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw p.data=u.data,p}throw u},s.onMismatch=(l,f,o)=>{var u=s.createError(l,f,o);if(["wrongType","mismatch"].includes(u.data.category)&&f.length===1&&bt(f[0])&&o.some(h=>!h.params.includes(","))){var p=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw p.data=u.data,p}throw u},s});function Jd(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Ec(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function _k(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Kd(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var Tk="ResultSet",Fk=[],Py=T(Tk,Fk,()=>{function e(r){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=r||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(r){return new e(r.entries)},e},{isClass:!0});var ru=9e15,wo=1e9,ev="0123456789abcdef",Mc="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",_c="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",rv={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ru,maxE:ru,crypto:!1},qy,Ra,Er=!0,Fc="[DecimalError] ",bo=Fc+"Invalid argument: ",Uy=Fc+"Precision limit exceeded",zy=Fc+"crypto unavailable",Wy="[object Decimal]",mn=Math.floor,Jt=Math.pow,Ok=/^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,Bk=/^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,Ik=/^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,Vy=/^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,Hi=1e7,br=7,Pk=9007199254740991,kk=Mc.length-1,tv=_c.length-1,Ue={toStringTag:Wy};Ue.absoluteValue=Ue.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),dr(e)};Ue.ceil=function(){return dr(new this.constructor(this),this.e+1,2)};Ue.clampedTo=Ue.clamp=function(e,r){var t,n=this,i=n.constructor;if(e=new i(e),r=new i(r),!e.s||!r.s)return new i(NaN);if(e.gt(r))throw Error(bo+r);return t=n.cmp(e),t<0?e:n.cmp(r)>0?r:new i(n)};Ue.comparedTo=Ue.cmp=function(e){var r,t,n,i,a=this,s=a.d,l=(e=new a.constructor(e)).d,f=a.s,o=e.s;if(!s||!l)return!f||!o?NaN:f!==o?f:s===l?0:!s^f<0?1:-1;if(!s[0]||!l[0])return s[0]?f:l[0]?-o:0;if(f!==o)return f;if(a.e!==e.e)return a.e>e.e^f<0?1:-1;for(n=s.length,i=l.length,r=0,t=nl[r]^f<0?1:-1;return n===i?0:n>i^f<0?1:-1};Ue.cosine=Ue.cos=function(){var e,r,t=this,n=t.constructor;return t.d?t.d[0]?(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+br,n.rounding=1,t=Rk(n,Zy(n,t)),n.precision=e,n.rounding=r,dr(Ra==2||Ra==3?t.neg():t,e,r,!0)):new n(1):new n(NaN)};Ue.cubeRoot=Ue.cbrt=function(){var e,r,t,n,i,a,s,l,f,o,u=this,p=u.constructor;if(!u.isFinite()||u.isZero())return new p(u);for(Er=!1,a=u.s*Jt(u.s*u,1/3),!a||Math.abs(a)==1/0?(t=ln(u.d),e=u.e,(a=(e-t.length+1)%3)&&(t+=a==1||a==-2?"0":"00"),a=Jt(t,1/3),e=mn((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new p(t),n.s=u.s):n=new p(a.toString()),s=(e=p.precision)+3;;)if(l=n,f=l.times(l).times(l),o=f.plus(u),n=xt(o.plus(u).times(l),o.plus(f),s+2,1),ln(l.d).slice(0,s)===(t=ln(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!i&&t=="4999"){if(!i&&(dr(l,e+1,0),l.times(l).times(l).eq(u))){n=l;break}s+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(dr(n,e+1,1),r=!n.times(n).times(n).eq(u));break}return Er=!0,dr(n,e,p.rounding,r)};Ue.decimalPlaces=Ue.dp=function(){var e,r=this.d,t=NaN;if(r){if(e=r.length-1,t=(e-mn(this.e/br))*br,e=r[e],e)for(;e%10==0;e/=10)t--;t<0&&(t=0)}return t};Ue.dividedBy=Ue.div=function(e){return xt(this,new this.constructor(e))};Ue.dividedToIntegerBy=Ue.divToInt=function(e){var r=this,t=r.constructor;return dr(xt(r,new t(e),0,1,1),t.precision,t.rounding)};Ue.equals=Ue.eq=function(e){return this.cmp(e)===0};Ue.floor=function(){return dr(new this.constructor(this),this.e+1,3)};Ue.greaterThan=Ue.gt=function(e){return this.cmp(e)>0};Ue.greaterThanOrEqualTo=Ue.gte=function(e){var r=this.cmp(e);return r==1||r===0};Ue.hyperbolicCosine=Ue.cosh=function(){var e,r,t,n,i,a=this,s=a.constructor,l=new s(1);if(!a.isFinite())return new s(a.s?1/0:NaN);if(a.isZero())return l;t=s.precision,n=s.rounding,s.precision=t+Math.max(a.e,a.sd())+4,s.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),r=(1/Bc(4,e)).toString()):(e=16,r="2.3283064365386962890625e-10"),a=tu(s,1,a.times(r),new s(1),!0);for(var f,o=e,u=new s(8);o--;)f=a.times(a),a=l.minus(f.times(u.minus(f.times(u))));return dr(a,s.precision=t,s.rounding=n,!0)};Ue.hyperbolicSine=Ue.sinh=function(){var e,r,t,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(r=a.precision,t=a.rounding,a.precision=r+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=tu(a,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Bc(5,e)),i=tu(a,2,i,i,!0);for(var s,l=new a(5),f=new a(16),o=new a(20);e--;)s=i.times(i),i=i.times(l.plus(s.times(f.times(s).plus(o))))}return a.precision=r,a.rounding=t,dr(i,r,t,!0)};Ue.hyperbolicTangent=Ue.tanh=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+7,n.rounding=1,xt(t.sinh(),t.cosh(),n.precision=e,n.rounding=r)):new n(t.s)};Ue.inverseCosine=Ue.acos=function(){var e,r=this,t=r.constructor,n=r.abs().cmp(1),i=t.precision,a=t.rounding;return n!==-1?n===0?r.isNeg()?Yi(t,i,a):new t(0):new t(NaN):r.isZero()?Yi(t,i+4,a).times(.5):(t.precision=i+6,t.rounding=1,r=r.asin(),e=Yi(t,i+4,a).times(.5),t.precision=i,t.rounding=a,e.minus(r))};Ue.inverseHyperbolicCosine=Ue.acosh=function(){var e,r,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(e=n.precision,r=n.rounding,n.precision=e+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,Er=!1,t=t.times(t).minus(1).sqrt().plus(t),Er=!0,n.precision=e,n.rounding=r,t.ln()):new n(t)};Ue.inverseHyperbolicSine=Ue.asinh=function(){var e,r,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,Er=!1,t=t.times(t).plus(1).sqrt().plus(t),Er=!0,n.precision=e,n.rounding=r,t.ln())};Ue.inverseHyperbolicTangent=Ue.atanh=function(){var e,r,t,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,r=a.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?dr(new a(i),e,r,!0):(a.precision=t=n-i.e,i=xt(i.plus(1),new a(1).minus(i),t+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=r,i.times(.5))):new a(NaN)};Ue.inverseSine=Ue.asin=function(){var e,r,t,n,i=this,a=i.constructor;return i.isZero()?new a(i):(r=i.abs().cmp(1),t=a.precision,n=a.rounding,r!==-1?r===0?(e=Yi(a,t+4,n).times(.5),e.s=i.s,e):new a(NaN):(a.precision=t+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=t,a.rounding=n,i.times(2)))};Ue.inverseTangent=Ue.atan=function(){var e,r,t,n,i,a,s,l,f,o=this,u=o.constructor,p=u.precision,h=u.rounding;if(o.isFinite()){if(o.isZero())return new u(o);if(o.abs().eq(1)&&p+4<=tv)return s=Yi(u,p+4,h).times(.25),s.s=o.s,s}else{if(!o.s)return new u(NaN);if(p+4<=tv)return s=Yi(u,p+4,h).times(.5),s.s=o.s,s}for(u.precision=l=p+10,u.rounding=1,t=Math.min(28,l/br+2|0),e=t;e;--e)o=o.div(o.times(o).plus(1).sqrt().plus(1));for(Er=!1,r=Math.ceil(l/br),n=1,f=o.times(o),s=new u(o),i=o;e!==-1;)if(i=i.times(f),a=s.minus(i.div(n+=2)),i=i.times(f),s=a.plus(i.div(n+=2)),s.d[r]!==void 0)for(e=r;s.d[e]===a.d[e]&&e--;);return t&&(s=s.times(2<this.d.length-2};Ue.isNaN=function(){return!this.s};Ue.isNegative=Ue.isNeg=function(){return this.s<0};Ue.isPositive=Ue.isPos=function(){return this.s>0};Ue.isZero=function(){return!!this.d&&this.d[0]===0};Ue.lessThan=Ue.lt=function(e){return this.cmp(e)<0};Ue.lessThanOrEqualTo=Ue.lte=function(e){return this.cmp(e)<1};Ue.logarithm=Ue.log=function(e){var r,t,n,i,a,s,l,f,o=this,u=o.constructor,p=u.precision,h=u.rounding,d=5;if(e==null)e=new u(10),r=!0;else{if(e=new u(e),t=e.d,e.s<0||!t||!t[0]||e.eq(1))return new u(NaN);r=e.eq(10)}if(t=o.d,o.s<0||!t||!t[0]||o.eq(1))return new u(t&&!t[0]?-1/0:o.s!=1?NaN:t?0:1/0);if(r)if(t.length>1)a=!0;else{for(i=t[0];i%10===0;)i/=10;a=i!==1}if(Er=!1,l=p+d,s=yo(o,l),n=r?Tc(u,l+10):yo(e,l),f=xt(s,n,l,1),bf(f.d,i=p,h))do if(l+=10,s=yo(o,l),n=r?Tc(u,l+10):yo(e,l),f=xt(s,n,l,1),!a){+ln(f.d).slice(i+1,i+15)+1==1e14&&(f=dr(f,p+1,0));break}while(bf(f.d,i+=10,h));return Er=!0,dr(f,p,h)};Ue.minus=Ue.sub=function(e){var r,t,n,i,a,s,l,f,o,u,p,h,d=this,x=d.constructor;if(e=new x(e),!d.d||!e.d)return!d.s||!e.s?e=new x(NaN):d.d?e.s=-e.s:e=new x(e.d||d.s!==e.s?d:NaN),e;if(d.s!=e.s)return e.s=-e.s,d.plus(e);if(o=d.d,h=e.d,l=x.precision,f=x.rounding,!o[0]||!h[0]){if(h[0])e.s=-e.s;else if(o[0])e=new x(d);else return new x(f===3?-0:0);return Er?dr(e,l,f):e}if(t=mn(e.e/br),u=mn(d.e/br),o=o.slice(),a=u-t,a){for(p=a<0,p?(r=o,a=-a,s=h.length):(r=h,t=u,s=o.length),n=Math.max(Math.ceil(l/br),s)+2,a>n&&(a=n,r.length=1),r.reverse(),n=a;n--;)r.push(0);r.reverse()}else{for(n=o.length,s=h.length,p=n0;--n)o[s++]=0;for(n=h.length;n>a;){if(o[--n]s?a+1:s+1,i>s&&(i=s,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(s=o.length,i=u.length,s-i<0&&(i=s,t=u,u=o,o=t),r=0;i;)r=(o[--i]=o[i]+u[i]+r)/Hi|0,o[i]%=Hi;for(r&&(o.unshift(r),++n),s=o.length;o[--s]==0;)o.pop();return e.d=o,e.e=Oc(o,n),Er?dr(e,l,f):e};Ue.precision=Ue.sd=function(e){var r,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(bo+e);return t.d?(r=Yy(t.d),e&&t.e+1>r&&(r=t.e+1)):r=NaN,r};Ue.round=function(){var e=this,r=e.constructor;return dr(new r(e),e.e+1,r.rounding)};Ue.sine=Ue.sin=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+br,n.rounding=1,t=qk(n,Zy(n,t)),n.precision=e,n.rounding=r,dr(Ra>2?t.neg():t,e,r,!0)):new n(NaN)};Ue.squareRoot=Ue.sqrt=function(){var e,r,t,n,i,a,s=this,l=s.d,f=s.e,o=s.s,u=s.constructor;if(o!==1||!l||!l[0])return new u(!o||o<0&&(!l||l[0])?NaN:l?s:1/0);for(Er=!1,o=Math.sqrt(+s),o==0||o==1/0?(r=ln(l),(r.length+f)%2==0&&(r+="0"),o=Math.sqrt(r),f=mn((f+1)/2)-(f<0||f%2),o==1/0?r="5e"+f:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+f),n=new u(r)):n=new u(o.toString()),t=(f=u.precision)+3;;)if(a=n,n=a.plus(xt(s,a,t+2,1)).times(.5),ln(a.d).slice(0,t)===(r=ln(n.d)).slice(0,t))if(r=r.slice(t-3,t+1),r=="9999"||!i&&r=="4999"){if(!i&&(dr(a,f+1,0),a.times(a).eq(s))){n=a;break}t+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(dr(n,f+1,1),e=!n.times(n).eq(s));break}return Er=!0,dr(n,f,u.rounding,e)};Ue.tangent=Ue.tan=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+10,n.rounding=1,t=t.sin(),t.s=1,t=xt(t,new n(1).minus(t.times(t)).sqrt(),e+10,0),n.precision=e,n.rounding=r,dr(Ra==2||Ra==4?t.neg():t,e,r,!0)):new n(NaN)};Ue.times=Ue.mul=function(e){var r,t,n,i,a,s,l,f,o,u=this,p=u.constructor,h=u.d,d=(e=new p(e)).d;if(e.s*=u.s,!h||!h[0]||!d||!d[0])return new p(!e.s||h&&!h[0]&&!d||d&&!d[0]&&!h?NaN:!h||!d?e.s/0:e.s*0);for(t=mn(u.e/br)+mn(e.e/br),f=h.length,o=d.length,f=0;){for(r=0,i=f+n;i>n;)l=a[i]+d[n]*h[i-n-1]+r,a[i--]=l%Hi|0,r=l/Hi|0;a[i]=(a[i]+r)%Hi|0}for(;!a[--s];)a.pop();return r?++t:a.shift(),e.d=a,e.e=Oc(a,t),Er?dr(e,p.precision,p.rounding):e};Ue.toBinary=function(e,r){return av(this,2,e,r)};Ue.toDecimalPlaces=Ue.toDP=function(e,r){var t=this,n=t.constructor;return t=new n(t),e===void 0?t:(Ln(e,0,wo),r===void 0?r=n.rounding:Ln(r,0,8),dr(t,e+t.e+1,r))};Ue.toExponential=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=pa(n,!0):(Ln(e,0,wo),r===void 0?r=i.rounding:Ln(r,0,8),n=dr(new i(n),e+1,r),t=pa(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+t:t};Ue.toFixed=function(e,r){var t,n,i=this,a=i.constructor;return e===void 0?t=pa(i):(Ln(e,0,wo),r===void 0?r=a.rounding:Ln(r,0,8),n=dr(new a(i),e+i.e+1,r),t=pa(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};Ue.toFraction=function(e){var r,t,n,i,a,s,l,f,o,u,p,h,d=this,x=d.d,v=d.constructor;if(!x)return new v(d);if(o=t=new v(1),n=f=new v(0),r=new v(n),a=r.e=Yy(x)-d.e-1,s=a%br,r.d[0]=Jt(10,s<0?br+s:s),e==null)e=a>0?r:o;else{if(l=new v(e),!l.isInt()||l.lt(o))throw Error(bo+l);e=l.gt(r)?a>0?r:o:l}for(Er=!1,l=new v(ln(x)),u=v.precision,v.precision=a=x.length*br*2;p=xt(l,r,0,1,1),i=t.plus(p.times(n)),i.cmp(e)!=1;)t=n,n=i,i=o,o=f.plus(p.times(i)),f=i,i=r,r=l.minus(p.times(i)),l=i;return i=xt(e.minus(t),n,0,1,1),f=f.plus(i.times(o)),t=t.plus(i.times(n)),f.s=o.s=d.s,h=xt(o,n,a,1).minus(d).abs().cmp(xt(f,t,a,1).minus(d).abs())<1?[o,n]:[f,t],v.precision=u,Er=!0,h};Ue.toHexadecimal=Ue.toHex=function(e,r){return av(this,16,e,r)};Ue.toNearest=function(e,r){var t=this,n=t.constructor;if(t=new n(t),e==null){if(!t.d)return t;e=new n(1),r=n.rounding}else{if(e=new n(e),r===void 0?r=n.rounding:Ln(r,0,8),!t.d)return e.s?t:e;if(!e.d)return e.s&&(e.s=t.s),e}return e.d[0]?(Er=!1,t=xt(t,e,0,r,1).times(e),Er=!0,dr(t)):(e.s=t.s,t=e),t};Ue.toNumber=function(){return+this};Ue.toOctal=function(e,r){return av(this,8,e,r)};Ue.toPower=Ue.pow=function(e){var r,t,n,i,a,s,l=this,f=l.constructor,o=+(e=new f(e));if(!l.d||!e.d||!l.d[0]||!e.d[0])return new f(Jt(+l,o));if(l=new f(l),l.eq(1))return l;if(n=f.precision,a=f.rounding,e.eq(1))return dr(l,n,a);if(r=mn(e.e/br),r>=e.d.length-1&&(t=o<0?-o:o)<=Pk)return i=Hy(f,l,t,n),e.s<0?new f(1).div(i):dr(i,n,a);if(s=l.s,s<0){if(rf.maxE+1||r0?s/0:0):(Er=!1,f.rounding=l.s=1,t=Math.min(12,(r+"").length),i=nv(e.times(yo(l,n+t)),n),i.d&&(i=dr(i,n+5,1),bf(i.d,n,a)&&(r=n+10,i=dr(nv(e.times(yo(l,r+t)),r),r+5,1),+ln(i.d).slice(n+1,n+15)+1==1e14&&(i=dr(i,n+1,0)))),i.s=s,Er=!0,f.rounding=a,dr(i,n,a))};Ue.toPrecision=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=pa(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Ln(e,1,wo),r===void 0?r=i.rounding:Ln(r,0,8),n=dr(new i(n),e,r),t=pa(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+t:t};Ue.toSignificantDigits=Ue.toSD=function(e,r){var t=this,n=t.constructor;return e===void 0?(e=n.precision,r=n.rounding):(Ln(e,1,wo),r===void 0?r=n.rounding:Ln(r,0,8)),dr(new n(t),e,r)};Ue.toString=function(){var e=this,r=e.constructor,t=pa(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t};Ue.truncated=Ue.trunc=function(){return dr(new this.constructor(this),this.e+1,1)};Ue.valueOf=Ue.toJSON=function(){var e=this,r=e.constructor,t=pa(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};function ln(e){var r,t,n,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,r=1;rt)throw Error(bo+e)}function bf(e,r,t,n){var i,a,s,l;for(a=e[0];a>=10;a/=10)--r;return--r<0?(r+=br,i=0):(i=Math.ceil((r+1)/br),r%=br),a=Jt(10,br-r),l=e[i]%a|0,n==null?r<3?(r==0?l=l/100|0:r==1&&(l=l/10|0),s=t<4&&l==99999||t>3&&l==49999||l==5e4||l==0):s=(t<4&&l+1==a||t>3&&l+1==a/2)&&(e[i+1]/a/100|0)==Jt(10,r-2)-1||(l==a/2||l==0)&&(e[i+1]/a/100|0)==0:r<4?(r==0?l=l/1e3|0:r==1?l=l/100|0:r==2&&(l=l/10|0),s=(n||t<4)&&l==9999||!n&&t>3&&l==4999):s=((n||t<4)&&l+1==a||!n&&t>3&&l+1==a/2)&&(e[i+1]/a/1e3|0)==Jt(10,r-3)-1,s}function Cc(e,r,t){for(var n,i=[0],a,s=0,l=e.length;st-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}function Rk(e,r){var t,n,i;if(r.isZero())return r;n=r.d.length,n<32?(t=Math.ceil(n/3),i=(1/Bc(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),e.precision+=t,r=tu(e,1,r.times(i),new e(1));for(var a=t;a--;){var s=r.times(r);r=s.times(s).minus(s).times(8).plus(1)}return e.precision-=t,r}var xt=function(){function e(n,i,a){var s,l=0,f=n.length;for(n=n.slice();f--;)s=n[f]*i+l,n[f]=s%a|0,l=s/a|0;return l&&n.unshift(l),n}function r(n,i,a,s){var l,f;if(a!=s)f=a>s?1:-1;else for(l=f=0;li[l]?1:-1;break}return f}function t(n,i,a,s){for(var l=0;a--;)n[a]-=l,l=n[a]1;)n.shift()}return function(n,i,a,s,l,f){var o,u,p,h,d,x,v,y,w,C,b,A,E,S,O,F,M,_,k,L,Y=n.constructor,$=n.s==i.s?1:-1,V=n.d,q=i.d;if(!V||!V[0]||!q||!q[0])return new Y(!n.s||!i.s||(V?q&&V[0]==q[0]:!q)?NaN:V&&V[0]==0||!q?$*0:$/0);for(f?(d=1,u=n.e-i.e):(f=Hi,d=br,u=mn(n.e/d)-mn(i.e/d)),k=q.length,M=V.length,w=new Y($),C=w.d=[],p=0;q[p]==(V[p]||0);p++);if(q[p]>(V[p]||0)&&u--,a==null?(S=a=Y.precision,s=Y.rounding):l?S=a+(n.e-i.e)+1:S=a,S<0)C.push(1),x=!0;else{if(S=S/d+2|0,p=0,k==1){for(h=0,q=q[0],S++;(p1&&(q=e(q,h,f),V=e(V,h,f),k=q.length,M=V.length),F=k,b=V.slice(0,k),A=b.length;A=f/2&&++_;do h=0,o=r(q,b,k,A),o<0?(E=b[0],k!=A&&(E=E*f+(b[1]||0)),h=E/_|0,h>1?(h>=f&&(h=f-1),v=e(q,h,f),y=v.length,A=b.length,o=r(v,b,y,A),o==1&&(h--,t(v,k=10;h/=10)p++;w.e=p+u*d-1,dr(w,l?a+w.e+1:a,s,x)}return w}}();function dr(e,r,t,n){var i,a,s,l,f,o,u,p,h,d=e.constructor;e:if(r!=null){if(p=e.d,!p)return e;for(i=1,l=p[0];l>=10;l/=10)i++;if(a=r-i,a<0)a+=br,s=r,u=p[h=0],f=u/Jt(10,i-s-1)%10|0;else if(h=Math.ceil((a+1)/br),l=p.length,h>=l)if(n){for(;l++<=h;)p.push(0);u=f=0,i=1,a%=br,s=a-br+1}else break e;else{for(u=l=p[h],i=1;l>=10;l/=10)i++;a%=br,s=a-br+i,f=s<0?0:u/Jt(10,i-s-1)%10|0}if(n=n||r<0||p[h+1]!==void 0||(s<0?u:u%Jt(10,i-s-1)),o=t<4?(f||n)&&(t==0||t==(e.s<0?3:2)):f>5||f==5&&(t==4||n||t==6&&(a>0?s>0?u/Jt(10,i-s):0:p[h-1])%10&1||t==(e.s<0?8:7)),r<1||!p[0])return p.length=0,o?(r-=e.e+1,p[0]=Jt(10,(br-r%br)%br),e.e=-r||0):p[0]=e.e=0,e;if(a==0?(p.length=h,l=1,h--):(p.length=h+1,l=Jt(10,br-a),p[h]=s>0?(u/Jt(10,i-s)%Jt(10,s)|0)*l:0),o)for(;;)if(h==0){for(a=1,s=p[0];s>=10;s/=10)a++;for(s=p[0]+=l,l=1;s>=10;s/=10)l++;a!=l&&(e.e++,p[0]==Hi&&(p[0]=1));break}else{if(p[h]+=l,p[h]!=Hi)break;p[h--]=0,l=1}for(a=p.length;p[--a]===0;)p.pop()}return Er&&(e.e>d.maxE?(e.d=null,e.e=NaN):e.e0?a=a.charAt(0)+"."+a.slice(1)+xo(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+xo(-i-1)+a,t&&(n=t-s)>0&&(a+=xo(n))):i>=s?(a+=xo(i+1-s),t&&(n=t-i-1)>0&&(a=a+"."+xo(n))):((n=i+1)0&&(i+1===s&&(a+="."),a+=xo(n))),a}function Oc(e,r){var t=e[0];for(r*=br;t>=10;t/=10)r++;return r}function Tc(e,r,t){if(r>kk)throw Er=!0,t&&(e.precision=t),Error(Uy);return dr(new e(Mc),r,1,!0)}function Yi(e,r,t){if(r>tv)throw Error(Uy);return dr(new e(_c),r,t,!0)}function Yy(e){var r=e.length-1,t=r*br+1;if(r=e[r],r){for(;r%10==0;r/=10)t--;for(r=e[0];r>=10;r/=10)t++}return t}function xo(e){for(var r="";e--;)r+="0";return r}function Hy(e,r,t,n){var i,a=new e(1),s=Math.ceil(n/br+4);for(Er=!1;;){if(t%2&&(a=a.times(r),Ry(a.d,s)&&(i=!0)),t=mn(t/2),t===0){t=a.d.length-1,i&&a.d[t]===0&&++a.d[t];break}r=r.times(r),Ry(r.d,s)}return Er=!0,a}function ky(e){return e.d[e.d.length-1]&1}function Gy(e,r,t){for(var n,i=new e(r[0]),a=0;++a17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(r==null?(Er=!1,f=x):f=r,l=new h(.03125);e.e>-2;)e=e.times(l),p+=5;for(n=Math.log(Jt(2,p))/Math.LN10*2+5|0,f+=n,t=a=s=new h(1),h.precision=f;;){if(a=dr(a.times(e),f,1),t=t.times(++u),l=s.plus(xt(a,t,f,1)),ln(l.d).slice(0,f)===ln(s.d).slice(0,f)){for(i=p;i--;)s=dr(s.times(s),f,1);if(r==null)if(o<3&&bf(s.d,f-n,d,o))h.precision=f+=10,t=a=l=new h(1),u=0,o++;else return dr(s,h.precision=x,d,Er=!0);else return h.precision=x,s}s=l}}function yo(e,r){var t,n,i,a,s,l,f,o,u,p,h,d=1,x=10,v=e,y=v.d,w=v.constructor,C=w.rounding,b=w.precision;if(v.s<0||!y||!y[0]||!v.e&&y[0]==1&&y.length==1)return new w(y&&!y[0]?-1/0:v.s!=1?NaN:y?0:v);if(r==null?(Er=!1,u=b):u=r,w.precision=u+=x,t=ln(y),n=t.charAt(0),Math.abs(a=v.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)v=v.times(e),t=ln(v.d),n=t.charAt(0),d++;a=v.e,n>1?(v=new w("0."+t),a++):v=new w(n+"."+t.slice(1))}else return o=Tc(w,u+2,b).times(a+""),v=yo(new w(n+"."+t.slice(1)),u-x).plus(o),w.precision=b,r==null?dr(v,b,C,Er=!0):v;for(p=v,f=s=v=xt(v.minus(1),v.plus(1),u,1),h=dr(v.times(v),u,1),i=3;;){if(s=dr(s.times(h),u,1),o=f.plus(xt(s,new w(i),u,1)),ln(o.d).slice(0,u)===ln(f.d).slice(0,u))if(f=f.times(2),a!==0&&(f=f.plus(Tc(w,u+2,b).times(a+""))),f=xt(f,new w(d),u,1),r==null)if(bf(f.d,u-x,C,l))w.precision=u+=x,o=s=v=xt(p.minus(1),p.plus(1),u,1),h=dr(v.times(v),u,1),i=l=1;else return dr(f,w.precision=b,C,Er=!0);else return w.precision=b,f;f=o,i+=2}}function $y(e){return String(e.s*e.s/0)}function iv(e,r){var t,n,i;for((t=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(t<0&&(t=n),t+=+r.slice(n+1),r=r.substring(0,n)):t<0&&(t=r.length),n=0;r.charCodeAt(n)===48;n++);for(i=r.length;r.charCodeAt(i-1)===48;--i);if(r=r.slice(n,i),r){if(i-=n,e.e=t=t-n-1,e.d=[],n=(t+1)%br,t<0&&(n+=br),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(r=r.replace(/(\\d)_(?=\\d)/g,"$1"),Vy.test(r))return iv(e,r)}else if(r==="Infinity"||r==="NaN")return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if(Bk.test(r))t=16,r=r.toLowerCase();else if(Ok.test(r))t=2;else if(Ik.test(r))t=8;else throw Error(bo+r);for(a=r.search(/p/i),a>0?(f=+r.slice(a+1),r=r.substring(2,a)):r=r.slice(2),a=r.indexOf("."),s=a>=0,n=e.constructor,s&&(r=r.replace(".",""),l=r.length,a=l-a,i=Hy(n,new n(t),a,a*2)),o=Cc(r,t,Hi),u=o.length-1,a=u;o[a]===0;--a)o.pop();return a<0?new n(e.s*0):(e.e=Oc(o,u),e.d=o,Er=!1,s&&(e=xt(e,i,l*4)),f&&(e=e.times(Math.abs(f)<54?Jt(2,f):wf.pow(2,f))),Er=!0,e)}function qk(e,r){var t,n=r.d.length;if(n<3)return r.isZero()?r:tu(e,2,r,r);t=1.4*Math.sqrt(n),t=t>16?16:t|0,r=r.times(1/Bc(5,t)),r=tu(e,2,r,r);for(var i,a=new e(5),s=new e(16),l=new e(20);t--;)i=r.times(r),r=r.times(a.plus(i.times(s.times(i).minus(l))));return r}function tu(e,r,t,n,i){var a,s,l,f,o=1,u=e.precision,p=Math.ceil(u/br);for(Er=!1,f=t.times(t),l=new e(n);;){if(s=xt(l.times(f),new e(r++*r++),u,1),l=i?n.plus(s):n.minus(s),n=xt(s.times(f),new e(r++*r++),u,1),s=l.plus(n),s.d[p]!==void 0){for(a=p;s.d[a]===l.d[a]&&a--;);if(a==-1)break}a=l,l=n,n=s,s=a,o++}return Er=!0,s.d.length=p+1,s}function Bc(e,r){for(var t=e;--r;)t*=e;return t}function Zy(e,r){var t,n=r.s<0,i=Yi(e,e.precision,1),a=i.times(.5);if(r=r.abs(),r.lte(a))return Ra=n?4:1,r;if(t=r.divToInt(i),t.isZero())Ra=n?3:2;else{if(r=r.minus(t.times(i)),r.lte(a))return Ra=ky(t)?n?2:3:n?4:1,r;Ra=ky(t)?n?1:4:n?3:2}return r.minus(i).abs()}function av(e,r,t,n){var i,a,s,l,f,o,u,p,h,d=e.constructor,x=t!==void 0;if(x?(Ln(t,1,wo),n===void 0?n=d.rounding:Ln(n,0,8)):(t=d.precision,n=d.rounding),!e.isFinite())u=$y(e);else{for(u=pa(e),s=u.indexOf("."),x?(i=2,r==16?t=t*4-3:r==8&&(t=t*3-2)):i=r,s>=0&&(u=u.replace(".",""),h=new d(1),h.e=u.length-s,h.d=Cc(pa(h),10,i),h.e=h.d.length),p=Cc(u,10,i),a=f=p.length;p[--f]==0;)p.pop();if(!p[0])u=x?"0p+0":"0";else{if(s<0?a--:(e=new d(e),e.d=p,e.e=a,e=xt(e,h,t,n,0,i),p=e.d,a=e.e,o=qy),s=p[t],l=i/2,o=o||p[t+1]!==void 0,o=n<4?(s!==void 0||o)&&(n===0||n===(e.s<0?3:2)):s>l||s===l&&(n===4||o||n===6&&p[t-1]&1||n===(e.s<0?8:7)),p.length=t,o)for(;++p[--t]>i-1;)p[t]=0,t||(++a,p.unshift(1));for(f=p.length;!p[f-1];--f);for(s=0,u="";s1)if(r==16||r==8){for(s=r==16?4:3,--f;f%s;f++)u+="0";for(p=Cc(u,i,r),f=p.length;!p[f-1];--f);for(s=1,u="1.";sf)for(a-=f;a--;)u+="0";else ar)return e.length=r,!0}function Uk(e){return new this(e).abs()}function zk(e){return new this(e).acos()}function Wk(e){return new this(e).acosh()}function Vk(e,r){return new this(e).plus(r)}function Yk(e){return new this(e).asin()}function Hk(e){return new this(e).asinh()}function Gk(e){return new this(e).atan()}function $k(e){return new this(e).atanh()}function Zk(e,r){e=new this(e),r=new this(r);var t,n=this.precision,i=this.rounding,a=n+4;return!e.s||!r.s?t=new this(NaN):!e.d&&!r.d?(t=Yi(this,a,1).times(r.s>0?.25:.75),t.s=e.s):!r.d||e.isZero()?(t=r.s<0?Yi(this,n,i):new this(0),t.s=e.s):!e.d||r.isZero()?(t=Yi(this,a,1).times(.5),t.s=e.s):r.s<0?(this.precision=a,this.rounding=1,t=this.atan(xt(e,r,a,1)),r=Yi(this,a,1),this.precision=n,this.rounding=i,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(xt(e,r,a,1)),t}function Qk(e){return new this(e).cbrt()}function Xk(e){return dr(e=new this(e),e.e+1,2)}function Jk(e,r,t){return new this(e).clamp(r,t)}function Kk(e){if(!e||typeof e!="object")throw Error(Fc+"Object expected");var r,t,n,i=e.defaults===!0,a=["precision",1,wo,"rounding",0,8,"toExpNeg",-ru,0,"toExpPos",0,ru,"maxE",0,ru,"minE",-ru,0,"modulo",0,9];for(r=0;r=a[r+1]&&n<=a[r+2])this[t]=n;else throw Error(bo+t+": "+n);if(t="crypto",i&&(this[t]=rv[t]),(n=e[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(zy);else this[t]=!1;else throw Error(bo+t+": "+n);return this}function jk(e){return new this(e).cos()}function eR(e){return new this(e).cosh()}function Qy(e){var r,t,n;function i(a){var s,l,f,o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,Ly(a)){o.s=a.s,Er?!a.d||a.e>i.maxE?(o.e=NaN,o.d=null):a.e=10;l/=10)s++;Er?s>i.maxE?(o.e=NaN,o.d=null):s=429e7?r[a]=crypto.getRandomValues(new Uint32Array(1))[0]:l[a++]=i%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(n*=4);a=214e7?crypto.randomBytes(4).copy(r,a):(l.push(i%1e7),a+=4);a=n/4}else throw Error(zy);else for(;a=10;i/=10)n++;n{var{on:r,config:t}=e,n=ts.clone({precision:t.precision,modulo:ts.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(i){return new n(i.value)},r&&r("config",function(i,a){i.precision!==a.precision&&n.config({precision:i.precision})}),n},{isClass:!0});var tn=ci(Ky(),1);var CR="Complex",MR=[],jy=T(CR,MR,()=>(Object.defineProperty(tn.default,"name",{value:"Complex"}),tn.default.prototype.constructor=tn.default,tn.default.prototype.type="Complex",tn.default.prototype.isComplex=!0,tn.default.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},tn.default.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},tn.default.prototype.format=function(e){var r="",t=this.im,n=this.re,i=Wi(this.re,e),a=Wi(this.im,e),s=ar(e)?e:e?e.precision:null;if(s!==null){var l=Math.pow(10,-s);Math.abs(n/t)r.re?1:e.rer.im?1:e.im(Object.defineProperty(ma.default,"name",{value:"Fraction"}),ma.default.prototype.constructor=ma.default,ma.default.prototype.type="Fraction",ma.default.prototype.isFraction=!0,ma.default.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},ma.default.fromJSON=function(e){return new ma.default(e)},ma.default),{isClass:!0});var FR="Range",OR=[],n1=T(FR,OR,()=>{function e(r,t,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=r!=null,a=t!=null,s=n!=null;if(i){if(je(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter start must be a number")}if(a){if(je(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter end must be a number")}if(s){if(je(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(r):0,this.end=a?parseFloat(t):0,this.step=s?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(r){if(typeof r!="string")return null;var t=r.split(":"),n=t.map(function(a){return parseFloat(a)}),i=n.some(function(a){return isNaN(a)});if(i)return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var r=0,t=this.start,n=this.step,i=this.end,a=i-t;return hi(n)===hi(a)?r=Math.ceil(a/n):a===0&&(r=0),isNaN(r)&&(r=0),[r]},e.prototype.min=function(){var r=this.size()[0];if(r>0)return this.step>0?this.start:this.start+(r-1)*this.step},e.prototype.max=function(){var r=this.size()[0];if(r>0)return this.step>0?this.start+(r-1)*this.step:this.start},e.prototype.forEach=function(r){var t=this.start,n=this.step,i=this.end,a=0;if(n>0)for(;ti;)r(t,[a],this),t+=n,a++},e.prototype.map=function(r){var t=[];return this.forEach(function(n,i,a){t[i[0]]=r(n,i,a)}),t},e.prototype.toArray=function(){var r=[];return this.forEach(function(t,n){r[n[0]]=t}),r},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(r){var t=Wi(this.start,r);return this.step!==1&&(t+=":"+Wi(this.step,r)),t+=":"+Wi(this.end,r),t},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(r){return new e(r.start,r.end,r.step)},e},{isClass:!0});var BR="Matrix",IR=[],i1=T(BR,IR,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(r,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(r,t,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(r){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(r,t,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(r,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(r,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(r,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(r){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(r){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function a1(e){var r=0,t=1,n=Object.create(null),i=Object.create(null),a=0,s=function(f){var o=i[f];if(!!o&&(delete n[o],delete i[f],--r,t===o)){if(!r){a=0,t=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++t););}};return e=Math.abs(e),{hit:function(f){var o=i[f],u=++a;if(n[u]=f,i[f]=u,!o)return++r,r<=e?void 0:(f=n[t],s(f),f);if(delete n[o],t===o)for(;!Object.prototype.hasOwnProperty.call(n,++t););},delete:s,clear:function(){r=a=0,t=1,n=Object.create(null),i=Object.create(null)}}}function ns(e){var{hasher:r,limit:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t=t??Number.POSITIVE_INFINITY,r=r??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:a1(t||Number.POSITIVE_INFINITY)});for(var i=[],a=0;a{var{Matrix:r}=e;function t(u,p){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(p&&!yt(p))throw new Error("Invalid datatype: "+p);if(Ge(u))u.type==="DenseMatrix"?(this._data=tr(u._data),this._size=tr(u._size),this._datatype=p||u._datatype):(this._data=u.toArray(),this._size=u.size(),this._datatype=p||u._datatype);else if(u&&Ar(u.data)&&Ar(u.size))this._data=u.data,this._size=u.size,Yd(this._data,this._size),this._datatype=p||u.datatype;else if(Ar(u))this._data=o(u),this._size=or(this._data),Yd(this._data,this._size),this._datatype=p;else{if(u)throw new TypeError("Unsupported type of data ("+_r(u)+")");this._data=[],this._size=[0],this._datatype=p}}t.prototype=new r,t.prototype.createDenseMatrix=function(u,p){return new t(u,p)},Object.defineProperty(t,"name",{value:"DenseMatrix"}),t.prototype.constructor=t,t.prototype.type="DenseMatrix",t.prototype.isDenseMatrix=!0,t.prototype.getDataType=function(){return vo(this._data,_r)},t.prototype.storage=function(){return"dense"},t.prototype.datatype=function(){return this._datatype},t.prototype.create=function(u,p){return new t(u,p)},t.prototype.subset=function(u,p,h){switch(arguments.length){case 1:return n(this,u);case 2:case 3:return a(this,u,p,h);default:throw new SyntaxError("Wrong number of arguments")}},t.prototype.get=function(u){if(!Ar(u))throw new TypeError("Array expected");if(u.length!==this._size.length)throw new pr(u.length,this._size.length);for(var p=0;p");var b=p.max().map(function(S){return S+1});f(u,b,d);var A=x.length,E=0;s(u._data,p,h,A,E)}return u}function s(u,p,h,d,x){var v=x===d-1,y=p.dimension(x);v?y.forEach(function(w,C){Xr(w),u[w]=h[C[0]]}):y.forEach(function(w,C){Xr(w),s(u[w],p,h[C[0]],d,x+1)})}t.prototype.resize=function(u,p,h){if(!bt(u))throw new TypeError("Array or Matrix expected");var d=u.valueOf().map(v=>Array.isArray(v)&&v.length===1?v[0]:v),x=h?this.clone():this;return l(x,d,p)};function l(u,p,h){if(p.length===0){for(var d=u._data;Ar(d);)d=d[0];return d}return u._size=p.slice(0),u._data=Vi(u._data,u._size,h),u}t.prototype.reshape=function(u,p){var h=p?this.clone():this;h._data=gf(h._data,u);var d=h._size.reduce((x,v)=>x*v);return h._size=xf(u,d),h};function f(u,p,h){for(var d=u._size.slice(0),x=!1;d.lengthd[v]&&(d[v]=p[v],x=!0);x&&l(u,d,h)}t.prototype.clone=function(){var u=new t({data:tr(this._data),size:tr(this._size),datatype:this._datatype});return u},t.prototype.size=function(){return this._size.slice(0)},t.prototype.map=function(u){var p=this,h=Ic(u),d=function y(w,C){return Ar(w)?w.map(function(b,A){return y(b,C.concat(A))}):h===1?u(w):h===2?u(w,C):u(w,C,p)},x=d(this._data,[]),v=this._datatype!==void 0?vo(x,_r):void 0;return new t(x,v)},t.prototype.forEach=function(u){var p=this,h=function d(x,v){Ar(x)?x.forEach(function(y,w){d(y,v.concat(w))}):u(x,v,p)};h(this._data,[])},t.prototype[Symbol.iterator]=function*(){var u=function*p(h,d){if(Ar(h))for(var x=0;x[b[w]]);p.push(new t(C,u._datatype))},v=0;v0?u:0,h=u<0?-u:0,d=this._size[0],x=this._size[1],v=Math.min(d-h,x-p),y=[],w=0;w0?h:0,v=h<0?-h:0,y=u[0],w=u[1],C=Math.min(y-v,w-x),b;if(Ar(p)){if(p.length!==C)throw new Error("Invalid value array length");b=function(F){return p[F]}}else if(Ge(p)){var A=p.size();if(A.length!==1||A[0]!==C)throw new Error("Invalid matrix length");b=function(F){return p.get([F])}}else b=function(){return p};d||(d=je(b(0))?b(0).mul(0):0);var E=[];if(u.length>0){E=Vi(E,u,d);for(var S=0;S{var{typed:r}=e;return r(s1,{any:tr})});function Pc(e){var r=e.length,t=e[0].length,n,i,a=[];for(i=0;i=n.length)throw new Xt(r,n.length);return Ge(e)?e.create(kc(e.valueOf(),r,t)):kc(e,r,t)}function kc(e,r,t){var n,i,a,s;if(r<=0)if(Array.isArray(e[0])){for(s=Pc(e),i=[],n=0;n{var{typed:r}=e;return r(f1,{number:He,BigNumber:function(n){return n.isInt()},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var qn="number",La="number, number";function fv(e){return Math.abs(e)}fv.signature=qn;function lv(e,r){return e+r}lv.signature=La;function cv(e,r){return e-r}cv.signature=La;function pv(e,r){return e*r}pv.signature=La;function qR(e,r){return e/r}qR.signature=La;function mv(e){return-e}mv.signature=qn;function hv(e){return e}hv.signature=qn;function nu(e){return sy(e)}nu.signature=qn;function dv(e){return e*e*e}dv.signature=qn;function vv(e){return Math.exp(e)}vv.signature=qn;function gv(e){return uy(e)}gv.signature=qn;function UR(e,r){if(!He(e)||!He(r))throw new Error("Parameters in function gcd must be integer numbers");for(var t;r!==0;)t=e%r,e=r,r=t;return e<0?-e:e}UR.signature=La;function xv(e,r){if(!He(e)||!He(r))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||r===0)return 0;for(var t,n=e*r;r!==0;)t=r,r=e%t,e=t;return Math.abs(n/e)}xv.signature=La;function c1(e,r){return r?Math.log(e)/Math.log(r):Math.log(e)}function yv(e){return oy(e)}yv.signature=qn;function bv(e){return ay(e)}bv.signature=qn;function zR(e){return xc(e)}zR.signature=qn;function WR(e,r){return r===0?e:e-r*Math.floor(e/r)}WR.signature=La;function wv(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,t=r<0;if(t&&(r=-r),r===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(r)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return t?1/0:0;if(!isFinite(e))return t?0:e;var n=Math.pow(Math.abs(e),1/r);return n=e<0?-n:n,t?1/n:n}function Rc(e){return hi(e)}Rc.signature=qn;function VR(e){return Math.sqrt(e)}VR.signature=qn;function Dv(e){return e*e}Dv.signature=qn;function Sv(e,r){var t,n,i,a=0,s=1,l=1,f=0;if(!He(e)||!He(r))throw new Error("Parameters in function xgcd must be integer numbers");for(;r;)n=Math.floor(e/r),i=e-n*r,t=a,a=s-n*a,s=t,t=l,l=f-n*l,f=t,e=r,r=i;var o;return e<0?o=[-e,-s,-f]:o=[e,e?s:0,f],o}Sv.signature=La;function Nv(e,r){return e*e<1&&r===1/0||e*e>1&&r===-1/0?0:Math.pow(e,r)}Nv.signature=La;function iu(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!He(r)||r<0||r>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(zd(e,r))}function YR(e){return Math.abs(e)}YR.signature=qn;var HR="number",au="number, number";function Av(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function bitAnd");return e&r}Av.signature=au;function Ev(e){if(!He(e))throw new Error("Integer expected in function bitNot");return~e}Ev.signature=HR;function Cv(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function bitOr");return e|r}Cv.signature=au;function Mv(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function bitXor");return e^r}Mv.signature=au;function _v(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function leftShift");return e<>r}Tv.signature=au;function Fv(e,r){if(!He(e)||!He(r))throw new Error("Integers expected in function rightLogShift");return e>>>r}Fv.signature=au;function Kn(e,r){if(r>1;return Kn(e,t)*Kn(t+1,r)}function Ov(e,r){if(!He(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!He(r)||r<0)throw new TypeError("Positive integer value expected in function combinations");if(r>e)throw new TypeError("k must be less than or equal to n");for(var t=e-r,n=1,i=r171?1/0:Kn(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*Df(1-e));if(e>=171.35)return 1/0;if(e>85){var t=e*e,n=t*e,i=n*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*t)-139/(51840*n)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,r=is[0];for(var s=1;s=1;n--)t+=v1[n]/(e+n);return qv+(e+.5)*Math.log(r)-r+Math.log(t)}Sf.signature="number";var Dt="number",QR="number, number";function XR(e){return Math.acos(e)}XR.signature=Dt;function Uv(e){return cy(e)}Uv.signature=Dt;function zv(e){return Math.atan(1/e)}zv.signature=Dt;function Wv(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}Wv.signature=Dt;function Vv(e){return Math.asin(1/e)}Vv.signature=Dt;function Yv(e){var r=1/e;return Math.log(r+Math.sqrt(r*r+1))}Yv.signature=Dt;function Hv(e){return Math.acos(1/e)}Hv.signature=Dt;function Gv(e){var r=1/e,t=Math.sqrt(r*r-1);return Math.log(t+r)}Gv.signature=Dt;function JR(e){return Math.asin(e)}JR.signature=Dt;function $v(e){return py(e)}$v.signature=Dt;function KR(e){return Math.atan(e)}KR.signature=Dt;function jR(e,r){return Math.atan2(e,r)}jR.signature=QR;function Zv(e){return my(e)}Zv.signature=Dt;function e9(e){return Math.cos(e)}e9.signature=Dt;function r9(e){return bc(e)}r9.signature=Dt;function Qv(e){return 1/Math.tan(e)}Qv.signature=Dt;function Xv(e){var r=Math.exp(2*e);return(r+1)/(r-1)}Xv.signature=Dt;function Jv(e){return 1/Math.sin(e)}Jv.signature=Dt;function Kv(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*hi(e)}Kv.signature=Dt;function jv(e){return 1/Math.cos(e)}jv.signature=Dt;function eg(e){return 2/(Math.exp(e)+Math.exp(-e))}eg.signature=Dt;function t9(e){return Math.sin(e)}t9.signature=Dt;function rg(e){return hy(e)}rg.signature=Dt;function n9(e){return Math.tan(e)}n9.signature=Dt;function i9(e){return wc(e)}i9.signature=Dt;var Nf="number";function a9(e){return He(e)}a9.signature=Nf;function tg(e){return e<0}tg.signature=Nf;function ng(e){return e>0}ng.signature=Nf;function ig(e){return e===0}ig.signature=Nf;function ag(e){return Number.isNaN(e)}ag.signature=Nf;var g1="isNegative",o9=["typed"],x1=T(g1,o9,e=>{var{typed:r}=e;return r(g1,{number:tg,BigNumber:function(n){return n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s<0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var y1="isNumeric",s9=["typed"],b1=T(y1,s9,e=>{var{typed:r}=e;return r(y1,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var w1="hasNumericValue",u9=["typed","isNumeric"],D1=T(w1,u9,e=>{var{typed:r,isNumeric:t}=e;return r(w1,{boolean:()=>!0,string:function(i){return i.trim().length>0&&!isNaN(Number(i))},any:function(i){return t(i)}})});var S1="isPositive",f9=["typed"],N1=T(S1,f9,e=>{var{typed:r}=e;return r(S1,{number:ng,BigNumber:function(n){return!n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s>0&&n.n>0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var A1="isZero",l9=["typed"],E1=T(A1,l9,e=>{var{typed:r}=e;return r(A1,{number:ig,BigNumber:function(n){return n.isZero()},Complex:function(n){return n.re===0&&n.im===0},Fraction:function(n){return n.d===1&&n.n===0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var C1="isNaN",c9=["typed"],M1=T(C1,c9,e=>{var{typed:r}=e;return r(C1,{number:ag,BigNumber:function(n){return n.isNaN()},Fraction:function(n){return!1},Complex:function(n){return n.isNaN()},Unit:function(n){return Number.isNaN(n.value)},"Array | Matrix":function(n){return Je(n,Number.isNaN)}})});var _1="typeOf",p9=["typed"],T1=T(_1,p9,e=>{var{typed:r}=e;return r(_1,{any:_r})});function Ut(e,r,t){if(t==null)return e.eq(r);if(e.eq(r))return!0;if(e.isNaN()||r.isNaN())return!1;if(e.isFinite()&&r.isFinite()){var n=e.minus(r).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),r.abs());return n.lte(i.times(t))}return!1}function F1(e,r,t){return wt(e.re,r.re,t)&&wt(e.im,r.im,t)}var vi=T("compareUnits",["typed"],e=>{var{typed:r}=e;return{"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return r.find(t,[n.valueType(),i.valueType()])(n.value,i.value)})}});var Lc="equalScalar",m9=["typed","config"],O1=T(Lc,m9,e=>{var{typed:r,config:t}=e,n=vi({typed:r});return r(Lc,{"boolean, boolean":function(a,s){return a===s},"number, number":function(a,s){return wt(a,s,t.epsilon)},"BigNumber, BigNumber":function(a,s){return a.eq(s)||Ut(a,s,t.epsilon)},"Fraction, Fraction":function(a,s){return a.equals(s)},"Complex, Complex":function(a,s){return F1(a,s,t.epsilon)}},n)}),SX=T(Lc,["typed","config"],e=>{var{typed:r,config:t}=e;return r(Lc,{"number, number":function(i,a){return wt(i,a,t.epsilon)}})});var h9="SparseMatrix",d9=["typed","equalScalar","Matrix"],B1=T(h9,d9,e=>{var{typed:r,equalScalar:t,Matrix:n}=e;function i(v,y){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(y&&!yt(y))throw new Error("Invalid datatype: "+y);if(Ge(v))a(this,v,y);else if(v&&Ar(v.index)&&Ar(v.ptr)&&Ar(v.size))this._values=v.values,this._index=v.index,this._ptr=v.ptr,this._size=v.size,this._datatype=y||v.datatype;else if(Ar(v))s(this,v,y);else{if(v)throw new TypeError("Unsupported type of data ("+_r(v)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=y}}function a(v,y,w){y.type==="SparseMatrix"?(v._values=y._values?tr(y._values):void 0,v._index=tr(y._index),v._ptr=tr(y._ptr),v._size=tr(y._size),v._datatype=w||y._datatype):s(v,y.valueOf(),w||y._datatype)}function s(v,y,w){v._values=[],v._index=[],v._ptr=[],v._datatype=w;var C=y.length,b=0,A=t,E=0;if(yt(w)&&(A=r.find(t,[w,w])||t,E=r.convert(0,w)),C>0){var S=0;do{v._ptr.push(v._index.length);for(var O=0;O");if(b.length===1){var F=y.dimension(0);F.forEach(function(k,L){Xr(k),v.set([k,0],w[L[0]],C)})}else{var M=y.dimension(0),_=y.dimension(1);M.forEach(function(k,L){Xr(k),_.forEach(function(Y,$){Xr(Y),v.set([k,Y],w[L[0]][$[0]],C)})})}}return v}i.prototype.get=function(v){if(!Ar(v))throw new TypeError("Array expected");if(v.length!==this._size.length)throw new pr(v.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var y=v[0],w=v[1];Xr(y,this._size[0]),Xr(w,this._size[1]);var C=o(y,this._ptr[w],this._ptr[w+1],this._index);return CA-1||b>E-1)&&(h(this,Math.max(C+1,A),Math.max(b+1,E),w),A=this._size[0],E=this._size[1]),Xr(C,A),Xr(b,E);var F=o(C,this._ptr[b],this._ptr[b+1],this._index);return FArray.isArray(A)&&A.length===1?A[0]:A);if(C.length!==2)throw new Error("Only two dimensions matrix are supported");C.forEach(function(A){if(!ar(A)||!He(A)||A<0)throw new TypeError("Invalid size, must contain positive integers (size: "+lr(C)+")")});var b=w?this.clone():this;return h(b,C[0],C[1],y)};function h(v,y,w,C){var b=C||0,A=t,E=0;yt(v._datatype)&&(A=r.find(t,[v._datatype,v._datatype])||t,E=r.convert(0,v._datatype),b=r.convert(b,v._datatype));var S=!A(b,E),O=v._size[0],F=v._size[1],M,_,k;if(w>F){for(_=F;_O){if(S){var L=0;for(_=0;_y-1&&(v._values.splice(k,1),v._index.splice(k,1),$++)}v._ptr[_]=v._values.length}return v._size[0]=y,v._size[1]=w,v}i.prototype.reshape=function(v,y){if(!Ar(v))throw new TypeError("Array expected");if(v.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");v.forEach(function(U){if(!ar(U)||!He(U)||U<=-2||U===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+lr(v)+")")});var w=this._size[0]*this._size[1];v=xf(v,w);var C=v[0]*v[1];if(w!==C)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var b=y?this.clone():this;if(this._size[0]===v[0]&&this._size[1]===v[1])return b;for(var A=[],E=0;E=y&&q<=w&&k(v._values[V],q-y,L-C)}else{for(var R={},j=Y;j<$;j++){var U=v._index[j];R[U]=v._values[j]}for(var oe=y;oe<=w;oe++){var me=oe in R?R[oe]:0;k(me,oe-y,L-C)}}}return F.push(S.length),new i({values:S,index:O,ptr:F,size:[w-y+1,b-C+1]})}i.prototype.forEach=function(v,y){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var w=this,C=this._size[0],b=this._size[1],A=0;A "+(this._values?lr(this._values[O],v):"X")}return b},i.prototype.toString=function(){return lr(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(v){if(v){if(je(v)&&(v=v.toNumber()),!ar(v)||!He(v))throw new TypeError("The parameter k must be an integer number")}else v=0;var y=v>0?v:0,w=v<0?-v:0,C=this._size[0],b=this._size[1],A=Math.min(C-w,b-y),E=[],S=[],O=[];O[0]=0;for(var F=y;F0?w:0,O=w<0?-w:0,F=v[0],M=v[1],_=Math.min(F-O,M-S),k;if(Ar(y)){if(y.length!==_)throw new Error("Invalid value array length");k=function(oe){return y[oe]}}else if(Ge(y)){var L=y.size();if(L.length!==1||L[0]!==_)throw new Error("Invalid matrix length");k=function(oe){return y.get([oe])}}else k=function(){return y};for(var Y=[],$=[],V=[],q=0;q=0&&R<_){var j=k(R);A(j,E)||($.push(R+O),Y.push(j))}}return V.push(Y.length),new i({values:Y,index:$,ptr:V,size:[F,M]})},i.prototype.swapRows=function(v,y){if(!ar(v)||!He(v)||!ar(y)||!He(y))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Xr(v,this._size[0]),Xr(y,this._size[0]),i._swapRows(v,y,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(v,y,w,C,b){for(var A=C[v],E=C[v+1],S=A;S=O||b[M]!==y)){var k=C?C[F]:void 0;b.splice(M,0,y),C&&C.splice(M,0,k),b.splice(M<=F?F+1:F,1),C&&C.splice(M<=F?F+1:F,1);continue}if(M=O||b[F]!==v)){var L=C?C[M]:void 0;b.splice(F,0,v),C&&C.splice(F,0,L),b.splice(F<=M?M+1:M,1),C&&C.splice(F<=M?M+1:M,1)}}},i},{isClass:!0});var h9="number",d9=["typed"];function v9(e){var r=e.match(/(0[box])([0-9a-fA-F]*)\\.([0-9a-fA-F]*)/);if(r){var t={"0b":2,"0o":8,"0x":16}[r[1]],n=r[2],i=r[3];return{input:e,radix:t,integerPart:n,fractionalPart:i}}else return null}function g9(e){for(var r=parseInt(e.integerPart,e.radix),t=0,n=0;n{var{typed:r}=e,t=r("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var a=v9(i);if(a)return g9(a);var s=0,c=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);c&&(s=Number(c[2]),i=c[1]);var f=Number(i);if(isNaN(f))throw new SyntaxError('String "'+i+'" is not a valid number');if(c){if(f>2**s-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));f>=2**(s-1)&&(f=f-2**s)}return f},BigNumber:function(i){return i.toNumber()},Fraction:function(i){return i.valueOf()},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),null:function(i){return 0},"Unit, string | Unit":function(i,a){return i.toNumber(a)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))});return t.fromJSON=function(n){return parseFloat(n.value)},t});var I1="string",x9=["typed"],P1=T(I1,x9,e=>{var{typed:r}=e;return r(I1,{"":function(){return""},number:zi,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t)),any:function(n){return String(n)}})});var k1="boolean",y9=["typed"],R1=T(k1,y9,e=>{var{typed:r}=e;return r(k1,{"":function(){return!1},boolean:function(n){return n},number:function(n){return!!n},null:function(n){return!1},BigNumber:function(n){return!n.isZero()},string:function(n){var i=n.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;var a=Number(n);if(n!==""&&!isNaN(a))return!!a;throw new Error('Cannot convert "'+n+'" to a boolean')},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var b9="bignumber",w9=["typed","BigNumber"],L1=T(b9,w9,e=>{var{typed:r,BigNumber:t}=e;return r("bignumber",{"":function(){return new t(0)},number:function(i){return new t(i+"")},string:function(i){var a=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(a){var s=a[2],c=t(a[1]),f=new t(2).pow(Number(s));if(c.gt(f.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var o=new t(2).pow(Number(s)-1);return c.gte(o)?c.sub(f):c}return new t(i)},BigNumber:function(i){return i},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Fraction:function(i){return new t(i.n).div(i.d).times(i.s)},null:function(i){return new t(0)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var D9="complex",S9=["typed","Complex"],q1=T(D9,S9,e=>{var{typed:r,Complex:t}=e;return r("complex",{"":function(){return t.ZERO},number:function(i){return new t(i,0)},"number, number":function(i,a){return new t(i,a)},"BigNumber, BigNumber":function(i,a){return new t(i.toNumber(),a.toNumber())},Fraction:function(i){return new t(i.valueOf(),0)},Complex:function(i){return i.clone()},string:function(i){return t(i)},null:function(i){return t(0)},Object:function(i){if("re"in i&&"im"in i)return new t(i.re,i.im);if("r"in i&&"phi"in i||"abs"in i&&"arg"in i)return new t(i);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var N9="fraction",A9=["typed","Fraction"],U1=T(N9,A9,e=>{var{typed:r,Fraction:t}=e;return r("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new t(i)},string:function(i){return new t(i)},"number, number":function(i,a){return new t(i,a)},null:function(i){return new t(0)},BigNumber:function(i){return new t(i.toString())},Fraction:function(i){return i},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Object:function(i){return new t(i)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var z1="matrix",E9=["typed","Matrix","DenseMatrix","SparseMatrix"],W1=T(z1,E9,e=>{var{typed:r,Matrix:t,DenseMatrix:n,SparseMatrix:i}=e;return r(z1,{"":function(){return a([])},string:function(c){return a([],c)},"string, string":function(c,f){return a([],c,f)},Array:function(c){return a(c)},Matrix:function(c){return a(c,c.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(s,c,f){if(c==="dense"||c==="default"||c===void 0)return new n(s,f);if(c==="sparse")return new i(s,f);throw new TypeError("Unknown matrix type "+JSON.stringify(c)+".")}});var V1="matrixFromFunction",C9=["typed","matrix","isZero"],Y1=T(V1,C9,e=>{var{typed:r,matrix:t,isZero:n}=e;return r(V1,{"Array | Matrix, function, string, string":function(s,c,f,o){return i(s,c,f,o)},"Array | Matrix, function, string":function(s,c,f){return i(s,c,f)},"Matrix, function":function(s,c){return i(s,c,"dense")},"Array, function":function(s,c){return i(s,c,"dense").toArray()},"Array | Matrix, string, function":function(s,c,f){return i(s,f,c)},"Array | Matrix, string, string, function":function(s,c,f,o){return i(s,o,c,f)}});function i(a,s,c,f){var o;return f!==void 0?o=t(c,f):o=t(c),o.resize(a),o.forEach(function(u,p){var h=s(p);n(h)||o.set(p,h)}),o}});var H1="matrixFromRows",M9=["typed","matrix","flatten","size"],G1=T(H1,M9,e=>{var{typed:r,matrix:t,flatten:n,size:i}=e;return r(H1,{"...Array":function(f){return a(f)},"...Matrix":function(f){return t(a(f.map(o=>o.toArray())))}});function a(c){if(c.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var f=s(c[0]),o=[];for(var u of c){var p=s(u);if(p!==f)throw new TypeError("The vectors had different length: "+(f|0)+" \\u2260 "+(p|0));o.push(n(u))}return o}function s(c){var f=i(c);if(f.length===1)return f[0];if(f.length===2){if(f[0]===1)return f[1];if(f[1]===1)return f[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}});var $1="matrixFromColumns",_9=["typed","matrix","flatten","size"],Z1=T($1,_9,e=>{var{typed:r,matrix:t,flatten:n,size:i}=e;return r($1,{"...Array":function(f){return a(f)},"...Matrix":function(f){return t(a(f.map(o=>o.toArray())))}});function a(c){if(c.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var f=s(c[0]),o=[],u=0;u{var{typed:r}=e;return r(Q1,{"Unit, Array":function(n,i){return n.splitUnit(i)}})});var J1="unaryMinus",F9=["typed"],K1=T(J1,F9,e=>{var{typed:r}=e;return r(J1,{number:pv,"Complex | BigNumber | Fraction":t=>t.neg(),Unit:r.referToSelf(t=>n=>{var i=n.clone();return i.value=r.find(t,i.valueType())(n.value),i}),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t,!0))})});var j1="unaryPlus",O9=["typed","config","BigNumber"],eb=T(j1,O9,e=>{var{typed:r,config:t,BigNumber:n}=e;return r(j1,{number:mv,Complex:function(a){return a},BigNumber:function(a){return a},Fraction:function(a){return a},Unit:function(a){return a.clone()},"Array | Matrix":r.referToSelf(i=>a=>Je(a,i,!0)),"boolean | string":function(a){return t.number==="BigNumber"?new n(+a):+a}})});var rb="abs",B9=["typed"],tb=T(rb,B9,e=>{var{typed:r}=e;return r(rb,{number:uv,"Complex | BigNumber | Fraction | Unit":t=>t.abs(),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t,!0))})});var nb="apply",I9=["typed","isInteger"],au=T(nb,I9,e=>{var{typed:r,isInteger:t}=e;return r(nb,{"Array | Matrix, number | BigNumber, function":function(i,a,s){if(!t(a))throw new TypeError("Integer number expected for dimension");var c=Array.isArray(i)?or(i):i.size();if(a<0||a>=c.length)throw new Xt(a,c.length);return Ge(i)?i.create(Lc(i.valueOf(),a,s)):Lc(i,a,s)}})});function Lc(e,r,t){var n,i,a;if(r<=0)if(Array.isArray(e[0])){for(a=P9(e),i=[],n=0;n{var{typed:r}=e;return r(ib,{"number, number":fv,"Complex, Complex":function(n,i){return n.add(i)},"BigNumber, BigNumber":function(n,i){return n.plus(i)},"Fraction, Fraction":function(n,i){return n.add(i)},"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=r.find(t,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})});var ob="subtractScalar",R9=["typed"],sb=T(ob,R9,e=>{var{typed:r}=e;return r(ob,{"number, number":lv,"Complex, Complex":function(n,i){return n.sub(i)},"BigNumber, BigNumber":function(n,i){return n.minus(i)},"Fraction, Fraction":function(n,i){return n.sub(i)},"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=r.find(t,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})});var ub="cbrt",L9=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],fb=T(ub,L9,e=>{var{config:r,typed:t,isNegative:n,unaryMinus:i,matrix:a,Complex:s,BigNumber:c,Fraction:f}=e;return t(ub,{number:tu,Complex:o,"Complex, boolean":o,BigNumber:function(h){return h.cbrt()},Unit:u});function o(p,h){var d=p.arg()/3,x=p.abs(),v=new s(tu(x),0).mul(new s(0,d).exp());if(h){var y=[v,new s(tu(x),0).mul(new s(0,d+Math.PI*2/3).exp()),new s(tu(x),0).mul(new s(0,d-Math.PI*2/3).exp())];return r.matrix==="Array"?y:a(y)}else return v}function u(p){if(p.value&&Gt(p.value)){var h=p.clone();return h.value=1,h=h.pow(1/3),h.value=o(p.value),h}else{var d=n(p.value);d&&(p.value=i(p.value));var x;je(p.value)?x=new c(1).div(3):Xn(p.value)?x=new f(1,3):x=1/3;var v=p.pow(x);return d&&(v.value=i(v.value)),v}}});var q9="matAlgo11xS0s",U9=["typed","equalScalar"],Jr=T(q9,U9,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s,c){var f=i._values,o=i._index,u=i._ptr,p=i._size,h=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=p[0],x=p[1],v,y=t,w=0,C=s;typeof h=="string"&&(v=h,y=r.find(t,[v,v]),w=r.convert(0,v),a=r.convert(a,v),C=r.find(s,[v,v]));for(var b=[],A=[],E=[],S=0;S{var{typed:r,DenseMatrix:t}=e;return function(i,a,s,c){var f=i._values,o=i._index,u=i._ptr,p=i._size,h=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=p[0],x=p[1],v,y=s;typeof h=="string"&&(v=h,a=r.convert(a,v),y=r.find(s,[v,v]));for(var w=[],C=[],b=[],A=0;A{var{typed:r}=e;return function(i,a,s,c){var f=i._data,o=i._size,u=i._datatype,p,h=s;typeof u=="string"&&(p=u,a=r.convert(a,p),h=r.find(s,[p,p]));var d=o.length>0?t(h,0,o,o[0],f,a,c):[];return i.createDenseMatrix({data:d,size:tr(o),datatype:p})};function t(n,i,a,s,c,f,o){var u=[];if(i===a.length-1)for(var p=0;p{var{typed:r,config:t,round:n}=e;return r(ag,{number:function(a){return wt(a,n(a),t.epsilon)?n(a):Math.ceil(a)},"number, number":function(a,s){if(wt(a,n(a,s),t.epsilon))return n(a,s);var[c,f]="".concat(a,"e").split("e"),o=Math.ceil(Number("".concat(c,"e").concat(Number(f)+s)));return[c,f]="".concat(o,"e").split("e"),Number("".concat(c,"e").concat(Number(f)-s))}})}),lb=T(ag,H9,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:c}=e,f=Jr({typed:r,equalScalar:a}),o=Lr({typed:r,DenseMatrix:c}),u=Bt({typed:r}),p=G9({typed:r,config:t,round:n});return r("ceil",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(d){return d.ceil()},"Complex, number":function(d,x){return d.ceil(x)},"Complex, BigNumber":function(d,x){return d.ceil(x.toNumber())},BigNumber:function(d){return Ut(d,n(d),t.epsilon)?n(d):d.ceil()},"BigNumber, BigNumber":function(d,x){return Ut(d,n(d,x),t.epsilon)?n(d,x):d.toDecimalPlaces(x.toNumber(),rs.ROUND_CEIL)},Fraction:function(d){return d.ceil()},"Fraction, number":function(d,x){return d.ceil(x)},"Fraction, BigNumber":function(d,x){return d.ceil(x.toNumber())},"Array | Matrix":r.referToSelf(h=>d=>Je(d,h,!0)),"Array, number | BigNumber":r.referToSelf(h=>(d,x)=>Je(d,v=>h(v,x),!0)),"SparseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>f(d,x,h,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>u(d,x,h,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(h=>(d,x)=>u(i(x),d,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(h=>(d,x)=>a(d,0)?s(x.size(),x.storage()):x.storage()==="dense"?u(x,d,h,!0):o(x,d,h,!0))})});var cb="cube",$9=["typed"],pb=T(cb,$9,e=>{var{typed:r}=e;return r(cb,{number:hv,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})});var mb="exp",Z9=["typed"],hb=T(mb,Z9,e=>{var{typed:r}=e;return r(mb,{number:dv,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})});var db="expm1",Q9=["typed","Complex"],vb=T(db,Q9,e=>{var{typed:r,Complex:t}=e;return r(db,{number:vv,Complex:function(i){var a=Math.exp(i.re);return new t(a*Math.cos(i.im)-1,a*Math.sin(i.im))},BigNumber:function(i){return i.exp().minus(1)}})});var og="fix",X9=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],J9=T(og,["typed","ceil","floor"],e=>{var{typed:r,ceil:t,floor:n}=e;return r(og,{number:function(a){return a>0?n(a):t(a)},"number, number":function(a,s){return a>0?n(a,s):t(a,s)}})}),gb=T(og,X9,e=>{var{typed:r,Complex:t,matrix:n,ceil:i,floor:a,equalScalar:s,zeros:c,DenseMatrix:f}=e,o=Lr({typed:r,DenseMatrix:f}),u=Bt({typed:r}),p=J9({typed:r,ceil:i,floor:a});return r("fix",{number:p.signatures.number,"number, number | BigNumber":p.signatures["number,number"],Complex:function(d){return new t(d.re>0?Math.floor(d.re):Math.ceil(d.re),d.im>0?Math.floor(d.im):Math.ceil(d.im))},"Complex, number":function(d,x){return new t(d.re>0?a(d.re,x):i(d.re,x),d.im>0?a(d.im,x):i(d.im,x))},"Complex, BigNumber":function(d,x){var v=x.toNumber();return new t(d.re>0?a(d.re,v):i(d.re,v),d.im>0?a(d.im,v):i(d.im,v))},BigNumber:function(d){return d.isNegative()?i(d):a(d)},"BigNumber, number | BigNumber":function(d,x){return d.isNegative()?i(d,x):a(d,x)},Fraction:function(d){return d.s<0?d.ceil():d.floor()},"Fraction, number | BigNumber":function(d,x){return d.s<0?i(d,x):a(d,x)},"Array | Matrix":r.referToSelf(h=>d=>Je(d,h,!0)),"Array | Matrix, number | BigNumber":r.referToSelf(h=>(d,x)=>Je(d,v=>h(v,x),!0)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(h=>(d,x)=>u(n(x),d,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(h=>(d,x)=>s(d,0)?c(x.size(),x.storage()):x.storage()==="dense"?u(x,d,h,!0):o(x,d,h,!0))})});var sg="floor",K9=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],j9=T(sg,["typed","config","round"],e=>{var{typed:r,config:t,round:n}=e;return r(sg,{number:function(a){return wt(a,n(a),t.epsilon)?n(a):Math.floor(a)},"number, number":function(a,s){if(wt(a,n(a,s),t.epsilon))return n(a,s);var[c,f]="".concat(a,"e").split("e"),o=Math.floor(Number("".concat(c,"e").concat(Number(f)+s)));return[c,f]="".concat(o,"e").split("e"),Number("".concat(c,"e").concat(Number(f)-s))}})}),qc=T(sg,K9,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:c}=e,f=Jr({typed:r,equalScalar:a}),o=Lr({typed:r,DenseMatrix:c}),u=Bt({typed:r}),p=j9({typed:r,config:t,round:n});return r("floor",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(d){return d.floor()},"Complex, number":function(d,x){return d.floor(x)},"Complex, BigNumber":function(d,x){return d.floor(x.toNumber())},BigNumber:function(d){return Ut(d,n(d),t.epsilon)?n(d):d.floor()},"BigNumber, BigNumber":function(d,x){return Ut(d,n(d,x),t.epsilon)?n(d,x):d.toDecimalPlaces(x.toNumber(),rs.ROUND_FLOOR)},Fraction:function(d){return d.floor()},"Fraction, number":function(d,x){return d.floor(x)},"Fraction, BigNumber":function(d,x){return d.floor(x.toNumber())},"Array | Matrix":r.referToSelf(h=>d=>Je(d,h,!0)),"Array, number | BigNumber":r.referToSelf(h=>(d,x)=>Je(d,v=>h(v,x),!0)),"SparseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>f(d,x,h,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>u(d,x,h,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(h=>(d,x)=>u(i(x),d,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(h=>(d,x)=>a(d,0)?s(x.size(),x.storage()):x.storage()==="dense"?u(x,d,h,!0):o(x,d,h,!0))})});var e7="matAlgo02xDS0",r7=["typed","equalScalar"],It=T(e7,r7,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s,c){var f=i._data,o=i._size,u=i._datatype||i.getDataType(),p=a._values,h=a._index,d=a._ptr,x=a._size,v=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(o.length!==x.length)throw new pr(o.length,x.length);if(o[0]!==x[0]||o[1]!==x[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+x+")");if(!p)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var y=o[0],w=o[1],C,b=t,A=0,E=s;typeof u=="string"&&u===v&&u!=="mixed"&&(C=u,b=r.find(t,[C,C]),A=r.convert(0,C),E=r.find(s,[C,C]));for(var S=[],O=[],F=[],M=0;M{var{typed:r}=e;return function(n,i,a,s){var c=n._data,f=n._size,o=n._datatype||n.getDataType(),u=i._values,p=i._index,h=i._ptr,d=i._size,x=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(f.length!==d.length)throw new pr(f.length,d.length);if(f[0]!==d[0]||f[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+d+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var v=f[0],y=f[1],w,C=0,b=a;typeof o=="string"&&o===x&&o!=="mixed"&&(w=o,C=r.convert(0,w),b=r.find(a,[w,w]));for(var A=[],E=0;E{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,d=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));var O=c&&h?[]:void 0,F=[],M=[],_=O?[]:void 0,k=O?[]:void 0,L=[],Y=[],$,V,q,R;for(V=0;V{var{typed:r}=e;return function(i,a,s){var c=i._data,f=i._size,o=i._datatype,u=a._data,p=a._size,h=a._datatype,d=[];if(f.length!==p.length)throw new pr(f.length,p.length);for(var x=0;x0?t(y,0,d,d[0],c,u):[];return i.createDenseMatrix({data:w,size:d,datatype:v})};function t(n,i,a,s,c,f){var o=[];if(i===a.length-1)for(var u=0;u{var{concat:r}=e;return function(i,a){var s=Math.max(i._size.length,a._size.length);if(i._size.length===a._size.length&&i._size.every((x,v)=>x===a._size[v]))return[i,a];for(var c=t(i._size,s,0),f=t(a._size,s,0),o=[],u=0;u{var{typed:r,matrix:t,concat:n}=e,i=xb({typed:r}),a=Bt({typed:r}),s=yb({concat:n});return function(f){var o=f.elop,u=f.SD||f.DS,p;o?(p={"DenseMatrix, DenseMatrix":(v,y)=>i(...s(v,y),o),"Array, Array":(v,y)=>i(...s(t(v),t(y)),o).valueOf(),"Array, DenseMatrix":(v,y)=>i(...s(t(v),y),o),"DenseMatrix, Array":(v,y)=>i(...s(v,t(y)),o)},f.SS&&(p["SparseMatrix, SparseMatrix"]=(v,y)=>f.SS(...s(v,y),o,!1)),f.DS&&(p["DenseMatrix, SparseMatrix"]=(v,y)=>f.DS(...s(v,y),o,!1),p["Array, SparseMatrix"]=(v,y)=>f.DS(...s(t(v),y),o,!1)),u&&(p["SparseMatrix, DenseMatrix"]=(v,y)=>u(...s(y,v),o,!0),p["SparseMatrix, Array"]=(v,y)=>u(...s(t(y),v),o,!0))):(p={"DenseMatrix, DenseMatrix":r.referToSelf(v=>(y,w)=>i(...s(y,w),v)),"Array, Array":r.referToSelf(v=>(y,w)=>i(...s(t(y),t(w)),v).valueOf()),"Array, DenseMatrix":r.referToSelf(v=>(y,w)=>i(...s(t(y),w),v)),"DenseMatrix, Array":r.referToSelf(v=>(y,w)=>i(...s(y,t(w)),v))},f.SS&&(p["SparseMatrix, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.SS(...s(y,w),v,!1))),f.DS&&(p["DenseMatrix, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.DS(...s(y,w),v,!1)),p["Array, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.DS(...s(t(y),w),v,!1))),u&&(p["SparseMatrix, DenseMatrix"]=r.referToSelf(v=>(y,w)=>u(...s(w,y),v,!0)),p["SparseMatrix, Array"]=r.referToSelf(v=>(y,w)=>u(...s(t(w),y),v,!0))));var h=f.scalar||"any",d=f.Ds||f.Ss;d&&(o?(p["DenseMatrix,"+h]=(v,y)=>a(v,y,o,!1),p[h+", DenseMatrix"]=(v,y)=>a(y,v,o,!0),p["Array,"+h]=(v,y)=>a(t(v),y,o,!1).valueOf(),p[h+", Array"]=(v,y)=>a(t(y),v,o,!0).valueOf()):(p["DenseMatrix,"+h]=r.referToSelf(v=>(y,w)=>a(y,w,v,!1)),p[h+", DenseMatrix"]=r.referToSelf(v=>(y,w)=>a(w,y,v,!0)),p["Array,"+h]=r.referToSelf(v=>(y,w)=>a(t(y),w,v,!1).valueOf()),p[h+", Array"]=r.referToSelf(v=>(y,w)=>a(t(w),y,v,!0).valueOf())));var x=f.sS!==void 0?f.sS:f.Ss;return o?(f.Ss&&(p["SparseMatrix,"+h]=(v,y)=>f.Ss(v,y,o,!1)),x&&(p[h+", SparseMatrix"]=(v,y)=>x(y,v,o,!0))):(f.Ss&&(p["SparseMatrix,"+h]=r.referToSelf(v=>(y,w)=>f.Ss(y,w,v,!1))),x&&(p[h+", SparseMatrix"]=r.referToSelf(v=>(y,w)=>x(w,y,v,!0)))),o&&o.signatures&&dc(p,o.signatures),p}});var bb="mod",p7=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],Uc=T(bb,p7,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:c,concat:f}=e,o=qc({typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:c}),u=It({typed:r,equalScalar:a}),p=ft({typed:r}),h=Do({typed:r,equalScalar:a}),d=Jr({typed:r,equalScalar:a}),x=Lr({typed:r,DenseMatrix:c}),v=vr({typed:r,matrix:i,concat:f});return r(bb,{"number, number":y,"BigNumber, BigNumber":function(C,b){return b.isZero()?C:C.sub(b.mul(o(C.div(b))))},"Fraction, Fraction":function(C,b){return b.equals(0)?C:C.sub(b.mul(o(C.div(b))))}},v({SS:h,DS:p,SD:u,Ss:d,sS:x}));function y(w,C){return C===0?w:w-C*o(w/C)}});var m7="matAlgo01xDSid",h7=["typed"],dn=T(m7,h7,e=>{var{typed:r}=e;return function(n,i,a,s){var c=n._data,f=n._size,o=n._datatype||n.getDataType(),u=i._values,p=i._index,h=i._ptr,d=i._size,x=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(f.length!==d.length)throw new pr(f.length,d.length);if(f[0]!==d[0]||f[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+d+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var v=f[0],y=f[1],w=typeof o=="string"&&o!=="mixed"&&o===x?o:void 0,C=w?r.find(a,[w,w]):a,b,A,E=[];for(b=0;b{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,d=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));var O=c&&h?[]:void 0,F=[],M=[],_=c&&h?[]:void 0,k=c&&h?[]:void 0,L=[],Y=[],$,V,q,R,j;for(V=0;V{var{typed:r,DenseMatrix:t}=e;return function(i,a,s,c){var f=i._values,o=i._index,u=i._ptr,p=i._size,h=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=p[0],x=p[1],v,y=s;typeof h=="string"&&(v=h,a=r.convert(a,v),y=r.find(s,[v,v]));for(var w=[],C=[],b=[],A=0;AArray.isArray(r))}var Sb=T(wb,y7,e=>{var{typed:r,matrix:t,config:n,round:i,equalScalar:a,zeros:s,BigNumber:c,DenseMatrix:f,concat:o}=e,u=Uc({typed:r,config:n,round:i,matrix:t,equalScalar:a,zeros:s,DenseMatrix:f,concat:o}),p=dn({typed:r}),h=ou({typed:r,equalScalar:a}),d=Un({typed:r,DenseMatrix:f}),x=vr({typed:r,matrix:t,concat:o});return r(wb,{"number, number":v,"BigNumber, BigNumber":y,"Fraction, Fraction":(w,C)=>w.gcd(C)},x({SS:h,DS:p,Ss:d}),{[b7]:r.referToSelf(w=>(C,b,A)=>{for(var E=w(C,b),S=0;SC=>{if(C.length===1&&Array.isArray(C[0])&&Db(C[0]))return w(...C[0]);if(Db(C))return w(...C);throw new jn("gcd() supports only 1d matrices!")}),Matrix:r.referToSelf(w=>C=>w(C.toArray()))});function v(w,C){if(!He(w)||!He(C))throw new Error("Parameters in function gcd must be integer numbers");for(var b;C!==0;)b=u(w,C),w=C,C=b;return w<0?-w:w}function y(w,C){if(!w.isInt()||!C.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var b=new c(0);!C.isZero();){var A=u(w,C);w=C,C=A}return w.lt(b)?w.neg():w}});var w7="matAlgo06xS0S0",D7=["typed","equalScalar"],So=T(w7,D7,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._size,o=i._datatype||i._data===void 0?i._datatype:i.getDataType(),u=a._values,p=a._size,h=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(f.length!==p.length)throw new pr(f.length,p.length);if(f[0]!==p[0]||f[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+p+")");var d=f[0],x=f[1],v,y=t,w=0,C=s;typeof o=="string"&&o===h&&o!=="mixed"&&(v=o,y=r.find(t,[v,v]),w=r.convert(0,v),C=r.find(s,[v,v]));for(var b=c&&u?[]:void 0,A=[],E=[],S=b?[]:void 0,O=[],F=[],M=0;M{var{typed:r,matrix:t,equalScalar:n,concat:i}=e,a=It({typed:r,equalScalar:n}),s=So({typed:r,equalScalar:n}),c=Jr({typed:r,equalScalar:n}),f=vr({typed:r,matrix:t,concat:i}),o="number | BigNumber | Fraction | Matrix | Array",u={};return u["".concat(o,", ").concat(o,", ...").concat(o)]=r.referToSelf(h=>(d,x,v)=>{for(var y=h(d,x),w=0;wh.lcm(d)},f({SS:s,DS:a,Ss:c}),u);function p(h,d){if(!h.isInt()||!d.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(h.isZero())return h;if(d.isZero())return d;for(var x=h.times(d);!d.isZero();){var v=d;d=h.mod(v),h=v}return x.div(h).abs()}});var Eb="log10",N7=["typed","config","Complex"],Cb=T(Eb,N7,e=>{var{typed:r,config:t,Complex:n}=e;return r(Eb,{number:function(a){return a>=0||t.predictable?xv(a):new n(a,0).log().div(Math.LN10)},Complex:function(a){return new n(a).log().div(Math.LN10)},BigNumber:function(a){return!a.isNegative()||t.predictable?a.log():new n(a.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":r.referToSelf(i=>a=>Je(a,i))})});var Mb="log2",A7=["typed","config","Complex"],_b=T(Mb,A7,e=>{var{typed:r,config:t,Complex:n}=e;return r(Mb,{number:function(s){return s>=0||t.predictable?yv(s):i(new n(s,0))},Complex:i,BigNumber:function(s){return!s.isNegative()||t.predictable?s.log(2):i(new n(s.toNumber(),0))},"Array | Matrix":r.referToSelf(a=>s=>Je(s,a))});function i(a){var s=Math.sqrt(a.re*a.re+a.im*a.im);return new n(Math.log2?Math.log2(s):Math.log(s)/Math.LN2,Math.atan2(a.im,a.re)/Math.LN2)}});var E7="multiplyScalar",C7=["typed"],Tb=T(E7,C7,e=>{var{typed:r}=e;return r("multiplyScalar",{"number, number":cv,"Complex, Complex":function(n,i){return n.mul(i)},"BigNumber, BigNumber":function(n,i){return n.times(i)},"Fraction, Fraction":function(n,i){return n.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(t,n)=>n.multiply(t),"Unit, number | Fraction | BigNumber | Complex | Unit":(t,n)=>t.multiply(n)})});var Fb="multiply",M7=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],Ob=T(Fb,M7,e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:i,equalScalar:a,dot:s}=e,c=Jr({typed:r,equalScalar:a}),f=Bt({typed:r});function o(E,S){switch(E.length){case 1:switch(S.length){case 1:if(E[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(E[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+E[0]+") must match Matrix rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;case 2:switch(S.length){case 1:if(E[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+E[1]+") must match Vector length ("+S[0]+")");break;case 2:if(E[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+E[1]+") must match Matrix B rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+E.length+" dimensions)")}}function u(E,S,O){if(O===0)throw new Error("Cannot multiply two empty vectors");return s(E,S)}function p(E,S){if(S.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return h(E,S)}function h(E,S){var O=E._data,F=E._size,M=E._datatype||E.getDataType(),_=S._data,k=S._size,L=S._datatype||S.getDataType(),Y=F[0],$=k[1],V,q=n,R=i;M&&L&&M===L&&typeof M=="string"&&M!=="mixed"&&(V=M,q=r.find(n,[V,V]),R=r.find(i,[V,V]));for(var j=[],U=0;U<$;U++){for(var oe=R(O[0],_[0][U]),me=1;mege)for(var xe=0,be=0;be(S,O)=>{o(or(S),or(O));var F=E(t(S),t(O));return Ge(F)?F.valueOf():F}),"Matrix, Matrix":function(S,O){var F=S.size(),M=O.size();return o(F,M),F.length===1?M.length===1?u(S,O,F[0]):p(S,O):M.length===1?d(S,O):x(S,O)},"Matrix, Array":r.referTo("Matrix,Matrix",E=>(S,O)=>E(S,t(O))),"Array, Matrix":r.referToSelf(E=>(S,O)=>E(t(S,O.storage()),O)),"SparseMatrix, any":function(S,O){return c(S,O,i,!1)},"DenseMatrix, any":function(S,O){return f(S,O,i,!1)},"any, SparseMatrix":function(S,O){return c(O,S,i,!0)},"any, DenseMatrix":function(S,O){return f(O,S,i,!0)},"Array, any":function(S,O){return f(t(S),O,i,!1).valueOf()},"any, Array":function(S,O){return f(t(O),S,i,!0).valueOf()},"any, any":i,"any, any, ...any":r.referToSelf(E=>(S,O,F)=>{for(var M=E(S,O),_=0;_{var{typed:r,matrix:t,equalScalar:n,BigNumber:i,concat:a}=e,s=dn({typed:r}),c=It({typed:r,equalScalar:n}),f=So({typed:r,equalScalar:n}),o=Jr({typed:r,equalScalar:n}),u=vr({typed:r,matrix:t,concat:a});function p(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return r(Bb,{number:bv,"number, number":bv,BigNumber:d=>h(d,new i(2)),"BigNumber, BigNumber":h,Complex:p,"Complex, number":p,Array:r.referTo("DenseMatrix,number",d=>x=>d(t(x),2).valueOf()),DenseMatrix:r.referTo("DenseMatrix,number",d=>x=>d(x,2)),SparseMatrix:r.referTo("SparseMatrix,number",d=>x=>d(x,2)),"SparseMatrix, SparseMatrix":r.referToSelf(d=>(x,v)=>{if(v.density()===1)return f(x,v,d);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":r.referToSelf(d=>(x,v)=>{if(v.density()===1)return s(x,v,d,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":r.referTo("DenseMatrix,SparseMatrix",d=>(x,v)=>d(t(x),v)),"number | BigNumber, SparseMatrix":r.referToSelf(d=>(x,v)=>{if(v.density()===1)return o(v,x,d,!0);throw new Error("Root must be non-zero")})},u({scalar:"number | BigNumber",SD:c,Ss:o,sS:!1}));function h(d,x){var v=i.precision,y=i.clone({precision:v+2}),w=new i(0),C=new y(1),b=x.isNegative();if(b&&(x=x.neg()),x.isZero())throw new Error("Root must be non-zero");if(d.isNegative()&&!x.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(d.isZero())return b?new y(1/0):0;if(!d.isFinite())return b?w:d;var A=d.abs().pow(C.div(x));return A=d.isNeg()?A.neg():A,new i((b?C.div(A):A).toPrecision(v))}});var Pb="sign",T7=["typed","BigNumber","Fraction","complex"],kb=T(Pb,T7,e=>{var{typed:r,BigNumber:t,complex:n,Fraction:i}=e;return r(Pb,{number:kc,Complex:function(s){return s.im===0?n(kc(s.re)):s.sign()},BigNumber:function(s){return new t(s.cmp(0))},Fraction:function(s){return new i(s.s,1)},"Array | Matrix":r.referToSelf(a=>s=>Je(s,a,!0)),Unit:r.referToSelf(a=>s=>{if(!s._isDerived()&&s.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return r.find(a,s.valueType())(s.value)})})});var F7="sqrt",O7=["config","typed","Complex"],Rb=T(F7,O7,e=>{var{config:r,typed:t,Complex:n}=e;return t("sqrt",{number:i,Complex:function(s){return s.sqrt()},BigNumber:function(s){return!s.isNegative()||r.predictable?s.sqrt():i(s.toNumber())},Unit:function(s){return s.pow(.5)}});function i(a){return isNaN(a)?NaN:a>=0||r.predictable?Math.sqrt(a):new n(a,0).sqrt()}});var Lb="square",B7=["typed"],qb=T(Lb,B7,e=>{var{typed:r}=e;return r(Lb,{number:wv,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})});var Ub="subtract",I7=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],zb=T(Ub,I7,e=>{var{typed:r,matrix:t,equalScalar:n,subtractScalar:i,unaryMinus:a,DenseMatrix:s,concat:c}=e,f=dn({typed:r}),o=ft({typed:r}),u=Do({typed:r,equalScalar:n}),p=Un({typed:r,DenseMatrix:s}),h=Lr({typed:r,DenseMatrix:s}),d=vr({typed:r,matrix:t,concat:c});return r(Ub,{"any, any":i},d({elop:i,SS:u,DS:f,SD:o,Ss:h,sS:p}))});var Wb="xgcd",P7=["typed","config","matrix","BigNumber"],Vb=T(Wb,P7,e=>{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r(Wb,{"number, number":function(c,f){var o=Dv(c,f);return t.matrix==="Array"?o:n(o)},"BigNumber, BigNumber":a});function a(s,c){var f,o,u,p=new i(0),h=new i(1),d=p,x=h,v=h,y=p;if(!s.isInt()||!c.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!c.isZero();)o=s.div(c).floor(),u=s.mod(c),f=d,d=x.minus(o.times(d)),x=f,f=v,v=y.minus(o.times(v)),y=f,s=c,c=u;var w;return s.lt(p)?w=[s.neg(),x.neg(),y.neg()]:w=[s,s.isZero()?0:x,y],t.matrix==="Array"?w:n(w)}});var Yb="invmod",k7=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],Hb=T(Yb,k7,e=>{var{typed:r,config:t,BigNumber:n,xgcd:i,equal:a,smaller:s,mod:c,add:f,isInteger:o}=e;return r(Yb,{"number, number":u,"BigNumber, BigNumber":u});function u(p,h){if(!o(p)||!o(h))throw new Error("Parameters in function invmod must be integer numbers");if(p=c(p,h),a(h,0))throw new Error("Divisor must be non zero");var d=i(p,h);d=d.valueOf();var[x,v]=d;return a(x,n(1))?(v=c(v,h),s(v,n(0))&&(v=f(v,h)),v):NaN}});var R7="matAlgo09xS0Sf",L7=["typed","equalScalar"],zc=T(R7,L7,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,d=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));var O=c&&h?[]:void 0,F=[],M=[],_=O?[]:void 0,k=[],L,Y,$,V,q;for(Y=0;Y{var{typed:r,matrix:t,equalScalar:n,multiplyScalar:i,concat:a}=e,s=It({typed:r,equalScalar:n}),c=zc({typed:r,equalScalar:n}),f=Jr({typed:r,equalScalar:n}),o=vr({typed:r,matrix:t,concat:a});return r(Gb,o({elop:i,SS:c,DS:s,Ss:f}))});function Zb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitAnd");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero()||r.eq(-1)||e.eq(r))return e;if(r.isZero()||e.eq(-1))return r;if(!e.isFinite()||!r.isFinite()){if(!e.isFinite()&&!r.isFinite())return e.isNegative()===r.isNegative()?e:new t(0);if(!e.isFinite())return r.isNegative()?e:e.isNegative()?new t(0):r;if(!r.isFinite())return e.isNegative()?r:r.isNegative()?new t(0):e}return fg(e,r,function(n,i){return n&i})}function su(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var r=e.constructor,t=r.precision;r.config({precision:1e9});var n=e.plus(new r(1));return n.s=-n.s||null,r.config({precision:t}),n}function Qb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitOr");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);var n=new t(-1);return e.isZero()||r.eq(n)||e.eq(r)?r:r.isZero()||e.eq(n)?e:!e.isFinite()||!r.isFinite()?!e.isFinite()&&!e.isNegative()&&r.isNegative()||e.isNegative()&&!r.isNegative()&&!r.isFinite()?n:e.isNegative()&&r.isNegative()?e.isFinite()?e:r:e.isFinite()?r:e:fg(e,r,function(i,a){return i|a})}function fg(e,r,t){var n=e.constructor,i,a,s=+(e.s<0),c=+(r.s<0);if(s){i=Wc(su(e));for(var f=0;f0;)t(u[--d],p[--x])===v&&(y=y.plus(w)),w=w.times(C);for(;x>0;)t(h,p[--x])===v&&(y=y.plus(w)),w=w.times(C);return n.config({precision:b}),v===0&&(y.s=-y.s),y}function Wc(e){for(var r=e.d,t=r[0]+"",n=1;n0)if(++c>o)for(c-=o;c--;)f+="0";else c1&&((u[d+1]===null||u[d+1]===void 0)&&(u[d+1]=0),u[d+1]+=u[d]>>1,u[d]&=1)}return u.reverse()}function Xb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitXor");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero())return r;if(r.isZero())return e;if(e.eq(r))return new t(0);var n=new t(-1);return e.eq(n)?su(r):r.eq(n)?su(e):!e.isFinite()||!r.isFinite()?!e.isFinite()&&!r.isFinite()?n:new t(e.isNegative()===r.isNegative()?1/0:-1/0):fg(e,r,function(i,a){return i^a})}function Jb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function leftShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:!e.isFinite()&&!r.isFinite()?new t(NaN):r.lt(55)?e.times(Math.pow(2,r.toNumber())+""):e.times(new t(2).pow(r))}function Kb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function rightArithShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:r.isFinite()?r.lt(55)?e.div(Math.pow(2,r.toNumber())+"").floor():e.div(new t(2).pow(r)).floor():e.isNegative()?new t(-1):e.isFinite()?new t(0):new t(NaN)}var jb="bitAnd",U7=["typed","matrix","equalScalar","concat"],Vc=T(jb,U7,e=>{var{typed:r,matrix:t,equalScalar:n,concat:i}=e,a=It({typed:r,equalScalar:n}),s=So({typed:r,equalScalar:n}),c=Jr({typed:r,equalScalar:n}),f=vr({typed:r,matrix:t,concat:i});return r(jb,{"number, number":Nv,"BigNumber, BigNumber":Zb},f({SS:s,DS:a,Ss:c}))});var ew="bitNot",z7=["typed"],rw=T(ew,z7,e=>{var{typed:r}=e;return r(ew,{number:Av,BigNumber:su,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var tw="bitOr",W7=["typed","matrix","equalScalar","DenseMatrix","concat"],Yc=T(tw,W7,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=dn({typed:r}),c=ou({typed:r,equalScalar:n}),f=Un({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:t,concat:a});return r(tw,{"number, number":Ev,"BigNumber, BigNumber":Qb},o({SS:c,DS:s,Ss:f}))});var V7="matAlgo07xSSf",Y7=["typed","DenseMatrix"],Vt=T(V7,Y7,e=>{var{typed:r,DenseMatrix:t}=e;return function(a,s,c){var f=a._size,o=a._datatype||a._data===void 0?a._datatype:a.getDataType(),u=s._size,p=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(f.length!==u.length)throw new pr(f.length,u.length);if(f[0]!==u[0]||f[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+u+")");var h=f[0],d=f[1],x,v=0,y=c;typeof o=="string"&&o===p&&o!=="mixed"&&(x=o,v=r.convert(0,x),y=r.find(c,[x,x]));var w,C,b=[];for(w=0;w{var{typed:r,matrix:t,DenseMatrix:n,concat:i}=e,a=ft({typed:r}),s=Vt({typed:r,DenseMatrix:n}),c=Lr({typed:r,DenseMatrix:n}),f=vr({typed:r,matrix:t,concat:i});return r(nw,{"number, number":Cv,"BigNumber, BigNumber":Xb},f({SS:s,DS:a,Ss:c}))});var aw="arg",G7=["typed"],ow=T(aw,G7,e=>{var{typed:r}=e;return r(aw,{number:function(n){return Math.atan2(0,n)},BigNumber:function(n){return n.constructor.atan2(0,n)},Complex:function(n){return n.arg()},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var sw="conj",$7=["typed"],uw=T(sw,$7,e=>{var{typed:r}=e;return r(sw,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.conjugate(),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var fw="im",Z7=["typed"],lw=T(fw,Z7,e=>{var{typed:r}=e;return r(fw,{number:()=>0,"BigNumber | Fraction":t=>t.mul(0),Complex:t=>t.im,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var cw="re",Q7=["typed"],pw=T(cw,Q7,e=>{var{typed:r}=e;return r(cw,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.re,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var mw="not",X7=["typed"],hw=T(mw,X7,e=>{var{typed:r}=e;return r(mw,{"null | undefined":()=>!0,number:Bv,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var dw="or",J7=["typed","matrix","equalScalar","DenseMatrix","concat"],Hc=T(dw,J7,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),c=Do({typed:r,equalScalar:n}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:t,concat:a});return r(dw,{"number, number":Iv,"Complex, Complex":function(p,h){return p.re!==0||p.im!==0||h.re!==0||h.im!==0},"BigNumber, BigNumber":function(p,h){return!p.isZero()&&!p.isNaN()||!h.isZero()&&!h.isNaN()},"Unit, Unit":r.referToSelf(u=>(p,h)=>u(p.value||0,h.value||0))},o({SS:c,DS:s,Ss:f}))});var vw="xor",K7=["typed","matrix","DenseMatrix","concat"],gw=T(vw,K7,e=>{var{typed:r,matrix:t,DenseMatrix:n,concat:i}=e,a=ft({typed:r}),s=Vt({typed:r,DenseMatrix:n}),c=Lr({typed:r,DenseMatrix:n}),f=vr({typed:r,matrix:t,concat:i});return r(vw,{"number, number":Pv,"Complex, Complex":function(u,p){return(u.re!==0||u.im!==0)!=(p.re!==0||p.im!==0)},"BigNumber, BigNumber":function(u,p){return(!u.isZero()&&!u.isNaN())!=(!p.isZero()&&!p.isNaN())},"Unit, Unit":r.referToSelf(o=>(u,p)=>o(u.value||0,p.value||0))},f({SS:s,DS:a,Ss:c}))});var xw="concat",j7=["typed","matrix","isInteger"],Gc=T(xw,j7,e=>{var{typed:r,matrix:t,isInteger:n}=e;return r(xw,{"...Array | Matrix | number | BigNumber":function(a){var s,c=a.length,f=-1,o,u=!1,p=[];for(s=0;s0&&f>o)throw new Xt(f,o+1)}else{var d=tr(h).valueOf(),x=or(d);if(p[s]=d,o=f,f=x.length-1,s>0&&f!==o)throw new pr(o+1,f+1)}}if(p.length===0)throw new SyntaxError("At least one matrix expected");for(var v=p.shift();p.length;)v=Gd(v,p.shift(),f);return u?t(v):v},"...string":function(a){return a.join("")}})});var yw="column",eL=["typed","Index","matrix","range"],$c=T(yw,eL,e=>{var{typed:r,Index:t,matrix:n,range:i}=e;return r(yw,{"Matrix, number":a,"Array, number":function(c,f){return a(n(tr(c)),f).valueOf()}});function a(s,c){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");Xr(c,s.size()[1]);var f=i(0,s.size()[0]),o=new t(f,c),u=s.subset(o);return Ge(u)?u:n([[u]])}});var bw="count",rL=["typed","size","prod"],ww=T(bw,rL,e=>{var{typed:r,size:t,prod:n}=e;return r(bw,{string:function(a){return a.length},"Matrix | Array":function(a){return n(t(a))}})});var Dw="cross",tL=["typed","matrix","subtract","multiply"],Sw=T(Dw,tL,e=>{var{typed:r,matrix:t,subtract:n,multiply:i}=e;return r(Dw,{"Matrix, Matrix":function(c,f){return t(a(c.toArray(),f.toArray()))},"Matrix, Array":function(c,f){return t(a(c.toArray(),f))},"Array, Matrix":function(c,f){return t(a(c,f.toArray()))},"Array, Array":a});function a(s,c){var f=Math.max(or(s).length,or(c).length);s=Xs(s),c=Xs(c);var o=or(s),u=or(c);if(o.length!==1||u.length!==1||o[0]!==3||u[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+o.join(", ")+"], B = ["+u.join(", ")+"])");var p=[n(i(s[1],c[2]),i(s[2],c[1])),n(i(s[2],c[0]),i(s[0],c[2])),n(i(s[0],c[1]),i(s[1],c[0]))];return f>1?[p]:p}});var Nw="diag",nL=["typed","matrix","DenseMatrix","SparseMatrix"],Aw=T(Nw,nL,e=>{var{typed:r,matrix:t,DenseMatrix:n,SparseMatrix:i}=e;return r(Nw,{Array:function(o){return a(o,0,or(o),null)},"Array, number":function(o,u){return a(o,u,or(o),null)},"Array, BigNumber":function(o,u){return a(o,u.toNumber(),or(o),null)},"Array, string":function(o,u){return a(o,0,or(o),u)},"Array, number, string":function(o,u,p){return a(o,u,or(o),p)},"Array, BigNumber, string":function(o,u,p){return a(o,u.toNumber(),or(o),p)},Matrix:function(o){return a(o,0,o.size(),o.storage())},"Matrix, number":function(o,u){return a(o,u,o.size(),o.storage())},"Matrix, BigNumber":function(o,u){return a(o,u.toNumber(),o.size(),o.storage())},"Matrix, string":function(o,u){return a(o,0,o.size(),u)},"Matrix, number, string":function(o,u,p){return a(o,u,o.size(),p)},"Matrix, BigNumber, string":function(o,u,p){return a(o,u.toNumber(),o.size(),p)}});function a(f,o,u,p){if(!He(o))throw new TypeError("Second parameter in function diag must be an integer");var h=o>0?o:0,d=o<0?-o:0;switch(u.length){case 1:return s(f,o,p,u[0],d,h);case 2:return c(f,o,p,u,d,h)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function s(f,o,u,p,h,d){var x=[p+h,p+d];if(u&&u!=="sparse"&&u!=="dense")throw new TypeError("Unknown matrix type ".concat(u,'"'));var v=u==="sparse"?i.diagonal(x,f,o):n.diagonal(x,f,o);return u!==null?v:v.valueOf()}function c(f,o,u,p,h,d){if(Ge(f)){var x=f.diagonal(o);return u!==null?u!==x.storage()?t(x,u):x:x.valueOf()}for(var v=Math.min(p[0]-h,p[1]-d),y=[],w=0;w=2&&v.push("index: ".concat(_r(t))),d.length>=3&&v.push("array: ".concat(_r(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(v.join(", "),") at index ").concat(JSON.stringify(t)))}else throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(y.message))}}}var iL="filter",aL=["typed"],Cw=T(iL,aL,e=>{var{typed:r}=e;return r("filter",{"Array, function":Ew,"Matrix, function":function(n,i){return n.create(Ew(n.toArray(),i))},"Array, RegExp":Js,"Matrix, RegExp":function(n,i){return n.create(Js(n.toArray(),i))}})});function Ew(e,r){return Sc(e,function(t,n,i){return vi(r,t,[n],i,"filter")})}var Mw="flatten",oL=["typed","matrix"],_w=T(Mw,oL,e=>{var{typed:r,matrix:t}=e;return r(Mw,{Array:function(i){return gr(i)},Matrix:function(i){var a=gr(i.toArray());return t(a)}})});var Tw="forEach",sL=["typed"],Fw=T(Tw,sL,e=>{var{typed:r}=e;return r(Tw,{"Array, function":uL,"Matrix, function":function(n,i){n.forEach(i)}})});function uL(e,r){var t=function n(i,a){if(Array.isArray(i))mo(i,function(s,c){n(s,a.concat(c))});else return vi(r,i,a,e,"forEach")};t(e,[])}var Ow="getMatrixDataType",fL=["typed"],Bw=T(Ow,fL,e=>{var{typed:r}=e;return r(Ow,{Array:function(n){return ho(n,_r)},Matrix:function(n){return n.getDataType()}})});var Iw="identity",lL=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],Pw=T(Iw,lL,e=>{var{typed:r,config:t,matrix:n,BigNumber:i,DenseMatrix:a,SparseMatrix:s}=e;return r(Iw,{"":function(){return t.matrix==="Matrix"?n([]):[]},string:function(u){return n(u)},"number | BigNumber":function(u){return f(u,u,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(u,p){return f(u,u,p)},"number | BigNumber, number | BigNumber":function(u,p){return f(u,p,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(u,p,h){return f(u,p,h)},Array:function(u){return c(u)},"Array, string":function(u,p){return c(u,p)},Matrix:function(u){return c(u.valueOf(),u.storage())},"Matrix, string":function(u,p){return c(u.valueOf(),p)}});function c(o,u){switch(o.length){case 0:return u?n(u):[];case 1:return f(o[0],o[0],u);case 2:return f(o[0],o[1],u);default:throw new Error("Vector containing two values expected")}}function f(o,u,p){var h=je(o)||je(u)?i:null;if(je(o)&&(o=o.toNumber()),je(u)&&(u=u.toNumber()),!He(o)||o<1)throw new Error("Parameters in function identity must be positive integers");if(!He(u)||u<1)throw new Error("Parameters in function identity must be positive integers");var d=h?new i(1):1,x=h?new h(0):0,v=[o,u];if(p){if(p==="sparse")return s.diagonal(v,d,0,x);if(p==="dense")return a.diagonal(v,d,0,x);throw new TypeError('Unknown matrix type "'.concat(p,'"'))}for(var y=Wi([],v,x),w=o{var{typed:r,matrix:t,multiplyScalar:n}=e;return r(kw,{"Matrix, Matrix":function(s,c){return t(i(s.toArray(),c.toArray()))},"Matrix, Array":function(s,c){return t(i(s.toArray(),c))},"Array, Matrix":function(s,c){return t(i(s,c.toArray()))},"Array, Array":i});function i(a,s){if(or(a).length===1&&(a=[a]),or(s).length===1&&(s=[s]),or(a).length>2||or(s).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(a.length)+", y = "+JSON.stringify(s.length)+")");var c=[],f=[];return a.map(function(o){return s.map(function(u){return f=[],c.push(f),o.map(function(p){return u.map(function(h){return f.push(n(p,h))})})})})&&c}});var Lw="map",pL=["typed"],qw=T(Lw,pL,e=>{var{typed:r}=e;return r(Lw,{"Array, function":mL,"Matrix, function":function(n,i){return n.map(i)}})});function mL(e,r){var t=function n(i,a){return Array.isArray(i)?i.map(function(s,c){return n(s,a.concat(c))}):vi(r,i,a,e,"map")};return t(e,[])}var Uw="diff",hL=["typed","matrix","subtract","number"],Zc=T(Uw,hL,e=>{var{typed:r,matrix:t,subtract:n,number:i}=e;return r(Uw,{"Array | Matrix":function(u){return Ge(u)?t(s(u.toArray())):s(u)},"Array | Matrix, number":function(u,p){if(!He(p))throw new RangeError("Dimension must be a whole number");return Ge(u)?t(a(u.toArray(),p)):a(u,p)},"Array, BigNumber":r.referTo("Array,number",o=>(u,p)=>o(u,i(p))),"Matrix, BigNumber":r.referTo("Matrix,number",o=>(u,p)=>o(u,i(p)))});function a(o,u){if(Ge(o)&&(o=o.toArray()),!Array.isArray(o))throw RangeError("Array/Matrix does not have that many dimensions");if(u>0){var p=[];return o.forEach(h=>{p.push(a(h,u-1))}),p}else{if(u===0)return s(o);throw RangeError("Cannot have negative dimension")}}function s(o){for(var u=[],p=o.length,h=1;h{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r("ones",{"":function(){return t.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(o){var u=o[o.length-1];if(typeof u=="string"){var p=o.pop();return a(o,p)}else return t.matrix==="Array"?a(o):a(o,"default")},Array:a,Matrix:function(o){var u=o.storage();return a(o.valueOf(),u)},"Array | Matrix, string":function(o,u){return a(o.valueOf(),u)}});function a(f,o){var u=s(f),p=u?new i(1):1;if(c(f),o){var h=n(o);return f.length>0?h.resize(f,p):h}else{var d=[];return f.length>0?Wi(d,f,p):d}}function s(f){var o=!1;return f.forEach(function(u,p,h){je(u)&&(o=!0,h[p]=u.toNumber())}),o}function c(f){f.forEach(function(o){if(typeof o!="number"||!He(o)||o<0)throw new Error("Parameters in function ones must be positive integers")})}});function uu(){throw new Error('No "bignumber" implementation available')}function Qc(){throw new Error('No "fraction" implementation available')}function Xc(){throw new Error('No "matrix" implementation available')}var Ww="range",gL=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Jc=T(Ww,gL,e=>{var{typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:c,largerEq:f,add:o,isPositive:u}=e;return r(Ww,{string:h,"string, boolean":h,"number, number":function(y,w){return p(d(y,w,1,!1))},"number, number, number":function(y,w,C){return p(d(y,w,C,!1))},"number, number, boolean":function(y,w,C){return p(d(y,w,1,C))},"number, number, number, boolean":function(y,w,C,b){return p(d(y,w,C,b))},"BigNumber, BigNumber":function(y,w){var C=y.constructor;return p(d(y,w,new C(1),!1))},"BigNumber, BigNumber, BigNumber":function(y,w,C){return p(d(y,w,C,!1))},"BigNumber, BigNumber, boolean":function(y,w,C){var b=y.constructor;return p(d(y,w,new b(1),C))},"BigNumber, BigNumber, BigNumber, boolean":function(y,w,C,b){return p(d(y,w,C,b))},"Unit, Unit, Unit":function(y,w,C){return p(d(y,w,C,!1))},"Unit, Unit, Unit, boolean":function(y,w,C,b){return p(d(y,w,C,b))}});function p(v){return t.matrix==="Matrix"?n?n(v):Xc():v}function h(v,y){var w=x(v);if(!w)throw new SyntaxError('String "'+v+'" is no valid range');return t.number==="BigNumber"?(i===void 0&&uu(),p(d(i(w.start),i(w.end),i(w.step)),y)):p(d(w.start,w.end,w.step,y))}function d(v,y,w,C){for(var b=[],A=u(w)?C?s:a:C?f:c,E=v;A(E,y);)b.push(E),E=o(E,w);return b}function x(v){var y=v.split(":"),w=y.map(function(b){return Number(b)}),C=w.some(function(b){return isNaN(b)});if(C)return null;switch(w.length){case 2:return{start:w[0],end:w[1],step:1};case 3:return{start:w[0],end:w[2],step:w[1]};default:return null}}});var Vw="reshape",xL=["typed","isInteger","matrix"],Yw=T(Vw,xL,e=>{var{typed:r,isInteger:t}=e;return r(Vw,{"Matrix, Array":function(i,a){return i.reshape(a,!0)},"Array, Array":function(i,a){return a.forEach(function(s){if(!t(s))throw new TypeError("Invalid size for dimension: "+s)}),vf(i,a)}})});var yL="resize",bL=["config","matrix"],Hw=T(yL,bL,e=>{var{config:r,matrix:t}=e;return function(a,s,c){if(arguments.length!==2&&arguments.length!==3)throw new jn("resize",arguments.length,2,3);if(Ge(s)&&(s=s.valueOf()),je(s[0])&&(s=s.map(function(u){return je(u)?u.toNumber():u})),Ge(a))return a.resize(s,c,!0);if(typeof a=="string")return n(a,s,c);var f=Array.isArray(a)?!1:r.matrix!=="Array";if(s.length===0){for(;Array.isArray(a);)a=a[0];return tr(a)}else{Array.isArray(a)||(a=[a]),a=tr(a);var o=Wi(a,s,c);return f?t(o):o}};function n(i,a,s){if(s!==void 0){if(typeof s!="string"||s.length!==1)throw new TypeError("Single character expected as defaultValue")}else s=" ";if(a.length!==1)throw new pr(a.length,1);var c=a[0];if(typeof c!="number"||!He(c))throw new TypeError("Invalid size, must contain positive integers (size: "+lr(a)+")");if(i.length>c)return i.substring(0,c);if(i.length{var{typed:r,multiply:t,rotationMatrix:n}=e;return r(Gw,{"Array , number | BigNumber | Complex | Unit":function(s,c){i(s,2);var f=t(n(c),s);return f.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(s,c){return i(s,2),t(n(c),s)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(s,c,f){i(s,3);var o=t(n(c,f),s);return o},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(s,c,f){return i(s,3),t(n(c,f),s)}});function i(a,s){var c=Array.isArray(a)?or(a):a.size();if(c.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(c.length===2&&c[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(c[0]!==s)throw new RangeError("Vector must be of dimensions 1x".concat(s))}});var Zw="rotationMatrix",DL=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],Qw=T(Zw,DL,e=>{var{typed:r,config:t,multiplyScalar:n,addScalar:i,unaryMinus:a,norm:s,BigNumber:c,matrix:f,DenseMatrix:o,SparseMatrix:u,cos:p,sin:h}=e;return r(Zw,{"":function(){return t.matrix==="Matrix"?f([]):[]},string:function(b){return f(b)},"number | BigNumber | Complex | Unit":function(b){return d(b,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(b,A){return d(b,A)},"number | BigNumber | Complex | Unit, Array":function(b,A){var E=f(A);return x(E),w(b,E,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(b,A){x(A);var E=A.storage()||(t.matrix==="Matrix"?"dense":void 0);return w(b,A,E)},"number | BigNumber | Complex | Unit, Array, string":function(b,A,E){var S=f(A);return x(S),w(b,S,E)},"number | BigNumber | Complex | Unit, Matrix, string":function(b,A,E){return x(A),w(b,A,E)}});function d(C,b){var A=je(C),E=A?new c(-1):-1,S=p(C),O=h(C),F=[[S,n(E,O)],[O,S]];return y(F,b)}function x(C){var b=C.size();if(b.length<1||b[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function v(C){return C.reduce((b,A)=>n(b,A))}function y(C,b){if(b){if(b==="sparse")return new u(C);if(b==="dense")return new o(C);throw new TypeError('Unknown matrix type "'.concat(b,'"'))}return C}function w(C,b,A){var E=s(b);if(E===0)throw new RangeError("Rotation around zero vector");var S=je(C)?c:null,O=S?new S(1):1,F=S?new S(-1):-1,M=S?new S(b.get([0])/E):b.get([0])/E,_=S?new S(b.get([1])/E):b.get([1])/E,k=S?new S(b.get([2])/E):b.get([2])/E,L=p(C),Y=i(O,a(L)),$=h(C),V=i(L,v([M,M,Y])),q=i(v([M,_,Y]),v([F,k,$])),R=i(v([M,k,Y]),v([_,$])),j=i(v([M,_,Y]),v([k,$])),U=i(L,v([_,_,Y])),oe=i(v([_,k,Y]),v([F,M,$])),me=i(v([M,k,Y]),v([F,_,$])),ie=i(v([_,k,Y]),v([M,$])),H=i(L,v([k,k,Y])),ce=[[V,q,R],[j,U,oe],[me,ie,H]];return y(ce,A)}});var Xw="row",SL=["typed","Index","matrix","range"],Kc=T(Xw,SL,e=>{var{typed:r,Index:t,matrix:n,range:i}=e;return r(Xw,{"Matrix, number":a,"Array, number":function(c,f){return a(n(tr(c)),f).valueOf()}});function a(s,c){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");Xr(c,s.size()[0]);var f=i(0,s.size()[1]),o=new t(c,f),u=s.subset(o);return Ge(u)?u:n([[u]])}});var Jw="size",NL=["typed","config","?matrix"],Kw=T(Jw,NL,e=>{var{typed:r,config:t,matrix:n}=e;return r(Jw,{Matrix:function(a){return a.create(a.size())},Array:or,string:function(a){return t.matrix==="Array"?[a.length]:n([a.length])},"number | Complex | BigNumber | Unit | boolean | null":function(a){return t.matrix==="Array"?[]:n?n([]):Xc()}})});var jw="squeeze",AL=["typed","matrix"],eD=T(jw,AL,e=>{var{typed:r,matrix:t}=e;return r(jw,{Array:function(i){return Xs(tr(i))},Matrix:function(i){var a=Xs(i.toArray());return Array.isArray(a)?t(a):a},any:function(i){return tr(i)}})});var rD="subset",EL=["typed","matrix","zeros","add"],jc=T(rD,EL,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e;return r(rD,{"Matrix, Index":function(c,f){return Ko(f)?t():(df(c,f),c.subset(f))},"Array, Index":r.referTo("Matrix, Index",function(s){return function(c,f){var o=s(t(c),f);return f.isScalar()?o:o.valueOf()}}),"Object, Index":ML,"string, Index":CL,"Matrix, Index, any, any":function(c,f,o,u){return Ko(f)?c:(df(c,f),c.clone().subset(f,a(o,f),u))},"Array, Index, any, any":r.referTo("Matrix, Index, any, any",function(s){return function(c,f,o,u){var p=s(t(c),f,o,u);return p.isMatrix?p.valueOf():p}}),"Array, Index, any":r.referTo("Matrix, Index, any, any",function(s){return function(c,f,o){return s(t(c),f,o,void 0).valueOf()}}),"Matrix, Index, any":r.referTo("Matrix, Index, any, any",function(s){return function(c,f,o){return s(c,f,o,void 0)}}),"string, Index, string":tD,"string, Index, string, string":tD,"Object, Index, any":_L});function a(s,c){if(typeof s=="string")throw new Error("can't boradcast a string");if(c._isScalar)return s;var f=c.size();if(f.every(o=>o>0))try{return i(s,n(f))}catch{return s}else return s}});function CL(e,r){if(!sa(r))throw new TypeError("Index expected");if(Ko(r))return"";if(df(Array.from(e),r),r.size().length!==1)throw new pr(r.size().length,1);var t=e.length;Xr(r.min()[0],t),Xr(r.max()[0],t);var n=r.dimension(0),i="";return n.forEach(function(a){i+=e.charAt(a)}),i}function tD(e,r,t,n){if(!r||r.isIndex!==!0)throw new TypeError("Index expected");if(Ko(r))return e;if(df(Array.from(e),r),r.size().length!==1)throw new pr(r.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=r.dimension(0),a=i.size()[0];if(a!==t.length)throw new pr(i.size()[0],t.length);var s=e.length;Xr(r.min()[0]),Xr(r.max()[0]);for(var c=[],f=0;fs)for(var o=s-1,u=c.length;o{var{typed:r,matrix:t}=e;return r(nD,{Array:s=>n(t(s)).valueOf(),Matrix:n,any:tr});function n(s){var c=s.size(),f;switch(c.length){case 1:f=s.clone();break;case 2:{var o=c[0],u=c[1];if(u===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+lr(c)+")");switch(s.storage()){case"dense":f=i(s,o,u);break;case"sparse":f=a(s,o,u);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+lr(c)+")")}return f}function i(s,c,f){for(var o=s._data,u=[],p,h=0;h{var{typed:r,transpose:t,conj:n}=e;return r(aD,{any:function(a){return n(t(a))}})});var sD="zeros",OL=["typed","config","matrix","BigNumber"],uD=T(sD,OL,e=>{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r(sD,{"":function(){return t.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(o){var u=o[o.length-1];if(typeof u=="string"){var p=o.pop();return a(o,p)}else return t.matrix==="Array"?a(o):a(o,"default")},Array:a,Matrix:function(o){var u=o.storage();return a(o.valueOf(),u)},"Array | Matrix, string":function(o,u){return a(o.valueOf(),u)}});function a(f,o){var u=s(f),p=u?new i(0):0;if(c(f),o){var h=n(o);return f.length>0?h.resize(f,p):h}else{var d=[];return f.length>0?Wi(d,f,p):d}}function s(f){var o=!1;return f.forEach(function(u,p,h){je(u)&&(o=!0,h[p]=u.toNumber())}),o}function c(f){f.forEach(function(o){if(typeof o!="number"||!He(o)||o<0)throw new Error("Parameters in function zeros must be positive integers")})}});var fD="fft",BL=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],lD=T(fD,BL,e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:i,divideScalar:a,exp:s,tau:c,i:f,dotDivide:o,conj:u,pow:p,ceil:h,log2:d}=e;return r(fD,{Array:x,Matrix:function(b){return b.create(x(b.toArray()))}});function x(C){var b=or(C);return b.length===1?w(C,b[0]):v(C.map(A=>x(A,b.slice(1))),0)}function v(C,b){var A=or(C);if(b!==0)return new Array(A[0]).fill(0).map((S,O)=>v(C[O],b-1));if(A.length===1)return w(C);function E(S){var O=or(S);return new Array(O[1]).fill(0).map((F,M)=>new Array(O[0]).fill(0).map((_,k)=>S[k][M]))}return E(v(E(C),1))}function y(C){for(var b=C.length,A=s(a(i(-1,i(f,c)),b)),E=[],S=1-b;Si(C[R],E[b-1+R])),...new Array(O-b).fill(0)],M=[...new Array(b+b-1).fill(0).map((q,R)=>a(1,E[R])),...new Array(O-(b+b-1)).fill(0)],_=w(F),k=w(M),L=new Array(O).fill(0).map((q,R)=>i(_[R],k[R])),Y=o(u(x(u(L))),O),$=[],V=b-1;VM%2===0),b/2),...w(C.filter((F,M)=>M%2===1),b/2)],E=0;E{var{typed:r,fft:t,dotDivide:n,conj:i}=e;return r(cD,{"Array | Matrix":function(s){var c=Ge(s)?s.size():or(s);return n(i(t(i(s))),c.reduce((f,o)=>f*o,1))}})});function mD(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function PL(e){for(var r=1;r{var{typed:r,add:t,subtract:n,multiply:i,divide:a,max:s,map:c,abs:f,isPositive:o,isNegative:u,larger:p,smaller:h,matrix:d,bignumber:x,unaryMinus:v}=e;function y(F){return function(M,_,k,L){var Y=!(_.length===2&&(_.every(S)||_.every(qt)));if(Y)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var $=_[0],V=_[1],q=p(V,$),R=L.firstStep;if(R!==void 0&&!o(R))throw new Error('"firstStep" must be positive');var j=L.maxStep;if(j!==void 0&&!o(j))throw new Error('"maxStep" must be positive');var U=L.minStep;if(U&&u(U))throw new Error('"minStep" must be positive or zero');var oe=[$,V,R,U,j].filter(Le=>Le!==void 0);if(!(oe.every(S)||oe.every(qt)))throw new Error('Inconsistent type of "t" dependant variables');for(var me=1,ie=L.tol?L.tol:1e-4,H=L.minDelta?L.minDelta:.2,ce=L.maxDelta?L.maxDelta:5,Me=L.maxIter?L.maxIter:1e4,pe=[$,V,...k,j,U].some(je),[ge,Se,xe,be]=pe?[x(F.a),x(F.c),x(F.b),x(F.bp)]:[F.a,F.c,F.b,F.bp],De=R?q?R:v(R):a(n(V,$),me),Ae=[$],ze=[k],Ze=n(xe,be),K=0,te=0,ye=A(q),ee=E(q);ye(Ae[K],V);){var ne=[];De=ee(Ae[K],V,De),ne.push(M(Ae[K],ze[K]));for(var ue=1;ueqt(Le)?Le.value:Le)));Ee1/4&&(Ae.push(t(Ae[K],De)),ze.push(t(ze[K],i(De,xe,ne))),K++);var Ce=.84*(ie/Ee)**(1/5);if(h(Ce,H)?Ce=H:p(Ce,ce)&&(Ce=ce),Ce=pe?x(Ce):Ce,De=i(De,Ce),j&&p(f(De),j)?De=q?j:v(j):U&&h(f(De),U)&&(De=q?U:v(U)),te++,te>Me)throw new Error("Maximum number of iterations reached, try changing options")}return{t:Ae,y:ze}}}function w(F,M,_,k){var L=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],Y=[null,1/2,3/4,1],$=[2/9,1/3,4/9,0],V=[7/24,1/4,1/3,1/8],q={a:L,c:Y,b:$,bp:V};return y(q)(F,M,_,k)}function C(F,M,_,k){var L=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],Y=[null,1/5,3/10,4/5,8/9,1,1],$=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],V=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],q={a:L,c:Y,b:$,bp:V};return y(q)(F,M,_,k)}function b(F,M,_,k){var L=k.method?k.method:"RK45",Y={RK23:w,RK45:C};if(L.toUpperCase()in Y){var $=PL({},k);return delete $.method,Y[L.toUpperCase()](F,M,_,$)}else{var V=Object.keys(Y).map(R=>'"'.concat(R,'"')),q="".concat(V.slice(0,-1).join(", ")," and ").concat(V.slice(-1));throw new Error('Unavailable method "'.concat(L,'". Available methods are ').concat(q))}}function A(F){return F?h:p}function E(F){var M=F?p:h;return function(_,k,L){var Y=t(_,L);return M(Y,k)?n(k,_):L}}function S(F){return je(F)||ar(F)}function O(F,M,_,k){var L=b(F,M.toArray(),_.toArray(),k);return{t:d(L.t),y:d(L.y)}}return r("solveODE",{"function, Array, Array, Object":b,"function, Matrix, Matrix, Object":O,"function, Array, Array":(F,M,_)=>b(F,M,_,{}),"function, Matrix, Matrix":(F,M,_)=>O(F,M,_,{}),"function, Array, number | BigNumber | Unit":(F,M,_)=>{var k=b(F,M,[_],{});return{t:k.t,y:k.y.map(L=>L[0])}},"function, Matrix, number | BigNumber | Unit":(F,M,_)=>{var k=b(F,M.toArray(),[_],{});return{t:d(k.t),y:d(k.y.map(L=>L[0]))}},"function, Array, number | BigNumber | Unit, Object":(F,M,_,k)=>{var L=b(F,M,[_],k);return{t:L.t,y:L.y.map(Y=>Y[0])}},"function, Matrix, number | BigNumber | Unit, Object":(F,M,_,k)=>{var L=b(F,M.toArray(),[_],k);return{t:d(L.t),y:d(L.y.map(Y=>Y[0]))}}})});var LL="erf",qL=["typed"],dD=T(LL,qL,e=>{var{typed:r}=e;return r("name",{number:function(s){var c=Math.abs(s);return c>=WL?mi(s):c<=UL?mi(s)*t(c):c<=4?mi(s)*(1-n(c)):mi(s)*(1-i(c))},"Array | Matrix":r.referToSelf(a=>s=>Je(s,a))});function t(a){var s=a*a,c=La[0][4]*s,f=s,o;for(o=0;o<3;o+=1)c=(c+La[0][o])*s,f=(f+fu[0][o])*s;return a*(c+La[0][3])/(f+fu[0][3])}function n(a){var s=La[1][8]*a,c=a,f;for(f=0;f<7;f+=1)s=(s+La[1][f])*a,c=(c+fu[1][f])*a;var o=(s+La[1][7])/(c+fu[1][7]),u=parseInt(a*16)/16,p=(a-u)*(a+u);return Math.exp(-u*u)*Math.exp(-p)*o}function i(a){var s=1/(a*a),c=La[2][5]*s,f=s,o;for(o=0;o<4;o+=1)c=(c+La[2][o])*s,f=(f+fu[2][o])*s;var u=s*(c+La[2][4])/(f+fu[2][4]);u=(zL-u)/a,s=parseInt(a*16)/16;var p=(a-s)*(a+s);return Math.exp(-s*s)*Math.exp(-p)*u}}),UL=.46875,zL=.5641895835477563,La=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],fu=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],WL=Math.pow(2,53);var vD="zeta",VL=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],gD=T(vD,VL,e=>{var{typed:r,config:t,multiply:n,pow:i,divide:a,factorial:s,equal:c,smallerEq:f,isNegative:o,gamma:u,sin:p,subtract:h,add:d,Complex:x,BigNumber:v,pi:y}=e;return r(vD,{number:S=>w(S,O=>O,()=>20),BigNumber:S=>w(S,O=>new v(O),()=>Math.abs(Math.log10(t.epsilon))),Complex:C});function w(S,O,F){return c(S,0)?O(-.5):c(S,1)?O(NaN):isFinite(S)?b(S,O,F,M=>M):o(S)?O(NaN):O(1)}function C(S){return S.re===0&&S.im===0?new x(-.5):S.re===1?new x(NaN,NaN):S.re===1/0&&S.im===0?new x(1):S.im===1/0||S.re===-1/0?new x(NaN,NaN):b(S,O=>O,O=>Math.round(1.3*15+.9*Math.abs(O.im)),O=>O.re)}function b(S,O,F,M){var _=F(S);if(M(S)>-(_-1)/2)return E(S,O(_),O);var k=n(i(2,S),i(O(y),h(S,1)));return k=n(k,p(n(a(O(y),2),S))),k=n(k,u(h(1,S))),n(k,b(h(1,S),O,F,M))}function A(S,O){for(var F=S,M=S;f(M,O);M=d(M,1)){var _=a(n(s(d(O,h(M,1))),i(4,M)),n(s(h(O,M)),s(n(2,M))));F=d(F,_)}return n(O,F)}function E(S,O,F){for(var M=a(1,n(A(F(0),O),h(1,i(2,h(1,S))))),_=F(0),k=F(1);f(k,O);k=d(k,1))_=d(_,a(n((-1)**(k-1),A(k,O)),i(k,S)));return n(M,_)}});var xD="mode",YL=["typed","isNaN","isNumeric"],yD=T(xD,YL,e=>{var{typed:r,isNaN:t,isNumeric:n}=e;return r(xD,{"Array | Matrix":i,"...":function(s){return i(s)}});function i(a){a=gr(a.valueOf());var s=a.length;if(s===0)throw new Error("Cannot calculate mode of an empty array");for(var c={},f=[],o=0,u=0;uo&&(o=c[p],f=[p])}return f}});function St(e,r,t){var n;return String(e).indexOf("Unexpected type")!==-1?(n=arguments.length>2?" (type: "+_r(t)+", value: "+JSON.stringify(t)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+r+", unexpected type of argument"+n)):String(e).indexOf("complex numbers")!==-1?(n=arguments.length>2?" (type: "+_r(t)+", value: "+JSON.stringify(t)+")":"",new TypeError("Cannot calculate "+r+", no ordering relation is defined for complex numbers"+n)):e}var bD="prod",HL=["typed","config","multiplyScalar","numeric"],wD=T(bD,HL,e=>{var{typed:r,config:t,multiplyScalar:n,numeric:i}=e;return r(bD,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(c,f){throw new Error("prod(A, dim) is not yet supported")},"...":function(c){return a(c)}});function a(s){var c;if(hn(s,function(f){try{c=c===void 0?f:n(c,f)}catch(o){throw St(o,"prod",f)}}),typeof c=="string"&&(c=i(c,t.number)),c===void 0)throw new Error("Cannot calculate prod of an empty array");return c}});var DD="format",GL=["typed"],SD=T(DD,GL,e=>{var{typed:r}=e;return r(DD,{any:lr,"any, Object | function | number | BigNumber":lr})});var ND="bin",$L=["typed","format"],AD=T(ND,$L,e=>{var{typed:r,format:t}=e;return r(ND,{"number | BigNumber":function(i){return t(i,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"bin",wordSize:a})}})});var ED="oct",ZL=["typed","format"],CD=T(ED,ZL,e=>{var{typed:r,format:t}=e;return r(ED,{"number | BigNumber":function(i){return t(i,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"oct",wordSize:a})}})});var MD="hex",QL=["typed","format"],_D=T(MD,QL,e=>{var{typed:r,format:t}=e;return r(MD,{"number | BigNumber":function(i){return t(i,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"hex",wordSize:a})}})});var ep=/\\$([\\w.]+)/g;var TD="print",XL=["typed"],rp=T(TD,XL,e=>{var{typed:r}=e;return r(TD,{"string, Object | Array":FD,"string, Object | Array, number | Object":FD})});function FD(e,r,t){return e.replace(ep,function(n,i){var a=i.split("."),s=r[a.shift()];for(s!==void 0&&s.isMatrix&&(s=s.toArray());a.length&&s!==void 0;){var c=a.shift();s=c?s[c]:s+"."}return s!==void 0?yt(s)?s:lr(s,t):n})}var OD="to",JL=["typed","matrix","concat"],BD=T(OD,JL,e=>{var{typed:r,matrix:t,concat:n}=e,i=vr({typed:r,matrix:t,concat:n});return r(OD,{"Unit, Unit | string":(a,s)=>a.to(s)},i({Ds:!0}))});var ID="isPrime",KL=["typed"],PD=T(ID,KL,e=>{var{typed:r}=e;return r(ID,{number:function(n){if(n*0!==0)return!1;if(n<=3)return n>1;if(n%2===0||n%3===0)return!1;for(var i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0},BigNumber:function(n){if(n.toNumber()*0!==0)return!1;if(n.lte(3))return n.gt(1);if(n.mod(2).eq(0)||n.mod(3).eq(0))return!1;if(n.lt(Math.pow(2,32))){for(var i=n.toNumber(),a=5;a*a<=i;a+=6)if(i%a===0||i%(a+2)===0)return!1;return!0}function s(C,b,A){for(var E=1;!b.eq(0);)b.mod(2).eq(0)?(b=b.div(2),C=C.mul(C).mod(A)):(b=b.sub(1),E=C.mul(E).mod(A));return E}var c=n.constructor.clone({precision:n.toFixed(0).length*2});n=new c(n);for(var f=0,o=n.sub(1);o.mod(2).eq(0);)o=o.div(2),f+=1;var u=null;if(n.lt("3317044064679887385961981"))u=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(C=>Cn=>Je(n,t))})});var jL="numeric",eq=["number","?bignumber","?fraction"],kD=T(jL,eq,e=>{var{number:r,bignumber:t,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:s=>r(s),BigNumber:t?s=>t(s):uu,Fraction:n?s=>n(s):Qc};return function(c){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",o=arguments.length>2?arguments[2]:void 0;if(o!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var u=_r(c);if(!(u in i))throw new TypeError("Cannot convert "+c+' of type "'+u+'"; valid input types are '+Object.keys(i).join(", "));if(!(f in a))throw new TypeError("Cannot convert "+c+' to type "'+f+'"; valid output types are '+Object.keys(a).join(", "));return f===u?c:a[f](c)}});var RD="divideScalar",rq=["typed","numeric"],LD=T(RD,rq,e=>{var{typed:r,numeric:t}=e;return r(RD,{"number, number":function(i,a){return i/a},"Complex, Complex":function(i,a){return i.div(a)},"BigNumber, BigNumber":function(i,a){return i.div(a)},"Fraction, Fraction":function(i,a){return i.div(a)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})});var qD="pow",tq=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],UD=T(qD,tq,e=>{var{typed:r,config:t,identity:n,multiply:i,matrix:a,inv:s,number:c,fraction:f,Complex:o}=e;return r(qD,{"number, number":u,"Complex, Complex":function(x,v){return x.pow(v)},"BigNumber, BigNumber":function(x,v){return v.isInteger()||x>=0||t.predictable?x.pow(v):new o(x.toNumber(),0).pow(v.toNumber(),0)},"Fraction, Fraction":function(x,v){var y=x.pow(v);if(y!=null)return y;if(t.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return u(x.valueOf(),v.valueOf())},"Array, number":p,"Array, BigNumber":function(x,v){return p(x,v.toNumber())},"Matrix, number":h,"Matrix, BigNumber":function(x,v){return h(x,v.toNumber())},"Unit, number | BigNumber":function(x,v){return x.pow(v)}});function u(d,x){if(t.predictable&&!He(x)&&d<0)try{var v=f(x),y=c(v);if((x===y||Math.abs((x-y)/x)<1e-14)&&v.d%2===1)return(v.n%2===0?1:-1)*Math.pow(-d,x)}catch{}return t.predictable&&(d<-1&&x===1/0||d>-1&&d<0&&x===-1/0)?NaN:He(x)||d>=0||t.predictable?Sv(d,x):d*d<1&&x===1/0||d*d>1&&x===-1/0?0:new o(d,0).pow(x,0)}function p(d,x){if(!He(x))throw new TypeError("For A^b, b must be an integer (value is "+x+")");var v=or(d);if(v.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+v.length+" dimensions)");if(v[0]!==v[1])throw new Error("For A^b, A must be square (size is "+v[0]+"x"+v[1]+")");if(x<0)try{return p(s(d),-x)}catch(C){throw C.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+x+")"):C}for(var y=n(v[0]).valueOf(),w=d;x>=1;)(x&1)===1&&(y=i(w,y)),x>>=1,w=i(w,w);return y}function h(d,x){return a(p(d.valueOf(),x))}});var lu="Number of decimals in function round must be an integer",zD="round",nq=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],WD=T(zD,nq,e=>{var{typed:r,config:t,matrix:n,equalScalar:i,zeros:a,BigNumber:s,DenseMatrix:c}=e,f=Jr({typed:r,equalScalar:i}),o=Lr({typed:r,DenseMatrix:c}),u=Bt({typed:r});function p(h){return Math.abs(Qs(h).exponent)}return r(zD,{number:function(d){var x=nu(d,p(t.epsilon)),v=wt(d,x,t.epsilon)?x:d;return nu(v)},"number, number":function(d,x){var v=p(t.epsilon);if(x>=v)return nu(d,x);var y=nu(d,v),w=wt(d,y,t.epsilon)?y:d;return nu(w,x)},"number, BigNumber":function(d,x){if(!x.isInteger())throw new TypeError(lu);return new s(d).toDecimalPlaces(x.toNumber())},Complex:function(d){return d.round()},"Complex, number":function(d,x){if(x%1)throw new TypeError(lu);return d.round(x)},"Complex, BigNumber":function(d,x){if(!x.isInteger())throw new TypeError(lu);var v=x.toNumber();return d.round(v)},BigNumber:function(d){var x=new s(d).toDecimalPlaces(p(t.epsilon)),v=Ut(d,x,t.epsilon)?x:d;return v.toDecimalPlaces(0)},"BigNumber, BigNumber":function(d,x){if(!x.isInteger())throw new TypeError(lu);var v=p(t.epsilon);if(x>=v)return d.toDecimalPlaces(x.toNumber());var y=d.toDecimalPlaces(v),w=Ut(d,y,t.epsilon)?y:d;return w.toDecimalPlaces(x.toNumber())},Fraction:function(d){return d.round()},"Fraction, number":function(d,x){if(x%1)throw new TypeError(lu);return d.round(x)},"Fraction, BigNumber":function(d,x){if(!x.isInteger())throw new TypeError(lu);return d.round(x.toNumber())},"Unit, number, Unit":r.referToSelf(h=>function(d,x,v){var y=d.toNumeric(v);return v.multiply(h(y,x))}),"Unit, BigNumber, Unit":r.referToSelf(h=>(d,x,v)=>h(d,x.toNumber(),v)),"Unit, Unit":r.referToSelf(h=>(d,x)=>h(d,0,x)),"Array | Matrix, number, Unit":r.referToSelf(h=>(d,x,v)=>Je(d,y=>h(y,x,v),!0)),"Array | Matrix, BigNumber, Unit":r.referToSelf(h=>(d,x,v)=>h(d,x.toNumber(),v)),"Array | Matrix, Unit":r.referToSelf(h=>(d,x)=>h(d,0,x)),"Array | Matrix":r.referToSelf(h=>d=>Je(d,h,!0)),"SparseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>f(d,x,h,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>u(d,x,h,!1)),"Array, number | BigNumber":r.referToSelf(h=>(d,x)=>u(n(d),x,h,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":r.referToSelf(h=>(d,x)=>i(d,0)?a(x.size(),x.storage()):o(x,d,h,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":r.referToSelf(h=>(d,x)=>i(d,0)?a(x.size(),x.storage()):u(x,d,h,!0)),"number | Complex | BigNumber | Fraction, Array":r.referToSelf(h=>(d,x)=>u(n(x),d,h,!0).valueOf())})});var VD="log",iq=["config","typed","divideScalar","Complex"],YD=T(VD,iq,e=>{var{typed:r,config:t,divideScalar:n,Complex:i}=e;return r(VD,{number:function(s){return s>=0||t.predictable?l1(s):new i(s,0).log()},Complex:function(s){return s.log()},BigNumber:function(s){return!s.isNegative()||t.predictable?s.ln():new i(s.toNumber(),0).log()},"any, any":r.referToSelf(a=>(s,c)=>n(a(s),a(c)))})});var HD="log1p",aq=["typed","config","divideScalar","log","Complex"],GD=T(HD,aq,e=>{var{typed:r,config:t,divideScalar:n,log:i,Complex:a}=e;return r(HD,{number:function(f){return f>=-1||t.predictable?gc(f):s(new a(f,0))},Complex:s,BigNumber:function(f){var o=f.plus(1);return!o.isNegative()||t.predictable?o.ln():s(new a(f.toNumber(),0))},"Array | Matrix":r.referToSelf(c=>f=>Je(f,c)),"any, any":r.referToSelf(c=>(f,o)=>n(c(f),i(o)))});function s(c){var f=c.re+1;return new a(Math.log(Math.sqrt(f*f+c.im*c.im)),Math.atan2(c.im,f))}});var $D="nthRoots",oq=["config","typed","divideScalar","Complex"],ZD=T($D,oq,e=>{var{typed:r,config:t,divideScalar:n,Complex:i}=e,a=[function(f){return new i(f,0)},function(f){return new i(0,f)},function(f){return new i(-f,0)},function(f){return new i(0,-f)}];function s(c,f){if(f<0)throw new Error("Root must be greater than zero");if(f===0)throw new Error("Root must be non-zero");if(f%1!==0)throw new Error("Root must be an integer");if(c===0||c.abs()===0)return[new i(0,0)];var o=typeof c=="number",u;(o||c.re===0||c.im===0)&&(o?u=2*+(c<0):c.im===0?u=2*+(c.re<0):u=2*+(c.im<0)+1);for(var p=c.arg(),h=c.abs(),d=[],x=Math.pow(h,1/f),v=0;v{var{typed:r,equalScalar:t,matrix:n,pow:i,DenseMatrix:a,concat:s}=e,c=ft({typed:r}),f=Vt({typed:r,DenseMatrix:a}),o=Jr({typed:r,equalScalar:t}),u=Lr({typed:r,DenseMatrix:a}),p=vr({typed:r,matrix:n,concat:s}),h={};for(var d in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,d)&&!d.includes("Matrix")&&!d.includes("Array")&&(h[d]=i.signatures[d]);var x=r(h);return r(QD,p({elop:x,SS:f,DS:c,Ss:o,sS:u}))});var JD="dotDivide",uq=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],KD=T(JD,uq,e=>{var{typed:r,matrix:t,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:s}=e,c=It({typed:r,equalScalar:n}),f=ft({typed:r}),o=Vt({typed:r,DenseMatrix:a}),u=Jr({typed:r,equalScalar:n}),p=Lr({typed:r,DenseMatrix:a}),h=vr({typed:r,matrix:t,concat:s});return r(JD,h({elop:i,SS:o,DS:f,SD:c,Ss:u,sS:p}))});function ma(e){var{DenseMatrix:r}=e;return function(n,i,a){var s=n.size();if(s.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+lr(s)+")");var c=s[0],f=s[1];if(c!==f)throw new RangeError("Matrix must be square (size: "+lr(s)+")");var o=[];if(Ge(i)){var u=i.size(),p=i._data;if(u.length===1){if(u[0]!==c)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var h=0;h{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:c}=e,f=ma({DenseMatrix:c});return r(jD,{"SparseMatrix, Array | Matrix":function(h,d){return u(h,d)},"DenseMatrix, Array | Matrix":function(h,d){return o(h,d)},"Array, Array | Matrix":function(h,d){var x=t(h),v=o(x,d);return v.valueOf()}});function o(p,h){h=f(p,h,!0);for(var d=h._data,x=p._size[0],v=p._size[1],y=[],w=p._data,C=0;CA&&(O.push(y[k]),F.push(L))}if(s(S,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var Y=n(E,S),$=0,V=F.length;${var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:c}=e,f=ma({DenseMatrix:c});return r(rS,{"SparseMatrix, Array | Matrix":function(h,d){return u(h,d)},"DenseMatrix, Array | Matrix":function(h,d){return o(h,d)},"Array, Array | Matrix":function(h,d){var x=t(h),v=o(x,d);return v.valueOf()}});function o(p,h){h=f(p,h,!0);for(var d=h._data,x=p._size[0],v=p._size[1],y=[],w=p._data,C=v-1;C>=0;C--){var b=d[C][0]||0,A=void 0;if(s(b,0))A=0;else{var E=w[C][C];if(s(E,0))throw new Error("Linear system cannot be solved since matrix is singular");A=n(b,E);for(var S=C-1;S>=0;S--)d[S]=[a(d[S][0]||0,i(A,w[S][C]))]}y[C]=[A]}return new c({data:y,size:[x,1]})}function u(p,h){h=f(p,h,!0);for(var d=h._data,x=p._size[0],v=p._size[1],y=p._values,w=p._index,C=p._ptr,b=[],A=v-1;A>=0;A--){var E=d[A][0]||0;if(s(E,0))b[A]=[0];else{for(var S=0,O=[],F=[],M=C[A],_=C[A+1],k=_-1;k>=M;k--){var L=w[k];L===A?S=y[k]:L{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:c}=e,f=ma({DenseMatrix:c});return r(nS,{"SparseMatrix, Array | Matrix":function(h,d){return u(h,d)},"DenseMatrix, Array | Matrix":function(h,d){return o(h,d)},"Array, Array | Matrix":function(h,d){var x=t(h),v=o(x,d);return v.map(y=>y.valueOf())}});function o(p,h){for(var d=[f(p,h,!0)._data.map(F=>F[0])],x=p._data,v=p._size[0],y=p._size[1],w=0;wnew c({data:F.map(M=>[M]),size:[v,1]}))}function u(p,h){for(var d=[f(p,h,!0)._data.map(me=>me[0])],x=p._size[0],v=p._size[1],y=p._values,w=p._index,C=p._ptr,b=0;bb&&(O.push(y[L]),F.push(Y))}if(s(k,0))if(s(S[b],0)){if(E===0){var R=[...S];R[b]=1;for(var j=0,U=F.length;jnew c({data:me.map(ie=>[ie]),size:[x,1]}))}});var aS="usolveAll",pq=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],oS=T(aS,pq,e=>{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:c}=e,f=ma({DenseMatrix:c});return r(aS,{"SparseMatrix, Array | Matrix":function(h,d){return u(h,d)},"DenseMatrix, Array | Matrix":function(h,d){return o(h,d)},"Array, Array | Matrix":function(h,d){var x=t(h),v=o(x,d);return v.map(y=>y.valueOf())}});function o(p,h){for(var d=[f(p,h,!0)._data.map(F=>F[0])],x=p._data,v=p._size[0],y=p._size[1],w=y-1;w>=0;w--)for(var C=d.length,b=0;b=0;O--)S[O]=a(S[O],x[O][w]);d.push(S)}}else{if(b===0)return[];d.splice(b,1),b-=1,C-=1}else{A[w]=n(A[w],x[w][w]);for(var E=w-1;E>=0;E--)A[E]=a(A[E],i(A[w],x[E][w]))}}return d.map(F=>new c({data:F.map(M=>[M]),size:[v,1]}))}function u(p,h){for(var d=[f(p,h,!0)._data.map(me=>me[0])],x=p._size[0],v=p._size[1],y=p._values,w=p._index,C=p._ptr,b=v-1;b>=0;b--)for(var A=d.length,E=0;E=M;L--){var Y=w[L];Y===b?k=y[L]:Ynew c({data:me.map(ie=>[ie]),size:[x,1]}))}});var mq="matAlgo08xS0Sid",hq=["typed","equalScalar"],cu=T(mq,hq,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,d=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");if(!c||!h)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));for(var O=[],F=[],M=[],_=[],k=[],L,Y,$,V,q=0;q{var{typed:r,matrix:t}=e;return{"Array, number":r.referTo("DenseMatrix, number",n=>(i,a)=>n(t(i),a).valueOf()),"Array, BigNumber":r.referTo("DenseMatrix, BigNumber",n=>(i,a)=>n(t(i),a).valueOf()),"number, Array":r.referTo("number, DenseMatrix",n=>(i,a)=>n(i,t(a)).valueOf()),"BigNumber, Array":r.referTo("BigNumber, DenseMatrix",n=>(i,a)=>n(i,t(a)).valueOf())}});var sS="leftShift",dq=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],uS=T(sS,dq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,c=dn({typed:r}),f=It({typed:r,equalScalar:n}),o=cu({typed:r,equalScalar:n}),u=Un({typed:r,DenseMatrix:a}),p=Jr({typed:r,equalScalar:n}),h=Bt({typed:r}),d=vr({typed:r,matrix:t,concat:s}),x=pu({typed:r,matrix:t});return r(sS,{"number, number":Mv,"BigNumber, BigNumber":Jb,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():h(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):h(w,y,v,!0))},x,d({SS:o,DS:c,SD:f}))});var fS="rightArithShift",vq=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],lS=T(fS,vq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,c=dn({typed:r}),f=It({typed:r,equalScalar:n}),o=cu({typed:r,equalScalar:n}),u=Un({typed:r,DenseMatrix:a}),p=Jr({typed:r,equalScalar:n}),h=Bt({typed:r}),d=vr({typed:r,matrix:t,concat:s}),x=pu({typed:r,matrix:t});return r(fS,{"number, number":_v,"BigNumber, BigNumber":Kb,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():h(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):h(w,y,v,!0))},x,d({SS:o,DS:c,SD:f}))});var cS="rightLogShift",gq=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],pS=T(cS,gq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,c=dn({typed:r}),f=It({typed:r,equalScalar:n}),o=cu({typed:r,equalScalar:n}),u=Un({typed:r,DenseMatrix:a}),p=Jr({typed:r,equalScalar:n}),h=Bt({typed:r}),d=vr({typed:r,matrix:t,concat:s}),x=pu({typed:r,matrix:t});return r(cS,{"number, number":Tv,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():h(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):h(w,y,v,!0))},x,d({SS:o,DS:c,SD:f}))});var mS="and",xq=["typed","matrix","equalScalar","zeros","not","concat"],tp=T(mS,xq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,c=It({typed:r,equalScalar:n}),f=So({typed:r,equalScalar:n}),o=Jr({typed:r,equalScalar:n}),u=Bt({typed:r}),p=vr({typed:r,matrix:t,concat:s});return r(mS,{"number, number":kv,"Complex, Complex":function(d,x){return(d.re!==0||d.im!==0)&&(x.re!==0||x.im!==0)},"BigNumber, BigNumber":function(d,x){return!d.isZero()&&!x.isZero()&&!d.isNaN()&&!x.isNaN()},"Unit, Unit":r.referToSelf(h=>(d,x)=>h(d.value||0,x.value||0)),"SparseMatrix, any":r.referToSelf(h=>(d,x)=>a(x)?i(d.size(),d.storage()):o(d,x,h,!1)),"DenseMatrix, any":r.referToSelf(h=>(d,x)=>a(x)?i(d.size(),d.storage()):u(d,x,h,!1)),"any, SparseMatrix":r.referToSelf(h=>(d,x)=>a(d)?i(d.size(),d.storage()):o(x,d,h,!0)),"any, DenseMatrix":r.referToSelf(h=>(d,x)=>a(d)?i(d.size(),d.storage()):u(x,d,h,!0)),"Array, any":r.referToSelf(h=>(d,x)=>h(t(d),x).valueOf()),"any, Array":r.referToSelf(h=>(d,x)=>h(d,t(x)).valueOf())},p({SS:f,DS:c}))});var np="compare",yq=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],hS=T(np,yq,e=>{var{typed:r,config:t,equalScalar:n,matrix:i,BigNumber:a,Fraction:s,DenseMatrix:c,concat:f}=e,o=ft({typed:r}),u=Do({typed:r,equalScalar:n}),p=Lr({typed:r,DenseMatrix:c}),h=vr({typed:r,matrix:i,concat:f}),d=di({typed:r});return r(np,bq({typed:r,config:t}),{"boolean, boolean":function(v,y){return v===y?0:v>y?1:-1},"BigNumber, BigNumber":function(v,y){return Ut(v,y,t.epsilon)?new a(0):new a(v.cmp(y))},"Fraction, Fraction":function(v,y){return new s(v.compare(y))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},d,h({SS:u,DS:o,Ss:p}))}),bq=T(np,["typed","config"],e=>{var{typed:r,config:t}=e;return r(np,{"number, number":function(i,a){return wt(i,a,t.epsilon)?0:i>a?1:-1}})});var is=li(vS(),1);var gS="compareNatural",wq=["typed","compare"],xS=T(gS,wq,e=>{var{typed:r,compare:t}=e,n=t.signatures["boolean,boolean"];return r(gS,{"any, any":i});function i(f,o){var u=_r(f),p=_r(o),h;if((u==="number"||u==="BigNumber"||u==="Fraction")&&(p==="number"||p==="BigNumber"||p==="Fraction"))return h=t(f,o),h.toString()!=="0"?h>0?1:-1:(0,is.default)(u,p);var d=["Array","DenseMatrix","SparseMatrix"];if(d.includes(u)||d.includes(p))return h=a(i,f,o),h!==0?h:(0,is.default)(u,p);if(u!==p)return(0,is.default)(u,p);if(u==="Complex")return Dq(f,o);if(u==="Unit")return f.equalBase(o)?i(f.value,o.value):s(i,f.formatUnits(),o.formatUnits());if(u==="boolean")return n(f,o);if(u==="string")return(0,is.default)(f,o);if(u==="Object")return c(i,f,o);if(u==="null"||u==="undefined")return 0;throw new TypeError('Unsupported type of value "'+u+'"')}function a(f,o,u){return Jn(o)&&Jn(u)?s(f,o.toJSON().values,u.toJSON().values):Jn(o)?a(f,o.toArray(),u):Jn(u)?a(f,o,u.toArray()):Ba(o)?a(f,o.toJSON().data,u):Ba(u)?a(f,o,u.toJSON().data):Array.isArray(o)?Array.isArray(u)?s(f,o,u):a(f,o,[u]):a(f,[o],u)}function s(f,o,u){for(var p=0,h=Math.min(o.length,u.length);pu.length?1:o.lengthr.re?1:e.rer.im?1:e.im{var{typed:r,matrix:t,concat:n}=e,i=vr({typed:r,matrix:t,concat:n});return r(yS,wc,i({elop:wc,Ds:!0}))});var ip="equal",Nq=["typed","matrix","equalScalar","DenseMatrix","concat"],wS=T(ip,Nq,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),c=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:t,concat:a});return r(ip,Aq({typed:r,equalScalar:n}),o({elop:n,SS:c,DS:s,Ss:f}))}),Aq=T(ip,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(ip,{"any, any":function(i,a){return i===null?a===null:a===null?i===null:i===void 0?a===void 0:a===void 0?i===void 0:t(i,a)}})});var DS="equalText",Eq=["typed","compareText","isZero"],SS=T(DS,Eq,e=>{var{typed:r,compareText:t,isZero:n}=e;return r(DS,{"any, any":function(a,s){return n(t(a,s))}})});var ap="smaller",Cq=["typed","config","matrix","DenseMatrix","concat"],NS=T(ap,Cq,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),c=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=di({typed:r});return r(ap,Mq({typed:r,config:t}),{"boolean, boolean":(p,h)=>pp.compare(h)===-1,"Complex, Complex":function(h,d){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:c,DS:s,Ss:f}))}),Mq=T(ap,["typed","config"],e=>{var{typed:r,config:t}=e;return r(ap,{"number, number":function(i,a){return i{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),c=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=di({typed:r});return r(op,Tq({typed:r,config:t}),{"boolean, boolean":(p,h)=>p<=h,"BigNumber, BigNumber":function(h,d){return h.lte(d)||Ut(h,d,t.epsilon)},"Fraction, Fraction":(p,h)=>p.compare(h)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:c,DS:s,Ss:f}))}),Tq=T(op,["typed","config"],e=>{var{typed:r,config:t}=e;return r(op,{"number, number":function(i,a){return i<=a||wt(i,a,t.epsilon)}})});var sp="larger",Fq=["typed","config","matrix","DenseMatrix","concat"],ES=T(sp,Fq,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),c=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=di({typed:r});return r(sp,Oq({typed:r,config:t}),{"boolean, boolean":(p,h)=>p>h,"BigNumber, BigNumber":function(h,d){return h.gt(d)&&!Ut(h,d,t.epsilon)},"Fraction, Fraction":(p,h)=>p.compare(h)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:c,DS:s,Ss:f}))}),Oq=T(sp,["typed","config"],e=>{var{typed:r,config:t}=e;return r(sp,{"number, number":function(i,a){return i>a&&!wt(i,a,t.epsilon)}})});var up="largerEq",Bq=["typed","config","matrix","DenseMatrix","concat"],CS=T(up,Bq,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),c=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=di({typed:r});return r(up,Iq({typed:r,config:t}),{"boolean, boolean":(p,h)=>p>=h,"BigNumber, BigNumber":function(h,d){return h.gte(d)||Ut(h,d,t.epsilon)},"Fraction, Fraction":(p,h)=>p.compare(h)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:c,DS:s,Ss:f}))}),Iq=T(up,["typed","config"],e=>{var{typed:r,config:t}=e;return r(up,{"number, number":function(i,a){return i>=a||wt(i,a,t.epsilon)}})});var MS="deepEqual",Pq=["typed","equal"],_S=T(MS,Pq,e=>{var{typed:r,equal:t}=e;return r(MS,{"any, any":function(a,s){return n(a.valueOf(),s.valueOf())}});function n(i,a){if(Array.isArray(i))if(Array.isArray(a)){var s=i.length;if(s!==a.length)return!1;for(var c=0;c{var{typed:r,config:t,equalScalar:n,matrix:i,DenseMatrix:a,concat:s}=e,c=ft({typed:r}),f=Vt({typed:r,DenseMatrix:a}),o=Lr({typed:r,DenseMatrix:a}),u=vr({typed:r,matrix:i,concat:s});return r(fp,Rq({typed:r,equalScalar:n}),u({elop:p,SS:f,DS:c,Ss:o}));function p(h,d){return!n(h,d)}}),Rq=T(fp,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(fp,{"any, any":function(i,a){return i===null?a!==null:a===null?i!==null:i===void 0?a!==void 0:a===void 0?i!==void 0:!t(i,a)}})});var FS="partitionSelect",Lq=["typed","isNumeric","isNaN","compare"],OS=T(FS,Lq,e=>{var{typed:r,isNumeric:t,isNaN:n,compare:i}=e,a=i,s=(o,u)=>-i(o,u);return r(FS,{"Array | Matrix, number":function(u,p){return c(u,p,a)},"Array | Matrix, number, string":function(u,p,h){if(h==="asc")return c(u,p,a);if(h==="desc")return c(u,p,s);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":c});function c(o,u,p){if(!He(u)||u<0)throw new Error("k must be a non-negative integer");if(Ge(o)){var h=o.size();if(h.length>1)throw new Error("Only one dimensional matrices supported");return f(o.valueOf(),u,p)}if(Array.isArray(o))return f(o,u,p)}function f(o,u,p){if(u>=o.length)throw new Error("k out of bounds");for(var h=0;h=0){var C=o[y];o[y]=o[v],o[v]=C,--y}else++v;p(o[v],w)>0&&--v,u<=v?x=v:d=v+1}return o[u]}});var BS="sort",qq=["typed","matrix","compare","compareNatural"],IS=T(BS,qq,e=>{var{typed:r,matrix:t,compare:n,compareNatural:i}=e,a=n,s=(u,p)=>-n(u,p);return r(BS,{Array:function(p){return f(p),p.sort(a)},Matrix:function(p){return o(p),t(p.toArray().sort(a),p.storage())},"Array, function":function(p,h){return f(p),p.sort(h)},"Matrix, function":function(p,h){return o(p),t(p.toArray().sort(h),p.storage())},"Array, string":function(p,h){return f(p),p.sort(c(h))},"Matrix, string":function(p,h){return o(p),t(p.toArray().sort(c(h)),p.storage())}});function c(u){if(u==="asc")return a;if(u==="desc")return s;if(u==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function f(u){if(or(u).length!==1)throw new Error("One dimensional array expected")}function o(u){if(u.size().length!==1)throw new Error("One dimensional matrix expected")}});var PS="max",Uq=["typed","config","numeric","larger"],lp=T(PS,Uq,e=>{var{typed:r,config:t,numeric:n,larger:i}=e;return r(PS,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(f,o){return wo(f,o.valueOf(),a)},"...":function(f){if(hi(f))throw new TypeError("Scalar values expected in function max");return s(f)}});function a(c,f){try{return i(c,f)?c:f}catch(o){throw St(o,"max",f)}}function s(c){var f;if(hn(c,function(o){try{isNaN(o)&&typeof o=="number"?f=NaN:(f===void 0||i(o,f))&&(f=o)}catch(u){throw St(u,"max",o)}}),f===void 0)throw new Error("Cannot calculate max of an empty array");return typeof f=="string"&&(f=n(f,t.number)),f}});var kS="min",zq=["typed","config","numeric","smaller"],cp=T(kS,zq,e=>{var{typed:r,config:t,numeric:n,smaller:i}=e;return r(kS,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(f,o){return wo(f,o.valueOf(),a)},"...":function(f){if(hi(f))throw new TypeError("Scalar values expected in function min");return s(f)}});function a(c,f){try{return i(c,f)?c:f}catch(o){throw St(o,"min",f)}}function s(c){var f;if(hn(c,function(o){try{isNaN(o)&&typeof o=="number"?f=NaN:(f===void 0||i(o,f))&&(f=o)}catch(u){throw St(u,"min",o)}}),f===void 0)throw new Error("Cannot calculate min of an empty array");return typeof f=="string"&&(f=n(f,t.number)),f}});var Wq="ImmutableDenseMatrix",Vq=["smaller","DenseMatrix"],RS=T(Wq,Vq,e=>{var{smaller:r,DenseMatrix:t}=e;function n(i,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!yt(a))throw new Error("Invalid datatype: "+a);if(Ge(i)||Ar(i)){var s=new t(i,a);this._data=s._data,this._size=s._size,this._datatype=s._datatype,this._min=null,this._max=null}else if(i&&Ar(i.data)&&Ar(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+_r(i)+")");this._data=[],this._size=[0],this._datatype=a,this._min=null,this._max=null}}return n.prototype=new t,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var a=t.prototype.subset.call(this,i);return Ge(a)?new n({data:a._data,size:a._size,datatype:a._datatype}):a}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:tr(this._data),size:tr(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(a){(i===null||r(a,i))&&(i=a)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(a){(i===null||r(i,a))&&(i=a)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0});var Yq="Index",Hq=["ImmutableDenseMatrix","getMatrixDataType"],qS=T(Yq,Hq,e=>{var{ImmutableDenseMatrix:r,getMatrixDataType:t}=e;function n(a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var s=0,c=arguments.length;s{t&&r.push(n)}),r}var Gq="FibonacciHeap",$q=["smaller","larger"],US=T(Gq,$q,e=>{var{smaller:r,larger:t}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(u,p){var h={key:u,value:p,degree:0};if(this._minimum){var d=this._minimum;h.left=d,h.right=d.right,d.right=h,h.right.left=h,r(u,d.key)&&(this._minimum=h)}else h.left=h,h.right=h,this._minimum=h;return this._size++,h},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var u=this._minimum;if(u===null)return u;for(var p=this._minimum,h=u.degree,d=u.child;h>0;){var x=d.right;d.left.right=d.right,d.right.left=d.left,d.left=p,d.right=p.right,p.right=d,d.right.left=d,d.parent=null,d=x,h--}return u.left.right=u.right,u.right.left=u.left,u===u.right?p=null:(p=u.right,p=o(p,this._size)),this._size--,this._minimum=p,u},i.prototype.remove=function(u){this._minimum=a(this._minimum,u,-1),this.extractMinimum()};function a(u,p,h){p.key=h;var d=p.parent;return d&&r(p.key,d.key)&&(s(u,p,d),c(u,d)),r(p.key,u.key)&&(u=p),u}function s(u,p,h){p.left.right=p.right,p.right.left=p.left,h.degree--,h.child===p&&(h.child=p.right),h.degree===0&&(h.child=null),p.left=u,p.right=u.right,u.right=p,p.right.left=p,p.parent=null,p.mark=!1}function c(u,p){var h=p.parent;!h||(p.mark?(s(u,p,h),c(h)):p.mark=!0)}var f=function(p,h){p.left.right=p.right,p.right.left=p.left,p.parent=h,h.child?(p.left=h.child,p.right=h.child.right,h.child.right=p,p.right.left=p):(h.child=p,p.right=p,p.left=p),h.degree++,p.mark=!1};function o(u,p){var h=Math.floor(Math.log(p)*n)+1,d=new Array(h),x=0,v=u;if(v)for(x++,v=v.right;v!==u;)x++,v=v.right;for(var y;x>0;){for(var w=v.degree,C=v.right;y=d[w],!!y;){if(t(v.key,y.key)){var b=y;y=v,v=b}f(y,v),d[w]=null,w++}d[w]=v,v=C,x--}u=null;for(var A=0;A{var{addScalar:r,equalScalar:t,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(a,s){if(this._values[a])this._values[a].value=s;else{var c=this._heap.insert(a,s);this._values[a]=c}},i.prototype.get=function(a){var s=this._values[a];return s?s.value:0},i.prototype.accumulate=function(a,s){var c=this._values[a];c?c.value=r(c.value,s):(c=this._heap.insert(a,s),this._values[a]=c)},i.prototype.forEach=function(a,s,c){var f=this._heap,o=this._values,u=[],p=f.extractMinimum();for(p&&u.push(p);p&&p.key<=s;)p.key>=a&&(t(p.value,0)||c(p.key,p.value,this)),p=f.extractMinimum(),p&&u.push(p);for(var h=0;h{var{on:r,config:t,addScalar:n,subtractScalar:i,multiplyScalar:a,divideScalar:s,pow:c,abs:f,fix:o,round:u,equal:p,isNumeric:h,format:d,number:x,Complex:v,BigNumber:y,Fraction:w}=e,C=x;function b(K,te){if(!(this instanceof b))throw new Error("Constructor must be called with the new operator");if(!(K==null||h(K)||Gt(K)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,te===void 0)this.units=[],this.dimensions=j.map(ee=>0);else if(typeof te=="string"){var ye=b.parse(te);this.units=ye.units,this.dimensions=ye.dimensions}else if(qt(te)&&te.value===null)this.fixPrefix=te.fixPrefix,this.skipAutomaticSimplification=te.skipAutomaticSimplification,this.dimensions=te.dimensions.slice(0),this.units=te.units.map(ee=>Mt({},ee));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(K)}Object.defineProperty(b,"name",{value:"Unit"}),b.prototype.constructor=b,b.prototype.type="Unit",b.prototype.isUnit=!0;var A,E,S;function O(){for(;S===" "||S===" ";)_()}function F(K){return K>="0"&&K<="9"||K==="."}function M(K){return K>="0"&&K<="9"}function _(){E++,S=A.charAt(E)}function k(K){E=K,S=A.charAt(E)}function L(){var K="",te=E;if(S==="+"?_():S==="-"&&(K+=S,_()),!F(S))return k(te),null;if(S==="."){if(K+=S,_(),!M(S))return k(te),null}else{for(;M(S);)K+=S,_();S==="."&&(K+=S,_())}for(;M(S);)K+=S,_();if(S==="E"||S==="e"){var ye="",ee=E;if(ye+=S,_(),(S==="+"||S==="-")&&(ye+=S,_()),!M(S))return k(ee),K;for(K=K+ye;M(S);)K+=S,_()}return K}function Y(){for(var K="";M(S)||b.isValidAlpha(S);)K+=S,_();var te=K.charAt(0);return b.isValidAlpha(te)?K:null}function $(K){return S===K?(_(),K):null}b.parse=function(K,te){if(te=te||{},A=K,E=-1,S="",typeof A!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var ye=new b;ye.units=[];var ee=1,ne=!1;_(),O();var ue=L(),Ee=null;if(ue){if(t.number==="BigNumber")Ee=new y(ue);else if(t.number==="Fraction")try{Ee=new w(ue)}catch{Ee=parseFloat(ue)}else Ee=parseFloat(ue);O(),$("*")?(ee=1,ne=!0):$("/")&&(ee=-1,ne=!0)}for(var Ce=[],Le=1;;){for(O();S==="(";)Ce.push(ee),Le*=ee,ee=1,_(),O();var Ie=void 0;if(S){var sr=S;if(Ie=Y(),Ie===null)throw new SyntaxError('Unexpected "'+sr+'" in "'+A+'" at index '+E.toString())}else break;var ir=V(Ie);if(ir===null)throw new SyntaxError('Unit "'+Ie+'" not found.');var Xe=ee*Le;if(O(),$("^")){O();var Or=L();if(Or===null)throw new SyntaxError('In "'+K+'", "^" must be followed by a floating-point number');Xe*=Or}ye.units.push({unit:ir.unit,prefix:ir.prefix,power:Xe});for(var re=0;re1||Math.abs(this.units[0].power-1)>1e-15},b.prototype._normalize=function(K){if(K==null||this.units.length===0)return K;for(var te=K,ye=b._getNumberConverter(_r(K)),ee=0;ee{if($e(H,K)){var te=H[K],ye=te.prefixes[""];return{unit:te,prefix:ye}}for(var ee in H)if($e(H,ee)&&yy(K,ee)){var ne=H[ee],ue=K.length-ee.length,Ee=K.substring(0,ue),Ce=$e(ne.prefixes,Ee)?ne.prefixes[Ee]:void 0;if(Ce!==void 0)return{unit:ne,prefix:Ce}}return null},{hasher:K=>K[0],limit:100});b.isValuelessUnit=function(K){return V(K)!==null},b.prototype.hasBase=function(K){if(typeof K=="string"&&(K=U[K]),!K)return!1;for(var te=0;te1e-12)return!1;return!0},b.prototype.equalBase=function(K){for(var te=0;te1e-12)return!1;return!0},b.prototype.equals=function(K){return this.equalBase(K)&&p(this.value,K.value)},b.prototype.multiply=function(K){for(var te=this.clone(),ye=qt(K)?K:new b(K),ee=0;ee1e-12&&($e(ge,Ce)?te.push({unit:ge[Ce].unit,prefix:ge[Ce].prefix,power:K.dimensions[Ee]||0}):ue=!0)}te.length1e-12)if($e(pe.si,ee))te.push({unit:pe.si[ee].unit,prefix:pe.si[ee].prefix,power:K.dimensions[ye]||0});else throw new Error("Cannot express custom unit "+ee+" in SI units")}return K.units=te,K.fixPrefix=!0,K.skipAutomaticSimplification=!0,this.value!==null?(K.value=null,this.to(K)):K},b.prototype.formatUnits=function(){for(var K="",te="",ye=0,ee=0,ne=0;ne0?(ye++,K+=" "+this.units[ne].prefix.name+this.units[ne].unit.name,Math.abs(this.units[ne].power-1)>1e-15&&(K+="^"+this.units[ne].power)):this.units[ne].power<0&&ee++;if(ee>0)for(var ue=0;ue0?(te+=" "+this.units[ue].prefix.name+this.units[ue].unit.name,Math.abs(this.units[ue].power+1)>1e-15&&(te+="^"+-this.units[ue].power)):(te+=" "+this.units[ue].prefix.name+this.units[ue].unit.name,te+="^"+this.units[ue].power));K=K.substr(1),te=te.substr(1),ye>1&&ee>0&&(K="("+K+")"),ee>1&&ye>0&&(te="("+te+")");var Ee=K;return ye>0&&ee>0&&(Ee+=" / "),Ee+=te,Ee},b.prototype.format=function(K){var te=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),ye=!1;typeof te.value<"u"&&te.value!==null&&Gt(te.value)&&(ye=Math.abs(te.value.re)<1e-14);for(var ee in te.units)$e(te.units,ee)&&te.units[ee].unit&&(te.units[ee].unit.name==="VA"&&ye?te.units[ee].unit=H.VAR:te.units[ee].unit.name==="VAR"&&!ye&&(te.units[ee].unit=H.VA));te.units.length===1&&!te.fixPrefix&&Math.abs(te.units[0].power-Math.round(te.units[0].power))<1e-14&&(te.units[0].prefix=te._bestPrefix());var ne=te._denormalize(te.value),ue=te.value!==null?d(ne,K||{}):"",Ee=te.formatUnits();return te.value&&Gt(te.value)&&(ue="("+ue+")"),Ee.length>0&&ue.length>0&&(ue+=" "),ue+=Ee,ue},b.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var K=this.value!==null?f(this.value):0,te=f(this.units[0].unit.value),ye=this.units[0].prefix;if(K===0)return ye;var ee=this.units[0].power,ne=Math.log(K/Math.pow(ye.value*te,ee))/Math.LN10-1.2;if(ne>-2.200001&&ne<1.800001)return ye;ne=Math.abs(ne);var ue=this.units[0].unit.prefixes;for(var Ee in ue)if($e(ue,Ee)){var Ce=ue[Ee];if(Ce.scientific){var Le=Math.abs(Math.log(K/Math.pow(Ce.value*te,ee))/Math.LN10-1.2);(Le0)},H={meter:{name:"meter",base:U.LENGTH,prefixes:R.LONG,value:1,offset:0},inch:{name:"inch",base:U.LENGTH,prefixes:R.NONE,value:.0254,offset:0},foot:{name:"foot",base:U.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yard:{name:"yard",base:U.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mile:{name:"mile",base:U.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},link:{name:"link",base:U.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rod:{name:"rod",base:U.LENGTH,prefixes:R.NONE,value:5.0292,offset:0},chain:{name:"chain",base:U.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:U.LENGTH,prefixes:R.NONE,value:1e-10,offset:0},m:{name:"m",base:U.LENGTH,prefixes:R.SHORT,value:1,offset:0},in:{name:"in",base:U.LENGTH,prefixes:R.NONE,value:.0254,offset:0},ft:{name:"ft",base:U.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yd:{name:"yd",base:U.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mi:{name:"mi",base:U.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},li:{name:"li",base:U.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rd:{name:"rd",base:U.LENGTH,prefixes:R.NONE,value:5.02921,offset:0},ch:{name:"ch",base:U.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},mil:{name:"mil",base:U.LENGTH,prefixes:R.NONE,value:254e-7,offset:0},m2:{name:"m2",base:U.SURFACE,prefixes:R.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:U.SURFACE,prefixes:R.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:U.SURFACE,prefixes:R.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:U.SURFACE,prefixes:R.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:U.SURFACE,prefixes:R.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:U.SURFACE,prefixes:R.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:U.SURFACE,prefixes:R.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:U.SURFACE,prefixes:R.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:U.SURFACE,prefixes:R.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:U.SURFACE,prefixes:R.NONE,value:1e4,offset:0},m3:{name:"m3",base:U.VOLUME,prefixes:R.CUBIC,value:1,offset:0},L:{name:"L",base:U.VOLUME,prefixes:R.SHORT,value:.001,offset:0},l:{name:"l",base:U.VOLUME,prefixes:R.SHORT,value:.001,offset:0},litre:{name:"litre",base:U.VOLUME,prefixes:R.LONG,value:.001,offset:0},cuin:{name:"cuin",base:U.VOLUME,prefixes:R.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:U.VOLUME,prefixes:R.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:U.VOLUME,prefixes:R.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:U.VOLUME,prefixes:R.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:U.VOLUME,prefixes:R.NONE,value:15e-6,offset:0},drop:{name:"drop",base:U.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:U.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},minim:{name:"minim",base:U.VOLUME,prefixes:R.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:U.VOLUME,prefixes:R.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:U.VOLUME,prefixes:R.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:U.VOLUME,prefixes:R.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:U.VOLUME,prefixes:R.NONE,value:1e-6,offset:0},cup:{name:"cup",base:U.VOLUME,prefixes:R.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:U.VOLUME,prefixes:R.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:U.VOLUME,prefixes:R.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:U.VOLUME,prefixes:R.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:U.VOLUME,prefixes:R.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:U.VOLUME,prefixes:R.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:U.VOLUME,prefixes:R.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:U.VOLUME,prefixes:R.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:U.VOLUME,prefixes:R.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:U.VOLUME,prefixes:R.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:U.VOLUME,prefixes:R.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:U.VOLUME,prefixes:R.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:U.VOLUME,prefixes:R.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:U.VOLUME,prefixes:R.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:U.VOLUME,prefixes:R.NONE,value:.1173478,offset:0},obl:{name:"obl",base:U.VOLUME,prefixes:R.NONE,value:.1589873,offset:0},g:{name:"g",base:U.MASS,prefixes:R.SHORT,value:.001,offset:0},gram:{name:"gram",base:U.MASS,prefixes:R.LONG,value:.001,offset:0},ton:{name:"ton",base:U.MASS,prefixes:R.SHORT,value:907.18474,offset:0},t:{name:"t",base:U.MASS,prefixes:R.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:U.MASS,prefixes:R.LONG,value:1e3,offset:0},grain:{name:"grain",base:U.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:U.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:U.MASS,prefixes:R.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:U.MASS,prefixes:R.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:U.MASS,prefixes:R.NONE,value:45.359237,offset:0},stick:{name:"stick",base:U.MASS,prefixes:R.NONE,value:.115,offset:0},stone:{name:"stone",base:U.MASS,prefixes:R.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:U.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:U.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:U.MASS,prefixes:R.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:U.MASS,prefixes:R.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:U.MASS,prefixes:R.NONE,value:45.359237,offset:0},s:{name:"s",base:U.TIME,prefixes:R.SHORT,value:1,offset:0},min:{name:"min",base:U.TIME,prefixes:R.NONE,value:60,offset:0},h:{name:"h",base:U.TIME,prefixes:R.NONE,value:3600,offset:0},second:{name:"second",base:U.TIME,prefixes:R.LONG,value:1,offset:0},sec:{name:"sec",base:U.TIME,prefixes:R.LONG,value:1,offset:0},minute:{name:"minute",base:U.TIME,prefixes:R.NONE,value:60,offset:0},hour:{name:"hour",base:U.TIME,prefixes:R.NONE,value:3600,offset:0},day:{name:"day",base:U.TIME,prefixes:R.NONE,value:86400,offset:0},week:{name:"week",base:U.TIME,prefixes:R.NONE,value:7*86400,offset:0},month:{name:"month",base:U.TIME,prefixes:R.NONE,value:2629800,offset:0},year:{name:"year",base:U.TIME,prefixes:R.NONE,value:31557600,offset:0},decade:{name:"decade",base:U.TIME,prefixes:R.NONE,value:315576e3,offset:0},century:{name:"century",base:U.TIME,prefixes:R.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:U.TIME,prefixes:R.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:U.FREQUENCY,prefixes:R.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:U.FREQUENCY,prefixes:R.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:U.ANGLE,prefixes:R.SHORT,value:1,offset:0},radian:{name:"radian",base:U.ANGLE,prefixes:R.LONG,value:1,offset:0},deg:{name:"deg",base:U.ANGLE,prefixes:R.SHORT,value:null,offset:0},degree:{name:"degree",base:U.ANGLE,prefixes:R.LONG,value:null,offset:0},grad:{name:"grad",base:U.ANGLE,prefixes:R.SHORT,value:null,offset:0},gradian:{name:"gradian",base:U.ANGLE,prefixes:R.LONG,value:null,offset:0},cycle:{name:"cycle",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},A:{name:"A",base:U.CURRENT,prefixes:R.SHORT,value:1,offset:0},ampere:{name:"ampere",base:U.CURRENT,prefixes:R.LONG,value:1,offset:0},K:{name:"K",base:U.TEMPERATURE,prefixes:R.SHORT,value:1,offset:0},degC:{name:"degC",base:U.TEMPERATURE,prefixes:R.SHORT,value:1,offset:273.15},degF:{name:"degF",base:U.TEMPERATURE,prefixes:R.SHORT,value:new w(5,9),offset:459.67},degR:{name:"degR",base:U.TEMPERATURE,prefixes:R.SHORT,value:new w(5,9),offset:0},kelvin:{name:"kelvin",base:U.TEMPERATURE,prefixes:R.LONG,value:1,offset:0},celsius:{name:"celsius",base:U.TEMPERATURE,prefixes:R.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:U.TEMPERATURE,prefixes:R.LONG,value:new w(5,9),offset:459.67},rankine:{name:"rankine",base:U.TEMPERATURE,prefixes:R.LONG,value:new w(5,9),offset:0},mol:{name:"mol",base:U.AMOUNT_OF_SUBSTANCE,prefixes:R.SHORT,value:1,offset:0},mole:{name:"mole",base:U.AMOUNT_OF_SUBSTANCE,prefixes:R.LONG,value:1,offset:0},cd:{name:"cd",base:U.LUMINOUS_INTENSITY,prefixes:R.SHORT,value:1,offset:0},candela:{name:"candela",base:U.LUMINOUS_INTENSITY,prefixes:R.LONG,value:1,offset:0},N:{name:"N",base:U.FORCE,prefixes:R.SHORT,value:1,offset:0},newton:{name:"newton",base:U.FORCE,prefixes:R.LONG,value:1,offset:0},dyn:{name:"dyn",base:U.FORCE,prefixes:R.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:U.FORCE,prefixes:R.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:U.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:U.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:U.FORCE,prefixes:R.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:U.FORCE,prefixes:R.NONE,value:9.80665,offset:0},J:{name:"J",base:U.ENERGY,prefixes:R.SHORT,value:1,offset:0},joule:{name:"joule",base:U.ENERGY,prefixes:R.LONG,value:1,offset:0},erg:{name:"erg",base:U.ENERGY,prefixes:R.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:U.ENERGY,prefixes:R.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:U.ENERGY,prefixes:R.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:U.ENERGY,prefixes:R.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:U.ENERGY,prefixes:R.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:U.POWER,prefixes:R.SHORT,value:1,offset:0},watt:{name:"watt",base:U.POWER,prefixes:R.LONG,value:1,offset:0},hp:{name:"hp",base:U.POWER,prefixes:R.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:U.POWER,prefixes:R.SHORT,value:v.I,offset:0},VA:{name:"VA",base:U.POWER,prefixes:R.SHORT,value:1,offset:0},Pa:{name:"Pa",base:U.PRESSURE,prefixes:R.SHORT,value:1,offset:0},psi:{name:"psi",base:U.PRESSURE,prefixes:R.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:U.PRESSURE,prefixes:R.NONE,value:101325,offset:0},bar:{name:"bar",base:U.PRESSURE,prefixes:R.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:U.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:U.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:U.PRESSURE,prefixes:R.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:U.PRESSURE,prefixes:R.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:U.ELECTRIC_CHARGE,prefixes:R.LONG,value:1,offset:0},C:{name:"C",base:U.ELECTRIC_CHARGE,prefixes:R.SHORT,value:1,offset:0},farad:{name:"farad",base:U.ELECTRIC_CAPACITANCE,prefixes:R.LONG,value:1,offset:0},F:{name:"F",base:U.ELECTRIC_CAPACITANCE,prefixes:R.SHORT,value:1,offset:0},volt:{name:"volt",base:U.ELECTRIC_POTENTIAL,prefixes:R.LONG,value:1,offset:0},V:{name:"V",base:U.ELECTRIC_POTENTIAL,prefixes:R.SHORT,value:1,offset:0},ohm:{name:"ohm",base:U.ELECTRIC_RESISTANCE,prefixes:R.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:U.ELECTRIC_INDUCTANCE,prefixes:R.LONG,value:1,offset:0},H:{name:"H",base:U.ELECTRIC_INDUCTANCE,prefixes:R.SHORT,value:1,offset:0},siemens:{name:"siemens",base:U.ELECTRIC_CONDUCTANCE,prefixes:R.LONG,value:1,offset:0},S:{name:"S",base:U.ELECTRIC_CONDUCTANCE,prefixes:R.SHORT,value:1,offset:0},weber:{name:"weber",base:U.MAGNETIC_FLUX,prefixes:R.LONG,value:1,offset:0},Wb:{name:"Wb",base:U.MAGNETIC_FLUX,prefixes:R.SHORT,value:1,offset:0},tesla:{name:"tesla",base:U.MAGNETIC_FLUX_DENSITY,prefixes:R.LONG,value:1,offset:0},T:{name:"T",base:U.MAGNETIC_FLUX_DENSITY,prefixes:R.SHORT,value:1,offset:0},b:{name:"b",base:U.BIT,prefixes:R.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:U.BIT,prefixes:R.BINARY_LONG,value:1,offset:0},B:{name:"B",base:U.BIT,prefixes:R.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:U.BIT,prefixes:R.BINARY_LONG,value:8,offset:0}},ce={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function Me(K){if(K.number==="BigNumber"){var te=Af(y);H.rad.value=new y(1),H.deg.value=te.div(180),H.grad.value=te.div(200),H.cycle.value=te.times(2),H.arcsec.value=te.div(648e3),H.arcmin.value=te.div(10800)}else H.rad.value=1,H.deg.value=Math.PI/180,H.grad.value=Math.PI/200,H.cycle.value=Math.PI*2,H.arcsec.value=Math.PI/648e3,H.arcmin.value=Math.PI/10800;H.radian.value=H.rad.value,H.degree.value=H.deg.value,H.gradian.value=H.grad.value}Me(t),r&&r("config",function(K,te){K.number!==te.number&&Me(K)});var pe={si:{NONE:{unit:ie,prefix:R.NONE[""]},LENGTH:{unit:H.m,prefix:R.SHORT[""]},MASS:{unit:H.g,prefix:R.SHORT.k},TIME:{unit:H.s,prefix:R.SHORT[""]},CURRENT:{unit:H.A,prefix:R.SHORT[""]},TEMPERATURE:{unit:H.K,prefix:R.SHORT[""]},LUMINOUS_INTENSITY:{unit:H.cd,prefix:R.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:H.mol,prefix:R.SHORT[""]},ANGLE:{unit:H.rad,prefix:R.SHORT[""]},BIT:{unit:H.bits,prefix:R.SHORT[""]},FORCE:{unit:H.N,prefix:R.SHORT[""]},ENERGY:{unit:H.J,prefix:R.SHORT[""]},POWER:{unit:H.W,prefix:R.SHORT[""]},PRESSURE:{unit:H.Pa,prefix:R.SHORT[""]},ELECTRIC_CHARGE:{unit:H.C,prefix:R.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:H.F,prefix:R.SHORT[""]},ELECTRIC_POTENTIAL:{unit:H.V,prefix:R.SHORT[""]},ELECTRIC_RESISTANCE:{unit:H.ohm,prefix:R.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:H.H,prefix:R.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:H.S,prefix:R.SHORT[""]},MAGNETIC_FLUX:{unit:H.Wb,prefix:R.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:H.T,prefix:R.SHORT[""]},FREQUENCY:{unit:H.Hz,prefix:R.SHORT[""]}}};pe.cgs=JSON.parse(JSON.stringify(pe.si)),pe.cgs.LENGTH={unit:H.m,prefix:R.SHORT.c},pe.cgs.MASS={unit:H.g,prefix:R.SHORT[""]},pe.cgs.FORCE={unit:H.dyn,prefix:R.SHORT[""]},pe.cgs.ENERGY={unit:H.erg,prefix:R.NONE[""]},pe.us=JSON.parse(JSON.stringify(pe.si)),pe.us.LENGTH={unit:H.ft,prefix:R.NONE[""]},pe.us.MASS={unit:H.lbm,prefix:R.NONE[""]},pe.us.TEMPERATURE={unit:H.degF,prefix:R.NONE[""]},pe.us.FORCE={unit:H.lbf,prefix:R.NONE[""]},pe.us.ENERGY={unit:H.BTU,prefix:R.BTU[""]},pe.us.POWER={unit:H.hp,prefix:R.NONE[""]},pe.us.PRESSURE={unit:H.psi,prefix:R.NONE[""]},pe.auto=JSON.parse(JSON.stringify(pe.si));var ge=pe.auto;b.setUnitSystem=function(K){if($e(pe,K))ge=pe[K];else throw new Error("Unit system "+K+" does not exist. Choices are: "+Object.keys(pe).join(", "))},b.getUnitSystem=function(){for(var K in pe)if($e(pe,K)&&pe[K]===ge)return K},b.typeConverters={BigNumber:function(te){return te!=null&&te.isFraction?new y(te.n).div(te.d).times(te.s):new y(te+"")},Fraction:function(te){return new w(te)},Complex:function(te){return te},number:function(te){return te!=null&&te.isFraction?x(te):te}},b.prototype._numberConverter=function(){var K=b.typeConverters[this.valueType()];if(K)return K;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},b._getNumberConverter=function(K){if(!b.typeConverters[K])throw new TypeError('Unsupported type "'+K+'"');return b.typeConverters[K]};for(var Se in H)if($e(H,Se)){var xe=H[Se];xe.dimensions=xe.base.dimensions}for(var be in ce)if($e(ce,be)){var De=H[ce[be]],Ae={};for(var ze in De)$e(De,ze)&&(Ae[ze]=De[ze]);Ae.name=be,H[be]=Ae}b.isValidAlpha=function(te){return/^[a-zA-Z]$/.test(te)};function Ze(K){for(var te=0;te0&&!(b.isValidAlpha(S)||M(S)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+K+'"')}}return b.createUnit=function(K,te){if(typeof K!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(te&&te.override){for(var ye in K)if($e(K,ye)&&b.deleteUnit(ye),K[ye].aliases)for(var ee=0;ee"u"||te===null)&&(te={}),typeof K!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if($e(H,K))throw new Error('Cannot create unit "'+K+'": a unit with that name already exists');Ze(K);var ye=null,ee=[],ne=0,ue,Ee,Ce;if(te&&te.type==="Unit")ye=te.clone();else if(typeof te=="string")te!==""&&(ue=te);else if(typeof te=="object")ue=te.definition,Ee=te.prefixes,ne=te.offset,Ce=te.baseName,te.aliases&&(ee=te.aliases.valueOf());else throw new TypeError('Cannot create unit "'+K+'" from "'+te.toString()+'": expecting "string" or "Unit" or "Object"');if(ee){for(var Le=0;Le1e-12){le=!1;break}if(le){Or=!0,Ie.base=U[re];break}}if(!Or){Ce=Ce||K+"_STUFF";var Oe={dimensions:ye.dimensions.slice(0)};Oe.key=Ce,U[Ce]=Oe,ge[Ce]={unit:Ie,prefix:R.NONE[""]},Ie.base=U[Ce]}}else{if(Ce=Ce||K+"_STUFF",j.indexOf(Ce)>=0)throw new Error('Cannot create new base unit "'+K+'": a base unit with that name already exists (and cannot be overridden)');j.push(Ce);for(var sr in U)$e(U,sr)&&(U[sr].dimensions[j.length-1]=0);for(var ir={dimensions:[]},Xe=0;Xe{var{typed:r,Unit:t}=e;return r($S,{Unit:function(i){return i.clone()},string:function(i){return t.isValuelessUnit(i)?new t(null,i):t.parse(i,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(i,a){return new t(i,a)},"number | BigNumber | Fraction":function(i){return new t(i)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var QS="sparse",jq=["typed","SparseMatrix"],XS=T(QS,jq,e=>{var{typed:r,SparseMatrix:t}=e;return r(QS,{"":function(){return new t([])},string:function(i){return new t([],i)},"Array | Matrix":function(i){return new t(i)},"Array | Matrix, string":function(i,a){return new t(i,a)}})});var JS="createUnit",eU=["typed","Unit"],KS=T(JS,eU,e=>{var{typed:r,Unit:t}=e;return r(JS,{"Object, Object":function(i,a){return t.createUnit(i,a)},Object:function(i){return t.createUnit(i,{})},"string, Unit | string | Object, Object":function(i,a,s){var c={};return c[i]=a,t.createUnit(c,s)},"string, Unit | string | Object":function(i,a){var s={};return s[i]=a,t.createUnit(s,{})},string:function(i){var a={};return a[i]={},t.createUnit(a,{})}})});var jS="acos",rU=["typed","config","Complex"],eN=T(jS,rU,e=>{var{typed:r,config:t,Complex:n}=e;return r(jS,{number:function(a){return a>=-1&&a<=1||t.predictable?Math.acos(a):new n(a,0).acos()},Complex:function(a){return a.acos()},BigNumber:function(a){return a.acos()}})});var rN="acosh",tU=["typed","config","Complex"],tN=T(rN,tU,e=>{var{typed:r,config:t,Complex:n}=e;return r(rN,{number:function(a){return a>=1||t.predictable?qv(a):a<=-1?new n(Math.log(Math.sqrt(a*a-1)-a),Math.PI):new n(a,0).acosh()},Complex:function(a){return a.acosh()},BigNumber:function(a){return a.acosh()}})});var nN="acot",nU=["typed","BigNumber"],iN=T(nN,nU,e=>{var{typed:r,BigNumber:t}=e;return r(nN,{number:Uv,Complex:function(i){return i.acot()},BigNumber:function(i){return new t(1).div(i).atan()}})});var aN="acoth",iU=["typed","config","Complex","BigNumber"],oN=T(aN,iU,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(aN,{number:function(s){return s>=1||s<=-1||t.predictable?zv(s):new n(s,0).acoth()},Complex:function(s){return s.acoth()},BigNumber:function(s){return new i(1).div(s).atanh()}})});var sN="acsc",aU=["typed","config","Complex","BigNumber"],uN=T(sN,aU,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(sN,{number:function(s){return s<=-1||s>=1||t.predictable?Wv(s):new n(s,0).acsc()},Complex:function(s){return s.acsc()},BigNumber:function(s){return new i(1).div(s).asin()}})});var fN="acsch",oU=["typed","BigNumber"],lN=T(fN,oU,e=>{var{typed:r,BigNumber:t}=e;return r(fN,{number:Vv,Complex:function(i){return i.acsch()},BigNumber:function(i){return new t(1).div(i).asinh()}})});var cN="asec",sU=["typed","config","Complex","BigNumber"],pN=T(cN,sU,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(cN,{number:function(s){return s<=-1||s>=1||t.predictable?Yv(s):new n(s,0).asec()},Complex:function(s){return s.asec()},BigNumber:function(s){return new i(1).div(s).acos()}})});var mN="asech",uU=["typed","config","Complex","BigNumber"],hN=T(mN,uU,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(mN,{number:function(s){if(s<=1&&s>=-1||t.predictable){var c=1/s;if(c>0||t.predictable)return Hv(s);var f=Math.sqrt(c*c-1);return new n(Math.log(f-c),Math.PI)}return new n(s,0).asech()},Complex:function(s){return s.asech()},BigNumber:function(s){return new i(1).div(s).acosh()}})});var dN="asin",fU=["typed","config","Complex"],vN=T(dN,fU,e=>{var{typed:r,config:t,Complex:n}=e;return r(dN,{number:function(a){return a>=-1&&a<=1||t.predictable?Math.asin(a):new n(a,0).asin()},Complex:function(a){return a.asin()},BigNumber:function(a){return a.asin()}})});var lU="asinh",cU=["typed"],gN=T(lU,cU,e=>{var{typed:r}=e;return r("asinh",{number:Gv,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})});var pU="atan",mU=["typed"],xN=T(pU,mU,e=>{var{typed:r}=e;return r("atan",{number:function(n){return Math.atan(n)},Complex:function(n){return n.atan()},BigNumber:function(n){return n.atan()}})});var yN="atan2",hU=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],bN=T(yN,hU,e=>{var{typed:r,matrix:t,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:s}=e,c=It({typed:r,equalScalar:n}),f=ft({typed:r}),o=zc({typed:r,equalScalar:n}),u=Jr({typed:r,equalScalar:n}),p=Lr({typed:r,DenseMatrix:a}),h=vr({typed:r,matrix:t,concat:s});return r(yN,{"number, number":Math.atan2,"BigNumber, BigNumber":(d,x)=>i.atan2(d,x)},h({scalar:"number | BigNumber",SS:o,DS:f,SD:c,Ss:u,sS:p}))});var wN="atanh",dU=["typed","config","Complex"],DN=T(wN,dU,e=>{var{typed:r,config:t,Complex:n}=e;return r(wN,{number:function(a){return a<=1&&a>=-1||t.predictable?$v(a):new n(a,0).atanh()},Complex:function(a){return a.atanh()},BigNumber:function(a){return a.atanh()}})});var gi=T("trigUnit",["typed"],e=>{var{typed:r}=e;return{Unit:r.referToSelf(t=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return r.find(t,n.valueType())(n.value)})}});var SN="cos",vU=["typed"],NN=T(SN,vU,e=>{var{typed:r}=e,t=gi({typed:r});return r(SN,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},t)});var AN="cosh",gU=["typed"],EN=T(AN,gU,e=>{var{typed:r}=e;return r(AN,{number:yc,"Complex | BigNumber":t=>t.cosh()})});var CN="cot",xU=["typed","BigNumber"],MN=T(CN,xU,e=>{var{typed:r,BigNumber:t}=e,n=gi({typed:r});return r(CN,{number:Zv,Complex:i=>i.cot(),BigNumber:i=>new t(1).div(i.tan())},n)});var _N="coth",yU=["typed","BigNumber"],TN=T(_N,yU,e=>{var{typed:r,BigNumber:t}=e;return r(_N,{number:Qv,Complex:n=>n.coth(),BigNumber:n=>new t(1).div(n.tanh())})});var FN="csc",bU=["typed","BigNumber"],ON=T(FN,bU,e=>{var{typed:r,BigNumber:t}=e,n=gi({typed:r});return r(FN,{number:Xv,Complex:i=>i.csc(),BigNumber:i=>new t(1).div(i.sin())},n)});var BN="csch",wU=["typed","BigNumber"],IN=T(BN,wU,e=>{var{typed:r,BigNumber:t}=e;return r(BN,{number:Jv,Complex:n=>n.csch(),BigNumber:n=>new t(1).div(n.sinh())})});var PN="sec",DU=["typed","BigNumber"],kN=T(PN,DU,e=>{var{typed:r,BigNumber:t}=e,n=gi({typed:r});return r(PN,{number:Kv,Complex:i=>i.sec(),BigNumber:i=>new t(1).div(i.cos())},n)});var RN="sech",SU=["typed","BigNumber"],LN=T(RN,SU,e=>{var{typed:r,BigNumber:t}=e;return r(RN,{number:jv,Complex:n=>n.sech(),BigNumber:n=>new t(1).div(n.cosh())})});var qN="sin",NU=["typed"],UN=T(qN,NU,e=>{var{typed:r}=e,t=gi({typed:r});return r(qN,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},t)});var zN="sinh",AU=["typed"],WN=T(zN,AU,e=>{var{typed:r}=e;return r(zN,{number:eg,"Complex | BigNumber":t=>t.sinh()})});var VN="tan",EU=["typed"],YN=T(VN,EU,e=>{var{typed:r}=e,t=gi({typed:r});return r(VN,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},t)});var CU="tanh",MU=["typed"],HN=T(CU,MU,e=>{var{typed:r}=e;return r("tanh",{number:bc,"Complex | BigNumber":t=>t.tanh()})});var GN="setCartesian",_U=["typed","size","subset","compareNatural","Index","DenseMatrix"],$N=T(GN,_U,e=>{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(GN,{"Array | Matrix, Array | Matrix":function(f,o){var u=[];if(n(t(f),new a(0))!==0&&n(t(o),new a(0))!==0){var p=gr(Array.isArray(f)?f:f.toArray()).sort(i),h=gr(Array.isArray(o)?o:o.toArray()).sort(i);u=[];for(var d=0;d{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(ZN,{"Array | Matrix, Array | Matrix":function(f,o){var u;if(n(t(f),new a(0))===0)u=[];else{if(n(t(o),new a(0))===0)return gr(f.toArray());var p=Ia(gr(Array.isArray(f)?f:f.toArray()).sort(i)),h=Ia(gr(Array.isArray(o)?o:o.toArray()).sort(i));u=[];for(var d,x=0;x{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(XN,{"Array | Matrix":function(f){var o;if(n(t(f),new a(0))===0)o=[];else{var u=gr(Array.isArray(f)?f:f.toArray()).sort(i);o=[],o.push(u[0]);for(var p=1;p{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(KN,{"Array | Matrix, Array | Matrix":function(f,o){var u;if(n(t(f),new a(0))===0||n(t(o),new a(0))===0)u=[];else{var p=Ia(gr(Array.isArray(f)?f:f.toArray()).sort(i)),h=Ia(gr(Array.isArray(o)?o:o.toArray()).sort(i));u=[];for(var d=0;d{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(e2,{"Array | Matrix, Array | Matrix":function(c,f){if(n(t(c),new a(0))===0)return!0;if(n(t(f),new a(0))===0)return!1;for(var o=Ia(gr(Array.isArray(c)?c:c.toArray()).sort(i)),u=Ia(gr(Array.isArray(f)?f:f.toArray()).sort(i)),p,h=0;h{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(t2,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(c,f){if(n(t(f),new a(0))===0)return 0;for(var o=gr(Array.isArray(f)?f:f.toArray()),u=0,p=0;p{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(i2,{"Array | Matrix":function(o){if(n(t(o),new a(0))===0)return[];for(var u=gr(Array.isArray(o)?o:o.toArray()).sort(i),p=[],h=0;h.toString(2).length<=u.length;)p.push(s(u,h.toString(2).split("").reverse())),h++;return c(p)}});function s(f,o){for(var u=[],p=0;p0;u--)for(var p=0;pf[p+1].length&&(o=f[p],f[p]=f[p+1],f[p+1]=o);return f}});var o2="setSize",kU=["typed","compareNatural"],s2=T(o2,kU,e=>{var{typed:r,compareNatural:t}=e;return r(o2,{"Array | Matrix":function(i){return Array.isArray(i)?gr(i).length:gr(i.toArray()).length},"Array | Matrix, boolean":function(i,a){if(a===!1||i.length===0)return Array.isArray(i)?gr(i).length:gr(i.toArray()).length;for(var s=gr(Array.isArray(i)?i:i.toArray()).sort(t),c=1,f=1;f{var{typed:r,size:t,concat:n,subset:i,setDifference:a,Index:s}=e;return r(u2,{"Array | Matrix, Array | Matrix":function(f,o){if(i(t(f),new s(0))===0)return gr(o);if(i(t(o),new s(0))===0)return gr(f);var u=gr(f),p=gr(o);return n(a(u,p),a(p,u))}})});var l2="setUnion",LU=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],c2=T(l2,LU,e=>{var{typed:r,size:t,concat:n,subset:i,setIntersect:a,setSymDifference:s,Index:c}=e;return r(l2,{"Array | Matrix, Array | Matrix":function(o,u){if(i(t(o),new c(0))===0)return gr(u);if(i(t(u),new c(0))===0)return gr(o);var p=gr(o),h=gr(u);return n(s(p,h),a(p,h))}})});var p2="add",qU=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],m2=T(p2,qU,e=>{var{typed:r,matrix:t,addScalar:n,equalScalar:i,DenseMatrix:a,SparseMatrix:s,concat:c}=e,f=dn({typed:r}),o=ou({typed:r,equalScalar:i}),u=Un({typed:r,DenseMatrix:a}),p=vr({typed:r,matrix:t,concat:c});return r(p2,{"any, any":n,"any, any, ...any":r.referToSelf(h=>(d,x,v)=>{for(var y=h(d,x),w=0;w{var{typed:r,abs:t,addScalar:n,divideScalar:i,multiplyScalar:a,sqrt:s,smaller:c,isPositive:f}=e;return r(h2,{"... number | BigNumber":o,Array:o,Matrix:u=>o(gr(u.toArray()))});function o(u){for(var p=0,h=0,d=0;d{var{typed:r,abs:t,add:n,pow:i,conj:a,sqrt:s,multiply:c,equalScalar:f,larger:o,smaller:u,matrix:p,ctranspose:h,eigs:d}=e;return r(v2,{number:Math.abs,Complex:function(F){return F.abs()},BigNumber:function(F){return F.abs()},boolean:function(F){return Math.abs(F)},Array:function(F){return S(p(F),2)},Matrix:function(F){return S(F,2)},"Array, number | BigNumber | string":function(F,M){return S(p(F),M)},"Matrix, number | BigNumber | string":function(F,M){return S(F,M)}});function x(O){var F=0;return O.forEach(function(M){var _=t(M);o(_,F)&&(F=_)},!0),F}function v(O){var F;return O.forEach(function(M){var _=t(M);(!F||u(_,F))&&(F=_)},!0),F||0}function y(O,F){if(F===Number.POSITIVE_INFINITY||F==="inf")return x(O);if(F===Number.NEGATIVE_INFINITY||F==="-inf")return v(O);if(F==="fro")return S(O,2);if(typeof F=="number"&&!isNaN(F)){if(!f(F,0)){var M=0;return O.forEach(function(_){M=n(i(t(_),F),M)},!0),i(M,1/F)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function w(O){var F=0;return O.forEach(function(M,_){F=n(F,c(M,a(M)))}),t(s(F))}function C(O){var F=[],M=0;return O.forEach(function(_,k){var L=k[1],Y=n(F[L]||0,t(_));o(Y,M)&&(M=Y),F[L]=Y},!0),M}function b(O){var F=O.size();if(F[0]!==F[1])throw new RangeError("Invalid matrix dimensions");var M=h(O),_=c(M,O),k=d(_).values.toArray(),L=k[k.length-1];return t(s(L))}function A(O){var F=[],M=0;return O.forEach(function(_,k){var L=k[0],Y=n(F[L]||0,t(_));o(Y,M)&&(M=Y),F[L]=Y},!0),M}function E(O,F){if(F===1)return C(O);if(F===Number.POSITIVE_INFINITY||F==="inf")return A(O);if(F==="fro")return w(O);if(F===2)return b(O);throw new Error("Unsupported parameter value "+F)}function S(O,F){var M=O.size();if(M.length===1)return y(O,F);if(M.length===2){if(M[0]&&M[1])return E(O,F);throw new RangeError("Invalid matrix dimensions")}}});var x2="dot",WU=["typed","addScalar","multiplyScalar","conj","size"],y2=T(x2,WU,e=>{var{typed:r,addScalar:t,multiplyScalar:n,conj:i,size:a}=e;return r(x2,{"Array | DenseMatrix, Array | DenseMatrix":c,"SparseMatrix, SparseMatrix":f});function s(u,p){var h=o(u),d=o(p),x,v;if(h.length===1)x=h[0];else if(h.length===2&&h[1]===1)x=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(d.length===1)v=d[0];else if(d.length===2&&d[1]===1)v=d[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+d.join(", ")+")");if(x!==v)throw new RangeError("Vectors must have equal length ("+x+" != "+v+")");if(x===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return x}function c(u,p){var h=s(u,p),d=Ge(u)?u._data:u,x=Ge(u)?u._datatype||u.getDataType():void 0,v=Ge(p)?p._data:p,y=Ge(p)?p._datatype||p.getDataType():void 0,w=o(u).length===2,C=o(p).length===2,b=t,A=n;if(x&&y&&x===y&&typeof x=="string"&&x!=="mixed"){var E=x;b=r.find(t,[E,E]),A=r.find(n,[E,E])}if(!w&&!C){for(var S=A(i(d[0]),v[0]),O=1;OS){A++;continue}E===S&&(y=w(y,C(d[b],v[A])),b++,A++)}return y}function o(u){return Ge(u)?u.size():a(u)}});var VU="trace",YU=["typed","matrix","add"],b2=T(VU,YU,e=>{var{typed:r,matrix:t,add:n}=e;return r("trace",{Array:function(c){return i(t(c))},SparseMatrix:a,DenseMatrix:i,any:tr});function i(s){var c=s._size,f=s._data;switch(c.length){case 1:if(c[0]===1)return tr(f[0]);throw new RangeError("Matrix must be square (size: "+lr(c)+")");case 2:{var o=c[0],u=c[1];if(o===u){for(var p=0,h=0;h0)for(var x=0;xx)break}return d}throw new RangeError("Matrix must be square (size: "+lr(u)+")")}});var w2="index",HU=["typed","Index"],D2=T(w2,HU,e=>{var{typed:r,Index:t}=e;return r(w2,{"...number | string | BigNumber | Range | Array | Matrix":function(i){var a=i.map(function(c){return je(c)?c.toNumber():Ar(c)||Ge(c)?c.map(function(f){return je(f)?f.toNumber():f}):c}),s=new t;return t.apply(s,a),s}})});var mp=new Set(["end"]);var GU="Node",$U=["mathWithTransform"],S2=T(GU,$U,e=>{var{mathWithTransform:r}=e;function t(i){for(var a of[...mp])if(i.has(a))throw new Error('Scope contains an illegal symbol, "'+a+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(a){return this.compile().evaluate(a)}compile(){var a=this._compile(r,{}),s={},c=null;function f(o){var u=Pa(o);return t(u),a(u,s,c)}return{evaluate:f}}_compile(a,s){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(a){throw new Error("Cannot run forEach on a Node interface")}map(a){throw new Error("Cannot run map on a Node interface")}_ifNode(a){if(!Sr(a))throw new TypeError("Callback function must return a Node");return a}traverse(a){a(this,null,null);function s(c,f){c.forEach(function(o,u,p){f(o,u,p),s(o,f)})}s(this,a)}transform(a){function s(c,f,o){var u=a(c,f,o);return u!==c?u:c.map(s)}return s(this,null,null)}filter(a){var s=[];return this.traverse(function(c,f,o){a(c,f,o)&&s.push(c)}),s}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(a){return a.cloneDeep()})}equals(a){return a?this.type===a.type&&Ui(this,a):!1}toString(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toString(a)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toHTML(a)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toTex(a)}_toTex(a){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(a){if(a&&typeof a=="object")switch(typeof a.handler){case"object":case"undefined":return;case"function":return a.handler(this,a);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function lt(e){return e&&e.isIndexError?new Xt(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function hp(e){var{subset:r}=e;return function(n,i){try{if(Array.isArray(n))return r(n,i);if(n&&typeof n.subset=="function")return n.subset(i);if(typeof n=="string")return r(n,i);if(typeof n=="object"){if(!i.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return gt(n,i.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(a){throw lt(a)}}}var dp="AccessorNode",ZU=["subset","Node"],N2=T(dp,ZU,e=>{var{subset:r,Node:t}=e,n=hp({subset:r});function i(s){return!(Sn(s)||$t(s)||yr(s)||fn(s)||fa(s)||Zt(s)||rt(s))}class a extends t{constructor(c,f){if(super(),!Sr(c))throw new TypeError('Node expected for parameter "object"');if(!kn(f))throw new TypeError('IndexNode expected for parameter "index"');this.object=c,this.index=f}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return dp}get isAccessorNode(){return!0}_compile(c,f){var o=this.object._compile(c,f),u=this.index._compile(c,f);if(this.index.isObjectProperty()){var p=this.index.getObjectProperty();return function(d,x,v){return gt(o(d,x,v),p)}}else return function(d,x,v){var y=o(d,x,v),w=u(d,x,y);return n(y,w)}}forEach(c){c(this.object,"object",this),c(this.index,"index",this)}map(c){return new a(this._ifNode(c(this.object,"object",this)),this._ifNode(c(this.index,"index",this)))}clone(){return new a(this.object,this.index)}_toString(c){var f=this.object.toString(c);return i(this.object)&&(f="("+f+")"),f+this.index.toString(c)}_toHTML(c){var f=this.object.toHTML(c);return i(this.object)&&(f='('+f+')'),f+this.index.toHTML(c)}_toTex(c){var f=this.object.toTex(c);return i(this.object)&&(f="\\\\left(' + object + '\\\\right)"),f+this.index.toTex(c)}toJSON(){return{mathjs:dp,object:this.object,index:this.index}}static fromJSON(c){return new a(c.object,c.index)}}return Ur(a,"name",dp),a},{isClass:!0,isNode:!0});var vp="ArrayNode",QU=["Node"],A2=T(vp,QU,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(Sr))throw new TypeError("Array containing Nodes expected")}get type(){return vp}get isArrayNode(){return!0}_compile(i,a){var s=Rn(this.items,function(o){return o._compile(i,a)}),c=i.config.matrix!=="Array";if(c){var f=i.matrix;return function(u,p,h){return f(Rn(s,function(d){return d(u,p,h)}))}}else return function(u,p,h){return Rn(s,function(d){return d(u,p,h)})}}forEach(i){for(var a=0;a['+a.join(',')+']'}_toTex(i){function a(s,c){var f=s.some($t)&&!s.every($t),o=c||f,u=o?"&":"\\\\\\\\",p=s.map(function(h){return h.items?a(h.items,!c):h.toTex(i)}).join(u);return f||!o||o&&!c?"\\\\begin{bmatrix}"+p+"\\\\end{bmatrix}":p}return a(this.items,!1)}}return Ur(t,"name",vp),t},{isClass:!0,isNode:!0});function E2(e){var{subset:r,matrix:t}=e;return function(i,a,s){try{if(Array.isArray(i)){var c=t(i).subset(a,s).valueOf();return c.forEach((f,o)=>{i[o]=f}),i}else{if(i&&typeof i.subset=="function")return i.subset(a,s);if(typeof i=="string")return r(i,a,s);if(typeof i=="object"){if(!a.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return la(i,a.getObjectProperty(),s),i}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(f){throw lt(f)}}}var xi=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function gp(e,r){if(!r||r!=="auto")return e;for(var t=e;Zt(t);)t=t.content;return t}function Gr(e,r,t,n){var i=e;r!=="keep"&&(i=e.getContent());for(var a=i.getIdentifier(),s=null,c=0;c{var{subset:r,matrix:t,Node:n}=e,i=hp({subset:r}),a=E2({subset:r,matrix:t});function s(f,o,u){o||(o="keep");var p=Gr(f,o,u),h=Gr(f.value,o,u);return o==="all"||h!==null&&h<=p}class c extends n{constructor(o,u,p){if(super(),this.object=o,this.index=p?u:null,this.value=p||u,!rt(o)&&!Sn(o))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(rt(o)&&o.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!kn(this.index))throw new TypeError('IndexNode expected as "index"');if(!Sr(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return yp}get isAssignmentNode(){return!0}_compile(o,u){var p=this.object._compile(o,u),h=this.index?this.index._compile(o,u):null,d=this.value._compile(o,u),x=this.object.name;if(this.index)if(this.index.isObjectProperty()){var v=this.index.getObjectProperty();return function(A,E,S){var O=p(A,E,S),F=d(A,E,S);return la(O,v,F),F}}else{if(rt(this.object))return function(A,E,S){var O=p(A,E,S),F=d(A,E,S),M=h(A,E,O);return A.set(x,a(O,M,F)),F};var y=this.object.object._compile(o,u);if(this.object.index.isObjectProperty()){var w=this.object.index.getObjectProperty();return function(A,E,S){var O=y(A,E,S),F=gt(O,w),M=h(A,E,F),_=d(A,E,S);return la(O,w,a(F,M,_)),_}}else{var C=this.object.index._compile(o,u);return function(A,E,S){var O=y(A,E,S),F=C(A,E,O),M=i(O,F),_=h(A,E,M),k=d(A,E,S);return a(O,F,a(M,_,k)),k}}}else{if(!rt(this.object))throw new TypeError("SymbolNode expected as object");return function(A,E,S){var O=d(A,E,S);return A.set(x,O),O}}}forEach(o){o(this.object,"object",this),this.index&&o(this.index,"index",this),o(this.value,"value",this)}map(o){var u=this._ifNode(o(this.object,"object",this)),p=this.index?this._ifNode(o(this.index,"index",this)):null,h=this._ifNode(o(this.value,"value",this));return new c(u,p,h)}clone(){return new c(this.object,this.index,this.value)}_toString(o){var u=this.object.toString(o),p=this.index?this.index.toString(o):"",h=this.value.toString(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(h="("+h+")"),u+p+" = "+h}toJSON(){return{mathjs:yp,object:this.object,index:this.index,value:this.value}}static fromJSON(o){return new c(o.object,o.index,o.value)}_toHTML(o){var u=this.object.toHTML(o),p=this.index?this.index.toHTML(o):"",h=this.value.toHTML(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(h='('+h+')'),u+p+'='+h}_toTex(o){var u=this.object.toTex(o),p=this.index?this.index.toTex(o):"",h=this.value.toTex(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(h="\\\\left(".concat(h,"\\\\right)")),u+p+"="+h}}return Ur(c,"name",yp),c},{isClass:!0,isNode:!0});var bp="BlockNode",JU=["ResultSet","Node"],_2=T(bp,JU,e=>{var{ResultSet:r,Node:t}=e;class n extends t{constructor(a){if(super(),!Array.isArray(a))throw new Error("Array expected");this.blocks=a.map(function(s){var c=s&&s.node,f=s&&s.visible!==void 0?s.visible:!0;if(!Sr(c))throw new TypeError('Property "node" must be a Node');if(typeof f!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:c,visible:f}})}get type(){return bp}get isBlockNode(){return!0}_compile(a,s){var c=Rn(this.blocks,function(f){return{evaluate:f.node._compile(a,s),visible:f.visible}});return function(o,u,p){var h=[];return mo(c,function(x){var v=x.evaluate(o,u,p);x.visible&&h.push(v)}),new r(h)}}forEach(a){for(var s=0;s;')}).join('
')}_toTex(a){return this.blocks.map(function(s){return s.node.toTex(a)+(s.visible?"":";")}).join(\`\\\\;\\\\; -\`)}}return Ur(n,"name",bp),n},{isClass:!0,isNode:!0});var wp="ConditionalNode",KU=["Node"],T2=T(wp,KU,e=>{var{Node:r}=e;function t(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if(je(i))return!i.isZero();if(Gt(i))return!!(i.re||i.im);if(qt(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+_r(i)+'"')}class n extends r{constructor(a,s,c){if(super(),!Sr(a))throw new TypeError("Parameter condition must be a Node");if(!Sr(s))throw new TypeError("Parameter trueExpr must be a Node");if(!Sr(c))throw new TypeError("Parameter falseExpr must be a Node");this.condition=a,this.trueExpr=s,this.falseExpr=c}get type(){return wp}get isConditionalNode(){return!0}_compile(a,s){var c=this.condition._compile(a,s),f=this.trueExpr._compile(a,s),o=this.falseExpr._compile(a,s);return function(p,h,d){return t(c(p,h,d))?f(p,h,d):o(p,h,d)}}forEach(a){a(this.condition,"condition",this),a(this.trueExpr,"trueExpr",this),a(this.falseExpr,"falseExpr",this)}map(a){return new n(this._ifNode(a(this.condition,"condition",this)),this._ifNode(a(this.trueExpr,"trueExpr",this)),this._ifNode(a(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=Gr(this,s,a&&a.implicit),f=this.condition.toString(a),o=Gr(this.condition,s,a&&a.implicit);(s==="all"||this.condition.type==="OperatorNode"||o!==null&&o<=c)&&(f="("+f+")");var u=this.trueExpr.toString(a),p=Gr(this.trueExpr,s,a&&a.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=c)&&(u="("+u+")");var h=this.falseExpr.toString(a),d=Gr(this.falseExpr,s,a&&a.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||d!==null&&d<=c)&&(h="("+h+")"),f+" ? "+u+" : "+h}toJSON(){return{mathjs:wp,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(a){return new n(a.condition,a.trueExpr,a.falseExpr)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=Gr(this,s,a&&a.implicit),f=this.condition.toHTML(a),o=Gr(this.condition,s,a&&a.implicit);(s==="all"||this.condition.type==="OperatorNode"||o!==null&&o<=c)&&(f='('+f+')');var u=this.trueExpr.toHTML(a),p=Gr(this.trueExpr,s,a&&a.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=c)&&(u='('+u+')');var h=this.falseExpr.toHTML(a),d=Gr(this.falseExpr,s,a&&a.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||d!==null&&d<=c)&&(h='('+h+')'),f+'?'+u+':'+h}_toTex(a){return"\\\\begin{cases} {"+this.trueExpr.toTex(a)+"}, &\\\\quad{\\\\text{if }\\\\;"+this.condition.toTex(a)+"}\\\\\\\\{"+this.falseExpr.toTex(a)+"}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}"}}return Ur(n,"name",wp),n},{isClass:!0,isNode:!0});var I2=li(O2(),1);var pg={Alpha:"A",alpha:"\\\\alpha",Beta:"B",beta:"\\\\beta",Gamma:"\\\\Gamma",gamma:"\\\\gamma",Delta:"\\\\Delta",delta:"\\\\delta",Epsilon:"E",epsilon:"\\\\epsilon",varepsilon:"\\\\varepsilon",Zeta:"Z",zeta:"\\\\zeta",Eta:"H",eta:"\\\\eta",Theta:"\\\\Theta",theta:"\\\\theta",vartheta:"\\\\vartheta",Iota:"I",iota:"\\\\iota",Kappa:"K",kappa:"\\\\kappa",varkappa:"\\\\varkappa",Lambda:"\\\\Lambda",lambda:"\\\\lambda",Mu:"M",mu:"\\\\mu",Nu:"N",nu:"\\\\nu",Xi:"\\\\Xi",xi:"\\\\xi",Omicron:"O",omicron:"o",Pi:"\\\\Pi",pi:"\\\\pi",varpi:"\\\\varpi",Rho:"P",rho:"\\\\rho",varrho:"\\\\varrho",Sigma:"\\\\Sigma",sigma:"\\\\sigma",varsigma:"\\\\varsigma",Tau:"T",tau:"\\\\tau",Upsilon:"\\\\Upsilon",upsilon:"\\\\upsilon",Phi:"\\\\Phi",phi:"\\\\phi",varphi:"\\\\varphi",Chi:"X",chi:"\\\\chi",Psi:"\\\\Psi",psi:"\\\\psi",Omega:"\\\\Omega",omega:"\\\\omega",true:"\\\\mathrm{True}",false:"\\\\mathrm{False}",i:"i",inf:"\\\\infty",Inf:"\\\\infty",infinity:"\\\\infty",Infinity:"\\\\infty",oo:"\\\\infty",lim:"\\\\lim",undefined:"\\\\mathbf{?}"},zr={transpose:"^\\\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\\\~",not:"\\\\neg",multiply:"\\\\cdot",divide:"\\\\frac",dotMultiply:".\\\\cdot",dotDivide:".:",mod:"\\\\mod",add:"+",subtract:"-",to:"\\\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\\\neq",smaller:"<",larger:">",smallerEq:"\\\\leq",largerEq:"\\\\geq",bitAnd:"\\\\&",bitXor:"\\\\underline{|}",bitOr:"|",and:"\\\\wedge",xor:"\\\\veebar",or:"\\\\vee"},mg={abs:{1:"\\\\left|\${args[0]}\\\\right|"},add:{2:"\\\\left(\${args[0]}".concat(zr.add,"\${args[1]}\\\\right)")},cbrt:{1:"\\\\sqrt[3]{\${args[0]}}"},ceil:{1:"\\\\left\\\\lceil\${args[0]}\\\\right\\\\rceil"},cube:{1:"\\\\left(\${args[0]}\\\\right)^3"},divide:{2:"\\\\frac{\${args[0]}}{\${args[1]}}"},dotDivide:{2:"\\\\left(\${args[0]}".concat(zr.dotDivide,"\${args[1]}\\\\right)")},dotMultiply:{2:"\\\\left(\${args[0]}".concat(zr.dotMultiply,"\${args[1]}\\\\right)")},dotPow:{2:"\\\\left(\${args[0]}".concat(zr.dotPow,"\${args[1]}\\\\right)")},exp:{1:"\\\\exp\\\\left(\${args[0]}\\\\right)"},expm1:"\\\\left(e".concat(zr.pow,"{\${args[0]}}-1\\\\right)"),fix:{1:"\\\\mathrm{\${name}}\\\\left(\${args[0]}\\\\right)"},floor:{1:"\\\\left\\\\lfloor\${args[0]}\\\\right\\\\rfloor"},gcd:"\\\\gcd\\\\left(\${args}\\\\right)",hypot:"\\\\hypot\\\\left(\${args}\\\\right)",log:{1:"\\\\ln\\\\left(\${args[0]}\\\\right)",2:"\\\\log_{\${args[1]}}\\\\left(\${args[0]}\\\\right)"},log10:{1:"\\\\log_{10}\\\\left(\${args[0]}\\\\right)"},log1p:{1:"\\\\ln\\\\left(\${args[0]}+1\\\\right)",2:"\\\\log_{\${args[1]}}\\\\left(\${args[0]}+1\\\\right)"},log2:"\\\\log_{2}\\\\left(\${args[0]}\\\\right)",mod:{2:"\\\\left(\${args[0]}".concat(zr.mod,"\${args[1]}\\\\right)")},multiply:{2:"\\\\left(\${args[0]}".concat(zr.multiply,"\${args[1]}\\\\right)")},norm:{1:"\\\\left\\\\|\${args[0]}\\\\right\\\\|",2:void 0},nthRoot:{2:"\\\\sqrt[\${args[1]}]{\${args[0]}}"},nthRoots:{2:"\\\\{y : $y^{args[1]} = {\${args[0]}}\\\\}"},pow:{2:"\\\\left(\${args[0]}\\\\right)".concat(zr.pow,"{\${args[1]}}")},round:{1:"\\\\left\\\\lfloor\${args[0]}\\\\right\\\\rceil",2:void 0},sign:{1:"\\\\mathrm{\${name}}\\\\left(\${args[0]}\\\\right)"},sqrt:{1:"\\\\sqrt{\${args[0]}}"},square:{1:"\\\\left(\${args[0]}\\\\right)^2"},subtract:{2:"\\\\left(\${args[0]}".concat(zr.subtract,"\${args[1]}\\\\right)")},unaryMinus:{1:"".concat(zr.unaryMinus,"\\\\left(\${args[0]}\\\\right)")},unaryPlus:{1:"".concat(zr.unaryPlus,"\\\\left(\${args[0]}\\\\right)")},bitAnd:{2:"\\\\left(\${args[0]}".concat(zr.bitAnd,"\${args[1]}\\\\right)")},bitNot:{1:zr.bitNot+"\\\\left(\${args[0]}\\\\right)"},bitOr:{2:"\\\\left(\${args[0]}".concat(zr.bitOr,"\${args[1]}\\\\right)")},bitXor:{2:"\\\\left(\${args[0]}".concat(zr.bitXor,"\${args[1]}\\\\right)")},leftShift:{2:"\\\\left(\${args[0]}".concat(zr.leftShift,"\${args[1]}\\\\right)")},rightArithShift:{2:"\\\\left(\${args[0]}".concat(zr.rightArithShift,"\${args[1]}\\\\right)")},rightLogShift:{2:"\\\\left(\${args[0]}".concat(zr.rightLogShift,"\${args[1]}\\\\right)")},bellNumbers:{1:"\\\\mathrm{B}_{\${args[0]}}"},catalan:{1:"\\\\mathrm{C}_{\${args[0]}}"},stirlingS2:{2:"\\\\mathrm{S}\\\\left(\${args}\\\\right)"},arg:{1:"\\\\arg\\\\left(\${args[0]}\\\\right)"},conj:{1:"\\\\left(\${args[0]}\\\\right)^*"},im:{1:"\\\\Im\\\\left\\\\lbrace\${args[0]}\\\\right\\\\rbrace"},re:{1:"\\\\Re\\\\left\\\\lbrace\${args[0]}\\\\right\\\\rbrace"},and:{2:"\\\\left(\${args[0]}".concat(zr.and,"\${args[1]}\\\\right)")},not:{1:zr.not+"\\\\left(\${args[0]}\\\\right)"},or:{2:"\\\\left(\${args[0]}".concat(zr.or,"\${args[1]}\\\\right)")},xor:{2:"\\\\left(\${args[0]}".concat(zr.xor,"\${args[1]}\\\\right)")},cross:{2:"\\\\left(\${args[0]}\\\\right)\\\\times\\\\left(\${args[1]}\\\\right)"},ctranspose:{1:"\\\\left(\${args[0]}\\\\right)".concat(zr.ctranspose)},det:{1:"\\\\det\\\\left(\${args[0]}\\\\right)"},dot:{2:"\\\\left(\${args[0]}\\\\cdot\${args[1]}\\\\right)"},expm:{1:"\\\\exp\\\\left(\${args[0]}\\\\right)"},inv:{1:"\\\\left(\${args[0]}\\\\right)^{-1}"},pinv:{1:"\\\\left(\${args[0]}\\\\right)^{+}"},sqrtm:{1:"{\${args[0]}}".concat(zr.pow,"{\\\\frac{1}{2}}")},trace:{1:"\\\\mathrm{tr}\\\\left(\${args[0]}\\\\right)"},transpose:{1:"\\\\left(\${args[0]}\\\\right)".concat(zr.transpose)},combinations:{2:"\\\\binom{\${args[0]}}{\${args[1]}}"},combinationsWithRep:{2:"\\\\left(\\\\!\\\\!{\\\\binom{\${args[0]}}{\${args[1]}}}\\\\!\\\\!\\\\right)"},factorial:{1:"\\\\left(\${args[0]}\\\\right)".concat(zr.factorial)},gamma:{1:"\\\\Gamma\\\\left(\${args[0]}\\\\right)"},lgamma:{1:"\\\\ln\\\\Gamma\\\\left(\${args[0]}\\\\right)"},equal:{2:"\\\\left(\${args[0]}".concat(zr.equal,"\${args[1]}\\\\right)")},larger:{2:"\\\\left(\${args[0]}".concat(zr.larger,"\${args[1]}\\\\right)")},largerEq:{2:"\\\\left(\${args[0]}".concat(zr.largerEq,"\${args[1]}\\\\right)")},smaller:{2:"\\\\left(\${args[0]}".concat(zr.smaller,"\${args[1]}\\\\right)")},smallerEq:{2:"\\\\left(\${args[0]}".concat(zr.smallerEq,"\${args[1]}\\\\right)")},unequal:{2:"\\\\left(\${args[0]}".concat(zr.unequal,"\${args[1]}\\\\right)")},erf:{1:"erf\\\\left(\${args[0]}\\\\right)"},max:"\\\\max\\\\left(\${args}\\\\right)",min:"\\\\min\\\\left(\${args}\\\\right)",variance:"\\\\mathrm{Var}\\\\left(\${args}\\\\right)",acos:{1:"\\\\cos^{-1}\\\\left(\${args[0]}\\\\right)"},acosh:{1:"\\\\cosh^{-1}\\\\left(\${args[0]}\\\\right)"},acot:{1:"\\\\cot^{-1}\\\\left(\${args[0]}\\\\right)"},acoth:{1:"\\\\coth^{-1}\\\\left(\${args[0]}\\\\right)"},acsc:{1:"\\\\csc^{-1}\\\\left(\${args[0]}\\\\right)"},acsch:{1:"\\\\mathrm{csch}^{-1}\\\\left(\${args[0]}\\\\right)"},asec:{1:"\\\\sec^{-1}\\\\left(\${args[0]}\\\\right)"},asech:{1:"\\\\mathrm{sech}^{-1}\\\\left(\${args[0]}\\\\right)"},asin:{1:"\\\\sin^{-1}\\\\left(\${args[0]}\\\\right)"},asinh:{1:"\\\\sinh^{-1}\\\\left(\${args[0]}\\\\right)"},atan:{1:"\\\\tan^{-1}\\\\left(\${args[0]}\\\\right)"},atan2:{2:"\\\\mathrm{atan2}\\\\left(\${args}\\\\right)"},atanh:{1:"\\\\tanh^{-1}\\\\left(\${args[0]}\\\\right)"},cos:{1:"\\\\cos\\\\left(\${args[0]}\\\\right)"},cosh:{1:"\\\\cosh\\\\left(\${args[0]}\\\\right)"},cot:{1:"\\\\cot\\\\left(\${args[0]}\\\\right)"},coth:{1:"\\\\coth\\\\left(\${args[0]}\\\\right)"},csc:{1:"\\\\csc\\\\left(\${args[0]}\\\\right)"},csch:{1:"\\\\mathrm{csch}\\\\left(\${args[0]}\\\\right)"},sec:{1:"\\\\sec\\\\left(\${args[0]}\\\\right)"},sech:{1:"\\\\mathrm{sech}\\\\left(\${args[0]}\\\\right)"},sin:{1:"\\\\sin\\\\left(\${args[0]}\\\\right)"},sinh:{1:"\\\\sinh\\\\left(\${args[0]}\\\\right)"},tan:{1:"\\\\tan\\\\left(\${args[0]}\\\\right)"},tanh:{1:"\\\\tanh\\\\left(\${args[0]}\\\\right)"},to:{2:"\\\\left(\${args[0]}".concat(zr.to,"\${args[1]}\\\\right)")},numeric:function(r,t){return r.args[0].toTex()},number:{0:"0",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)\${args[1]}\\\\right)"},string:{0:'\\\\mathtt{""}',1:"\\\\mathrm{string}\\\\left(\${args[0]}\\\\right)"},bignumber:{0:"0",1:"\\\\left(\${args[0]}\\\\right)"},complex:{0:"0",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)+".concat(pg.i,"\\\\cdot\\\\left(\${args[1]}\\\\right)\\\\right)")},matrix:{0:"\\\\begin{bmatrix}\\\\end{bmatrix}",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\${args[0]}\\\\right)"},sparse:{0:"\\\\begin{bsparse}\\\\end{bsparse}",1:"\\\\left(\${args[0]}\\\\right)"},unit:{1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)\${args[1]}\\\\right)"}},P2="\\\\mathrm{\${name}}\\\\left(\${args}\\\\right)",B2={deg:"^\\\\circ"};function Dp(e){return(0,I2.default)(e,{preserveFormatting:!0})}function Sp(e,r){return r=typeof r>"u"?!1:r,r?$e(B2,e)?B2[e]:"\\\\mathrm{"+Dp(e)+"}":$e(pg,e)?pg[e]:Dp(e)}var Np="ConstantNode",tz=["Node"],k2=T(Np,tz,e=>{var{Node:r}=e;class t extends r{constructor(i){super(),this.value=i}get type(){return Np}get isConstantNode(){return!0}_compile(i,a){var s=this.value;return function(){return s}}forEach(i){}map(i){return this.clone()}clone(){return new t(this.value)}_toString(i){return lr(this.value,i)}_toHTML(i){var a=this._toString(i);switch(_r(this.value)){case"number":case"BigNumber":case"Fraction":return''+a+"";case"string":return''+a+"";case"boolean":return''+a+"";case"null":return''+a+"";case"undefined":return''+a+"";default:return''+a+""}}toJSON(){return{mathjs:Np,value:this.value}}static fromJSON(i){return new t(i.value)}_toTex(i){var a=this._toString(i),s=_r(this.value);switch(s){case"string":return"\\\\mathtt{"+Dp(a)+"}";case"number":case"BigNumber":{var c=s==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!c)return this.value.valueOf()<0?"-\\\\infty":"\\\\infty";var f=a.toLowerCase().indexOf("e");return f!==-1?a.substring(0,f)+"\\\\cdot10^{"+a.substring(f+1)+"}":a}case"Fraction":return this.value.toLatex();default:return a}}}return Ur(t,"name",Np),t},{isClass:!0,isNode:!0});var Ap="FunctionAssignmentNode",nz=["typed","Node"],R2=T(Ap,nz,e=>{var{typed:r,Node:t}=e;function n(a,s,c){var f=Gr(a,s,c),o=Gr(a.expr,s,c);return s==="all"||o!==null&&o<=f}class i extends t{constructor(s,c,f){if(super(),typeof s!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(c))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!Sr(f))throw new TypeError('Node expected for parameter "expr"');if(mp.has(s))throw new Error('Illegal function name, "'+s+'" is a reserved keyword');var o=new Set;for(var u of c){var p=typeof u=="string"?u:u.name;if(o.has(p))throw new Error('Duplicate parameter name "'.concat(p,'"'));o.add(p)}this.name=s,this.params=c.map(function(h){return h&&h.name||h}),this.types=c.map(function(h){return h&&h.type||"any"}),this.expr=f}get type(){return Ap}get isFunctionAssignmentNode(){return!0}_compile(s,c){var f=Object.create(c);mo(this.params,function(x){f[x]=!0});var o=this.expr._compile(s,f),u=this.name,p=this.params,h=Yd(this.types,","),d=u+"("+Yd(this.params,", ")+")";return function(v,y,w){var C={};C[h]=function(){for(var A=Object.create(y),E=0;E'+Qt(this.params[o])+"");var u=this.expr.toHTML(s);return n(this,c,s&&s.implicit)&&(u='('+u+')'),''+Qt(this.name)+'('+f.join(',')+')='+u}_toTex(s){var c=s&&s.parenthesis?s.parenthesis:"keep",f=this.expr.toTex(s);return n(this,c,s&&s.implicit)&&(f="\\\\left(".concat(f,"\\\\right)")),"\\\\mathrm{"+this.name+"}\\\\left("+this.params.map(Sp).join(",")+"\\\\right)="+f}}return Ur(i,"name",Ap),i},{isClass:!0,isNode:!0});var Ep="IndexNode",iz=["Node","size"],L2=T(Ep,iz,e=>{var{Node:r,size:t}=e;class n extends r{constructor(a,s){if(super(),this.dimensions=a,this.dotNotation=s||!1,!Array.isArray(a)||!a.every(Sr))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return Ep}get isIndexNode(){return!0}_compile(a,s){var c=Rn(this.dimensions,function(o,u){var p=o.filter(x=>x.isSymbolNode&&x.name==="end").length>0;if(p){var h=Object.create(s);h.end=!0;var d=o._compile(a,h);return function(v,y,w){if(!Ge(w)&&!Ar(w)&&!yt(w))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+_r(w));var C=t(w).valueOf(),b=Object.create(y);return b.end=C[u],d(v,b,w)}}else return o._compile(a,s)}),f=gt(a,"index");return function(u,p,h){var d=Rn(c,function(x){return x(u,p,h)});return f(...d)}}forEach(a){for(var s=0;s.'+Qt(this.getObjectProperty())+"":'['+s.join(',')+']'}_toTex(a){var s=this.dimensions.map(function(c){return c.toTex(a)});return this.dotNotation?"."+this.getObjectProperty():"_{"+s.join(",")+"}"}}return Ur(n,"name",Ep),n},{isClass:!0,isNode:!0});var Cp="ObjectNode",az=["Node"],q2=T(Cp,az,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(a){return Sr(i[a])})))throw new TypeError("Object containing Nodes expected")}get type(){return Cp}get isObjectNode(){return!0}_compile(i,a){var s={};for(var c in this.properties)if($e(this.properties,c)){var f=Jo(c),o=JSON.parse(f),u=gt(this.properties,c);s[o]=u._compile(i,a)}return function(h,d,x){var v={};for(var y in s)$e(s,y)&&(v[y]=s[y](h,d,x));return v}}forEach(i){for(var a in this.properties)$e(this.properties,a)&&i(this.properties[a],"properties["+Jo(a)+"]",this)}map(i){var a={};for(var s in this.properties)$e(this.properties,s)&&(a[s]=this._ifNode(i(this.properties[s],"properties["+Jo(s)+"]",this)));return new t(a)}clone(){var i={};for(var a in this.properties)$e(this.properties,a)&&(i[a]=this.properties[a]);return new t(i)}_toString(i){var a=[];for(var s in this.properties)$e(this.properties,s)&&a.push(Jo(s)+": "+this.properties[s].toString(i));return"{"+a.join(", ")+"}"}toJSON(){return{mathjs:Cp,properties:this.properties}}static fromJSON(i){return new t(i.properties)}_toHTML(i){var a=[];for(var s in this.properties)$e(this.properties,s)&&a.push(''+Qt(s)+':'+this.properties[s].toHTML(i));return'{'+a.join(',')+'}'}_toTex(i){var a=[];for(var s in this.properties)$e(this.properties,s)&&a.push("\\\\mathbf{"+s+":} & "+this.properties[s].toTex(i)+"\\\\\\\\");var c="\\\\left\\\\{\\\\begin{array}{ll}"+a.join(\` -\`)+"\\\\end{array}\\\\right\\\\}";return c}}return Ur(t,"name",Cp),t},{isClass:!0,isNode:!0});function as(e,r){return new js(e,new es(r),new Set(Object.keys(r)))}var Mp="OperatorNode",oz=["Node"],U2=T(Mp,oz,e=>{var{Node:r}=e;function t(a,s){var c=a;if(s==="auto")for(;Zt(c);)c=c.content;return yr(c)?!0:ut(c)?t(c.args[0],s):!1}function n(a,s,c,f,o){var u=Gr(a,s,c),p=mu(a,s);if(s==="all"||f.length>2&&a.getIdentifier()!=="OperatorNode:add"&&a.getIdentifier()!=="OperatorNode:multiply")return f.map(function(_){switch(_.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var h;switch(f.length){case 0:h=[];break;case 1:{var d=Gr(f[0],s,c,a);if(o&&d!==null){var x,v;if(s==="keep"?(x=f[0].getIdentifier(),v=a.getIdentifier()):(x=f[0].getContent().getIdentifier(),v=a.getContent().getIdentifier()),xi[u][v].latexLeftParens===!1){h=[!1];break}if(xi[d][x].latexParens===!1){h=[!1];break}}if(d===null){h=[!1];break}if(d<=u){h=[!0];break}h=[!1]}break;case 2:{var y,w=Gr(f[0],s,c,a),C=xp(a,f[0],s);w===null?y=!1:w===u&&p==="right"&&!C||w=2&&a.getIdentifier()==="OperatorNode:multiply"&&a.implicit&&s!=="all"&&c==="hide")for(var M=1;M2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var y=o.map(function(w,C){return w=w.toString(s),u[C]&&(w="("+w+")"),w});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?y.join(" "):y.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:Mp,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(s){return new i(s.op,s.fn,s.args,s.implicit,s.isPercentage)}_toHTML(s){var c=s&&s.parenthesis?s.parenthesis:"keep",f=s&&s.implicit?s.implicit:"hide",o=this.args,u=n(this,c,f,o,!1);if(o.length===1){var p=mu(this,c),h=o[0].toHTML(s);return u[0]&&(h='('+h+')'),p==="right"?''+Qt(this.op)+""+h:h+''+Qt(this.op)+""}else if(o.length===2){var d=o[0].toHTML(s),x=o[1].toHTML(s);return u[0]&&(d='('+d+')'),u[1]&&(x='('+x+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?d+''+x:d+''+Qt(this.op)+""+x}else{var v=o.map(function(y,w){return y=y.toHTML(s),u[w]&&(y='('+y+')'),y});return o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?v.join(''):v.join(''+Qt(this.op)+""):''+Qt(this.fn)+'('+v.join(',')+')'}}_toTex(s){var c=s&&s.parenthesis?s.parenthesis:"keep",f=s&&s.implicit?s.implicit:"hide",o=this.args,u=n(this,c,f,o,!0),p=zr[this.fn];if(p=typeof p>"u"?this.op:p,o.length===1){var h=mu(this,c),d=o[0].toTex(s);return u[0]&&(d="\\\\left(".concat(d,"\\\\right)")),h==="right"?p+d:d+p}else if(o.length===2){var x=o[0],v=x.toTex(s);u[0]&&(v="\\\\left(".concat(v,"\\\\right)"));var y=o[1],w=y.toTex(s);u[1]&&(w="\\\\left(".concat(w,"\\\\right)"));var C;switch(c==="keep"?C=x.getIdentifier():C=x.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return p+"{"+v+"}{"+w+"}";case"OperatorNode:pow":switch(v="{"+v+"}",w="{"+w+"}",C){case"ConditionalNode":case"OperatorNode:divide":v="\\\\left(".concat(v,"\\\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&f==="hide")return v+"~"+w}return v+p+w}else if(o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var b=o.map(function(A,E){return A=A.toTex(s),u[E]&&(A="\\\\left(".concat(A,"\\\\right)")),A});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&f==="hide"?b.join("~"):b.join(p)}else return"\\\\mathrm{"+this.fn+"}\\\\left("+o.map(function(A){return A.toTex(s)}).join(",")+"\\\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Ur(i,"name",Mp),i},{isClass:!0,isNode:!0});var _p="ParenthesisNode",sz=["Node"],z2=T(_p,sz,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),!Sr(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return _p}get isParenthesisNode(){return!0}_compile(i,a){return this.content._compile(i,a)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var a=i(this.content,"content",this);return new t(a)}clone(){return new t(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:_p,content:this.content}}static fromJSON(i){return new t(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'('+this.content.toHTML(i)+')':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\\\left(".concat(this.content.toTex(i),"\\\\right)"):this.content.toTex(i)}}return Ur(t,"name",_p),t},{isClass:!0,isNode:!0});var Tp="RangeNode",uz=["Node"],W2=T(Tp,uz,e=>{var{Node:r}=e;function t(i,a,s){var c=Gr(i,a,s),f={},o=Gr(i.start,a,s);if(f.start=o!==null&&o<=c||a==="all",i.step){var u=Gr(i.step,a,s);f.step=u!==null&&u<=c||a==="all"}var p=Gr(i.end,a,s);return f.end=p!==null&&p<=c||a==="all",f}class n extends r{constructor(a,s,c){if(super(),!Sr(a))throw new TypeError("Node expected");if(!Sr(s))throw new TypeError("Node expected");if(c&&!Sr(c))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=a,this.end=s,this.step=c||null}get type(){return Tp}get isRangeNode(){return!0}needsEnd(){var a=this.filter(function(s){return rt(s)&&s.name==="end"});return a.length>0}_compile(a,s){var c=a.range,f=this.start._compile(a,s),o=this.end._compile(a,s);if(this.step){var u=this.step._compile(a,s);return function(h,d,x){return c(f(h,d,x),o(h,d,x),u(h,d,x))}}else return function(h,d,x){return c(f(h,d,x),o(h,d,x))}}forEach(a){a(this.start,"start",this),a(this.end,"end",this),this.step&&a(this.step,"step",this)}map(a){return new n(this._ifNode(a(this.start,"start",this)),this._ifNode(a(this.end,"end",this)),this.step&&this._ifNode(a(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=t(this,s,a&&a.implicit),f,o=this.start.toString(a);if(c.start&&(o="("+o+")"),f=o,this.step){var u=this.step.toString(a);c.step&&(u="("+u+")"),f+=":"+u}var p=this.end.toString(a);return c.end&&(p="("+p+")"),f+=":"+p,f}toJSON(){return{mathjs:Tp,start:this.start,end:this.end,step:this.step}}static fromJSON(a){return new n(a.start,a.end,a.step)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=t(this,s,a&&a.implicit),f,o=this.start.toHTML(a);if(c.start&&(o='('+o+')'),f=o,this.step){var u=this.step.toHTML(a);c.step&&(u='('+u+')'),f+=':'+u}var p=this.end.toHTML(a);return c.end&&(p='('+p+')'),f+=':'+p,f}_toTex(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=t(this,s,a&&a.implicit),f=this.start.toTex(a);if(c.start&&(f="\\\\left(".concat(f,"\\\\right)")),this.step){var o=this.step.toTex(a);c.step&&(o="\\\\left(".concat(o,"\\\\right)")),f+=":"+o}var u=this.end.toTex(a);return c.end&&(u="\\\\left(".concat(u,"\\\\right)")),f+=":"+u,f}}return Ur(n,"name",Tp),n},{isClass:!0,isNode:!0});var Fp="RelationalNode",fz=["Node"],V2=T(Fp,fz,e=>{var{Node:r}=e,t={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends r{constructor(a,s){if(super(),!Array.isArray(a))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(s))throw new TypeError("Parameter params must be an array");if(a.length!==s.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=a,this.params=s}get type(){return Fp}get isRelationalNode(){return!0}_compile(a,s){var c=this,f=this.params.map(o=>o._compile(a,s));return function(u,p,h){for(var d,x=f[0](u,p,h),v=0;va(s,"params["+c+"]",this),this)}map(a){return new n(this.conditionals.slice(),this.params.map((s,c)=>this._ifNode(a(s,"params["+c+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",c=Gr(this,s,a&&a.implicit),f=this.params.map(function(p,h){var d=Gr(p,s,a&&a.implicit);return s==="all"||d!==null&&d<=c?"("+p.toString(a)+")":p.toString(a)}),o=f[0],u=0;u('+p.toHTML(a)+')':p.toHTML(a)}),o=f[0],u=0;u'+Qt(t[this.conditionals[u]])+""+f[u+1];return o}_toTex(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",c=Gr(this,s,a&&a.implicit),f=this.params.map(function(p,h){var d=Gr(p,s,a&&a.implicit);return s==="all"||d!==null&&d<=c?"\\\\left("+p.toTex(a)+"\\right)":p.toTex(a)}),o=f[0],u=0;u{var{math:r,Unit:t,Node:n}=e;function i(s){return t?t.isValuelessUnit(s):!1}class a extends n{constructor(c){if(super(),typeof c!="string")throw new TypeError('String expected for parameter "name"');this.name=c}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(c,f){var o=this.name;if(f[o]===!0)return function(p,h,d){return gt(h,o)};if(o in c)return function(p,h,d){return p.has(o)?p.get(o):gt(c,o)};var u=i(o);return function(p,h,d){return p.has(o)?p.get(o):u?new t(null,o):a.onUndefinedSymbol(o)}}forEach(c){}map(c){return this.clone()}static onUndefinedSymbol(c){throw new Error("Undefined symbol "+c)}clone(){return new a(this.name)}_toString(c){return this.name}_toHTML(c){var f=Qt(this.name);return f==="true"||f==="false"?''+f+"":f==="i"?''+f+"":f==="Infinity"?''+f+"":f==="NaN"?''+f+"":f==="null"?''+f+"":f==="undefined"?''+f+"":''+f+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(c){return new a(c.name)}_toTex(c){var f=!1;typeof r[this.name]>"u"&&i(this.name)&&(f=!0);var o=Sp(this.name,f);return o[0]==="\\\\"?o:" "+o}}return a},{isClass:!0,isNode:!0});var Op="FunctionNode",pz=["math","Node","SymbolNode"],H2=T(Op,pz,e=>{var r,{math:t,Node:n,SymbolNode:i}=e,a=f=>lr(f,{truncate:78});function s(f,o,u){for(var p="",h=/\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)/gi,d=0,x;(x=h.exec(f))!==null;)if(p+=f.substring(d,x.index),d=x.index,x[0]==="$$")p+="$",d++;else{d+=x[0].length;var v=o[x[1]];if(!v)throw new ReferenceError("Template: Property "+x[1]+" does not exist.");if(x[2]===void 0)switch(typeof v){case"string":p+=v;break;case"object":if(Sr(v))p+=v.toTex(u);else if(Array.isArray(v))p+=v.map(function(y,w){if(Sr(y))return y.toTex(u);throw new TypeError("Template: "+x[1]+"["+w+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes")}else if(Sr(v[x[2]]&&v[x[2]]))p+=v[x[2]].toTex(u);else throw new TypeError("Template: "+x[1]+"["+x[2]+"] is not a Node.")}return p+=f.slice(d),p}class c extends n{constructor(o,u){if(super(),typeof o=="string"&&(o=new i(o)),!Sr(o))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(u)||!u.every(Sr))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=o,this.args=u||[]}get name(){return this.fn.name||""}get type(){return Op}get isFunctionNode(){return!0}_compile(o,u){var p=this.args.map(F=>F._compile(o,u));if(rt(this.fn)){var h=this.fn.name;if(u[h]){var w=this.args;return function(M,_,k){var L=gt(_,h);if(typeof L!="function")throw new TypeError("Argument '".concat(h,"' was not a function; received: ").concat(a(L)));if(L.rawArgs)return L(w,o,as(M,_));var Y=p.map($=>$(M,_,k));return L.apply(L,Y)}}else{var d=h in o?gt(o,h):void 0,x=typeof d=="function"&&d.rawArgs===!0,v=F=>{var M;if(F.has(h))M=F.get(h);else if(h in o)M=gt(o,h);else return c.onUndefinedFunction(h);if(typeof M=="function")return M;throw new TypeError("'".concat(h,\`' is not a function; its value is: - \`).concat(a(M)))};if(x){var y=this.args;return function(M,_,k){var L=v(M);return L(y,o,as(M,_))}}else switch(p.length){case 0:return function(M,_,k){var L=v(M);return L()};case 1:return function(M,_,k){var L=v(M),Y=p[0];return L(Y(M,_,k))};case 2:return function(M,_,k){var L=v(M),Y=p[0],$=p[1];return L(Y(M,_,k),$(M,_,k))};default:return function(M,_,k){var L=v(M),Y=p.map($=>$(M,_,k));return L(...Y)}}}}else if(Sn(this.fn)&&kn(this.fn.index)&&this.fn.index.isObjectProperty()){var C=this.fn.object._compile(o,u),b=this.fn.index.getObjectProperty(),A=this.args;return function(M,_,k){var L=C(M,_,k),Y=My(L,b);if(Y!=null&&Y.rawArgs)return Y(A,o,as(M,_));var $=p.map(V=>V(M,_,k));return Y.apply(L,$)}}else{var E=this.fn.toString(),S=this.fn._compile(o,u),O=this.args;return function(M,_,k){var L=S(M,_,k);if(typeof L!="function")throw new TypeError("Expression '".concat(E,"' did not evaluate to a function; value is:")+\` - \`.concat(a(L)));if(L.rawArgs)return L(O,o,as(M,_));var Y=p.map($=>$(M,_,k));return L.apply(L,Y)}}}forEach(o){o(this.fn,"fn",this);for(var u=0;u'+Qt(this.fn)+'('+u.join(',')+')'}toTex(o){var u;return o&&typeof o.handler=="object"&&$e(o.handler,this.name)&&(u=o.handler[this.name](this,o)),typeof u<"u"?u:super.toTex(o)}_toTex(o){var u=this.args.map(function(d){return d.toTex(o)}),p;mg[this.name]&&(p=mg[this.name]),t[this.name]&&(typeof t[this.name].toTex=="function"||typeof t[this.name].toTex=="object"||typeof t[this.name].toTex=="string")&&(p=t[this.name].toTex);var h;switch(typeof p){case"function":h=p(this,o);break;case"string":h=s(p,this,o);break;case"object":switch(typeof p[u.length]){case"function":h=p[u.length](this,o);break;case"string":h=s(p[u.length],this,o);break}}return typeof h<"u"?h:s(P2,this,o)}getIdentifier(){return this.type+":"+this.name}}return r=c,Ur(c,"name",Op),Ur(c,"onUndefinedFunction",function(f){throw new Error("Undefined function "+f)}),Ur(c,"fromJSON",function(f){return new r(f.fn,f.args)}),c},{isClass:!0,isNode:!0});var G2="parse",mz=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],$2=T(G2,mz,e=>{var{typed:r,numeric:t,config:n,AccessorNode:i,ArrayNode:a,AssignmentNode:s,BlockNode:c,ConditionalNode:f,ConstantNode:o,FunctionAssignmentNode:u,FunctionNode:p,IndexNode:h,ObjectNode:d,OperatorNode:x,ParenthesisNode:v,RangeNode:y,RelationalNode:w,SymbolNode:C}=e,b=r(G2,{string:function(Q){return me(Q,{})},"Array | Matrix":function(Q){return A(Q,{})},"string, Object":function(Q,ve){var Be=ve.nodes!==void 0?ve.nodes:{};return me(Q,Be)},"Array | Matrix, Object":A});function A(B){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ve=Q.nodes!==void 0?Q.nodes:{};return Je(B,function(Be){if(typeof Be!="string")throw new TypeError("String expected");return me(Be,ve)})}var E={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},S={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},O={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},F={true:!0,false:!1,null:null,undefined:void 0},M=["NaN","Infinity"],_={'"':'"',"'":"'","\\\\":"\\\\","/":"/",b:"\\b",f:"\\f",n:\` + (\`+lr(F,v)+", "+lr(A,v)+") ==> "+(this._values?lr(this._values[O],v):"X")}return b},i.prototype.toString=function(){return lr(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(v){if(v){if(je(v)&&(v=v.toNumber()),!ar(v)||!He(v))throw new TypeError("The parameter k must be an integer number")}else v=0;var y=v>0?v:0,w=v<0?-v:0,C=this._size[0],b=this._size[1],A=Math.min(C-w,b-y),E=[],S=[],O=[];O[0]=0;for(var F=y;F0?w:0,O=w<0?-w:0,F=v[0],M=v[1],_=Math.min(F-O,M-S),k;if(Ar(y)){if(y.length!==_)throw new Error("Invalid value array length");k=function(oe){return y[oe]}}else if(Ge(y)){var L=y.size();if(L.length!==1||L[0]!==_)throw new Error("Invalid matrix length");k=function(oe){return y.get([oe])}}else k=function(){return y};for(var Y=[],$=[],V=[],q=0;q=0&&R<_){var j=k(R);A(j,E)||($.push(R+O),Y.push(j))}}return V.push(Y.length),new i({values:Y,index:$,ptr:V,size:[F,M]})},i.prototype.swapRows=function(v,y){if(!ar(v)||!He(v)||!ar(y)||!He(y))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Xr(v,this._size[0]),Xr(y,this._size[0]),i._swapRows(v,y,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(v,y,w,C,b){for(var A=C[v],E=C[v+1],S=A;S=O||b[M]!==y)){var k=C?C[F]:void 0;b.splice(M,0,y),C&&C.splice(M,0,k),b.splice(M<=F?F+1:F,1),C&&C.splice(M<=F?F+1:F,1);continue}if(M=O||b[F]!==v)){var L=C?C[M]:void 0;b.splice(F,0,v),C&&C.splice(F,0,L),b.splice(F<=M?M+1:M,1),C&&C.splice(F<=M?M+1:M,1)}}},i},{isClass:!0});var v9="number",g9=["typed"];function x9(e){var r=e.match(/(0[box])([0-9a-fA-F]*)\\.([0-9a-fA-F]*)/);if(r){var t={"0b":2,"0o":8,"0x":16}[r[1]],n=r[2],i=r[3];return{input:e,radix:t,integerPart:n,fractionalPart:i}}else return null}function y9(e){for(var r=parseInt(e.integerPart,e.radix),t=0,n=0;n{var{typed:r}=e,t=r("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var a=x9(i);if(a)return y9(a);var s=0,l=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);l&&(s=Number(l[2]),i=l[1]);var f=Number(i);if(isNaN(f))throw new SyntaxError('String "'+i+'" is not a valid number');if(l){if(f>2**s-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));f>=2**(s-1)&&(f=f-2**s)}return f},BigNumber:function(i){return i.toNumber()},Fraction:function(i){return i.valueOf()},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),null:function(i){return 0},"Unit, string | Unit":function(i,a){return i.toNumber(a)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))});return t.fromJSON=function(n){return parseFloat(n.value)},t});var P1="string",b9=["typed"],k1=T(P1,b9,e=>{var{typed:r}=e;return r(P1,{"":function(){return""},number:Wi,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t)),any:function(n){return String(n)}})});var R1="boolean",w9=["typed"],L1=T(R1,w9,e=>{var{typed:r}=e;return r(R1,{"":function(){return!1},boolean:function(n){return n},number:function(n){return!!n},null:function(n){return!1},BigNumber:function(n){return!n.isZero()},string:function(n){var i=n.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;var a=Number(n);if(n!==""&&!isNaN(a))return!!a;throw new Error('Cannot convert "'+n+'" to a boolean')},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var D9="bignumber",S9=["typed","BigNumber"],q1=T(D9,S9,e=>{var{typed:r,BigNumber:t}=e;return r("bignumber",{"":function(){return new t(0)},number:function(i){return new t(i+"")},string:function(i){var a=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(a){var s=a[2],l=t(a[1]),f=new t(2).pow(Number(s));if(l.gt(f.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var o=new t(2).pow(Number(s)-1);return l.gte(o)?l.sub(f):l}return new t(i)},BigNumber:function(i){return i},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Fraction:function(i){return new t(i.n).div(i.d).times(i.s)},null:function(i){return new t(0)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var N9="complex",A9=["typed","Complex"],U1=T(N9,A9,e=>{var{typed:r,Complex:t}=e;return r("complex",{"":function(){return t.ZERO},number:function(i){return new t(i,0)},"number, number":function(i,a){return new t(i,a)},"BigNumber, BigNumber":function(i,a){return new t(i.toNumber(),a.toNumber())},Fraction:function(i){return new t(i.valueOf(),0)},Complex:function(i){return i.clone()},string:function(i){return t(i)},null:function(i){return t(0)},Object:function(i){if("re"in i&&"im"in i)return new t(i.re,i.im);if("r"in i&&"phi"in i||"abs"in i&&"arg"in i)return new t(i);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var E9="fraction",C9=["typed","Fraction"],z1=T(E9,C9,e=>{var{typed:r,Fraction:t}=e;return r("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new t(i)},string:function(i){return new t(i)},"number, number":function(i,a){return new t(i,a)},null:function(i){return new t(0)},BigNumber:function(i){return new t(i.toString())},Fraction:function(i){return i},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Object:function(i){return new t(i)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var W1="matrix",M9=["typed","Matrix","DenseMatrix","SparseMatrix"],V1=T(W1,M9,e=>{var{typed:r,Matrix:t,DenseMatrix:n,SparseMatrix:i}=e;return r(W1,{"":function(){return a([])},string:function(l){return a([],l)},"string, string":function(l,f){return a([],l,f)},Array:function(l){return a(l)},Matrix:function(l){return a(l,l.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(s,l,f){if(l==="dense"||l==="default"||l===void 0)return new n(s,f);if(l==="sparse")return new i(s,f);throw new TypeError("Unknown matrix type "+JSON.stringify(l)+".")}});var Y1="matrixFromFunction",_9=["typed","matrix","isZero"],H1=T(Y1,_9,e=>{var{typed:r,matrix:t,isZero:n}=e;return r(Y1,{"Array | Matrix, function, string, string":function(s,l,f,o){return i(s,l,f,o)},"Array | Matrix, function, string":function(s,l,f){return i(s,l,f)},"Matrix, function":function(s,l){return i(s,l,"dense")},"Array, function":function(s,l){return i(s,l,"dense").toArray()},"Array | Matrix, string, function":function(s,l,f){return i(s,f,l)},"Array | Matrix, string, string, function":function(s,l,f,o){return i(s,o,l,f)}});function i(a,s,l,f){var o;return f!==void 0?o=t(l,f):o=t(l),o.resize(a),o.forEach(function(u,p){var h=s(p);n(h)||o.set(p,h)}),o}});var G1="matrixFromRows",T9=["typed","matrix","flatten","size"],$1=T(G1,T9,e=>{var{typed:r,matrix:t,flatten:n,size:i}=e;return r(G1,{"...Array":function(f){return a(f)},"...Matrix":function(f){return t(a(f.map(o=>o.toArray())))}});function a(l){if(l.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var f=s(l[0]),o=[];for(var u of l){var p=s(u);if(p!==f)throw new TypeError("The vectors had different length: "+(f|0)+" \\u2260 "+(p|0));o.push(n(u))}return o}function s(l){var f=i(l);if(f.length===1)return f[0];if(f.length===2){if(f[0]===1)return f[1];if(f[1]===1)return f[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}});var Z1="matrixFromColumns",F9=["typed","matrix","flatten","size"],Q1=T(Z1,F9,e=>{var{typed:r,matrix:t,flatten:n,size:i}=e;return r(Z1,{"...Array":function(f){return a(f)},"...Matrix":function(f){return t(a(f.map(o=>o.toArray())))}});function a(l){if(l.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var f=s(l[0]),o=[],u=0;u{var{typed:r}=e;return r(X1,{"Unit, Array":function(n,i){return n.splitUnit(i)}})});var K1="unaryMinus",B9=["typed"],j1=T(K1,B9,e=>{var{typed:r}=e;return r(K1,{number:mv,"Complex | BigNumber | Fraction":t=>t.neg(),Unit:r.referToSelf(t=>n=>{var i=n.clone();return i.value=r.find(t,i.valueType())(n.value),i}),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t,!0))})});var eb="unaryPlus",I9=["typed","config","BigNumber"],rb=T(eb,I9,e=>{var{typed:r,config:t,BigNumber:n}=e;return r(eb,{number:hv,Complex:function(a){return a},BigNumber:function(a){return a},Fraction:function(a){return a},Unit:function(a){return a.clone()},"Array | Matrix":r.referToSelf(i=>a=>Je(a,i,!0)),"boolean | string":function(a){return t.number==="BigNumber"?new n(+a):+a}})});var tb="abs",P9=["typed"],nb=T(tb,P9,e=>{var{typed:r}=e;return r(tb,{number:fv,"Complex | BigNumber | Fraction | Unit":t=>t.abs(),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t,!0))})});var ib="apply",k9=["typed","isInteger"],ou=T(ib,k9,e=>{var{typed:r,isInteger:t}=e;return r(ib,{"Array | Matrix, number | BigNumber, function":function(i,a,s){if(!t(a))throw new TypeError("Integer number expected for dimension");var l=Array.isArray(i)?or(i):i.size();if(a<0||a>=l.length)throw new Xt(a,l.length);return Ge(i)?i.create(qc(i.valueOf(),a,s)):qc(i,a,s)}})});function qc(e,r,t){var n,i,a;if(r<=0)if(Array.isArray(e[0])){for(a=R9(e),i=[],n=0;n{var{typed:r}=e;return r(ab,{"number, number":lv,"Complex, Complex":function(n,i){return n.add(i)},"BigNumber, BigNumber":function(n,i){return n.plus(i)},"Fraction, Fraction":function(n,i){return n.add(i)},"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=r.find(t,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})});var sb="subtractScalar",q9=["typed"],ub=T(sb,q9,e=>{var{typed:r}=e;return r(sb,{"number, number":cv,"Complex, Complex":function(n,i){return n.sub(i)},"BigNumber, BigNumber":function(n,i){return n.minus(i)},"Fraction, Fraction":function(n,i){return n.sub(i)},"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=r.find(t,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})});var fb="cbrt",U9=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],lb=T(fb,U9,e=>{var{config:r,typed:t,isNegative:n,unaryMinus:i,matrix:a,Complex:s,BigNumber:l,Fraction:f}=e;return t(fb,{number:nu,Complex:o,"Complex, boolean":o,BigNumber:function(h){return h.cbrt()},Unit:u});function o(p,h){var d=p.arg()/3,x=p.abs(),v=new s(nu(x),0).mul(new s(0,d).exp());if(h){var y=[v,new s(nu(x),0).mul(new s(0,d+Math.PI*2/3).exp()),new s(nu(x),0).mul(new s(0,d-Math.PI*2/3).exp())];return r.matrix==="Array"?y:a(y)}else return v}function u(p){if(p.value&&Gt(p.value)){var h=p.clone();return h.value=1,h=h.pow(1/3),h.value=o(p.value),h}else{var d=n(p.value);d&&(p.value=i(p.value));var x;je(p.value)?x=new l(1).div(3):Xn(p.value)?x=new f(1,3):x=1/3;var v=p.pow(x);return d&&(v.value=i(v.value)),v}}});var z9="matAlgo11xS0s",W9=["typed","equalScalar"],Jr=T(z9,W9,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s,l){var f=i._values,o=i._index,u=i._ptr,p=i._size,h=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=p[0],x=p[1],v,y=t,w=0,C=s;typeof h=="string"&&(v=h,y=r.find(t,[v,v]),w=r.convert(0,v),a=r.convert(a,v),C=r.find(s,[v,v]));for(var b=[],A=[],E=[],S=0;S{var{typed:r,DenseMatrix:t}=e;return function(i,a,s,l){var f=i._values,o=i._index,u=i._ptr,p=i._size,h=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=p[0],x=p[1],v,y=s;typeof h=="string"&&(v=h,a=r.convert(a,v),y=r.find(s,[v,v]));for(var w=[],C=[],b=[],A=0;A{var{typed:r}=e;return function(i,a,s,l){var f=i._data,o=i._size,u=i._datatype,p,h=s;typeof u=="string"&&(p=u,a=r.convert(a,p),h=r.find(s,[p,p]));var d=o.length>0?t(h,0,o,o[0],f,a,l):[];return i.createDenseMatrix({data:d,size:tr(o),datatype:p})};function t(n,i,a,s,l,f,o){var u=[];if(i===a.length-1)for(var p=0;p{var{typed:r,config:t,round:n}=e;return r(og,{number:function(a){return wt(a,n(a),t.epsilon)?n(a):Math.ceil(a)},"number, number":function(a,s){if(wt(a,n(a,s),t.epsilon))return n(a,s);var[l,f]="".concat(a,"e").split("e"),o=Math.ceil(Number("".concat(l,"e").concat(Number(f)+s)));return[l,f]="".concat(o,"e").split("e"),Number("".concat(l,"e").concat(Number(f)-s))}})}),cb=T(og,$9,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:l}=e,f=Jr({typed:r,equalScalar:a}),o=Lr({typed:r,DenseMatrix:l}),u=Bt({typed:r}),p=Z9({typed:r,config:t,round:n});return r("ceil",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(d){return d.ceil()},"Complex, number":function(d,x){return d.ceil(x)},"Complex, BigNumber":function(d,x){return d.ceil(x.toNumber())},BigNumber:function(d){return Ut(d,n(d),t.epsilon)?n(d):d.ceil()},"BigNumber, BigNumber":function(d,x){return Ut(d,n(d,x),t.epsilon)?n(d,x):d.toDecimalPlaces(x.toNumber(),ts.ROUND_CEIL)},Fraction:function(d){return d.ceil()},"Fraction, number":function(d,x){return d.ceil(x)},"Fraction, BigNumber":function(d,x){return d.ceil(x.toNumber())},"Array | Matrix":r.referToSelf(h=>d=>Je(d,h,!0)),"Array, number | BigNumber":r.referToSelf(h=>(d,x)=>Je(d,v=>h(v,x),!0)),"SparseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>f(d,x,h,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>u(d,x,h,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(h=>(d,x)=>u(i(x),d,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(h=>(d,x)=>a(d,0)?s(x.size(),x.storage()):x.storage()==="dense"?u(x,d,h,!0):o(x,d,h,!0))})});var pb="cube",Q9=["typed"],mb=T(pb,Q9,e=>{var{typed:r}=e;return r(pb,{number:dv,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})});var hb="exp",X9=["typed"],db=T(hb,X9,e=>{var{typed:r}=e;return r(hb,{number:vv,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})});var vb="expm1",J9=["typed","Complex"],gb=T(vb,J9,e=>{var{typed:r,Complex:t}=e;return r(vb,{number:gv,Complex:function(i){var a=Math.exp(i.re);return new t(a*Math.cos(i.im)-1,a*Math.sin(i.im))},BigNumber:function(i){return i.exp().minus(1)}})});var sg="fix",K9=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],j9=T(sg,["typed","ceil","floor"],e=>{var{typed:r,ceil:t,floor:n}=e;return r(sg,{number:function(a){return a>0?n(a):t(a)},"number, number":function(a,s){return a>0?n(a,s):t(a,s)}})}),xb=T(sg,K9,e=>{var{typed:r,Complex:t,matrix:n,ceil:i,floor:a,equalScalar:s,zeros:l,DenseMatrix:f}=e,o=Lr({typed:r,DenseMatrix:f}),u=Bt({typed:r}),p=j9({typed:r,ceil:i,floor:a});return r("fix",{number:p.signatures.number,"number, number | BigNumber":p.signatures["number,number"],Complex:function(d){return new t(d.re>0?Math.floor(d.re):Math.ceil(d.re),d.im>0?Math.floor(d.im):Math.ceil(d.im))},"Complex, number":function(d,x){return new t(d.re>0?a(d.re,x):i(d.re,x),d.im>0?a(d.im,x):i(d.im,x))},"Complex, BigNumber":function(d,x){var v=x.toNumber();return new t(d.re>0?a(d.re,v):i(d.re,v),d.im>0?a(d.im,v):i(d.im,v))},BigNumber:function(d){return d.isNegative()?i(d):a(d)},"BigNumber, number | BigNumber":function(d,x){return d.isNegative()?i(d,x):a(d,x)},Fraction:function(d){return d.s<0?d.ceil():d.floor()},"Fraction, number | BigNumber":function(d,x){return d.s<0?i(d,x):a(d,x)},"Array | Matrix":r.referToSelf(h=>d=>Je(d,h,!0)),"Array | Matrix, number | BigNumber":r.referToSelf(h=>(d,x)=>Je(d,v=>h(v,x),!0)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(h=>(d,x)=>u(n(x),d,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(h=>(d,x)=>s(d,0)?l(x.size(),x.storage()):x.storage()==="dense"?u(x,d,h,!0):o(x,d,h,!0))})});var ug="floor",e7=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],r7=T(ug,["typed","config","round"],e=>{var{typed:r,config:t,round:n}=e;return r(ug,{number:function(a){return wt(a,n(a),t.epsilon)?n(a):Math.floor(a)},"number, number":function(a,s){if(wt(a,n(a,s),t.epsilon))return n(a,s);var[l,f]="".concat(a,"e").split("e"),o=Math.floor(Number("".concat(l,"e").concat(Number(f)+s)));return[l,f]="".concat(o,"e").split("e"),Number("".concat(l,"e").concat(Number(f)-s))}})}),Uc=T(ug,e7,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:l}=e,f=Jr({typed:r,equalScalar:a}),o=Lr({typed:r,DenseMatrix:l}),u=Bt({typed:r}),p=r7({typed:r,config:t,round:n});return r("floor",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(d){return d.floor()},"Complex, number":function(d,x){return d.floor(x)},"Complex, BigNumber":function(d,x){return d.floor(x.toNumber())},BigNumber:function(d){return Ut(d,n(d),t.epsilon)?n(d):d.floor()},"BigNumber, BigNumber":function(d,x){return Ut(d,n(d,x),t.epsilon)?n(d,x):d.toDecimalPlaces(x.toNumber(),ts.ROUND_FLOOR)},Fraction:function(d){return d.floor()},"Fraction, number":function(d,x){return d.floor(x)},"Fraction, BigNumber":function(d,x){return d.floor(x.toNumber())},"Array | Matrix":r.referToSelf(h=>d=>Je(d,h,!0)),"Array, number | BigNumber":r.referToSelf(h=>(d,x)=>Je(d,v=>h(v,x),!0)),"SparseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>f(d,x,h,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>u(d,x,h,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(h=>(d,x)=>u(i(x),d,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(h=>(d,x)=>a(d,0)?s(x.size(),x.storage()):x.storage()==="dense"?u(x,d,h,!0):o(x,d,h,!0))})});var t7="matAlgo02xDS0",n7=["typed","equalScalar"],It=T(t7,n7,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s,l){var f=i._data,o=i._size,u=i._datatype||i.getDataType(),p=a._values,h=a._index,d=a._ptr,x=a._size,v=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(o.length!==x.length)throw new pr(o.length,x.length);if(o[0]!==x[0]||o[1]!==x[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+x+")");if(!p)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var y=o[0],w=o[1],C,b=t,A=0,E=s;typeof u=="string"&&u===v&&u!=="mixed"&&(C=u,b=r.find(t,[C,C]),A=r.convert(0,C),E=r.find(s,[C,C]));for(var S=[],O=[],F=[],M=0;M{var{typed:r}=e;return function(n,i,a,s){var l=n._data,f=n._size,o=n._datatype||n.getDataType(),u=i._values,p=i._index,h=i._ptr,d=i._size,x=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(f.length!==d.length)throw new pr(f.length,d.length);if(f[0]!==d[0]||f[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+d+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var v=f[0],y=f[1],w,C=0,b=a;typeof o=="string"&&o===x&&o!=="mixed"&&(w=o,C=r.convert(0,w),b=r.find(a,[w,w]));for(var A=[],E=0;E{var{typed:r,equalScalar:t}=e;return function(i,a,s){var l=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,d=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));var O=l&&h?[]:void 0,F=[],M=[],_=O?[]:void 0,k=O?[]:void 0,L=[],Y=[],$,V,q,R;for(V=0;V{var{typed:r}=e;return function(i,a,s){var l=i._data,f=i._size,o=i._datatype,u=a._data,p=a._size,h=a._datatype,d=[];if(f.length!==p.length)throw new pr(f.length,p.length);for(var x=0;x0?t(y,0,d,d[0],l,u):[];return i.createDenseMatrix({data:w,size:d,datatype:v})};function t(n,i,a,s,l,f){var o=[];if(i===a.length-1)for(var u=0;u{var{concat:r}=e;return function(i,a){var s=Math.max(i._size.length,a._size.length);if(i._size.length===a._size.length&&i._size.every((x,v)=>x===a._size[v]))return[i,a];for(var l=t(i._size,s,0),f=t(a._size,s,0),o=[],u=0;u{var{typed:r,matrix:t,concat:n}=e,i=yb({typed:r}),a=Bt({typed:r}),s=bb({concat:n});return function(f){var o=f.elop,u=f.SD||f.DS,p;o?(p={"DenseMatrix, DenseMatrix":(v,y)=>i(...s(v,y),o),"Array, Array":(v,y)=>i(...s(t(v),t(y)),o).valueOf(),"Array, DenseMatrix":(v,y)=>i(...s(t(v),y),o),"DenseMatrix, Array":(v,y)=>i(...s(v,t(y)),o)},f.SS&&(p["SparseMatrix, SparseMatrix"]=(v,y)=>f.SS(...s(v,y),o,!1)),f.DS&&(p["DenseMatrix, SparseMatrix"]=(v,y)=>f.DS(...s(v,y),o,!1),p["Array, SparseMatrix"]=(v,y)=>f.DS(...s(t(v),y),o,!1)),u&&(p["SparseMatrix, DenseMatrix"]=(v,y)=>u(...s(y,v),o,!0),p["SparseMatrix, Array"]=(v,y)=>u(...s(t(y),v),o,!0))):(p={"DenseMatrix, DenseMatrix":r.referToSelf(v=>(y,w)=>i(...s(y,w),v)),"Array, Array":r.referToSelf(v=>(y,w)=>i(...s(t(y),t(w)),v).valueOf()),"Array, DenseMatrix":r.referToSelf(v=>(y,w)=>i(...s(t(y),w),v)),"DenseMatrix, Array":r.referToSelf(v=>(y,w)=>i(...s(y,t(w)),v))},f.SS&&(p["SparseMatrix, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.SS(...s(y,w),v,!1))),f.DS&&(p["DenseMatrix, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.DS(...s(y,w),v,!1)),p["Array, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.DS(...s(t(y),w),v,!1))),u&&(p["SparseMatrix, DenseMatrix"]=r.referToSelf(v=>(y,w)=>u(...s(w,y),v,!0)),p["SparseMatrix, Array"]=r.referToSelf(v=>(y,w)=>u(...s(t(w),y),v,!0))));var h=f.scalar||"any",d=f.Ds||f.Ss;d&&(o?(p["DenseMatrix,"+h]=(v,y)=>a(v,y,o,!1),p[h+", DenseMatrix"]=(v,y)=>a(y,v,o,!0),p["Array,"+h]=(v,y)=>a(t(v),y,o,!1).valueOf(),p[h+", Array"]=(v,y)=>a(t(y),v,o,!0).valueOf()):(p["DenseMatrix,"+h]=r.referToSelf(v=>(y,w)=>a(y,w,v,!1)),p[h+", DenseMatrix"]=r.referToSelf(v=>(y,w)=>a(w,y,v,!0)),p["Array,"+h]=r.referToSelf(v=>(y,w)=>a(t(y),w,v,!1).valueOf()),p[h+", Array"]=r.referToSelf(v=>(y,w)=>a(t(w),y,v,!0).valueOf())));var x=f.sS!==void 0?f.sS:f.Ss;return o?(f.Ss&&(p["SparseMatrix,"+h]=(v,y)=>f.Ss(v,y,o,!1)),x&&(p[h+", SparseMatrix"]=(v,y)=>x(y,v,o,!0))):(f.Ss&&(p["SparseMatrix,"+h]=r.referToSelf(v=>(y,w)=>f.Ss(y,w,v,!1))),x&&(p[h+", SparseMatrix"]=r.referToSelf(v=>(y,w)=>x(w,y,v,!0)))),o&&o.signatures&&vc(p,o.signatures),p}});var wb="mod",h7=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],zc=T(wb,h7,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:l,concat:f}=e,o=Uc({typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:l}),u=It({typed:r,equalScalar:a}),p=ft({typed:r}),h=So({typed:r,equalScalar:a}),d=Jr({typed:r,equalScalar:a}),x=Lr({typed:r,DenseMatrix:l}),v=vr({typed:r,matrix:i,concat:f});return r(wb,{"number, number":y,"BigNumber, BigNumber":function(C,b){return b.isZero()?C:C.sub(b.mul(o(C.div(b))))},"Fraction, Fraction":function(C,b){return b.equals(0)?C:C.sub(b.mul(o(C.div(b))))}},v({SS:h,DS:p,SD:u,Ss:d,sS:x}));function y(w,C){return C===0?w:w-C*o(w/C)}});var d7="matAlgo01xDSid",v7=["typed"],dn=T(d7,v7,e=>{var{typed:r}=e;return function(n,i,a,s){var l=n._data,f=n._size,o=n._datatype||n.getDataType(),u=i._values,p=i._index,h=i._ptr,d=i._size,x=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(f.length!==d.length)throw new pr(f.length,d.length);if(f[0]!==d[0]||f[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+d+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var v=f[0],y=f[1],w=typeof o=="string"&&o!=="mixed"&&o===x?o:void 0,C=w?r.find(a,[w,w]):a,b,A,E=[];for(b=0;b{var{typed:r,equalScalar:t}=e;return function(i,a,s){var l=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,d=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));var O=l&&h?[]:void 0,F=[],M=[],_=l&&h?[]:void 0,k=l&&h?[]:void 0,L=[],Y=[],$,V,q,R,j;for(V=0;V{var{typed:r,DenseMatrix:t}=e;return function(i,a,s,l){var f=i._values,o=i._index,u=i._ptr,p=i._size,h=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=p[0],x=p[1],v,y=s;typeof h=="string"&&(v=h,a=r.convert(a,v),y=r.find(s,[v,v]));for(var w=[],C=[],b=[],A=0;AArray.isArray(r))}var Nb=T(Db,w7,e=>{var{typed:r,matrix:t,config:n,round:i,equalScalar:a,zeros:s,BigNumber:l,DenseMatrix:f,concat:o}=e,u=zc({typed:r,config:n,round:i,matrix:t,equalScalar:a,zeros:s,DenseMatrix:f,concat:o}),p=dn({typed:r}),h=su({typed:r,equalScalar:a}),d=Un({typed:r,DenseMatrix:f}),x=vr({typed:r,matrix:t,concat:o});return r(Db,{"number, number":v,"BigNumber, BigNumber":y,"Fraction, Fraction":(w,C)=>w.gcd(C)},x({SS:h,DS:p,Ss:d}),{[D7]:r.referToSelf(w=>(C,b,A)=>{for(var E=w(C,b),S=0;SC=>{if(C.length===1&&Array.isArray(C[0])&&Sb(C[0]))return w(...C[0]);if(Sb(C))return w(...C);throw new jn("gcd() supports only 1d matrices!")}),Matrix:r.referToSelf(w=>C=>w(C.toArray()))});function v(w,C){if(!He(w)||!He(C))throw new Error("Parameters in function gcd must be integer numbers");for(var b;C!==0;)b=u(w,C),w=C,C=b;return w<0?-w:w}function y(w,C){if(!w.isInt()||!C.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var b=new l(0);!C.isZero();){var A=u(w,C);w=C,C=A}return w.lt(b)?w.neg():w}});var S7="matAlgo06xS0S0",N7=["typed","equalScalar"],No=T(S7,N7,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var l=i._values,f=i._size,o=i._datatype||i._data===void 0?i._datatype:i.getDataType(),u=a._values,p=a._size,h=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(f.length!==p.length)throw new pr(f.length,p.length);if(f[0]!==p[0]||f[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+p+")");var d=f[0],x=f[1],v,y=t,w=0,C=s;typeof o=="string"&&o===h&&o!=="mixed"&&(v=o,y=r.find(t,[v,v]),w=r.convert(0,v),C=r.find(s,[v,v]));for(var b=l&&u?[]:void 0,A=[],E=[],S=b?[]:void 0,O=[],F=[],M=0;M{var{typed:r,matrix:t,equalScalar:n,concat:i}=e,a=It({typed:r,equalScalar:n}),s=No({typed:r,equalScalar:n}),l=Jr({typed:r,equalScalar:n}),f=vr({typed:r,matrix:t,concat:i}),o="number | BigNumber | Fraction | Matrix | Array",u={};return u["".concat(o,", ").concat(o,", ...").concat(o)]=r.referToSelf(h=>(d,x,v)=>{for(var y=h(d,x),w=0;wh.lcm(d)},f({SS:s,DS:a,Ss:l}),u);function p(h,d){if(!h.isInt()||!d.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(h.isZero())return h;if(d.isZero())return d;for(var x=h.times(d);!d.isZero();){var v=d;d=h.mod(v),h=v}return x.div(h).abs()}});var Cb="log10",E7=["typed","config","Complex"],Mb=T(Cb,E7,e=>{var{typed:r,config:t,Complex:n}=e;return r(Cb,{number:function(a){return a>=0||t.predictable?yv(a):new n(a,0).log().div(Math.LN10)},Complex:function(a){return new n(a).log().div(Math.LN10)},BigNumber:function(a){return!a.isNegative()||t.predictable?a.log():new n(a.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":r.referToSelf(i=>a=>Je(a,i))})});var _b="log2",C7=["typed","config","Complex"],Tb=T(_b,C7,e=>{var{typed:r,config:t,Complex:n}=e;return r(_b,{number:function(s){return s>=0||t.predictable?bv(s):i(new n(s,0))},Complex:i,BigNumber:function(s){return!s.isNegative()||t.predictable?s.log(2):i(new n(s.toNumber(),0))},"Array | Matrix":r.referToSelf(a=>s=>Je(s,a))});function i(a){var s=Math.sqrt(a.re*a.re+a.im*a.im);return new n(Math.log2?Math.log2(s):Math.log(s)/Math.LN2,Math.atan2(a.im,a.re)/Math.LN2)}});var M7="multiplyScalar",_7=["typed"],Fb=T(M7,_7,e=>{var{typed:r}=e;return r("multiplyScalar",{"number, number":pv,"Complex, Complex":function(n,i){return n.mul(i)},"BigNumber, BigNumber":function(n,i){return n.times(i)},"Fraction, Fraction":function(n,i){return n.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(t,n)=>n.multiply(t),"Unit, number | Fraction | BigNumber | Complex | Unit":(t,n)=>t.multiply(n)})});var Ob="multiply",T7=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],Bb=T(Ob,T7,e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:i,equalScalar:a,dot:s}=e,l=Jr({typed:r,equalScalar:a}),f=Bt({typed:r});function o(E,S){switch(E.length){case 1:switch(S.length){case 1:if(E[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(E[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+E[0]+") must match Matrix rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;case 2:switch(S.length){case 1:if(E[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+E[1]+") must match Vector length ("+S[0]+")");break;case 2:if(E[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+E[1]+") must match Matrix B rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+E.length+" dimensions)")}}function u(E,S,O){if(O===0)throw new Error("Cannot multiply two empty vectors");return s(E,S)}function p(E,S){if(S.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return h(E,S)}function h(E,S){var O=E._data,F=E._size,M=E._datatype||E.getDataType(),_=S._data,k=S._size,L=S._datatype||S.getDataType(),Y=F[0],$=k[1],V,q=n,R=i;M&&L&&M===L&&typeof M=="string"&&M!=="mixed"&&(V=M,q=r.find(n,[V,V]),R=r.find(i,[V,V]));for(var j=[],U=0;U<$;U++){for(var oe=R(O[0],_[0][U]),me=1;mege)for(var xe=0,be=0;be(S,O)=>{o(or(S),or(O));var F=E(t(S),t(O));return Ge(F)?F.valueOf():F}),"Matrix, Matrix":function(S,O){var F=S.size(),M=O.size();return o(F,M),F.length===1?M.length===1?u(S,O,F[0]):p(S,O):M.length===1?d(S,O):x(S,O)},"Matrix, Array":r.referTo("Matrix,Matrix",E=>(S,O)=>E(S,t(O))),"Array, Matrix":r.referToSelf(E=>(S,O)=>E(t(S,O.storage()),O)),"SparseMatrix, any":function(S,O){return l(S,O,i,!1)},"DenseMatrix, any":function(S,O){return f(S,O,i,!1)},"any, SparseMatrix":function(S,O){return l(O,S,i,!0)},"any, DenseMatrix":function(S,O){return f(O,S,i,!0)},"Array, any":function(S,O){return f(t(S),O,i,!1).valueOf()},"any, Array":function(S,O){return f(t(O),S,i,!0).valueOf()},"any, any":i,"any, any, ...any":r.referToSelf(E=>(S,O,F)=>{for(var M=E(S,O),_=0;_{var{typed:r,matrix:t,equalScalar:n,BigNumber:i,concat:a}=e,s=dn({typed:r}),l=It({typed:r,equalScalar:n}),f=No({typed:r,equalScalar:n}),o=Jr({typed:r,equalScalar:n}),u=vr({typed:r,matrix:t,concat:a});function p(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return r(Ib,{number:wv,"number, number":wv,BigNumber:d=>h(d,new i(2)),"BigNumber, BigNumber":h,Complex:p,"Complex, number":p,Array:r.referTo("DenseMatrix,number",d=>x=>d(t(x),2).valueOf()),DenseMatrix:r.referTo("DenseMatrix,number",d=>x=>d(x,2)),SparseMatrix:r.referTo("SparseMatrix,number",d=>x=>d(x,2)),"SparseMatrix, SparseMatrix":r.referToSelf(d=>(x,v)=>{if(v.density()===1)return f(x,v,d);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":r.referToSelf(d=>(x,v)=>{if(v.density()===1)return s(x,v,d,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":r.referTo("DenseMatrix,SparseMatrix",d=>(x,v)=>d(t(x),v)),"number | BigNumber, SparseMatrix":r.referToSelf(d=>(x,v)=>{if(v.density()===1)return o(v,x,d,!0);throw new Error("Root must be non-zero")})},u({scalar:"number | BigNumber",SD:l,Ss:o,sS:!1}));function h(d,x){var v=i.precision,y=i.clone({precision:v+2}),w=new i(0),C=new y(1),b=x.isNegative();if(b&&(x=x.neg()),x.isZero())throw new Error("Root must be non-zero");if(d.isNegative()&&!x.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(d.isZero())return b?new y(1/0):0;if(!d.isFinite())return b?w:d;var A=d.abs().pow(C.div(x));return A=d.isNeg()?A.neg():A,new i((b?C.div(A):A).toPrecision(v))}});var kb="sign",O7=["typed","BigNumber","Fraction","complex"],Rb=T(kb,O7,e=>{var{typed:r,BigNumber:t,complex:n,Fraction:i}=e;return r(kb,{number:Rc,Complex:function(s){return s.im===0?n(Rc(s.re)):s.sign()},BigNumber:function(s){return new t(s.cmp(0))},Fraction:function(s){return new i(s.s,1)},"Array | Matrix":r.referToSelf(a=>s=>Je(s,a,!0)),Unit:r.referToSelf(a=>s=>{if(!s._isDerived()&&s.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return r.find(a,s.valueType())(s.value)})})});var B7="sqrt",I7=["config","typed","Complex"],Lb=T(B7,I7,e=>{var{config:r,typed:t,Complex:n}=e;return t("sqrt",{number:i,Complex:function(s){return s.sqrt()},BigNumber:function(s){return!s.isNegative()||r.predictable?s.sqrt():i(s.toNumber())},Unit:function(s){return s.pow(.5)}});function i(a){return isNaN(a)?NaN:a>=0||r.predictable?Math.sqrt(a):new n(a,0).sqrt()}});var qb="square",P7=["typed"],Ub=T(qb,P7,e=>{var{typed:r}=e;return r(qb,{number:Dv,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})});var zb="subtract",k7=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Wb=T(zb,k7,e=>{var{typed:r,matrix:t,equalScalar:n,subtractScalar:i,unaryMinus:a,DenseMatrix:s,concat:l}=e,f=dn({typed:r}),o=ft({typed:r}),u=So({typed:r,equalScalar:n}),p=Un({typed:r,DenseMatrix:s}),h=Lr({typed:r,DenseMatrix:s}),d=vr({typed:r,matrix:t,concat:l});return r(zb,{"any, any":i},d({elop:i,SS:u,DS:f,SD:o,Ss:h,sS:p}))});var Vb="xgcd",R7=["typed","config","matrix","BigNumber"],Yb=T(Vb,R7,e=>{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r(Vb,{"number, number":function(l,f){var o=Sv(l,f);return t.matrix==="Array"?o:n(o)},"BigNumber, BigNumber":a});function a(s,l){var f,o,u,p=new i(0),h=new i(1),d=p,x=h,v=h,y=p;if(!s.isInt()||!l.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!l.isZero();)o=s.div(l).floor(),u=s.mod(l),f=d,d=x.minus(o.times(d)),x=f,f=v,v=y.minus(o.times(v)),y=f,s=l,l=u;var w;return s.lt(p)?w=[s.neg(),x.neg(),y.neg()]:w=[s,s.isZero()?0:x,y],t.matrix==="Array"?w:n(w)}});var Hb="invmod",L7=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],Gb=T(Hb,L7,e=>{var{typed:r,config:t,BigNumber:n,xgcd:i,equal:a,smaller:s,mod:l,add:f,isInteger:o}=e;return r(Hb,{"number, number":u,"BigNumber, BigNumber":u});function u(p,h){if(!o(p)||!o(h))throw new Error("Parameters in function invmod must be integer numbers");if(p=l(p,h),a(h,0))throw new Error("Divisor must be non zero");var d=i(p,h);d=d.valueOf();var[x,v]=d;return a(x,n(1))?(v=l(v,h),s(v,n(0))&&(v=f(v,h)),v):NaN}});var q7="matAlgo09xS0Sf",U7=["typed","equalScalar"],Wc=T(q7,U7,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var l=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,d=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));var O=l&&h?[]:void 0,F=[],M=[],_=O?[]:void 0,k=[],L,Y,$,V,q;for(Y=0;Y{var{typed:r,matrix:t,equalScalar:n,multiplyScalar:i,concat:a}=e,s=It({typed:r,equalScalar:n}),l=Wc({typed:r,equalScalar:n}),f=Jr({typed:r,equalScalar:n}),o=vr({typed:r,matrix:t,concat:a});return r($b,o({elop:i,SS:l,DS:s,Ss:f}))});function Qb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitAnd");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero()||r.eq(-1)||e.eq(r))return e;if(r.isZero()||e.eq(-1))return r;if(!e.isFinite()||!r.isFinite()){if(!e.isFinite()&&!r.isFinite())return e.isNegative()===r.isNegative()?e:new t(0);if(!e.isFinite())return r.isNegative()?e:e.isNegative()?new t(0):r;if(!r.isFinite())return e.isNegative()?r:r.isNegative()?new t(0):e}return lg(e,r,function(n,i){return n&i})}function uu(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var r=e.constructor,t=r.precision;r.config({precision:1e9});var n=e.plus(new r(1));return n.s=-n.s||null,r.config({precision:t}),n}function Xb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitOr");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);var n=new t(-1);return e.isZero()||r.eq(n)||e.eq(r)?r:r.isZero()||e.eq(n)?e:!e.isFinite()||!r.isFinite()?!e.isFinite()&&!e.isNegative()&&r.isNegative()||e.isNegative()&&!r.isNegative()&&!r.isFinite()?n:e.isNegative()&&r.isNegative()?e.isFinite()?e:r:e.isFinite()?r:e:lg(e,r,function(i,a){return i|a})}function lg(e,r,t){var n=e.constructor,i,a,s=+(e.s<0),l=+(r.s<0);if(s){i=Vc(uu(e));for(var f=0;f0;)t(u[--d],p[--x])===v&&(y=y.plus(w)),w=w.times(C);for(;x>0;)t(h,p[--x])===v&&(y=y.plus(w)),w=w.times(C);return n.config({precision:b}),v===0&&(y.s=-y.s),y}function Vc(e){for(var r=e.d,t=r[0]+"",n=1;n0)if(++l>o)for(l-=o;l--;)f+="0";else l1&&((u[d+1]===null||u[d+1]===void 0)&&(u[d+1]=0),u[d+1]+=u[d]>>1,u[d]&=1)}return u.reverse()}function Jb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitXor");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero())return r;if(r.isZero())return e;if(e.eq(r))return new t(0);var n=new t(-1);return e.eq(n)?uu(r):r.eq(n)?uu(e):!e.isFinite()||!r.isFinite()?!e.isFinite()&&!r.isFinite()?n:new t(e.isNegative()===r.isNegative()?1/0:-1/0):lg(e,r,function(i,a){return i^a})}function Kb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function leftShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:!e.isFinite()&&!r.isFinite()?new t(NaN):r.lt(55)?e.times(Math.pow(2,r.toNumber())+""):e.times(new t(2).pow(r))}function jb(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function rightArithShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:r.isFinite()?r.lt(55)?e.div(Math.pow(2,r.toNumber())+"").floor():e.div(new t(2).pow(r)).floor():e.isNegative()?new t(-1):e.isFinite()?new t(0):new t(NaN)}var ew="bitAnd",W7=["typed","matrix","equalScalar","concat"],Yc=T(ew,W7,e=>{var{typed:r,matrix:t,equalScalar:n,concat:i}=e,a=It({typed:r,equalScalar:n}),s=No({typed:r,equalScalar:n}),l=Jr({typed:r,equalScalar:n}),f=vr({typed:r,matrix:t,concat:i});return r(ew,{"number, number":Av,"BigNumber, BigNumber":Qb},f({SS:s,DS:a,Ss:l}))});var rw="bitNot",V7=["typed"],tw=T(rw,V7,e=>{var{typed:r}=e;return r(rw,{number:Ev,BigNumber:uu,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var nw="bitOr",Y7=["typed","matrix","equalScalar","DenseMatrix","concat"],Hc=T(nw,Y7,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=dn({typed:r}),l=su({typed:r,equalScalar:n}),f=Un({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:t,concat:a});return r(nw,{"number, number":Cv,"BigNumber, BigNumber":Xb},o({SS:l,DS:s,Ss:f}))});var H7="matAlgo07xSSf",G7=["typed","DenseMatrix"],Vt=T(H7,G7,e=>{var{typed:r,DenseMatrix:t}=e;return function(a,s,l){var f=a._size,o=a._datatype||a._data===void 0?a._datatype:a.getDataType(),u=s._size,p=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(f.length!==u.length)throw new pr(f.length,u.length);if(f[0]!==u[0]||f[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+u+")");var h=f[0],d=f[1],x,v=0,y=l;typeof o=="string"&&o===p&&o!=="mixed"&&(x=o,v=r.convert(0,x),y=r.find(l,[x,x]));var w,C,b=[];for(w=0;w{var{typed:r,matrix:t,DenseMatrix:n,concat:i}=e,a=ft({typed:r}),s=Vt({typed:r,DenseMatrix:n}),l=Lr({typed:r,DenseMatrix:n}),f=vr({typed:r,matrix:t,concat:i});return r(iw,{"number, number":Mv,"BigNumber, BigNumber":Jb},f({SS:s,DS:a,Ss:l}))});var ow="arg",Z7=["typed"],sw=T(ow,Z7,e=>{var{typed:r}=e;return r(ow,{number:function(n){return Math.atan2(0,n)},BigNumber:function(n){return n.constructor.atan2(0,n)},Complex:function(n){return n.arg()},"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var uw="conj",Q7=["typed"],fw=T(uw,Q7,e=>{var{typed:r}=e;return r(uw,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.conjugate(),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var lw="im",X7=["typed"],cw=T(lw,X7,e=>{var{typed:r}=e;return r(lw,{number:()=>0,"BigNumber | Fraction":t=>t.mul(0),Complex:t=>t.im,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var pw="re",J7=["typed"],mw=T(pw,J7,e=>{var{typed:r}=e;return r(pw,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.re,"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var hw="not",K7=["typed"],dw=T(hw,K7,e=>{var{typed:r}=e;return r(hw,{"null | undefined":()=>!0,number:Iv,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Je(n,t))})});var vw="or",j7=["typed","matrix","equalScalar","DenseMatrix","concat"],Gc=T(vw,j7,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),l=So({typed:r,equalScalar:n}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:t,concat:a});return r(vw,{"number, number":Pv,"Complex, Complex":function(p,h){return p.re!==0||p.im!==0||h.re!==0||h.im!==0},"BigNumber, BigNumber":function(p,h){return!p.isZero()&&!p.isNaN()||!h.isZero()&&!h.isNaN()},"Unit, Unit":r.referToSelf(u=>(p,h)=>u(p.value||0,h.value||0))},o({SS:l,DS:s,Ss:f}))});var gw="xor",eL=["typed","matrix","DenseMatrix","concat"],xw=T(gw,eL,e=>{var{typed:r,matrix:t,DenseMatrix:n,concat:i}=e,a=ft({typed:r}),s=Vt({typed:r,DenseMatrix:n}),l=Lr({typed:r,DenseMatrix:n}),f=vr({typed:r,matrix:t,concat:i});return r(gw,{"number, number":kv,"Complex, Complex":function(u,p){return(u.re!==0||u.im!==0)!=(p.re!==0||p.im!==0)},"BigNumber, BigNumber":function(u,p){return(!u.isZero()&&!u.isNaN())!=(!p.isZero()&&!p.isNaN())},"Unit, Unit":r.referToSelf(o=>(u,p)=>o(u.value||0,p.value||0))},f({SS:s,DS:a,Ss:l}))});var yw="concat",rL=["typed","matrix","isInteger"],$c=T(yw,rL,e=>{var{typed:r,matrix:t,isInteger:n}=e;return r(yw,{"...Array | Matrix | number | BigNumber":function(a){var s,l=a.length,f=-1,o,u=!1,p=[];for(s=0;s0&&f>o)throw new Xt(f,o+1)}else{var d=tr(h).valueOf(),x=or(d);if(p[s]=d,o=f,f=x.length-1,s>0&&f!==o)throw new pr(o+1,f+1)}}if(p.length===0)throw new SyntaxError("At least one matrix expected");for(var v=p.shift();p.length;)v=$d(v,p.shift(),f);return u?t(v):v},"...string":function(a){return a.join("")}})});var bw="column",tL=["typed","Index","matrix","range"],Zc=T(bw,tL,e=>{var{typed:r,Index:t,matrix:n,range:i}=e;return r(bw,{"Matrix, number":a,"Array, number":function(l,f){return a(n(tr(l)),f).valueOf()}});function a(s,l){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");Xr(l,s.size()[1]);var f=i(0,s.size()[0]),o=new t(f,l),u=s.subset(o);return Ge(u)?u:n([[u]])}});var ww="count",nL=["typed","size","prod"],Dw=T(ww,nL,e=>{var{typed:r,size:t,prod:n}=e;return r(ww,{string:function(a){return a.length},"Matrix | Array":function(a){return n(t(a))}})});var Sw="cross",iL=["typed","matrix","subtract","multiply"],Nw=T(Sw,iL,e=>{var{typed:r,matrix:t,subtract:n,multiply:i}=e;return r(Sw,{"Matrix, Matrix":function(l,f){return t(a(l.toArray(),f.toArray()))},"Matrix, Array":function(l,f){return t(a(l.toArray(),f))},"Array, Matrix":function(l,f){return t(a(l,f.toArray()))},"Array, Array":a});function a(s,l){var f=Math.max(or(s).length,or(l).length);s=Js(s),l=Js(l);var o=or(s),u=or(l);if(o.length!==1||u.length!==1||o[0]!==3||u[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+o.join(", ")+"], B = ["+u.join(", ")+"])");var p=[n(i(s[1],l[2]),i(s[2],l[1])),n(i(s[2],l[0]),i(s[0],l[2])),n(i(s[0],l[1]),i(s[1],l[0]))];return f>1?[p]:p}});var Aw="diag",aL=["typed","matrix","DenseMatrix","SparseMatrix"],Ew=T(Aw,aL,e=>{var{typed:r,matrix:t,DenseMatrix:n,SparseMatrix:i}=e;return r(Aw,{Array:function(o){return a(o,0,or(o),null)},"Array, number":function(o,u){return a(o,u,or(o),null)},"Array, BigNumber":function(o,u){return a(o,u.toNumber(),or(o),null)},"Array, string":function(o,u){return a(o,0,or(o),u)},"Array, number, string":function(o,u,p){return a(o,u,or(o),p)},"Array, BigNumber, string":function(o,u,p){return a(o,u.toNumber(),or(o),p)},Matrix:function(o){return a(o,0,o.size(),o.storage())},"Matrix, number":function(o,u){return a(o,u,o.size(),o.storage())},"Matrix, BigNumber":function(o,u){return a(o,u.toNumber(),o.size(),o.storage())},"Matrix, string":function(o,u){return a(o,0,o.size(),u)},"Matrix, number, string":function(o,u,p){return a(o,u,o.size(),p)},"Matrix, BigNumber, string":function(o,u,p){return a(o,u.toNumber(),o.size(),p)}});function a(f,o,u,p){if(!He(o))throw new TypeError("Second parameter in function diag must be an integer");var h=o>0?o:0,d=o<0?-o:0;switch(u.length){case 1:return s(f,o,p,u[0],d,h);case 2:return l(f,o,p,u,d,h)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function s(f,o,u,p,h,d){var x=[p+h,p+d];if(u&&u!=="sparse"&&u!=="dense")throw new TypeError("Unknown matrix type ".concat(u,'"'));var v=u==="sparse"?i.diagonal(x,f,o):n.diagonal(x,f,o);return u!==null?v:v.valueOf()}function l(f,o,u,p,h,d){if(Ge(f)){var x=f.diagonal(o);return u!==null?u!==x.storage()?t(x,u):x:x.valueOf()}for(var v=Math.min(p[0]-h,p[1]-d),y=[],w=0;w=2&&v.push("index: ".concat(_r(t))),d.length>=3&&v.push("array: ".concat(_r(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(v.join(", "),") at index ").concat(JSON.stringify(t)))}else throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(y.message))}}}var oL="filter",sL=["typed"],Mw=T(oL,sL,e=>{var{typed:r}=e;return r("filter",{"Array, function":Cw,"Matrix, function":function(n,i){return n.create(Cw(n.toArray(),i))},"Array, RegExp":Ks,"Matrix, RegExp":function(n,i){return n.create(Ks(n.toArray(),i))}})});function Cw(e,r){return Nc(e,function(t,n,i){return gi(r,t,[n],i,"filter")})}var _w="flatten",uL=["typed","matrix"],Tw=T(_w,uL,e=>{var{typed:r,matrix:t}=e;return r(_w,{Array:function(i){return gr(i)},Matrix:function(i){var a=gr(i.toArray());return t(a)}})});var Fw="forEach",fL=["typed"],Ow=T(Fw,fL,e=>{var{typed:r}=e;return r(Fw,{"Array, function":lL,"Matrix, function":function(n,i){n.forEach(i)}})});function lL(e,r){var t=function n(i,a){if(Array.isArray(i))ho(i,function(s,l){n(s,a.concat(l))});else return gi(r,i,a,e,"forEach")};t(e,[])}var Bw="getMatrixDataType",cL=["typed"],Iw=T(Bw,cL,e=>{var{typed:r}=e;return r(Bw,{Array:function(n){return vo(n,_r)},Matrix:function(n){return n.getDataType()}})});var Pw="identity",pL=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],kw=T(Pw,pL,e=>{var{typed:r,config:t,matrix:n,BigNumber:i,DenseMatrix:a,SparseMatrix:s}=e;return r(Pw,{"":function(){return t.matrix==="Matrix"?n([]):[]},string:function(u){return n(u)},"number | BigNumber":function(u){return f(u,u,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(u,p){return f(u,u,p)},"number | BigNumber, number | BigNumber":function(u,p){return f(u,p,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(u,p,h){return f(u,p,h)},Array:function(u){return l(u)},"Array, string":function(u,p){return l(u,p)},Matrix:function(u){return l(u.valueOf(),u.storage())},"Matrix, string":function(u,p){return l(u.valueOf(),p)}});function l(o,u){switch(o.length){case 0:return u?n(u):[];case 1:return f(o[0],o[0],u);case 2:return f(o[0],o[1],u);default:throw new Error("Vector containing two values expected")}}function f(o,u,p){var h=je(o)||je(u)?i:null;if(je(o)&&(o=o.toNumber()),je(u)&&(u=u.toNumber()),!He(o)||o<1)throw new Error("Parameters in function identity must be positive integers");if(!He(u)||u<1)throw new Error("Parameters in function identity must be positive integers");var d=h?new i(1):1,x=h?new h(0):0,v=[o,u];if(p){if(p==="sparse")return s.diagonal(v,d,0,x);if(p==="dense")return a.diagonal(v,d,0,x);throw new TypeError('Unknown matrix type "'.concat(p,'"'))}for(var y=Vi([],v,x),w=o{var{typed:r,matrix:t,multiplyScalar:n}=e;return r(Rw,{"Matrix, Matrix":function(s,l){return t(i(s.toArray(),l.toArray()))},"Matrix, Array":function(s,l){return t(i(s.toArray(),l))},"Array, Matrix":function(s,l){return t(i(s,l.toArray()))},"Array, Array":i});function i(a,s){if(or(a).length===1&&(a=[a]),or(s).length===1&&(s=[s]),or(a).length>2||or(s).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(a.length)+", y = "+JSON.stringify(s.length)+")");var l=[],f=[];return a.map(function(o){return s.map(function(u){return f=[],l.push(f),o.map(function(p){return u.map(function(h){return f.push(n(p,h))})})})})&&l}});var qw="map",hL=["typed"],Uw=T(qw,hL,e=>{var{typed:r}=e;return r(qw,{"Array, function":dL,"Matrix, function":function(n,i){return n.map(i)}})});function dL(e,r){var t=function n(i,a){return Array.isArray(i)?i.map(function(s,l){return n(s,a.concat(l))}):gi(r,i,a,e,"map")};return t(e,[])}var zw="diff",vL=["typed","matrix","subtract","number"],Qc=T(zw,vL,e=>{var{typed:r,matrix:t,subtract:n,number:i}=e;return r(zw,{"Array | Matrix":function(u){return Ge(u)?t(s(u.toArray())):s(u)},"Array | Matrix, number":function(u,p){if(!He(p))throw new RangeError("Dimension must be a whole number");return Ge(u)?t(a(u.toArray(),p)):a(u,p)},"Array, BigNumber":r.referTo("Array,number",o=>(u,p)=>o(u,i(p))),"Matrix, BigNumber":r.referTo("Matrix,number",o=>(u,p)=>o(u,i(p)))});function a(o,u){if(Ge(o)&&(o=o.toArray()),!Array.isArray(o))throw RangeError("Array/Matrix does not have that many dimensions");if(u>0){var p=[];return o.forEach(h=>{p.push(a(h,u-1))}),p}else{if(u===0)return s(o);throw RangeError("Cannot have negative dimension")}}function s(o){for(var u=[],p=o.length,h=1;h{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r("ones",{"":function(){return t.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(o){var u=o[o.length-1];if(typeof u=="string"){var p=o.pop();return a(o,p)}else return t.matrix==="Array"?a(o):a(o,"default")},Array:a,Matrix:function(o){var u=o.storage();return a(o.valueOf(),u)},"Array | Matrix, string":function(o,u){return a(o.valueOf(),u)}});function a(f,o){var u=s(f),p=u?new i(1):1;if(l(f),o){var h=n(o);return f.length>0?h.resize(f,p):h}else{var d=[];return f.length>0?Vi(d,f,p):d}}function s(f){var o=!1;return f.forEach(function(u,p,h){je(u)&&(o=!0,h[p]=u.toNumber())}),o}function l(f){f.forEach(function(o){if(typeof o!="number"||!He(o)||o<0)throw new Error("Parameters in function ones must be positive integers")})}});function fu(){throw new Error('No "bignumber" implementation available')}function Xc(){throw new Error('No "fraction" implementation available')}function Jc(){throw new Error('No "matrix" implementation available')}var Vw="range",yL=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Kc=T(Vw,yL,e=>{var{typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:l,largerEq:f,add:o,isPositive:u}=e;return r(Vw,{string:h,"string, boolean":h,"number, number":function(y,w){return p(d(y,w,1,!1))},"number, number, number":function(y,w,C){return p(d(y,w,C,!1))},"number, number, boolean":function(y,w,C){return p(d(y,w,1,C))},"number, number, number, boolean":function(y,w,C,b){return p(d(y,w,C,b))},"BigNumber, BigNumber":function(y,w){var C=y.constructor;return p(d(y,w,new C(1),!1))},"BigNumber, BigNumber, BigNumber":function(y,w,C){return p(d(y,w,C,!1))},"BigNumber, BigNumber, boolean":function(y,w,C){var b=y.constructor;return p(d(y,w,new b(1),C))},"BigNumber, BigNumber, BigNumber, boolean":function(y,w,C,b){return p(d(y,w,C,b))},"Unit, Unit, Unit":function(y,w,C){return p(d(y,w,C,!1))},"Unit, Unit, Unit, boolean":function(y,w,C,b){return p(d(y,w,C,b))}});function p(v){return t.matrix==="Matrix"?n?n(v):Jc():v}function h(v,y){var w=x(v);if(!w)throw new SyntaxError('String "'+v+'" is no valid range');return t.number==="BigNumber"?(i===void 0&&fu(),p(d(i(w.start),i(w.end),i(w.step)),y)):p(d(w.start,w.end,w.step,y))}function d(v,y,w,C){for(var b=[],A=u(w)?C?s:a:C?f:l,E=v;A(E,y);)b.push(E),E=o(E,w);return b}function x(v){var y=v.split(":"),w=y.map(function(b){return Number(b)}),C=w.some(function(b){return isNaN(b)});if(C)return null;switch(w.length){case 2:return{start:w[0],end:w[1],step:1};case 3:return{start:w[0],end:w[2],step:w[1]};default:return null}}});var Yw="reshape",bL=["typed","isInteger","matrix"],Hw=T(Yw,bL,e=>{var{typed:r,isInteger:t}=e;return r(Yw,{"Matrix, Array":function(i,a){return i.reshape(a,!0)},"Array, Array":function(i,a){return a.forEach(function(s){if(!t(s))throw new TypeError("Invalid size for dimension: "+s)}),gf(i,a)}})});var wL="resize",DL=["config","matrix"],Gw=T(wL,DL,e=>{var{config:r,matrix:t}=e;return function(a,s,l){if(arguments.length!==2&&arguments.length!==3)throw new jn("resize",arguments.length,2,3);if(Ge(s)&&(s=s.valueOf()),je(s[0])&&(s=s.map(function(u){return je(u)?u.toNumber():u})),Ge(a))return a.resize(s,l,!0);if(typeof a=="string")return n(a,s,l);var f=Array.isArray(a)?!1:r.matrix!=="Array";if(s.length===0){for(;Array.isArray(a);)a=a[0];return tr(a)}else{Array.isArray(a)||(a=[a]),a=tr(a);var o=Vi(a,s,l);return f?t(o):o}};function n(i,a,s){if(s!==void 0){if(typeof s!="string"||s.length!==1)throw new TypeError("Single character expected as defaultValue")}else s=" ";if(a.length!==1)throw new pr(a.length,1);var l=a[0];if(typeof l!="number"||!He(l))throw new TypeError("Invalid size, must contain positive integers (size: "+lr(a)+")");if(i.length>l)return i.substring(0,l);if(i.length{var{typed:r,multiply:t,rotationMatrix:n}=e;return r($w,{"Array , number | BigNumber | Complex | Unit":function(s,l){i(s,2);var f=t(n(l),s);return f.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(s,l){return i(s,2),t(n(l),s)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(s,l,f){i(s,3);var o=t(n(l,f),s);return o},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(s,l,f){return i(s,3),t(n(l,f),s)}});function i(a,s){var l=Array.isArray(a)?or(a):a.size();if(l.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(l.length===2&&l[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(l[0]!==s)throw new RangeError("Vector must be of dimensions 1x".concat(s))}});var Qw="rotationMatrix",NL=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],Xw=T(Qw,NL,e=>{var{typed:r,config:t,multiplyScalar:n,addScalar:i,unaryMinus:a,norm:s,BigNumber:l,matrix:f,DenseMatrix:o,SparseMatrix:u,cos:p,sin:h}=e;return r(Qw,{"":function(){return t.matrix==="Matrix"?f([]):[]},string:function(b){return f(b)},"number | BigNumber | Complex | Unit":function(b){return d(b,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(b,A){return d(b,A)},"number | BigNumber | Complex | Unit, Array":function(b,A){var E=f(A);return x(E),w(b,E,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(b,A){x(A);var E=A.storage()||(t.matrix==="Matrix"?"dense":void 0);return w(b,A,E)},"number | BigNumber | Complex | Unit, Array, string":function(b,A,E){var S=f(A);return x(S),w(b,S,E)},"number | BigNumber | Complex | Unit, Matrix, string":function(b,A,E){return x(A),w(b,A,E)}});function d(C,b){var A=je(C),E=A?new l(-1):-1,S=p(C),O=h(C),F=[[S,n(E,O)],[O,S]];return y(F,b)}function x(C){var b=C.size();if(b.length<1||b[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function v(C){return C.reduce((b,A)=>n(b,A))}function y(C,b){if(b){if(b==="sparse")return new u(C);if(b==="dense")return new o(C);throw new TypeError('Unknown matrix type "'.concat(b,'"'))}return C}function w(C,b,A){var E=s(b);if(E===0)throw new RangeError("Rotation around zero vector");var S=je(C)?l:null,O=S?new S(1):1,F=S?new S(-1):-1,M=S?new S(b.get([0])/E):b.get([0])/E,_=S?new S(b.get([1])/E):b.get([1])/E,k=S?new S(b.get([2])/E):b.get([2])/E,L=p(C),Y=i(O,a(L)),$=h(C),V=i(L,v([M,M,Y])),q=i(v([M,_,Y]),v([F,k,$])),R=i(v([M,k,Y]),v([_,$])),j=i(v([M,_,Y]),v([k,$])),U=i(L,v([_,_,Y])),oe=i(v([_,k,Y]),v([F,M,$])),me=i(v([M,k,Y]),v([F,_,$])),ie=i(v([_,k,Y]),v([M,$])),H=i(L,v([k,k,Y])),ce=[[V,q,R],[j,U,oe],[me,ie,H]];return y(ce,A)}});var Jw="row",AL=["typed","Index","matrix","range"],jc=T(Jw,AL,e=>{var{typed:r,Index:t,matrix:n,range:i}=e;return r(Jw,{"Matrix, number":a,"Array, number":function(l,f){return a(n(tr(l)),f).valueOf()}});function a(s,l){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");Xr(l,s.size()[0]);var f=i(0,s.size()[1]),o=new t(l,f),u=s.subset(o);return Ge(u)?u:n([[u]])}});var Kw="size",EL=["typed","config","?matrix"],jw=T(Kw,EL,e=>{var{typed:r,config:t,matrix:n}=e;return r(Kw,{Matrix:function(a){return a.create(a.size())},Array:or,string:function(a){return t.matrix==="Array"?[a.length]:n([a.length])},"number | Complex | BigNumber | Unit | boolean | null":function(a){return t.matrix==="Array"?[]:n?n([]):Jc()}})});var eD="squeeze",CL=["typed","matrix"],rD=T(eD,CL,e=>{var{typed:r,matrix:t}=e;return r(eD,{Array:function(i){return Js(tr(i))},Matrix:function(i){var a=Js(i.toArray());return Array.isArray(a)?t(a):a},any:function(i){return tr(i)}})});var tD="subset",ML=["typed","matrix","zeros","add"],ep=T(tD,ML,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e;return r(tD,{"Matrix, Index":function(l,f){return jo(f)?t():(vf(l,f),l.subset(f))},"Array, Index":r.referTo("Matrix, Index",function(s){return function(l,f){var o=s(t(l),f);return f.isScalar()?o:o.valueOf()}}),"Object, Index":TL,"string, Index":_L,"Matrix, Index, any, any":function(l,f,o,u){return jo(f)?l:(vf(l,f),l.clone().subset(f,a(o,f),u))},"Array, Index, any, any":r.referTo("Matrix, Index, any, any",function(s){return function(l,f,o,u){var p=s(t(l),f,o,u);return p.isMatrix?p.valueOf():p}}),"Array, Index, any":r.referTo("Matrix, Index, any, any",function(s){return function(l,f,o){return s(t(l),f,o,void 0).valueOf()}}),"Matrix, Index, any":r.referTo("Matrix, Index, any, any",function(s){return function(l,f,o){return s(l,f,o,void 0)}}),"string, Index, string":nD,"string, Index, string, string":nD,"Object, Index, any":FL});function a(s,l){if(typeof s=="string")throw new Error("can't boradcast a string");if(l._isScalar)return s;var f=l.size();if(f.every(o=>o>0))try{return i(s,n(f))}catch{return s}else return s}});function _L(e,r){if(!ua(r))throw new TypeError("Index expected");if(jo(r))return"";if(vf(Array.from(e),r),r.size().length!==1)throw new pr(r.size().length,1);var t=e.length;Xr(r.min()[0],t),Xr(r.max()[0],t);var n=r.dimension(0),i="";return n.forEach(function(a){i+=e.charAt(a)}),i}function nD(e,r,t,n){if(!r||r.isIndex!==!0)throw new TypeError("Index expected");if(jo(r))return e;if(vf(Array.from(e),r),r.size().length!==1)throw new pr(r.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=r.dimension(0),a=i.size()[0];if(a!==t.length)throw new pr(i.size()[0],t.length);var s=e.length;Xr(r.min()[0]),Xr(r.max()[0]);for(var l=[],f=0;fs)for(var o=s-1,u=l.length;o{var{typed:r,matrix:t}=e;return r(iD,{Array:s=>n(t(s)).valueOf(),Matrix:n,any:tr});function n(s){var l=s.size(),f;switch(l.length){case 1:f=s.clone();break;case 2:{var o=l[0],u=l[1];if(u===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+lr(l)+")");switch(s.storage()){case"dense":f=i(s,o,u);break;case"sparse":f=a(s,o,u);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+lr(l)+")")}return f}function i(s,l,f){for(var o=s._data,u=[],p,h=0;h{var{typed:r,transpose:t,conj:n}=e;return r(oD,{any:function(a){return n(t(a))}})});var uD="zeros",IL=["typed","config","matrix","BigNumber"],fD=T(uD,IL,e=>{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r(uD,{"":function(){return t.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(o){var u=o[o.length-1];if(typeof u=="string"){var p=o.pop();return a(o,p)}else return t.matrix==="Array"?a(o):a(o,"default")},Array:a,Matrix:function(o){var u=o.storage();return a(o.valueOf(),u)},"Array | Matrix, string":function(o,u){return a(o.valueOf(),u)}});function a(f,o){var u=s(f),p=u?new i(0):0;if(l(f),o){var h=n(o);return f.length>0?h.resize(f,p):h}else{var d=[];return f.length>0?Vi(d,f,p):d}}function s(f){var o=!1;return f.forEach(function(u,p,h){je(u)&&(o=!0,h[p]=u.toNumber())}),o}function l(f){f.forEach(function(o){if(typeof o!="number"||!He(o)||o<0)throw new Error("Parameters in function zeros must be positive integers")})}});var lD="fft",PL=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],cD=T(lD,PL,e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:i,divideScalar:a,exp:s,tau:l,i:f,dotDivide:o,conj:u,pow:p,ceil:h,log2:d}=e;return r(lD,{Array:x,Matrix:function(b){return b.create(x(b.toArray()))}});function x(C){var b=or(C);return b.length===1?w(C,b[0]):v(C.map(A=>x(A,b.slice(1))),0)}function v(C,b){var A=or(C);if(b!==0)return new Array(A[0]).fill(0).map((S,O)=>v(C[O],b-1));if(A.length===1)return w(C);function E(S){var O=or(S);return new Array(O[1]).fill(0).map((F,M)=>new Array(O[0]).fill(0).map((_,k)=>S[k][M]))}return E(v(E(C),1))}function y(C){for(var b=C.length,A=s(a(i(-1,i(f,l)),b)),E=[],S=1-b;Si(C[R],E[b-1+R])),...new Array(O-b).fill(0)],M=[...new Array(b+b-1).fill(0).map((q,R)=>a(1,E[R])),...new Array(O-(b+b-1)).fill(0)],_=w(F),k=w(M),L=new Array(O).fill(0).map((q,R)=>i(_[R],k[R])),Y=o(u(x(u(L))),O),$=[],V=b-1;VM%2===0),b/2),...w(C.filter((F,M)=>M%2===1),b/2)],E=0;E{var{typed:r,fft:t,dotDivide:n,conj:i}=e;return r(pD,{"Array | Matrix":function(s){var l=Ge(s)?s.size():or(s);return n(i(t(i(s))),l.reduce((f,o)=>f*o,1))}})});function hD(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function RL(e){for(var r=1;r{var{typed:r,add:t,subtract:n,multiply:i,divide:a,max:s,map:l,abs:f,isPositive:o,isNegative:u,larger:p,smaller:h,matrix:d,bignumber:x,unaryMinus:v}=e;function y(F){return function(M,_,k,L){var Y=!(_.length===2&&(_.every(S)||_.every(qt)));if(Y)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var $=_[0],V=_[1],q=p(V,$),R=L.firstStep;if(R!==void 0&&!o(R))throw new Error('"firstStep" must be positive');var j=L.maxStep;if(j!==void 0&&!o(j))throw new Error('"maxStep" must be positive');var U=L.minStep;if(U&&u(U))throw new Error('"minStep" must be positive or zero');var oe=[$,V,R,U,j].filter(Le=>Le!==void 0);if(!(oe.every(S)||oe.every(qt)))throw new Error('Inconsistent type of "t" dependant variables');for(var me=1,ie=L.tol?L.tol:1e-4,H=L.minDelta?L.minDelta:.2,ce=L.maxDelta?L.maxDelta:5,Me=L.maxIter?L.maxIter:1e4,pe=[$,V,...k,j,U].some(je),[ge,Se,xe,be]=pe?[x(F.a),x(F.c),x(F.b),x(F.bp)]:[F.a,F.c,F.b,F.bp],De=R?q?R:v(R):a(n(V,$),me),Ae=[$],ze=[k],Ze=n(xe,be),K=0,te=0,ye=A(q),ee=E(q);ye(Ae[K],V);){var ne=[];De=ee(Ae[K],V,De),ne.push(M(Ae[K],ze[K]));for(var ue=1;ueqt(Le)?Le.value:Le)));Ee1/4&&(Ae.push(t(Ae[K],De)),ze.push(t(ze[K],i(De,xe,ne))),K++);var Ce=.84*(ie/Ee)**(1/5);if(h(Ce,H)?Ce=H:p(Ce,ce)&&(Ce=ce),Ce=pe?x(Ce):Ce,De=i(De,Ce),j&&p(f(De),j)?De=q?j:v(j):U&&h(f(De),U)&&(De=q?U:v(U)),te++,te>Me)throw new Error("Maximum number of iterations reached, try changing options")}return{t:Ae,y:ze}}}function w(F,M,_,k){var L=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],Y=[null,1/2,3/4,1],$=[2/9,1/3,4/9,0],V=[7/24,1/4,1/3,1/8],q={a:L,c:Y,b:$,bp:V};return y(q)(F,M,_,k)}function C(F,M,_,k){var L=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],Y=[null,1/5,3/10,4/5,8/9,1,1],$=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],V=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],q={a:L,c:Y,b:$,bp:V};return y(q)(F,M,_,k)}function b(F,M,_,k){var L=k.method?k.method:"RK45",Y={RK23:w,RK45:C};if(L.toUpperCase()in Y){var $=RL({},k);return delete $.method,Y[L.toUpperCase()](F,M,_,$)}else{var V=Object.keys(Y).map(R=>'"'.concat(R,'"')),q="".concat(V.slice(0,-1).join(", ")," and ").concat(V.slice(-1));throw new Error('Unavailable method "'.concat(L,'". Available methods are ').concat(q))}}function A(F){return F?h:p}function E(F){var M=F?p:h;return function(_,k,L){var Y=t(_,L);return M(Y,k)?n(k,_):L}}function S(F){return je(F)||ar(F)}function O(F,M,_,k){var L=b(F,M.toArray(),_.toArray(),k);return{t:d(L.t),y:d(L.y)}}return r("solveODE",{"function, Array, Array, Object":b,"function, Matrix, Matrix, Object":O,"function, Array, Array":(F,M,_)=>b(F,M,_,{}),"function, Matrix, Matrix":(F,M,_)=>O(F,M,_,{}),"function, Array, number | BigNumber | Unit":(F,M,_)=>{var k=b(F,M,[_],{});return{t:k.t,y:k.y.map(L=>L[0])}},"function, Matrix, number | BigNumber | Unit":(F,M,_)=>{var k=b(F,M.toArray(),[_],{});return{t:d(k.t),y:d(k.y.map(L=>L[0]))}},"function, Array, number | BigNumber | Unit, Object":(F,M,_,k)=>{var L=b(F,M,[_],k);return{t:L.t,y:L.y.map(Y=>Y[0])}},"function, Matrix, number | BigNumber | Unit, Object":(F,M,_,k)=>{var L=b(F,M.toArray(),[_],k);return{t:d(L.t),y:d(L.y.map(Y=>Y[0]))}}})});var UL="erf",zL=["typed"],vD=T(UL,zL,e=>{var{typed:r}=e;return r("name",{number:function(s){var l=Math.abs(s);return l>=YL?hi(s):l<=WL?hi(s)*t(l):l<=4?hi(s)*(1-n(l)):hi(s)*(1-i(l))},"Array | Matrix":r.referToSelf(a=>s=>Je(s,a))});function t(a){var s=a*a,l=qa[0][4]*s,f=s,o;for(o=0;o<3;o+=1)l=(l+qa[0][o])*s,f=(f+lu[0][o])*s;return a*(l+qa[0][3])/(f+lu[0][3])}function n(a){var s=qa[1][8]*a,l=a,f;for(f=0;f<7;f+=1)s=(s+qa[1][f])*a,l=(l+lu[1][f])*a;var o=(s+qa[1][7])/(l+lu[1][7]),u=parseInt(a*16)/16,p=(a-u)*(a+u);return Math.exp(-u*u)*Math.exp(-p)*o}function i(a){var s=1/(a*a),l=qa[2][5]*s,f=s,o;for(o=0;o<4;o+=1)l=(l+qa[2][o])*s,f=(f+lu[2][o])*s;var u=s*(l+qa[2][4])/(f+lu[2][4]);u=(VL-u)/a,s=parseInt(a*16)/16;var p=(a-s)*(a+s);return Math.exp(-s*s)*Math.exp(-p)*u}}),WL=.46875,VL=.5641895835477563,qa=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],lu=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],YL=Math.pow(2,53);var gD="zeta",HL=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],xD=T(gD,HL,e=>{var{typed:r,config:t,multiply:n,pow:i,divide:a,factorial:s,equal:l,smallerEq:f,isNegative:o,gamma:u,sin:p,subtract:h,add:d,Complex:x,BigNumber:v,pi:y}=e;return r(gD,{number:S=>w(S,O=>O,()=>20),BigNumber:S=>w(S,O=>new v(O),()=>Math.abs(Math.log10(t.epsilon))),Complex:C});function w(S,O,F){return l(S,0)?O(-.5):l(S,1)?O(NaN):isFinite(S)?b(S,O,F,M=>M):o(S)?O(NaN):O(1)}function C(S){return S.re===0&&S.im===0?new x(-.5):S.re===1?new x(NaN,NaN):S.re===1/0&&S.im===0?new x(1):S.im===1/0||S.re===-1/0?new x(NaN,NaN):b(S,O=>O,O=>Math.round(1.3*15+.9*Math.abs(O.im)),O=>O.re)}function b(S,O,F,M){var _=F(S);if(M(S)>-(_-1)/2)return E(S,O(_),O);var k=n(i(2,S),i(O(y),h(S,1)));return k=n(k,p(n(a(O(y),2),S))),k=n(k,u(h(1,S))),n(k,b(h(1,S),O,F,M))}function A(S,O){for(var F=S,M=S;f(M,O);M=d(M,1)){var _=a(n(s(d(O,h(M,1))),i(4,M)),n(s(h(O,M)),s(n(2,M))));F=d(F,_)}return n(O,F)}function E(S,O,F){for(var M=a(1,n(A(F(0),O),h(1,i(2,h(1,S))))),_=F(0),k=F(1);f(k,O);k=d(k,1))_=d(_,a(n((-1)**(k-1),A(k,O)),i(k,S)));return n(M,_)}});var yD="mode",GL=["typed","isNaN","isNumeric"],bD=T(yD,GL,e=>{var{typed:r,isNaN:t,isNumeric:n}=e;return r(yD,{"Array | Matrix":i,"...":function(s){return i(s)}});function i(a){a=gr(a.valueOf());var s=a.length;if(s===0)throw new Error("Cannot calculate mode of an empty array");for(var l={},f=[],o=0,u=0;uo&&(o=l[p],f=[p])}return f}});function St(e,r,t){var n;return String(e).indexOf("Unexpected type")!==-1?(n=arguments.length>2?" (type: "+_r(t)+", value: "+JSON.stringify(t)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+r+", unexpected type of argument"+n)):String(e).indexOf("complex numbers")!==-1?(n=arguments.length>2?" (type: "+_r(t)+", value: "+JSON.stringify(t)+")":"",new TypeError("Cannot calculate "+r+", no ordering relation is defined for complex numbers"+n)):e}var wD="prod",$L=["typed","config","multiplyScalar","numeric"],DD=T(wD,$L,e=>{var{typed:r,config:t,multiplyScalar:n,numeric:i}=e;return r(wD,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(l,f){throw new Error("prod(A, dim) is not yet supported")},"...":function(l){return a(l)}});function a(s){var l;if(hn(s,function(f){try{l=l===void 0?f:n(l,f)}catch(o){throw St(o,"prod",f)}}),typeof l=="string"&&(l=i(l,t.number)),l===void 0)throw new Error("Cannot calculate prod of an empty array");return l}});var SD="format",ZL=["typed"],ND=T(SD,ZL,e=>{var{typed:r}=e;return r(SD,{any:lr,"any, Object | function | number | BigNumber":lr})});var AD="bin",QL=["typed","format"],ED=T(AD,QL,e=>{var{typed:r,format:t}=e;return r(AD,{"number | BigNumber":function(i){return t(i,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"bin",wordSize:a})}})});var CD="oct",XL=["typed","format"],MD=T(CD,XL,e=>{var{typed:r,format:t}=e;return r(CD,{"number | BigNumber":function(i){return t(i,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"oct",wordSize:a})}})});var _D="hex",JL=["typed","format"],TD=T(_D,JL,e=>{var{typed:r,format:t}=e;return r(_D,{"number | BigNumber":function(i){return t(i,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"hex",wordSize:a})}})});var rp=/\\$([\\w.]+)/g;var FD="print",KL=["typed"],tp=T(FD,KL,e=>{var{typed:r}=e;return r(FD,{"string, Object | Array":OD,"string, Object | Array, number | Object":OD})});function OD(e,r,t){return e.replace(rp,function(n,i){var a=i.split("."),s=r[a.shift()];for(s!==void 0&&s.isMatrix&&(s=s.toArray());a.length&&s!==void 0;){var l=a.shift();s=l?s[l]:s+"."}return s!==void 0?yt(s)?s:lr(s,t):n})}var BD="to",jL=["typed","matrix","concat"],ID=T(BD,jL,e=>{var{typed:r,matrix:t,concat:n}=e,i=vr({typed:r,matrix:t,concat:n});return r(BD,{"Unit, Unit | string":(a,s)=>a.to(s)},i({Ds:!0}))});var PD="isPrime",eq=["typed"],kD=T(PD,eq,e=>{var{typed:r}=e;return r(PD,{number:function(n){if(n*0!==0)return!1;if(n<=3)return n>1;if(n%2===0||n%3===0)return!1;for(var i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0},BigNumber:function(n){if(n.toNumber()*0!==0)return!1;if(n.lte(3))return n.gt(1);if(n.mod(2).eq(0)||n.mod(3).eq(0))return!1;if(n.lt(Math.pow(2,32))){for(var i=n.toNumber(),a=5;a*a<=i;a+=6)if(i%a===0||i%(a+2)===0)return!1;return!0}function s(C,b,A){for(var E=1;!b.eq(0);)b.mod(2).eq(0)?(b=b.div(2),C=C.mul(C).mod(A)):(b=b.sub(1),E=C.mul(E).mod(A));return E}var l=n.constructor.clone({precision:n.toFixed(0).length*2});n=new l(n);for(var f=0,o=n.sub(1);o.mod(2).eq(0);)o=o.div(2),f+=1;var u=null;if(n.lt("3317044064679887385961981"))u=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(C=>Cn=>Je(n,t))})});var rq="numeric",tq=["number","?bignumber","?fraction"],RD=T(rq,tq,e=>{var{number:r,bignumber:t,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:s=>r(s),BigNumber:t?s=>t(s):fu,Fraction:n?s=>n(s):Xc};return function(l){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",o=arguments.length>2?arguments[2]:void 0;if(o!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var u=_r(l);if(!(u in i))throw new TypeError("Cannot convert "+l+' of type "'+u+'"; valid input types are '+Object.keys(i).join(", "));if(!(f in a))throw new TypeError("Cannot convert "+l+' to type "'+f+'"; valid output types are '+Object.keys(a).join(", "));return f===u?l:a[f](l)}});var LD="divideScalar",nq=["typed","numeric"],qD=T(LD,nq,e=>{var{typed:r,numeric:t}=e;return r(LD,{"number, number":function(i,a){return i/a},"Complex, Complex":function(i,a){return i.div(a)},"BigNumber, BigNumber":function(i,a){return i.div(a)},"Fraction, Fraction":function(i,a){return i.div(a)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})});var UD="pow",iq=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],zD=T(UD,iq,e=>{var{typed:r,config:t,identity:n,multiply:i,matrix:a,inv:s,number:l,fraction:f,Complex:o}=e;return r(UD,{"number, number":u,"Complex, Complex":function(x,v){return x.pow(v)},"BigNumber, BigNumber":function(x,v){return v.isInteger()||x>=0||t.predictable?x.pow(v):new o(x.toNumber(),0).pow(v.toNumber(),0)},"Fraction, Fraction":function(x,v){var y=x.pow(v);if(y!=null)return y;if(t.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return u(x.valueOf(),v.valueOf())},"Array, number":p,"Array, BigNumber":function(x,v){return p(x,v.toNumber())},"Matrix, number":h,"Matrix, BigNumber":function(x,v){return h(x,v.toNumber())},"Unit, number | BigNumber":function(x,v){return x.pow(v)}});function u(d,x){if(t.predictable&&!He(x)&&d<0)try{var v=f(x),y=l(v);if((x===y||Math.abs((x-y)/x)<1e-14)&&v.d%2===1)return(v.n%2===0?1:-1)*Math.pow(-d,x)}catch{}return t.predictable&&(d<-1&&x===1/0||d>-1&&d<0&&x===-1/0)?NaN:He(x)||d>=0||t.predictable?Nv(d,x):d*d<1&&x===1/0||d*d>1&&x===-1/0?0:new o(d,0).pow(x,0)}function p(d,x){if(!He(x))throw new TypeError("For A^b, b must be an integer (value is "+x+")");var v=or(d);if(v.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+v.length+" dimensions)");if(v[0]!==v[1])throw new Error("For A^b, A must be square (size is "+v[0]+"x"+v[1]+")");if(x<0)try{return p(s(d),-x)}catch(C){throw C.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+x+")"):C}for(var y=n(v[0]).valueOf(),w=d;x>=1;)(x&1)===1&&(y=i(w,y)),x>>=1,w=i(w,w);return y}function h(d,x){return a(p(d.valueOf(),x))}});var cu="Number of decimals in function round must be an integer",WD="round",aq=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],VD=T(WD,aq,e=>{var{typed:r,config:t,matrix:n,equalScalar:i,zeros:a,BigNumber:s,DenseMatrix:l}=e,f=Jr({typed:r,equalScalar:i}),o=Lr({typed:r,DenseMatrix:l}),u=Bt({typed:r});function p(h){return Math.abs(Xs(h).exponent)}return r(WD,{number:function(d){var x=iu(d,p(t.epsilon)),v=wt(d,x,t.epsilon)?x:d;return iu(v)},"number, number":function(d,x){var v=p(t.epsilon);if(x>=v)return iu(d,x);var y=iu(d,v),w=wt(d,y,t.epsilon)?y:d;return iu(w,x)},"number, BigNumber":function(d,x){if(!x.isInteger())throw new TypeError(cu);return new s(d).toDecimalPlaces(x.toNumber())},Complex:function(d){return d.round()},"Complex, number":function(d,x){if(x%1)throw new TypeError(cu);return d.round(x)},"Complex, BigNumber":function(d,x){if(!x.isInteger())throw new TypeError(cu);var v=x.toNumber();return d.round(v)},BigNumber:function(d){var x=new s(d).toDecimalPlaces(p(t.epsilon)),v=Ut(d,x,t.epsilon)?x:d;return v.toDecimalPlaces(0)},"BigNumber, BigNumber":function(d,x){if(!x.isInteger())throw new TypeError(cu);var v=p(t.epsilon);if(x>=v)return d.toDecimalPlaces(x.toNumber());var y=d.toDecimalPlaces(v),w=Ut(d,y,t.epsilon)?y:d;return w.toDecimalPlaces(x.toNumber())},Fraction:function(d){return d.round()},"Fraction, number":function(d,x){if(x%1)throw new TypeError(cu);return d.round(x)},"Fraction, BigNumber":function(d,x){if(!x.isInteger())throw new TypeError(cu);return d.round(x.toNumber())},"Unit, number, Unit":r.referToSelf(h=>function(d,x,v){var y=d.toNumeric(v);return v.multiply(h(y,x))}),"Unit, BigNumber, Unit":r.referToSelf(h=>(d,x,v)=>h(d,x.toNumber(),v)),"Unit, Unit":r.referToSelf(h=>(d,x)=>h(d,0,x)),"Array | Matrix, number, Unit":r.referToSelf(h=>(d,x,v)=>Je(d,y=>h(y,x,v),!0)),"Array | Matrix, BigNumber, Unit":r.referToSelf(h=>(d,x,v)=>h(d,x.toNumber(),v)),"Array | Matrix, Unit":r.referToSelf(h=>(d,x)=>h(d,0,x)),"Array | Matrix":r.referToSelf(h=>d=>Je(d,h,!0)),"SparseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>f(d,x,h,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(h=>(d,x)=>u(d,x,h,!1)),"Array, number | BigNumber":r.referToSelf(h=>(d,x)=>u(n(d),x,h,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":r.referToSelf(h=>(d,x)=>i(d,0)?a(x.size(),x.storage()):o(x,d,h,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":r.referToSelf(h=>(d,x)=>i(d,0)?a(x.size(),x.storage()):u(x,d,h,!0)),"number | Complex | BigNumber | Fraction, Array":r.referToSelf(h=>(d,x)=>u(n(x),d,h,!0).valueOf())})});var YD="log",oq=["config","typed","divideScalar","Complex"],HD=T(YD,oq,e=>{var{typed:r,config:t,divideScalar:n,Complex:i}=e;return r(YD,{number:function(s){return s>=0||t.predictable?c1(s):new i(s,0).log()},Complex:function(s){return s.log()},BigNumber:function(s){return!s.isNegative()||t.predictable?s.ln():new i(s.toNumber(),0).log()},"any, any":r.referToSelf(a=>(s,l)=>n(a(s),a(l)))})});var GD="log1p",sq=["typed","config","divideScalar","log","Complex"],$D=T(GD,sq,e=>{var{typed:r,config:t,divideScalar:n,log:i,Complex:a}=e;return r(GD,{number:function(f){return f>=-1||t.predictable?xc(f):s(new a(f,0))},Complex:s,BigNumber:function(f){var o=f.plus(1);return!o.isNegative()||t.predictable?o.ln():s(new a(f.toNumber(),0))},"Array | Matrix":r.referToSelf(l=>f=>Je(f,l)),"any, any":r.referToSelf(l=>(f,o)=>n(l(f),i(o)))});function s(l){var f=l.re+1;return new a(Math.log(Math.sqrt(f*f+l.im*l.im)),Math.atan2(l.im,f))}});var ZD="nthRoots",uq=["config","typed","divideScalar","Complex"],QD=T(ZD,uq,e=>{var{typed:r,config:t,divideScalar:n,Complex:i}=e,a=[function(f){return new i(f,0)},function(f){return new i(0,f)},function(f){return new i(-f,0)},function(f){return new i(0,-f)}];function s(l,f){if(f<0)throw new Error("Root must be greater than zero");if(f===0)throw new Error("Root must be non-zero");if(f%1!==0)throw new Error("Root must be an integer");if(l===0||l.abs()===0)return[new i(0,0)];var o=typeof l=="number",u;(o||l.re===0||l.im===0)&&(o?u=2*+(l<0):l.im===0?u=2*+(l.re<0):u=2*+(l.im<0)+1);for(var p=l.arg(),h=l.abs(),d=[],x=Math.pow(h,1/f),v=0;v{var{typed:r,equalScalar:t,matrix:n,pow:i,DenseMatrix:a,concat:s}=e,l=ft({typed:r}),f=Vt({typed:r,DenseMatrix:a}),o=Jr({typed:r,equalScalar:t}),u=Lr({typed:r,DenseMatrix:a}),p=vr({typed:r,matrix:n,concat:s}),h={};for(var d in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,d)&&!d.includes("Matrix")&&!d.includes("Array")&&(h[d]=i.signatures[d]);var x=r(h);return r(XD,p({elop:x,SS:f,DS:l,Ss:o,sS:u}))});var KD="dotDivide",lq=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],jD=T(KD,lq,e=>{var{typed:r,matrix:t,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:s}=e,l=It({typed:r,equalScalar:n}),f=ft({typed:r}),o=Vt({typed:r,DenseMatrix:a}),u=Jr({typed:r,equalScalar:n}),p=Lr({typed:r,DenseMatrix:a}),h=vr({typed:r,matrix:t,concat:s});return r(KD,h({elop:i,SS:o,DS:f,SD:l,Ss:u,sS:p}))});function ha(e){var{DenseMatrix:r}=e;return function(n,i,a){var s=n.size();if(s.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+lr(s)+")");var l=s[0],f=s[1];if(l!==f)throw new RangeError("Matrix must be square (size: "+lr(s)+")");var o=[];if(Ge(i)){var u=i.size(),p=i._data;if(u.length===1){if(u[0]!==l)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var h=0;h{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:l}=e,f=ha({DenseMatrix:l});return r(eS,{"SparseMatrix, Array | Matrix":function(h,d){return u(h,d)},"DenseMatrix, Array | Matrix":function(h,d){return o(h,d)},"Array, Array | Matrix":function(h,d){var x=t(h),v=o(x,d);return v.valueOf()}});function o(p,h){h=f(p,h,!0);for(var d=h._data,x=p._size[0],v=p._size[1],y=[],w=p._data,C=0;CA&&(O.push(y[k]),F.push(L))}if(s(S,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var Y=n(E,S),$=0,V=F.length;${var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:l}=e,f=ha({DenseMatrix:l});return r(tS,{"SparseMatrix, Array | Matrix":function(h,d){return u(h,d)},"DenseMatrix, Array | Matrix":function(h,d){return o(h,d)},"Array, Array | Matrix":function(h,d){var x=t(h),v=o(x,d);return v.valueOf()}});function o(p,h){h=f(p,h,!0);for(var d=h._data,x=p._size[0],v=p._size[1],y=[],w=p._data,C=v-1;C>=0;C--){var b=d[C][0]||0,A=void 0;if(s(b,0))A=0;else{var E=w[C][C];if(s(E,0))throw new Error("Linear system cannot be solved since matrix is singular");A=n(b,E);for(var S=C-1;S>=0;S--)d[S]=[a(d[S][0]||0,i(A,w[S][C]))]}y[C]=[A]}return new l({data:y,size:[x,1]})}function u(p,h){h=f(p,h,!0);for(var d=h._data,x=p._size[0],v=p._size[1],y=p._values,w=p._index,C=p._ptr,b=[],A=v-1;A>=0;A--){var E=d[A][0]||0;if(s(E,0))b[A]=[0];else{for(var S=0,O=[],F=[],M=C[A],_=C[A+1],k=_-1;k>=M;k--){var L=w[k];L===A?S=y[k]:L{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:l}=e,f=ha({DenseMatrix:l});return r(iS,{"SparseMatrix, Array | Matrix":function(h,d){return u(h,d)},"DenseMatrix, Array | Matrix":function(h,d){return o(h,d)},"Array, Array | Matrix":function(h,d){var x=t(h),v=o(x,d);return v.map(y=>y.valueOf())}});function o(p,h){for(var d=[f(p,h,!0)._data.map(F=>F[0])],x=p._data,v=p._size[0],y=p._size[1],w=0;wnew l({data:F.map(M=>[M]),size:[v,1]}))}function u(p,h){for(var d=[f(p,h,!0)._data.map(me=>me[0])],x=p._size[0],v=p._size[1],y=p._values,w=p._index,C=p._ptr,b=0;bb&&(O.push(y[L]),F.push(Y))}if(s(k,0))if(s(S[b],0)){if(E===0){var R=[...S];R[b]=1;for(var j=0,U=F.length;jnew l({data:me.map(ie=>[ie]),size:[x,1]}))}});var oS="usolveAll",hq=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],sS=T(oS,hq,e=>{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:l}=e,f=ha({DenseMatrix:l});return r(oS,{"SparseMatrix, Array | Matrix":function(h,d){return u(h,d)},"DenseMatrix, Array | Matrix":function(h,d){return o(h,d)},"Array, Array | Matrix":function(h,d){var x=t(h),v=o(x,d);return v.map(y=>y.valueOf())}});function o(p,h){for(var d=[f(p,h,!0)._data.map(F=>F[0])],x=p._data,v=p._size[0],y=p._size[1],w=y-1;w>=0;w--)for(var C=d.length,b=0;b=0;O--)S[O]=a(S[O],x[O][w]);d.push(S)}}else{if(b===0)return[];d.splice(b,1),b-=1,C-=1}else{A[w]=n(A[w],x[w][w]);for(var E=w-1;E>=0;E--)A[E]=a(A[E],i(A[w],x[E][w]))}}return d.map(F=>new l({data:F.map(M=>[M]),size:[v,1]}))}function u(p,h){for(var d=[f(p,h,!0)._data.map(me=>me[0])],x=p._size[0],v=p._size[1],y=p._values,w=p._index,C=p._ptr,b=v-1;b>=0;b--)for(var A=d.length,E=0;E=M;L--){var Y=w[L];Y===b?k=y[L]:Ynew l({data:me.map(ie=>[ie]),size:[x,1]}))}});var dq="matAlgo08xS0Sid",vq=["typed","equalScalar"],pu=T(dq,vq,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var l=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,d=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new pr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");if(!l||!h)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var w=u[0],C=u[1],b,A=t,E=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),E=r.convert(0,b),S=r.find(s,[b,b]));for(var O=[],F=[],M=[],_=[],k=[],L,Y,$,V,q=0;q{var{typed:r,matrix:t}=e;return{"Array, number":r.referTo("DenseMatrix, number",n=>(i,a)=>n(t(i),a).valueOf()),"Array, BigNumber":r.referTo("DenseMatrix, BigNumber",n=>(i,a)=>n(t(i),a).valueOf()),"number, Array":r.referTo("number, DenseMatrix",n=>(i,a)=>n(i,t(a)).valueOf()),"BigNumber, Array":r.referTo("BigNumber, DenseMatrix",n=>(i,a)=>n(i,t(a)).valueOf())}});var uS="leftShift",gq=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],fS=T(uS,gq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,l=dn({typed:r}),f=It({typed:r,equalScalar:n}),o=pu({typed:r,equalScalar:n}),u=Un({typed:r,DenseMatrix:a}),p=Jr({typed:r,equalScalar:n}),h=Bt({typed:r}),d=vr({typed:r,matrix:t,concat:s}),x=mu({typed:r,matrix:t});return r(uS,{"number, number":_v,"BigNumber, BigNumber":Kb,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():h(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):h(w,y,v,!0))},x,d({SS:o,DS:l,SD:f}))});var lS="rightArithShift",xq=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],cS=T(lS,xq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,l=dn({typed:r}),f=It({typed:r,equalScalar:n}),o=pu({typed:r,equalScalar:n}),u=Un({typed:r,DenseMatrix:a}),p=Jr({typed:r,equalScalar:n}),h=Bt({typed:r}),d=vr({typed:r,matrix:t,concat:s}),x=mu({typed:r,matrix:t});return r(lS,{"number, number":Tv,"BigNumber, BigNumber":jb,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():h(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):h(w,y,v,!0))},x,d({SS:o,DS:l,SD:f}))});var pS="rightLogShift",yq=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],mS=T(pS,yq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,l=dn({typed:r}),f=It({typed:r,equalScalar:n}),o=pu({typed:r,equalScalar:n}),u=Un({typed:r,DenseMatrix:a}),p=Jr({typed:r,equalScalar:n}),h=Bt({typed:r}),d=vr({typed:r,matrix:t,concat:s}),x=mu({typed:r,matrix:t});return r(pS,{"number, number":Fv,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():h(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):h(w,y,v,!0))},x,d({SS:o,DS:l,SD:f}))});var hS="and",bq=["typed","matrix","equalScalar","zeros","not","concat"],np=T(hS,bq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,l=It({typed:r,equalScalar:n}),f=No({typed:r,equalScalar:n}),o=Jr({typed:r,equalScalar:n}),u=Bt({typed:r}),p=vr({typed:r,matrix:t,concat:s});return r(hS,{"number, number":Rv,"Complex, Complex":function(d,x){return(d.re!==0||d.im!==0)&&(x.re!==0||x.im!==0)},"BigNumber, BigNumber":function(d,x){return!d.isZero()&&!x.isZero()&&!d.isNaN()&&!x.isNaN()},"Unit, Unit":r.referToSelf(h=>(d,x)=>h(d.value||0,x.value||0)),"SparseMatrix, any":r.referToSelf(h=>(d,x)=>a(x)?i(d.size(),d.storage()):o(d,x,h,!1)),"DenseMatrix, any":r.referToSelf(h=>(d,x)=>a(x)?i(d.size(),d.storage()):u(d,x,h,!1)),"any, SparseMatrix":r.referToSelf(h=>(d,x)=>a(d)?i(d.size(),d.storage()):o(x,d,h,!0)),"any, DenseMatrix":r.referToSelf(h=>(d,x)=>a(d)?i(d.size(),d.storage()):u(x,d,h,!0)),"Array, any":r.referToSelf(h=>(d,x)=>h(t(d),x).valueOf()),"any, Array":r.referToSelf(h=>(d,x)=>h(d,t(x)).valueOf())},p({SS:f,DS:l}))});var ip="compare",wq=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],dS=T(ip,wq,e=>{var{typed:r,config:t,equalScalar:n,matrix:i,BigNumber:a,Fraction:s,DenseMatrix:l,concat:f}=e,o=ft({typed:r}),u=So({typed:r,equalScalar:n}),p=Lr({typed:r,DenseMatrix:l}),h=vr({typed:r,matrix:i,concat:f}),d=vi({typed:r});return r(ip,Dq({typed:r,config:t}),{"boolean, boolean":function(v,y){return v===y?0:v>y?1:-1},"BigNumber, BigNumber":function(v,y){return Ut(v,y,t.epsilon)?new a(0):new a(v.cmp(y))},"Fraction, Fraction":function(v,y){return new s(v.compare(y))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},d,h({SS:u,DS:o,Ss:p}))}),Dq=T(ip,["typed","config"],e=>{var{typed:r,config:t}=e;return r(ip,{"number, number":function(i,a){return wt(i,a,t.epsilon)?0:i>a?1:-1}})});var as=ci(gS(),1);var xS="compareNatural",Sq=["typed","compare"],yS=T(xS,Sq,e=>{var{typed:r,compare:t}=e,n=t.signatures["boolean,boolean"];return r(xS,{"any, any":i});function i(f,o){var u=_r(f),p=_r(o),h;if((u==="number"||u==="BigNumber"||u==="Fraction")&&(p==="number"||p==="BigNumber"||p==="Fraction"))return h=t(f,o),h.toString()!=="0"?h>0?1:-1:(0,as.default)(u,p);var d=["Array","DenseMatrix","SparseMatrix"];if(d.includes(u)||d.includes(p))return h=a(i,f,o),h!==0?h:(0,as.default)(u,p);if(u!==p)return(0,as.default)(u,p);if(u==="Complex")return Nq(f,o);if(u==="Unit")return f.equalBase(o)?i(f.value,o.value):s(i,f.formatUnits(),o.formatUnits());if(u==="boolean")return n(f,o);if(u==="string")return(0,as.default)(f,o);if(u==="Object")return l(i,f,o);if(u==="null"||u==="undefined")return 0;throw new TypeError('Unsupported type of value "'+u+'"')}function a(f,o,u){return Jn(o)&&Jn(u)?s(f,o.toJSON().values,u.toJSON().values):Jn(o)?a(f,o.toArray(),u):Jn(u)?a(f,o,u.toArray()):Ia(o)?a(f,o.toJSON().data,u):Ia(u)?a(f,o,u.toJSON().data):Array.isArray(o)?Array.isArray(u)?s(f,o,u):a(f,o,[u]):a(f,[o],u)}function s(f,o,u){for(var p=0,h=Math.min(o.length,u.length);pu.length?1:o.lengthr.re?1:e.rer.im?1:e.im{var{typed:r,matrix:t,concat:n}=e,i=vr({typed:r,matrix:t,concat:n});return r(bS,Dc,i({elop:Dc,Ds:!0}))});var ap="equal",Eq=["typed","matrix","equalScalar","DenseMatrix","concat"],DS=T(ap,Eq,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),l=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:t,concat:a});return r(ap,Cq({typed:r,equalScalar:n}),o({elop:n,SS:l,DS:s,Ss:f}))}),Cq=T(ap,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(ap,{"any, any":function(i,a){return i===null?a===null:a===null?i===null:i===void 0?a===void 0:a===void 0?i===void 0:t(i,a)}})});var SS="equalText",Mq=["typed","compareText","isZero"],NS=T(SS,Mq,e=>{var{typed:r,compareText:t,isZero:n}=e;return r(SS,{"any, any":function(a,s){return n(t(a,s))}})});var op="smaller",_q=["typed","config","matrix","DenseMatrix","concat"],AS=T(op,_q,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),l=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=vi({typed:r});return r(op,Tq({typed:r,config:t}),{"boolean, boolean":(p,h)=>pp.compare(h)===-1,"Complex, Complex":function(h,d){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:l,DS:s,Ss:f}))}),Tq=T(op,["typed","config"],e=>{var{typed:r,config:t}=e;return r(op,{"number, number":function(i,a){return i{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),l=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=vi({typed:r});return r(sp,Oq({typed:r,config:t}),{"boolean, boolean":(p,h)=>p<=h,"BigNumber, BigNumber":function(h,d){return h.lte(d)||Ut(h,d,t.epsilon)},"Fraction, Fraction":(p,h)=>p.compare(h)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:l,DS:s,Ss:f}))}),Oq=T(sp,["typed","config"],e=>{var{typed:r,config:t}=e;return r(sp,{"number, number":function(i,a){return i<=a||wt(i,a,t.epsilon)}})});var up="larger",Bq=["typed","config","matrix","DenseMatrix","concat"],CS=T(up,Bq,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),l=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=vi({typed:r});return r(up,Iq({typed:r,config:t}),{"boolean, boolean":(p,h)=>p>h,"BigNumber, BigNumber":function(h,d){return h.gt(d)&&!Ut(h,d,t.epsilon)},"Fraction, Fraction":(p,h)=>p.compare(h)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:l,DS:s,Ss:f}))}),Iq=T(up,["typed","config"],e=>{var{typed:r,config:t}=e;return r(up,{"number, number":function(i,a){return i>a&&!wt(i,a,t.epsilon)}})});var fp="largerEq",Pq=["typed","config","matrix","DenseMatrix","concat"],MS=T(fp,Pq,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=ft({typed:r}),l=Vt({typed:r,DenseMatrix:i}),f=Lr({typed:r,DenseMatrix:i}),o=vr({typed:r,matrix:n,concat:a}),u=vi({typed:r});return r(fp,kq({typed:r,config:t}),{"boolean, boolean":(p,h)=>p>=h,"BigNumber, BigNumber":function(h,d){return h.gte(d)||Ut(h,d,t.epsilon)},"Fraction, Fraction":(p,h)=>p.compare(h)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:l,DS:s,Ss:f}))}),kq=T(fp,["typed","config"],e=>{var{typed:r,config:t}=e;return r(fp,{"number, number":function(i,a){return i>=a||wt(i,a,t.epsilon)}})});var _S="deepEqual",Rq=["typed","equal"],TS=T(_S,Rq,e=>{var{typed:r,equal:t}=e;return r(_S,{"any, any":function(a,s){return n(a.valueOf(),s.valueOf())}});function n(i,a){if(Array.isArray(i))if(Array.isArray(a)){var s=i.length;if(s!==a.length)return!1;for(var l=0;l{var{typed:r,config:t,equalScalar:n,matrix:i,DenseMatrix:a,concat:s}=e,l=ft({typed:r}),f=Vt({typed:r,DenseMatrix:a}),o=Lr({typed:r,DenseMatrix:a}),u=vr({typed:r,matrix:i,concat:s});return r(lp,qq({typed:r,equalScalar:n}),u({elop:p,SS:f,DS:l,Ss:o}));function p(h,d){return!n(h,d)}}),qq=T(lp,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(lp,{"any, any":function(i,a){return i===null?a!==null:a===null?i!==null:i===void 0?a!==void 0:a===void 0?i!==void 0:!t(i,a)}})});var OS="partitionSelect",Uq=["typed","isNumeric","isNaN","compare"],BS=T(OS,Uq,e=>{var{typed:r,isNumeric:t,isNaN:n,compare:i}=e,a=i,s=(o,u)=>-i(o,u);return r(OS,{"Array | Matrix, number":function(u,p){return l(u,p,a)},"Array | Matrix, number, string":function(u,p,h){if(h==="asc")return l(u,p,a);if(h==="desc")return l(u,p,s);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":l});function l(o,u,p){if(!He(u)||u<0)throw new Error("k must be a non-negative integer");if(Ge(o)){var h=o.size();if(h.length>1)throw new Error("Only one dimensional matrices supported");return f(o.valueOf(),u,p)}if(Array.isArray(o))return f(o,u,p)}function f(o,u,p){if(u>=o.length)throw new Error("k out of bounds");for(var h=0;h=0){var C=o[y];o[y]=o[v],o[v]=C,--y}else++v;p(o[v],w)>0&&--v,u<=v?x=v:d=v+1}return o[u]}});var IS="sort",zq=["typed","matrix","compare","compareNatural"],PS=T(IS,zq,e=>{var{typed:r,matrix:t,compare:n,compareNatural:i}=e,a=n,s=(u,p)=>-n(u,p);return r(IS,{Array:function(p){return f(p),p.sort(a)},Matrix:function(p){return o(p),t(p.toArray().sort(a),p.storage())},"Array, function":function(p,h){return f(p),p.sort(h)},"Matrix, function":function(p,h){return o(p),t(p.toArray().sort(h),p.storage())},"Array, string":function(p,h){return f(p),p.sort(l(h))},"Matrix, string":function(p,h){return o(p),t(p.toArray().sort(l(h)),p.storage())}});function l(u){if(u==="asc")return a;if(u==="desc")return s;if(u==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function f(u){if(or(u).length!==1)throw new Error("One dimensional array expected")}function o(u){if(u.size().length!==1)throw new Error("One dimensional matrix expected")}});var kS="max",Wq=["typed","config","numeric","larger"],cp=T(kS,Wq,e=>{var{typed:r,config:t,numeric:n,larger:i}=e;return r(kS,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(f,o){return Do(f,o.valueOf(),a)},"...":function(f){if(di(f))throw new TypeError("Scalar values expected in function max");return s(f)}});function a(l,f){try{return i(l,f)?l:f}catch(o){throw St(o,"max",f)}}function s(l){var f;if(hn(l,function(o){try{isNaN(o)&&typeof o=="number"?f=NaN:(f===void 0||i(o,f))&&(f=o)}catch(u){throw St(u,"max",o)}}),f===void 0)throw new Error("Cannot calculate max of an empty array");return typeof f=="string"&&(f=n(f,t.number)),f}});var RS="min",Vq=["typed","config","numeric","smaller"],pp=T(RS,Vq,e=>{var{typed:r,config:t,numeric:n,smaller:i}=e;return r(RS,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(f,o){return Do(f,o.valueOf(),a)},"...":function(f){if(di(f))throw new TypeError("Scalar values expected in function min");return s(f)}});function a(l,f){try{return i(l,f)?l:f}catch(o){throw St(o,"min",f)}}function s(l){var f;if(hn(l,function(o){try{isNaN(o)&&typeof o=="number"?f=NaN:(f===void 0||i(o,f))&&(f=o)}catch(u){throw St(u,"min",o)}}),f===void 0)throw new Error("Cannot calculate min of an empty array");return typeof f=="string"&&(f=n(f,t.number)),f}});var Yq="ImmutableDenseMatrix",Hq=["smaller","DenseMatrix"],LS=T(Yq,Hq,e=>{var{smaller:r,DenseMatrix:t}=e;function n(i,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!yt(a))throw new Error("Invalid datatype: "+a);if(Ge(i)||Ar(i)){var s=new t(i,a);this._data=s._data,this._size=s._size,this._datatype=s._datatype,this._min=null,this._max=null}else if(i&&Ar(i.data)&&Ar(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+_r(i)+")");this._data=[],this._size=[0],this._datatype=a,this._min=null,this._max=null}}return n.prototype=new t,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var a=t.prototype.subset.call(this,i);return Ge(a)?new n({data:a._data,size:a._size,datatype:a._datatype}):a}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:tr(this._data),size:tr(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(a){(i===null||r(a,i))&&(i=a)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(a){(i===null||r(i,a))&&(i=a)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0});var Gq="Index",$q=["ImmutableDenseMatrix","getMatrixDataType"],US=T(Gq,$q,e=>{var{ImmutableDenseMatrix:r,getMatrixDataType:t}=e;function n(a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var s=0,l=arguments.length;s{t&&r.push(n)}),r}var Zq="FibonacciHeap",Qq=["smaller","larger"],zS=T(Zq,Qq,e=>{var{smaller:r,larger:t}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(u,p){var h={key:u,value:p,degree:0};if(this._minimum){var d=this._minimum;h.left=d,h.right=d.right,d.right=h,h.right.left=h,r(u,d.key)&&(this._minimum=h)}else h.left=h,h.right=h,this._minimum=h;return this._size++,h},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var u=this._minimum;if(u===null)return u;for(var p=this._minimum,h=u.degree,d=u.child;h>0;){var x=d.right;d.left.right=d.right,d.right.left=d.left,d.left=p,d.right=p.right,p.right=d,d.right.left=d,d.parent=null,d=x,h--}return u.left.right=u.right,u.right.left=u.left,u===u.right?p=null:(p=u.right,p=o(p,this._size)),this._size--,this._minimum=p,u},i.prototype.remove=function(u){this._minimum=a(this._minimum,u,-1),this.extractMinimum()};function a(u,p,h){p.key=h;var d=p.parent;return d&&r(p.key,d.key)&&(s(u,p,d),l(u,d)),r(p.key,u.key)&&(u=p),u}function s(u,p,h){p.left.right=p.right,p.right.left=p.left,h.degree--,h.child===p&&(h.child=p.right),h.degree===0&&(h.child=null),p.left=u,p.right=u.right,u.right=p,p.right.left=p,p.parent=null,p.mark=!1}function l(u,p){var h=p.parent;!h||(p.mark?(s(u,p,h),l(h)):p.mark=!0)}var f=function(p,h){p.left.right=p.right,p.right.left=p.left,p.parent=h,h.child?(p.left=h.child,p.right=h.child.right,h.child.right=p,p.right.left=p):(h.child=p,p.right=p,p.left=p),h.degree++,p.mark=!1};function o(u,p){var h=Math.floor(Math.log(p)*n)+1,d=new Array(h),x=0,v=u;if(v)for(x++,v=v.right;v!==u;)x++,v=v.right;for(var y;x>0;){for(var w=v.degree,C=v.right;y=d[w],!!y;){if(t(v.key,y.key)){var b=y;y=v,v=b}f(y,v),d[w]=null,w++}d[w]=v,v=C,x--}u=null;for(var A=0;A{var{addScalar:r,equalScalar:t,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(a,s){if(this._values[a])this._values[a].value=s;else{var l=this._heap.insert(a,s);this._values[a]=l}},i.prototype.get=function(a){var s=this._values[a];return s?s.value:0},i.prototype.accumulate=function(a,s){var l=this._values[a];l?l.value=r(l.value,s):(l=this._heap.insert(a,s),this._values[a]=l)},i.prototype.forEach=function(a,s,l){var f=this._heap,o=this._values,u=[],p=f.extractMinimum();for(p&&u.push(p);p&&p.key<=s;)p.key>=a&&(t(p.value,0)||l(p.key,p.value,this)),p=f.extractMinimum(),p&&u.push(p);for(var h=0;h{var{on:r,config:t,addScalar:n,subtractScalar:i,multiplyScalar:a,divideScalar:s,pow:l,abs:f,fix:o,round:u,equal:p,isNumeric:h,format:d,number:x,Complex:v,BigNumber:y,Fraction:w}=e,C=x;function b(K,te){if(!(this instanceof b))throw new Error("Constructor must be called with the new operator");if(!(K==null||h(K)||Gt(K)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,te===void 0)this.units=[],this.dimensions=j.map(ee=>0);else if(typeof te=="string"){var ye=b.parse(te);this.units=ye.units,this.dimensions=ye.dimensions}else if(qt(te)&&te.value===null)this.fixPrefix=te.fixPrefix,this.skipAutomaticSimplification=te.skipAutomaticSimplification,this.dimensions=te.dimensions.slice(0),this.units=te.units.map(ee=>Mt({},ee));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(K)}Object.defineProperty(b,"name",{value:"Unit"}),b.prototype.constructor=b,b.prototype.type="Unit",b.prototype.isUnit=!0;var A,E,S;function O(){for(;S===" "||S===" ";)_()}function F(K){return K>="0"&&K<="9"||K==="."}function M(K){return K>="0"&&K<="9"}function _(){E++,S=A.charAt(E)}function k(K){E=K,S=A.charAt(E)}function L(){var K="",te=E;if(S==="+"?_():S==="-"&&(K+=S,_()),!F(S))return k(te),null;if(S==="."){if(K+=S,_(),!M(S))return k(te),null}else{for(;M(S);)K+=S,_();S==="."&&(K+=S,_())}for(;M(S);)K+=S,_();if(S==="E"||S==="e"){var ye="",ee=E;if(ye+=S,_(),(S==="+"||S==="-")&&(ye+=S,_()),!M(S))return k(ee),K;for(K=K+ye;M(S);)K+=S,_()}return K}function Y(){for(var K="";M(S)||b.isValidAlpha(S);)K+=S,_();var te=K.charAt(0);return b.isValidAlpha(te)?K:null}function $(K){return S===K?(_(),K):null}b.parse=function(K,te){if(te=te||{},A=K,E=-1,S="",typeof A!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var ye=new b;ye.units=[];var ee=1,ne=!1;_(),O();var ue=L(),Ee=null;if(ue){if(t.number==="BigNumber")Ee=new y(ue);else if(t.number==="Fraction")try{Ee=new w(ue)}catch{Ee=parseFloat(ue)}else Ee=parseFloat(ue);O(),$("*")?(ee=1,ne=!0):$("/")&&(ee=-1,ne=!0)}for(var Ce=[],Le=1;;){for(O();S==="(";)Ce.push(ee),Le*=ee,ee=1,_(),O();var Ie=void 0;if(S){var sr=S;if(Ie=Y(),Ie===null)throw new SyntaxError('Unexpected "'+sr+'" in "'+A+'" at index '+E.toString())}else break;var ir=V(Ie);if(ir===null)throw new SyntaxError('Unit "'+Ie+'" not found.');var Xe=ee*Le;if(O(),$("^")){O();var Or=L();if(Or===null)throw new SyntaxError('In "'+K+'", "^" must be followed by a floating-point number');Xe*=Or}ye.units.push({unit:ir.unit,prefix:ir.prefix,power:Xe});for(var re=0;re1||Math.abs(this.units[0].power-1)>1e-15},b.prototype._normalize=function(K){if(K==null||this.units.length===0)return K;for(var te=K,ye=b._getNumberConverter(_r(K)),ee=0;ee{if($e(H,K)){var te=H[K],ye=te.prefixes[""];return{unit:te,prefix:ye}}for(var ee in H)if($e(H,ee)&&by(K,ee)){var ne=H[ee],ue=K.length-ee.length,Ee=K.substring(0,ue),Ce=$e(ne.prefixes,Ee)?ne.prefixes[Ee]:void 0;if(Ce!==void 0)return{unit:ne,prefix:Ce}}return null},{hasher:K=>K[0],limit:100});b.isValuelessUnit=function(K){return V(K)!==null},b.prototype.hasBase=function(K){if(typeof K=="string"&&(K=U[K]),!K)return!1;for(var te=0;te1e-12)return!1;return!0},b.prototype.equalBase=function(K){for(var te=0;te1e-12)return!1;return!0},b.prototype.equals=function(K){return this.equalBase(K)&&p(this.value,K.value)},b.prototype.multiply=function(K){for(var te=this.clone(),ye=qt(K)?K:new b(K),ee=0;ee1e-12&&($e(ge,Ce)?te.push({unit:ge[Ce].unit,prefix:ge[Ce].prefix,power:K.dimensions[Ee]||0}):ue=!0)}te.length1e-12)if($e(pe.si,ee))te.push({unit:pe.si[ee].unit,prefix:pe.si[ee].prefix,power:K.dimensions[ye]||0});else throw new Error("Cannot express custom unit "+ee+" in SI units")}return K.units=te,K.fixPrefix=!0,K.skipAutomaticSimplification=!0,this.value!==null?(K.value=null,this.to(K)):K},b.prototype.formatUnits=function(){for(var K="",te="",ye=0,ee=0,ne=0;ne0?(ye++,K+=" "+this.units[ne].prefix.name+this.units[ne].unit.name,Math.abs(this.units[ne].power-1)>1e-15&&(K+="^"+this.units[ne].power)):this.units[ne].power<0&&ee++;if(ee>0)for(var ue=0;ue0?(te+=" "+this.units[ue].prefix.name+this.units[ue].unit.name,Math.abs(this.units[ue].power+1)>1e-15&&(te+="^"+-this.units[ue].power)):(te+=" "+this.units[ue].prefix.name+this.units[ue].unit.name,te+="^"+this.units[ue].power));K=K.substr(1),te=te.substr(1),ye>1&&ee>0&&(K="("+K+")"),ee>1&&ye>0&&(te="("+te+")");var Ee=K;return ye>0&&ee>0&&(Ee+=" / "),Ee+=te,Ee},b.prototype.format=function(K){var te=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),ye=!1;typeof te.value<"u"&&te.value!==null&&Gt(te.value)&&(ye=Math.abs(te.value.re)<1e-14);for(var ee in te.units)$e(te.units,ee)&&te.units[ee].unit&&(te.units[ee].unit.name==="VA"&&ye?te.units[ee].unit=H.VAR:te.units[ee].unit.name==="VAR"&&!ye&&(te.units[ee].unit=H.VA));te.units.length===1&&!te.fixPrefix&&Math.abs(te.units[0].power-Math.round(te.units[0].power))<1e-14&&(te.units[0].prefix=te._bestPrefix());var ne=te._denormalize(te.value),ue=te.value!==null?d(ne,K||{}):"",Ee=te.formatUnits();return te.value&&Gt(te.value)&&(ue="("+ue+")"),Ee.length>0&&ue.length>0&&(ue+=" "),ue+=Ee,ue},b.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var K=this.value!==null?f(this.value):0,te=f(this.units[0].unit.value),ye=this.units[0].prefix;if(K===0)return ye;var ee=this.units[0].power,ne=Math.log(K/Math.pow(ye.value*te,ee))/Math.LN10-1.2;if(ne>-2.200001&&ne<1.800001)return ye;ne=Math.abs(ne);var ue=this.units[0].unit.prefixes;for(var Ee in ue)if($e(ue,Ee)){var Ce=ue[Ee];if(Ce.scientific){var Le=Math.abs(Math.log(K/Math.pow(Ce.value*te,ee))/Math.LN10-1.2);(Le0)},H={meter:{name:"meter",base:U.LENGTH,prefixes:R.LONG,value:1,offset:0},inch:{name:"inch",base:U.LENGTH,prefixes:R.NONE,value:.0254,offset:0},foot:{name:"foot",base:U.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yard:{name:"yard",base:U.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mile:{name:"mile",base:U.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},link:{name:"link",base:U.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rod:{name:"rod",base:U.LENGTH,prefixes:R.NONE,value:5.0292,offset:0},chain:{name:"chain",base:U.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:U.LENGTH,prefixes:R.NONE,value:1e-10,offset:0},m:{name:"m",base:U.LENGTH,prefixes:R.SHORT,value:1,offset:0},in:{name:"in",base:U.LENGTH,prefixes:R.NONE,value:.0254,offset:0},ft:{name:"ft",base:U.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yd:{name:"yd",base:U.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mi:{name:"mi",base:U.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},li:{name:"li",base:U.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rd:{name:"rd",base:U.LENGTH,prefixes:R.NONE,value:5.02921,offset:0},ch:{name:"ch",base:U.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},mil:{name:"mil",base:U.LENGTH,prefixes:R.NONE,value:254e-7,offset:0},m2:{name:"m2",base:U.SURFACE,prefixes:R.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:U.SURFACE,prefixes:R.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:U.SURFACE,prefixes:R.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:U.SURFACE,prefixes:R.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:U.SURFACE,prefixes:R.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:U.SURFACE,prefixes:R.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:U.SURFACE,prefixes:R.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:U.SURFACE,prefixes:R.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:U.SURFACE,prefixes:R.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:U.SURFACE,prefixes:R.NONE,value:1e4,offset:0},m3:{name:"m3",base:U.VOLUME,prefixes:R.CUBIC,value:1,offset:0},L:{name:"L",base:U.VOLUME,prefixes:R.SHORT,value:.001,offset:0},l:{name:"l",base:U.VOLUME,prefixes:R.SHORT,value:.001,offset:0},litre:{name:"litre",base:U.VOLUME,prefixes:R.LONG,value:.001,offset:0},cuin:{name:"cuin",base:U.VOLUME,prefixes:R.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:U.VOLUME,prefixes:R.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:U.VOLUME,prefixes:R.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:U.VOLUME,prefixes:R.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:U.VOLUME,prefixes:R.NONE,value:15e-6,offset:0},drop:{name:"drop",base:U.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:U.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},minim:{name:"minim",base:U.VOLUME,prefixes:R.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:U.VOLUME,prefixes:R.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:U.VOLUME,prefixes:R.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:U.VOLUME,prefixes:R.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:U.VOLUME,prefixes:R.NONE,value:1e-6,offset:0},cup:{name:"cup",base:U.VOLUME,prefixes:R.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:U.VOLUME,prefixes:R.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:U.VOLUME,prefixes:R.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:U.VOLUME,prefixes:R.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:U.VOLUME,prefixes:R.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:U.VOLUME,prefixes:R.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:U.VOLUME,prefixes:R.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:U.VOLUME,prefixes:R.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:U.VOLUME,prefixes:R.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:U.VOLUME,prefixes:R.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:U.VOLUME,prefixes:R.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:U.VOLUME,prefixes:R.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:U.VOLUME,prefixes:R.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:U.VOLUME,prefixes:R.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:U.VOLUME,prefixes:R.NONE,value:.1173478,offset:0},obl:{name:"obl",base:U.VOLUME,prefixes:R.NONE,value:.1589873,offset:0},g:{name:"g",base:U.MASS,prefixes:R.SHORT,value:.001,offset:0},gram:{name:"gram",base:U.MASS,prefixes:R.LONG,value:.001,offset:0},ton:{name:"ton",base:U.MASS,prefixes:R.SHORT,value:907.18474,offset:0},t:{name:"t",base:U.MASS,prefixes:R.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:U.MASS,prefixes:R.LONG,value:1e3,offset:0},grain:{name:"grain",base:U.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:U.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:U.MASS,prefixes:R.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:U.MASS,prefixes:R.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:U.MASS,prefixes:R.NONE,value:45.359237,offset:0},stick:{name:"stick",base:U.MASS,prefixes:R.NONE,value:.115,offset:0},stone:{name:"stone",base:U.MASS,prefixes:R.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:U.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:U.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:U.MASS,prefixes:R.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:U.MASS,prefixes:R.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:U.MASS,prefixes:R.NONE,value:45.359237,offset:0},s:{name:"s",base:U.TIME,prefixes:R.SHORT,value:1,offset:0},min:{name:"min",base:U.TIME,prefixes:R.NONE,value:60,offset:0},h:{name:"h",base:U.TIME,prefixes:R.NONE,value:3600,offset:0},second:{name:"second",base:U.TIME,prefixes:R.LONG,value:1,offset:0},sec:{name:"sec",base:U.TIME,prefixes:R.LONG,value:1,offset:0},minute:{name:"minute",base:U.TIME,prefixes:R.NONE,value:60,offset:0},hour:{name:"hour",base:U.TIME,prefixes:R.NONE,value:3600,offset:0},day:{name:"day",base:U.TIME,prefixes:R.NONE,value:86400,offset:0},week:{name:"week",base:U.TIME,prefixes:R.NONE,value:7*86400,offset:0},month:{name:"month",base:U.TIME,prefixes:R.NONE,value:2629800,offset:0},year:{name:"year",base:U.TIME,prefixes:R.NONE,value:31557600,offset:0},decade:{name:"decade",base:U.TIME,prefixes:R.NONE,value:315576e3,offset:0},century:{name:"century",base:U.TIME,prefixes:R.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:U.TIME,prefixes:R.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:U.FREQUENCY,prefixes:R.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:U.FREQUENCY,prefixes:R.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:U.ANGLE,prefixes:R.SHORT,value:1,offset:0},radian:{name:"radian",base:U.ANGLE,prefixes:R.LONG,value:1,offset:0},deg:{name:"deg",base:U.ANGLE,prefixes:R.SHORT,value:null,offset:0},degree:{name:"degree",base:U.ANGLE,prefixes:R.LONG,value:null,offset:0},grad:{name:"grad",base:U.ANGLE,prefixes:R.SHORT,value:null,offset:0},gradian:{name:"gradian",base:U.ANGLE,prefixes:R.LONG,value:null,offset:0},cycle:{name:"cycle",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},A:{name:"A",base:U.CURRENT,prefixes:R.SHORT,value:1,offset:0},ampere:{name:"ampere",base:U.CURRENT,prefixes:R.LONG,value:1,offset:0},K:{name:"K",base:U.TEMPERATURE,prefixes:R.SHORT,value:1,offset:0},degC:{name:"degC",base:U.TEMPERATURE,prefixes:R.SHORT,value:1,offset:273.15},degF:{name:"degF",base:U.TEMPERATURE,prefixes:R.SHORT,value:new w(5,9),offset:459.67},degR:{name:"degR",base:U.TEMPERATURE,prefixes:R.SHORT,value:new w(5,9),offset:0},kelvin:{name:"kelvin",base:U.TEMPERATURE,prefixes:R.LONG,value:1,offset:0},celsius:{name:"celsius",base:U.TEMPERATURE,prefixes:R.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:U.TEMPERATURE,prefixes:R.LONG,value:new w(5,9),offset:459.67},rankine:{name:"rankine",base:U.TEMPERATURE,prefixes:R.LONG,value:new w(5,9),offset:0},mol:{name:"mol",base:U.AMOUNT_OF_SUBSTANCE,prefixes:R.SHORT,value:1,offset:0},mole:{name:"mole",base:U.AMOUNT_OF_SUBSTANCE,prefixes:R.LONG,value:1,offset:0},cd:{name:"cd",base:U.LUMINOUS_INTENSITY,prefixes:R.SHORT,value:1,offset:0},candela:{name:"candela",base:U.LUMINOUS_INTENSITY,prefixes:R.LONG,value:1,offset:0},N:{name:"N",base:U.FORCE,prefixes:R.SHORT,value:1,offset:0},newton:{name:"newton",base:U.FORCE,prefixes:R.LONG,value:1,offset:0},dyn:{name:"dyn",base:U.FORCE,prefixes:R.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:U.FORCE,prefixes:R.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:U.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:U.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:U.FORCE,prefixes:R.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:U.FORCE,prefixes:R.NONE,value:9.80665,offset:0},J:{name:"J",base:U.ENERGY,prefixes:R.SHORT,value:1,offset:0},joule:{name:"joule",base:U.ENERGY,prefixes:R.LONG,value:1,offset:0},erg:{name:"erg",base:U.ENERGY,prefixes:R.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:U.ENERGY,prefixes:R.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:U.ENERGY,prefixes:R.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:U.ENERGY,prefixes:R.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:U.ENERGY,prefixes:R.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:U.POWER,prefixes:R.SHORT,value:1,offset:0},watt:{name:"watt",base:U.POWER,prefixes:R.LONG,value:1,offset:0},hp:{name:"hp",base:U.POWER,prefixes:R.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:U.POWER,prefixes:R.SHORT,value:v.I,offset:0},VA:{name:"VA",base:U.POWER,prefixes:R.SHORT,value:1,offset:0},Pa:{name:"Pa",base:U.PRESSURE,prefixes:R.SHORT,value:1,offset:0},psi:{name:"psi",base:U.PRESSURE,prefixes:R.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:U.PRESSURE,prefixes:R.NONE,value:101325,offset:0},bar:{name:"bar",base:U.PRESSURE,prefixes:R.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:U.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:U.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:U.PRESSURE,prefixes:R.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:U.PRESSURE,prefixes:R.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:U.ELECTRIC_CHARGE,prefixes:R.LONG,value:1,offset:0},C:{name:"C",base:U.ELECTRIC_CHARGE,prefixes:R.SHORT,value:1,offset:0},farad:{name:"farad",base:U.ELECTRIC_CAPACITANCE,prefixes:R.LONG,value:1,offset:0},F:{name:"F",base:U.ELECTRIC_CAPACITANCE,prefixes:R.SHORT,value:1,offset:0},volt:{name:"volt",base:U.ELECTRIC_POTENTIAL,prefixes:R.LONG,value:1,offset:0},V:{name:"V",base:U.ELECTRIC_POTENTIAL,prefixes:R.SHORT,value:1,offset:0},ohm:{name:"ohm",base:U.ELECTRIC_RESISTANCE,prefixes:R.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:U.ELECTRIC_INDUCTANCE,prefixes:R.LONG,value:1,offset:0},H:{name:"H",base:U.ELECTRIC_INDUCTANCE,prefixes:R.SHORT,value:1,offset:0},siemens:{name:"siemens",base:U.ELECTRIC_CONDUCTANCE,prefixes:R.LONG,value:1,offset:0},S:{name:"S",base:U.ELECTRIC_CONDUCTANCE,prefixes:R.SHORT,value:1,offset:0},weber:{name:"weber",base:U.MAGNETIC_FLUX,prefixes:R.LONG,value:1,offset:0},Wb:{name:"Wb",base:U.MAGNETIC_FLUX,prefixes:R.SHORT,value:1,offset:0},tesla:{name:"tesla",base:U.MAGNETIC_FLUX_DENSITY,prefixes:R.LONG,value:1,offset:0},T:{name:"T",base:U.MAGNETIC_FLUX_DENSITY,prefixes:R.SHORT,value:1,offset:0},b:{name:"b",base:U.BIT,prefixes:R.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:U.BIT,prefixes:R.BINARY_LONG,value:1,offset:0},B:{name:"B",base:U.BIT,prefixes:R.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:U.BIT,prefixes:R.BINARY_LONG,value:8,offset:0}},ce={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function Me(K){if(K.number==="BigNumber"){var te=Ef(y);H.rad.value=new y(1),H.deg.value=te.div(180),H.grad.value=te.div(200),H.cycle.value=te.times(2),H.arcsec.value=te.div(648e3),H.arcmin.value=te.div(10800)}else H.rad.value=1,H.deg.value=Math.PI/180,H.grad.value=Math.PI/200,H.cycle.value=Math.PI*2,H.arcsec.value=Math.PI/648e3,H.arcmin.value=Math.PI/10800;H.radian.value=H.rad.value,H.degree.value=H.deg.value,H.gradian.value=H.grad.value}Me(t),r&&r("config",function(K,te){K.number!==te.number&&Me(K)});var pe={si:{NONE:{unit:ie,prefix:R.NONE[""]},LENGTH:{unit:H.m,prefix:R.SHORT[""]},MASS:{unit:H.g,prefix:R.SHORT.k},TIME:{unit:H.s,prefix:R.SHORT[""]},CURRENT:{unit:H.A,prefix:R.SHORT[""]},TEMPERATURE:{unit:H.K,prefix:R.SHORT[""]},LUMINOUS_INTENSITY:{unit:H.cd,prefix:R.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:H.mol,prefix:R.SHORT[""]},ANGLE:{unit:H.rad,prefix:R.SHORT[""]},BIT:{unit:H.bits,prefix:R.SHORT[""]},FORCE:{unit:H.N,prefix:R.SHORT[""]},ENERGY:{unit:H.J,prefix:R.SHORT[""]},POWER:{unit:H.W,prefix:R.SHORT[""]},PRESSURE:{unit:H.Pa,prefix:R.SHORT[""]},ELECTRIC_CHARGE:{unit:H.C,prefix:R.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:H.F,prefix:R.SHORT[""]},ELECTRIC_POTENTIAL:{unit:H.V,prefix:R.SHORT[""]},ELECTRIC_RESISTANCE:{unit:H.ohm,prefix:R.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:H.H,prefix:R.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:H.S,prefix:R.SHORT[""]},MAGNETIC_FLUX:{unit:H.Wb,prefix:R.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:H.T,prefix:R.SHORT[""]},FREQUENCY:{unit:H.Hz,prefix:R.SHORT[""]}}};pe.cgs=JSON.parse(JSON.stringify(pe.si)),pe.cgs.LENGTH={unit:H.m,prefix:R.SHORT.c},pe.cgs.MASS={unit:H.g,prefix:R.SHORT[""]},pe.cgs.FORCE={unit:H.dyn,prefix:R.SHORT[""]},pe.cgs.ENERGY={unit:H.erg,prefix:R.NONE[""]},pe.us=JSON.parse(JSON.stringify(pe.si)),pe.us.LENGTH={unit:H.ft,prefix:R.NONE[""]},pe.us.MASS={unit:H.lbm,prefix:R.NONE[""]},pe.us.TEMPERATURE={unit:H.degF,prefix:R.NONE[""]},pe.us.FORCE={unit:H.lbf,prefix:R.NONE[""]},pe.us.ENERGY={unit:H.BTU,prefix:R.BTU[""]},pe.us.POWER={unit:H.hp,prefix:R.NONE[""]},pe.us.PRESSURE={unit:H.psi,prefix:R.NONE[""]},pe.auto=JSON.parse(JSON.stringify(pe.si));var ge=pe.auto;b.setUnitSystem=function(K){if($e(pe,K))ge=pe[K];else throw new Error("Unit system "+K+" does not exist. Choices are: "+Object.keys(pe).join(", "))},b.getUnitSystem=function(){for(var K in pe)if($e(pe,K)&&pe[K]===ge)return K},b.typeConverters={BigNumber:function(te){return te!=null&&te.isFraction?new y(te.n).div(te.d).times(te.s):new y(te+"")},Fraction:function(te){return new w(te)},Complex:function(te){return te},number:function(te){return te!=null&&te.isFraction?x(te):te}},b.prototype._numberConverter=function(){var K=b.typeConverters[this.valueType()];if(K)return K;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},b._getNumberConverter=function(K){if(!b.typeConverters[K])throw new TypeError('Unsupported type "'+K+'"');return b.typeConverters[K]};for(var Se in H)if($e(H,Se)){var xe=H[Se];xe.dimensions=xe.base.dimensions}for(var be in ce)if($e(ce,be)){var De=H[ce[be]],Ae={};for(var ze in De)$e(De,ze)&&(Ae[ze]=De[ze]);Ae.name=be,H[be]=Ae}b.isValidAlpha=function(te){return/^[a-zA-Z]$/.test(te)};function Ze(K){for(var te=0;te0&&!(b.isValidAlpha(S)||M(S)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+K+'"')}}return b.createUnit=function(K,te){if(typeof K!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(te&&te.override){for(var ye in K)if($e(K,ye)&&b.deleteUnit(ye),K[ye].aliases)for(var ee=0;ee"u"||te===null)&&(te={}),typeof K!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if($e(H,K))throw new Error('Cannot create unit "'+K+'": a unit with that name already exists');Ze(K);var ye=null,ee=[],ne=0,ue,Ee,Ce;if(te&&te.type==="Unit")ye=te.clone();else if(typeof te=="string")te!==""&&(ue=te);else if(typeof te=="object")ue=te.definition,Ee=te.prefixes,ne=te.offset,Ce=te.baseName,te.aliases&&(ee=te.aliases.valueOf());else throw new TypeError('Cannot create unit "'+K+'" from "'+te.toString()+'": expecting "string" or "Unit" or "Object"');if(ee){for(var Le=0;Le1e-12){le=!1;break}if(le){Or=!0,Ie.base=U[re];break}}if(!Or){Ce=Ce||K+"_STUFF";var Oe={dimensions:ye.dimensions.slice(0)};Oe.key=Ce,U[Ce]=Oe,ge[Ce]={unit:Ie,prefix:R.NONE[""]},Ie.base=U[Ce]}}else{if(Ce=Ce||K+"_STUFF",j.indexOf(Ce)>=0)throw new Error('Cannot create new base unit "'+K+'": a base unit with that name already exists (and cannot be overridden)');j.push(Ce);for(var sr in U)$e(U,sr)&&(U[sr].dimensions[j.length-1]=0);for(var ir={dimensions:[]},Xe=0;Xe{var{typed:r,Unit:t}=e;return r(ZS,{Unit:function(i){return i.clone()},string:function(i){return t.isValuelessUnit(i)?new t(null,i):t.parse(i,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(i,a){return new t(i,a)},"number | BigNumber | Fraction":function(i){return new t(i)},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var XS="sparse",rU=["typed","SparseMatrix"],JS=T(XS,rU,e=>{var{typed:r,SparseMatrix:t}=e;return r(XS,{"":function(){return new t([])},string:function(i){return new t([],i)},"Array | Matrix":function(i){return new t(i)},"Array | Matrix, string":function(i,a){return new t(i,a)}})});var KS="createUnit",tU=["typed","Unit"],jS=T(KS,tU,e=>{var{typed:r,Unit:t}=e;return r(KS,{"Object, Object":function(i,a){return t.createUnit(i,a)},Object:function(i){return t.createUnit(i,{})},"string, Unit | string | Object, Object":function(i,a,s){var l={};return l[i]=a,t.createUnit(l,s)},"string, Unit | string | Object":function(i,a){var s={};return s[i]=a,t.createUnit(s,{})},string:function(i){var a={};return a[i]={},t.createUnit(a,{})}})});var eN="acos",nU=["typed","config","Complex"],rN=T(eN,nU,e=>{var{typed:r,config:t,Complex:n}=e;return r(eN,{number:function(a){return a>=-1&&a<=1||t.predictable?Math.acos(a):new n(a,0).acos()},Complex:function(a){return a.acos()},BigNumber:function(a){return a.acos()}})});var tN="acosh",iU=["typed","config","Complex"],nN=T(tN,iU,e=>{var{typed:r,config:t,Complex:n}=e;return r(tN,{number:function(a){return a>=1||t.predictable?Uv(a):a<=-1?new n(Math.log(Math.sqrt(a*a-1)-a),Math.PI):new n(a,0).acosh()},Complex:function(a){return a.acosh()},BigNumber:function(a){return a.acosh()}})});var iN="acot",aU=["typed","BigNumber"],aN=T(iN,aU,e=>{var{typed:r,BigNumber:t}=e;return r(iN,{number:zv,Complex:function(i){return i.acot()},BigNumber:function(i){return new t(1).div(i).atan()}})});var oN="acoth",oU=["typed","config","Complex","BigNumber"],sN=T(oN,oU,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(oN,{number:function(s){return s>=1||s<=-1||t.predictable?Wv(s):new n(s,0).acoth()},Complex:function(s){return s.acoth()},BigNumber:function(s){return new i(1).div(s).atanh()}})});var uN="acsc",sU=["typed","config","Complex","BigNumber"],fN=T(uN,sU,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(uN,{number:function(s){return s<=-1||s>=1||t.predictable?Vv(s):new n(s,0).acsc()},Complex:function(s){return s.acsc()},BigNumber:function(s){return new i(1).div(s).asin()}})});var lN="acsch",uU=["typed","BigNumber"],cN=T(lN,uU,e=>{var{typed:r,BigNumber:t}=e;return r(lN,{number:Yv,Complex:function(i){return i.acsch()},BigNumber:function(i){return new t(1).div(i).asinh()}})});var pN="asec",fU=["typed","config","Complex","BigNumber"],mN=T(pN,fU,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(pN,{number:function(s){return s<=-1||s>=1||t.predictable?Hv(s):new n(s,0).asec()},Complex:function(s){return s.asec()},BigNumber:function(s){return new i(1).div(s).acos()}})});var hN="asech",lU=["typed","config","Complex","BigNumber"],dN=T(hN,lU,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(hN,{number:function(s){if(s<=1&&s>=-1||t.predictable){var l=1/s;if(l>0||t.predictable)return Gv(s);var f=Math.sqrt(l*l-1);return new n(Math.log(f-l),Math.PI)}return new n(s,0).asech()},Complex:function(s){return s.asech()},BigNumber:function(s){return new i(1).div(s).acosh()}})});var vN="asin",cU=["typed","config","Complex"],gN=T(vN,cU,e=>{var{typed:r,config:t,Complex:n}=e;return r(vN,{number:function(a){return a>=-1&&a<=1||t.predictable?Math.asin(a):new n(a,0).asin()},Complex:function(a){return a.asin()},BigNumber:function(a){return a.asin()}})});var pU="asinh",mU=["typed"],xN=T(pU,mU,e=>{var{typed:r}=e;return r("asinh",{number:$v,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})});var hU="atan",dU=["typed"],yN=T(hU,dU,e=>{var{typed:r}=e;return r("atan",{number:function(n){return Math.atan(n)},Complex:function(n){return n.atan()},BigNumber:function(n){return n.atan()}})});var bN="atan2",vU=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],wN=T(bN,vU,e=>{var{typed:r,matrix:t,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:s}=e,l=It({typed:r,equalScalar:n}),f=ft({typed:r}),o=Wc({typed:r,equalScalar:n}),u=Jr({typed:r,equalScalar:n}),p=Lr({typed:r,DenseMatrix:a}),h=vr({typed:r,matrix:t,concat:s});return r(bN,{"number, number":Math.atan2,"BigNumber, BigNumber":(d,x)=>i.atan2(d,x)},h({scalar:"number | BigNumber",SS:o,DS:f,SD:l,Ss:u,sS:p}))});var DN="atanh",gU=["typed","config","Complex"],SN=T(DN,gU,e=>{var{typed:r,config:t,Complex:n}=e;return r(DN,{number:function(a){return a<=1&&a>=-1||t.predictable?Zv(a):new n(a,0).atanh()},Complex:function(a){return a.atanh()},BigNumber:function(a){return a.atanh()}})});var xi=T("trigUnit",["typed"],e=>{var{typed:r}=e;return{Unit:r.referToSelf(t=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return r.find(t,n.valueType())(n.value)})}});var NN="cos",xU=["typed"],AN=T(NN,xU,e=>{var{typed:r}=e,t=xi({typed:r});return r(NN,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},t)});var EN="cosh",yU=["typed"],CN=T(EN,yU,e=>{var{typed:r}=e;return r(EN,{number:bc,"Complex | BigNumber":t=>t.cosh()})});var MN="cot",bU=["typed","BigNumber"],_N=T(MN,bU,e=>{var{typed:r,BigNumber:t}=e,n=xi({typed:r});return r(MN,{number:Qv,Complex:i=>i.cot(),BigNumber:i=>new t(1).div(i.tan())},n)});var TN="coth",wU=["typed","BigNumber"],FN=T(TN,wU,e=>{var{typed:r,BigNumber:t}=e;return r(TN,{number:Xv,Complex:n=>n.coth(),BigNumber:n=>new t(1).div(n.tanh())})});var ON="csc",DU=["typed","BigNumber"],BN=T(ON,DU,e=>{var{typed:r,BigNumber:t}=e,n=xi({typed:r});return r(ON,{number:Jv,Complex:i=>i.csc(),BigNumber:i=>new t(1).div(i.sin())},n)});var IN="csch",SU=["typed","BigNumber"],PN=T(IN,SU,e=>{var{typed:r,BigNumber:t}=e;return r(IN,{number:Kv,Complex:n=>n.csch(),BigNumber:n=>new t(1).div(n.sinh())})});var kN="sec",NU=["typed","BigNumber"],RN=T(kN,NU,e=>{var{typed:r,BigNumber:t}=e,n=xi({typed:r});return r(kN,{number:jv,Complex:i=>i.sec(),BigNumber:i=>new t(1).div(i.cos())},n)});var LN="sech",AU=["typed","BigNumber"],qN=T(LN,AU,e=>{var{typed:r,BigNumber:t}=e;return r(LN,{number:eg,Complex:n=>n.sech(),BigNumber:n=>new t(1).div(n.cosh())})});var UN="sin",EU=["typed"],zN=T(UN,EU,e=>{var{typed:r}=e,t=xi({typed:r});return r(UN,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},t)});var WN="sinh",CU=["typed"],VN=T(WN,CU,e=>{var{typed:r}=e;return r(WN,{number:rg,"Complex | BigNumber":t=>t.sinh()})});var YN="tan",MU=["typed"],HN=T(YN,MU,e=>{var{typed:r}=e,t=xi({typed:r});return r(YN,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},t)});var _U="tanh",TU=["typed"],GN=T(_U,TU,e=>{var{typed:r}=e;return r("tanh",{number:wc,"Complex | BigNumber":t=>t.tanh()})});var $N="setCartesian",FU=["typed","size","subset","compareNatural","Index","DenseMatrix"],ZN=T($N,FU,e=>{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r($N,{"Array | Matrix, Array | Matrix":function(f,o){var u=[];if(n(t(f),new a(0))!==0&&n(t(o),new a(0))!==0){var p=gr(Array.isArray(f)?f:f.toArray()).sort(i),h=gr(Array.isArray(o)?o:o.toArray()).sort(i);u=[];for(var d=0;d{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(QN,{"Array | Matrix, Array | Matrix":function(f,o){var u;if(n(t(f),new a(0))===0)u=[];else{if(n(t(o),new a(0))===0)return gr(f.toArray());var p=Pa(gr(Array.isArray(f)?f:f.toArray()).sort(i)),h=Pa(gr(Array.isArray(o)?o:o.toArray()).sort(i));u=[];for(var d,x=0;x{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(JN,{"Array | Matrix":function(f){var o;if(n(t(f),new a(0))===0)o=[];else{var u=gr(Array.isArray(f)?f:f.toArray()).sort(i);o=[],o.push(u[0]);for(var p=1;p{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(jN,{"Array | Matrix, Array | Matrix":function(f,o){var u;if(n(t(f),new a(0))===0||n(t(o),new a(0))===0)u=[];else{var p=Pa(gr(Array.isArray(f)?f:f.toArray()).sort(i)),h=Pa(gr(Array.isArray(o)?o:o.toArray()).sort(i));u=[];for(var d=0;d{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(r2,{"Array | Matrix, Array | Matrix":function(l,f){if(n(t(l),new a(0))===0)return!0;if(n(t(f),new a(0))===0)return!1;for(var o=Pa(gr(Array.isArray(l)?l:l.toArray()).sort(i)),u=Pa(gr(Array.isArray(f)?f:f.toArray()).sort(i)),p,h=0;h{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(n2,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(l,f){if(n(t(f),new a(0))===0)return 0;for(var o=gr(Array.isArray(f)?f:f.toArray()),u=0,p=0;p{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(a2,{"Array | Matrix":function(o){if(n(t(o),new a(0))===0)return[];for(var u=gr(Array.isArray(o)?o:o.toArray()).sort(i),p=[],h=0;h.toString(2).length<=u.length;)p.push(s(u,h.toString(2).split("").reverse())),h++;return l(p)}});function s(f,o){for(var u=[],p=0;p0;u--)for(var p=0;pf[p+1].length&&(o=f[p],f[p]=f[p+1],f[p+1]=o);return f}});var s2="setSize",LU=["typed","compareNatural"],u2=T(s2,LU,e=>{var{typed:r,compareNatural:t}=e;return r(s2,{"Array | Matrix":function(i){return Array.isArray(i)?gr(i).length:gr(i.toArray()).length},"Array | Matrix, boolean":function(i,a){if(a===!1||i.length===0)return Array.isArray(i)?gr(i).length:gr(i.toArray()).length;for(var s=gr(Array.isArray(i)?i:i.toArray()).sort(t),l=1,f=1;f{var{typed:r,size:t,concat:n,subset:i,setDifference:a,Index:s}=e;return r(f2,{"Array | Matrix, Array | Matrix":function(f,o){if(i(t(f),new s(0))===0)return gr(o);if(i(t(o),new s(0))===0)return gr(f);var u=gr(f),p=gr(o);return n(a(u,p),a(p,u))}})});var c2="setUnion",UU=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],p2=T(c2,UU,e=>{var{typed:r,size:t,concat:n,subset:i,setIntersect:a,setSymDifference:s,Index:l}=e;return r(c2,{"Array | Matrix, Array | Matrix":function(o,u){if(i(t(o),new l(0))===0)return gr(u);if(i(t(u),new l(0))===0)return gr(o);var p=gr(o),h=gr(u);return n(s(p,h),a(p,h))}})});var m2="add",zU=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],h2=T(m2,zU,e=>{var{typed:r,matrix:t,addScalar:n,equalScalar:i,DenseMatrix:a,SparseMatrix:s,concat:l}=e,f=dn({typed:r}),o=su({typed:r,equalScalar:i}),u=Un({typed:r,DenseMatrix:a}),p=vr({typed:r,matrix:t,concat:l});return r(m2,{"any, any":n,"any, any, ...any":r.referToSelf(h=>(d,x,v)=>{for(var y=h(d,x),w=0;w{var{typed:r,abs:t,addScalar:n,divideScalar:i,multiplyScalar:a,sqrt:s,smaller:l,isPositive:f}=e;return r(d2,{"... number | BigNumber":o,Array:o,Matrix:u=>o(gr(u.toArray()))});function o(u){for(var p=0,h=0,d=0;d{var{typed:r,abs:t,add:n,pow:i,conj:a,sqrt:s,multiply:l,equalScalar:f,larger:o,smaller:u,matrix:p,ctranspose:h,eigs:d}=e;return r(g2,{number:Math.abs,Complex:function(F){return F.abs()},BigNumber:function(F){return F.abs()},boolean:function(F){return Math.abs(F)},Array:function(F){return S(p(F),2)},Matrix:function(F){return S(F,2)},"Array, number | BigNumber | string":function(F,M){return S(p(F),M)},"Matrix, number | BigNumber | string":function(F,M){return S(F,M)}});function x(O){var F=0;return O.forEach(function(M){var _=t(M);o(_,F)&&(F=_)},!0),F}function v(O){var F;return O.forEach(function(M){var _=t(M);(!F||u(_,F))&&(F=_)},!0),F||0}function y(O,F){if(F===Number.POSITIVE_INFINITY||F==="inf")return x(O);if(F===Number.NEGATIVE_INFINITY||F==="-inf")return v(O);if(F==="fro")return S(O,2);if(typeof F=="number"&&!isNaN(F)){if(!f(F,0)){var M=0;return O.forEach(function(_){M=n(i(t(_),F),M)},!0),i(M,1/F)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function w(O){var F=0;return O.forEach(function(M,_){F=n(F,l(M,a(M)))}),t(s(F))}function C(O){var F=[],M=0;return O.forEach(function(_,k){var L=k[1],Y=n(F[L]||0,t(_));o(Y,M)&&(M=Y),F[L]=Y},!0),M}function b(O){var F=O.size();if(F[0]!==F[1])throw new RangeError("Invalid matrix dimensions");var M=h(O),_=l(M,O),k=d(_).values.toArray(),L=k[k.length-1];return t(s(L))}function A(O){var F=[],M=0;return O.forEach(function(_,k){var L=k[0],Y=n(F[L]||0,t(_));o(Y,M)&&(M=Y),F[L]=Y},!0),M}function E(O,F){if(F===1)return C(O);if(F===Number.POSITIVE_INFINITY||F==="inf")return A(O);if(F==="fro")return w(O);if(F===2)return b(O);throw new Error("Unsupported parameter value "+F)}function S(O,F){var M=O.size();if(M.length===1)return y(O,F);if(M.length===2){if(M[0]&&M[1])return E(O,F);throw new RangeError("Invalid matrix dimensions")}}});var y2="dot",YU=["typed","addScalar","multiplyScalar","conj","size"],b2=T(y2,YU,e=>{var{typed:r,addScalar:t,multiplyScalar:n,conj:i,size:a}=e;return r(y2,{"Array | DenseMatrix, Array | DenseMatrix":l,"SparseMatrix, SparseMatrix":f});function s(u,p){var h=o(u),d=o(p),x,v;if(h.length===1)x=h[0];else if(h.length===2&&h[1]===1)x=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(d.length===1)v=d[0];else if(d.length===2&&d[1]===1)v=d[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+d.join(", ")+")");if(x!==v)throw new RangeError("Vectors must have equal length ("+x+" != "+v+")");if(x===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return x}function l(u,p){var h=s(u,p),d=Ge(u)?u._data:u,x=Ge(u)?u._datatype||u.getDataType():void 0,v=Ge(p)?p._data:p,y=Ge(p)?p._datatype||p.getDataType():void 0,w=o(u).length===2,C=o(p).length===2,b=t,A=n;if(x&&y&&x===y&&typeof x=="string"&&x!=="mixed"){var E=x;b=r.find(t,[E,E]),A=r.find(n,[E,E])}if(!w&&!C){for(var S=A(i(d[0]),v[0]),O=1;OS){A++;continue}E===S&&(y=w(y,C(d[b],v[A])),b++,A++)}return y}function o(u){return Ge(u)?u.size():a(u)}});var HU="trace",GU=["typed","matrix","add"],w2=T(HU,GU,e=>{var{typed:r,matrix:t,add:n}=e;return r("trace",{Array:function(l){return i(t(l))},SparseMatrix:a,DenseMatrix:i,any:tr});function i(s){var l=s._size,f=s._data;switch(l.length){case 1:if(l[0]===1)return tr(f[0]);throw new RangeError("Matrix must be square (size: "+lr(l)+")");case 2:{var o=l[0],u=l[1];if(o===u){for(var p=0,h=0;h0)for(var x=0;xx)break}return d}throw new RangeError("Matrix must be square (size: "+lr(u)+")")}});var D2="index",$U=["typed","Index"],S2=T(D2,$U,e=>{var{typed:r,Index:t}=e;return r(D2,{"...number | string | BigNumber | Range | Array | Matrix":function(i){var a=i.map(function(l){return je(l)?l.toNumber():Ar(l)||Ge(l)?l.map(function(f){return je(f)?f.toNumber():f}):l}),s=new t;return t.apply(s,a),s}})});var hp=new Set(["end"]);var ZU="Node",QU=["mathWithTransform"],N2=T(ZU,QU,e=>{var{mathWithTransform:r}=e;function t(i){for(var a of[...hp])if(i.has(a))throw new Error('Scope contains an illegal symbol, "'+a+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(a){return this.compile().evaluate(a)}compile(){var a=this._compile(r,{}),s={},l=null;function f(o){var u=ka(o);return t(u),a(u,s,l)}return{evaluate:f}}_compile(a,s){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(a){throw new Error("Cannot run forEach on a Node interface")}map(a){throw new Error("Cannot run map on a Node interface")}_ifNode(a){if(!Sr(a))throw new TypeError("Callback function must return a Node");return a}traverse(a){a(this,null,null);function s(l,f){l.forEach(function(o,u,p){f(o,u,p),s(o,f)})}s(this,a)}transform(a){function s(l,f,o){var u=a(l,f,o);return u!==l?u:l.map(s)}return s(this,null,null)}filter(a){var s=[];return this.traverse(function(l,f,o){a(l,f,o)&&s.push(l)}),s}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(a){return a.cloneDeep()})}equals(a){return a?this.type===a.type&&zi(this,a):!1}toString(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toString(a)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toHTML(a)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toTex(a)}_toTex(a){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(a){if(a&&typeof a=="object")switch(typeof a.handler){case"object":case"undefined":return;case"function":return a.handler(this,a);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function lt(e){return e&&e.isIndexError?new Xt(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function dp(e){var{subset:r}=e;return function(n,i){try{if(Array.isArray(n))return r(n,i);if(n&&typeof n.subset=="function")return n.subset(i);if(typeof n=="string")return r(n,i);if(typeof n=="object"){if(!i.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return gt(n,i.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(a){throw lt(a)}}}var vp="AccessorNode",XU=["subset","Node"],A2=T(vp,XU,e=>{var{subset:r,Node:t}=e,n=dp({subset:r});function i(s){return!(Sn(s)||$t(s)||yr(s)||fn(s)||la(s)||Zt(s)||rt(s))}class a extends t{constructor(l,f){if(super(),!Sr(l))throw new TypeError('Node expected for parameter "object"');if(!kn(f))throw new TypeError('IndexNode expected for parameter "index"');this.object=l,this.index=f}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return vp}get isAccessorNode(){return!0}_compile(l,f){var o=this.object._compile(l,f),u=this.index._compile(l,f);if(this.index.isObjectProperty()){var p=this.index.getObjectProperty();return function(d,x,v){return gt(o(d,x,v),p)}}else return function(d,x,v){var y=o(d,x,v),w=u(d,x,y);return n(y,w)}}forEach(l){l(this.object,"object",this),l(this.index,"index",this)}map(l){return new a(this._ifNode(l(this.object,"object",this)),this._ifNode(l(this.index,"index",this)))}clone(){return new a(this.object,this.index)}_toString(l){var f=this.object.toString(l);return i(this.object)&&(f="("+f+")"),f+this.index.toString(l)}_toHTML(l){var f=this.object.toHTML(l);return i(this.object)&&(f='('+f+')'),f+this.index.toHTML(l)}_toTex(l){var f=this.object.toTex(l);return i(this.object)&&(f="\\\\left(' + object + '\\\\right)"),f+this.index.toTex(l)}toJSON(){return{mathjs:vp,object:this.object,index:this.index}}static fromJSON(l){return new a(l.object,l.index)}}return Ur(a,"name",vp),a},{isClass:!0,isNode:!0});var gp="ArrayNode",JU=["Node"],E2=T(gp,JU,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(Sr))throw new TypeError("Array containing Nodes expected")}get type(){return gp}get isArrayNode(){return!0}_compile(i,a){var s=Rn(this.items,function(o){return o._compile(i,a)}),l=i.config.matrix!=="Array";if(l){var f=i.matrix;return function(u,p,h){return f(Rn(s,function(d){return d(u,p,h)}))}}else return function(u,p,h){return Rn(s,function(d){return d(u,p,h)})}}forEach(i){for(var a=0;a['+a.join(',')+']'}_toTex(i){function a(s,l){var f=s.some($t)&&!s.every($t),o=l||f,u=o?"&":"\\\\\\\\",p=s.map(function(h){return h.items?a(h.items,!l):h.toTex(i)}).join(u);return f||!o||o&&!l?"\\\\begin{bmatrix}"+p+"\\\\end{bmatrix}":p}return a(this.items,!1)}}return Ur(t,"name",gp),t},{isClass:!0,isNode:!0});function C2(e){var{subset:r,matrix:t}=e;return function(i,a,s){try{if(Array.isArray(i)){var l=t(i).subset(a,s).valueOf();return l.forEach((f,o)=>{i[o]=f}),i}else{if(i&&typeof i.subset=="function")return i.subset(a,s);if(typeof i=="string")return r(i,a,s);if(typeof i=="object"){if(!a.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return ca(i,a.getObjectProperty(),s),i}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(f){throw lt(f)}}}var yi=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function xp(e,r){if(!r||r!=="auto")return e;for(var t=e;Zt(t);)t=t.content;return t}function Gr(e,r,t,n){var i=e;r!=="keep"&&(i=e.getContent());for(var a=i.getIdentifier(),s=null,l=0;l{var{subset:r,matrix:t,Node:n}=e,i=dp({subset:r}),a=C2({subset:r,matrix:t});function s(f,o,u){o||(o="keep");var p=Gr(f,o,u),h=Gr(f.value,o,u);return o==="all"||h!==null&&h<=p}class l extends n{constructor(o,u,p){if(super(),this.object=o,this.index=p?u:null,this.value=p||u,!rt(o)&&!Sn(o))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(rt(o)&&o.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!kn(this.index))throw new TypeError('IndexNode expected as "index"');if(!Sr(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return bp}get isAssignmentNode(){return!0}_compile(o,u){var p=this.object._compile(o,u),h=this.index?this.index._compile(o,u):null,d=this.value._compile(o,u),x=this.object.name;if(this.index)if(this.index.isObjectProperty()){var v=this.index.getObjectProperty();return function(A,E,S){var O=p(A,E,S),F=d(A,E,S);return ca(O,v,F),F}}else{if(rt(this.object))return function(A,E,S){var O=p(A,E,S),F=d(A,E,S),M=h(A,E,O);return A.set(x,a(O,M,F)),F};var y=this.object.object._compile(o,u);if(this.object.index.isObjectProperty()){var w=this.object.index.getObjectProperty();return function(A,E,S){var O=y(A,E,S),F=gt(O,w),M=h(A,E,F),_=d(A,E,S);return ca(O,w,a(F,M,_)),_}}else{var C=this.object.index._compile(o,u);return function(A,E,S){var O=y(A,E,S),F=C(A,E,O),M=i(O,F),_=h(A,E,M),k=d(A,E,S);return a(O,F,a(M,_,k)),k}}}else{if(!rt(this.object))throw new TypeError("SymbolNode expected as object");return function(A,E,S){var O=d(A,E,S);return A.set(x,O),O}}}forEach(o){o(this.object,"object",this),this.index&&o(this.index,"index",this),o(this.value,"value",this)}map(o){var u=this._ifNode(o(this.object,"object",this)),p=this.index?this._ifNode(o(this.index,"index",this)):null,h=this._ifNode(o(this.value,"value",this));return new l(u,p,h)}clone(){return new l(this.object,this.index,this.value)}_toString(o){var u=this.object.toString(o),p=this.index?this.index.toString(o):"",h=this.value.toString(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(h="("+h+")"),u+p+" = "+h}toJSON(){return{mathjs:bp,object:this.object,index:this.index,value:this.value}}static fromJSON(o){return new l(o.object,o.index,o.value)}_toHTML(o){var u=this.object.toHTML(o),p=this.index?this.index.toHTML(o):"",h=this.value.toHTML(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(h='('+h+')'),u+p+'='+h}_toTex(o){var u=this.object.toTex(o),p=this.index?this.index.toTex(o):"",h=this.value.toTex(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(h="\\\\left(".concat(h,"\\\\right)")),u+p+"="+h}}return Ur(l,"name",bp),l},{isClass:!0,isNode:!0});var wp="BlockNode",jU=["ResultSet","Node"],T2=T(wp,jU,e=>{var{ResultSet:r,Node:t}=e;class n extends t{constructor(a){if(super(),!Array.isArray(a))throw new Error("Array expected");this.blocks=a.map(function(s){var l=s&&s.node,f=s&&s.visible!==void 0?s.visible:!0;if(!Sr(l))throw new TypeError('Property "node" must be a Node');if(typeof f!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:l,visible:f}})}get type(){return wp}get isBlockNode(){return!0}_compile(a,s){var l=Rn(this.blocks,function(f){return{evaluate:f.node._compile(a,s),visible:f.visible}});return function(o,u,p){var h=[];return ho(l,function(x){var v=x.evaluate(o,u,p);x.visible&&h.push(v)}),new r(h)}}forEach(a){for(var s=0;s;')}).join('
')}_toTex(a){return this.blocks.map(function(s){return s.node.toTex(a)+(s.visible?"":";")}).join(\`\\\\;\\\\; +\`)}}return Ur(n,"name",wp),n},{isClass:!0,isNode:!0});var Dp="ConditionalNode",ez=["Node"],F2=T(Dp,ez,e=>{var{Node:r}=e;function t(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if(je(i))return!i.isZero();if(Gt(i))return!!(i.re||i.im);if(qt(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+_r(i)+'"')}class n extends r{constructor(a,s,l){if(super(),!Sr(a))throw new TypeError("Parameter condition must be a Node");if(!Sr(s))throw new TypeError("Parameter trueExpr must be a Node");if(!Sr(l))throw new TypeError("Parameter falseExpr must be a Node");this.condition=a,this.trueExpr=s,this.falseExpr=l}get type(){return Dp}get isConditionalNode(){return!0}_compile(a,s){var l=this.condition._compile(a,s),f=this.trueExpr._compile(a,s),o=this.falseExpr._compile(a,s);return function(p,h,d){return t(l(p,h,d))?f(p,h,d):o(p,h,d)}}forEach(a){a(this.condition,"condition",this),a(this.trueExpr,"trueExpr",this),a(this.falseExpr,"falseExpr",this)}map(a){return new n(this._ifNode(a(this.condition,"condition",this)),this._ifNode(a(this.trueExpr,"trueExpr",this)),this._ifNode(a(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=Gr(this,s,a&&a.implicit),f=this.condition.toString(a),o=Gr(this.condition,s,a&&a.implicit);(s==="all"||this.condition.type==="OperatorNode"||o!==null&&o<=l)&&(f="("+f+")");var u=this.trueExpr.toString(a),p=Gr(this.trueExpr,s,a&&a.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=l)&&(u="("+u+")");var h=this.falseExpr.toString(a),d=Gr(this.falseExpr,s,a&&a.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||d!==null&&d<=l)&&(h="("+h+")"),f+" ? "+u+" : "+h}toJSON(){return{mathjs:Dp,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(a){return new n(a.condition,a.trueExpr,a.falseExpr)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=Gr(this,s,a&&a.implicit),f=this.condition.toHTML(a),o=Gr(this.condition,s,a&&a.implicit);(s==="all"||this.condition.type==="OperatorNode"||o!==null&&o<=l)&&(f='('+f+')');var u=this.trueExpr.toHTML(a),p=Gr(this.trueExpr,s,a&&a.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=l)&&(u='('+u+')');var h=this.falseExpr.toHTML(a),d=Gr(this.falseExpr,s,a&&a.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||d!==null&&d<=l)&&(h='('+h+')'),f+'?'+u+':'+h}_toTex(a){return"\\\\begin{cases} {"+this.trueExpr.toTex(a)+"}, &\\\\quad{\\\\text{if }\\\\;"+this.condition.toTex(a)+"}\\\\\\\\{"+this.falseExpr.toTex(a)+"}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}"}}return Ur(n,"name",Dp),n},{isClass:!0,isNode:!0});var P2=ci(B2(),1);var mg={Alpha:"A",alpha:"\\\\alpha",Beta:"B",beta:"\\\\beta",Gamma:"\\\\Gamma",gamma:"\\\\gamma",Delta:"\\\\Delta",delta:"\\\\delta",Epsilon:"E",epsilon:"\\\\epsilon",varepsilon:"\\\\varepsilon",Zeta:"Z",zeta:"\\\\zeta",Eta:"H",eta:"\\\\eta",Theta:"\\\\Theta",theta:"\\\\theta",vartheta:"\\\\vartheta",Iota:"I",iota:"\\\\iota",Kappa:"K",kappa:"\\\\kappa",varkappa:"\\\\varkappa",Lambda:"\\\\Lambda",lambda:"\\\\lambda",Mu:"M",mu:"\\\\mu",Nu:"N",nu:"\\\\nu",Xi:"\\\\Xi",xi:"\\\\xi",Omicron:"O",omicron:"o",Pi:"\\\\Pi",pi:"\\\\pi",varpi:"\\\\varpi",Rho:"P",rho:"\\\\rho",varrho:"\\\\varrho",Sigma:"\\\\Sigma",sigma:"\\\\sigma",varsigma:"\\\\varsigma",Tau:"T",tau:"\\\\tau",Upsilon:"\\\\Upsilon",upsilon:"\\\\upsilon",Phi:"\\\\Phi",phi:"\\\\phi",varphi:"\\\\varphi",Chi:"X",chi:"\\\\chi",Psi:"\\\\Psi",psi:"\\\\psi",Omega:"\\\\Omega",omega:"\\\\omega",true:"\\\\mathrm{True}",false:"\\\\mathrm{False}",i:"i",inf:"\\\\infty",Inf:"\\\\infty",infinity:"\\\\infty",Infinity:"\\\\infty",oo:"\\\\infty",lim:"\\\\lim",undefined:"\\\\mathbf{?}"},zr={transpose:"^\\\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\\\~",not:"\\\\neg",multiply:"\\\\cdot",divide:"\\\\frac",dotMultiply:".\\\\cdot",dotDivide:".:",mod:"\\\\mod",add:"+",subtract:"-",to:"\\\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\\\neq",smaller:"<",larger:">",smallerEq:"\\\\leq",largerEq:"\\\\geq",bitAnd:"\\\\&",bitXor:"\\\\underline{|}",bitOr:"|",and:"\\\\wedge",xor:"\\\\veebar",or:"\\\\vee"},hg={abs:{1:"\\\\left|\${args[0]}\\\\right|"},add:{2:"\\\\left(\${args[0]}".concat(zr.add,"\${args[1]}\\\\right)")},cbrt:{1:"\\\\sqrt[3]{\${args[0]}}"},ceil:{1:"\\\\left\\\\lceil\${args[0]}\\\\right\\\\rceil"},cube:{1:"\\\\left(\${args[0]}\\\\right)^3"},divide:{2:"\\\\frac{\${args[0]}}{\${args[1]}}"},dotDivide:{2:"\\\\left(\${args[0]}".concat(zr.dotDivide,"\${args[1]}\\\\right)")},dotMultiply:{2:"\\\\left(\${args[0]}".concat(zr.dotMultiply,"\${args[1]}\\\\right)")},dotPow:{2:"\\\\left(\${args[0]}".concat(zr.dotPow,"\${args[1]}\\\\right)")},exp:{1:"\\\\exp\\\\left(\${args[0]}\\\\right)"},expm1:"\\\\left(e".concat(zr.pow,"{\${args[0]}}-1\\\\right)"),fix:{1:"\\\\mathrm{\${name}}\\\\left(\${args[0]}\\\\right)"},floor:{1:"\\\\left\\\\lfloor\${args[0]}\\\\right\\\\rfloor"},gcd:"\\\\gcd\\\\left(\${args}\\\\right)",hypot:"\\\\hypot\\\\left(\${args}\\\\right)",log:{1:"\\\\ln\\\\left(\${args[0]}\\\\right)",2:"\\\\log_{\${args[1]}}\\\\left(\${args[0]}\\\\right)"},log10:{1:"\\\\log_{10}\\\\left(\${args[0]}\\\\right)"},log1p:{1:"\\\\ln\\\\left(\${args[0]}+1\\\\right)",2:"\\\\log_{\${args[1]}}\\\\left(\${args[0]}+1\\\\right)"},log2:"\\\\log_{2}\\\\left(\${args[0]}\\\\right)",mod:{2:"\\\\left(\${args[0]}".concat(zr.mod,"\${args[1]}\\\\right)")},multiply:{2:"\\\\left(\${args[0]}".concat(zr.multiply,"\${args[1]}\\\\right)")},norm:{1:"\\\\left\\\\|\${args[0]}\\\\right\\\\|",2:void 0},nthRoot:{2:"\\\\sqrt[\${args[1]}]{\${args[0]}}"},nthRoots:{2:"\\\\{y : $y^{args[1]} = {\${args[0]}}\\\\}"},pow:{2:"\\\\left(\${args[0]}\\\\right)".concat(zr.pow,"{\${args[1]}}")},round:{1:"\\\\left\\\\lfloor\${args[0]}\\\\right\\\\rceil",2:void 0},sign:{1:"\\\\mathrm{\${name}}\\\\left(\${args[0]}\\\\right)"},sqrt:{1:"\\\\sqrt{\${args[0]}}"},square:{1:"\\\\left(\${args[0]}\\\\right)^2"},subtract:{2:"\\\\left(\${args[0]}".concat(zr.subtract,"\${args[1]}\\\\right)")},unaryMinus:{1:"".concat(zr.unaryMinus,"\\\\left(\${args[0]}\\\\right)")},unaryPlus:{1:"".concat(zr.unaryPlus,"\\\\left(\${args[0]}\\\\right)")},bitAnd:{2:"\\\\left(\${args[0]}".concat(zr.bitAnd,"\${args[1]}\\\\right)")},bitNot:{1:zr.bitNot+"\\\\left(\${args[0]}\\\\right)"},bitOr:{2:"\\\\left(\${args[0]}".concat(zr.bitOr,"\${args[1]}\\\\right)")},bitXor:{2:"\\\\left(\${args[0]}".concat(zr.bitXor,"\${args[1]}\\\\right)")},leftShift:{2:"\\\\left(\${args[0]}".concat(zr.leftShift,"\${args[1]}\\\\right)")},rightArithShift:{2:"\\\\left(\${args[0]}".concat(zr.rightArithShift,"\${args[1]}\\\\right)")},rightLogShift:{2:"\\\\left(\${args[0]}".concat(zr.rightLogShift,"\${args[1]}\\\\right)")},bellNumbers:{1:"\\\\mathrm{B}_{\${args[0]}}"},catalan:{1:"\\\\mathrm{C}_{\${args[0]}}"},stirlingS2:{2:"\\\\mathrm{S}\\\\left(\${args}\\\\right)"},arg:{1:"\\\\arg\\\\left(\${args[0]}\\\\right)"},conj:{1:"\\\\left(\${args[0]}\\\\right)^*"},im:{1:"\\\\Im\\\\left\\\\lbrace\${args[0]}\\\\right\\\\rbrace"},re:{1:"\\\\Re\\\\left\\\\lbrace\${args[0]}\\\\right\\\\rbrace"},and:{2:"\\\\left(\${args[0]}".concat(zr.and,"\${args[1]}\\\\right)")},not:{1:zr.not+"\\\\left(\${args[0]}\\\\right)"},or:{2:"\\\\left(\${args[0]}".concat(zr.or,"\${args[1]}\\\\right)")},xor:{2:"\\\\left(\${args[0]}".concat(zr.xor,"\${args[1]}\\\\right)")},cross:{2:"\\\\left(\${args[0]}\\\\right)\\\\times\\\\left(\${args[1]}\\\\right)"},ctranspose:{1:"\\\\left(\${args[0]}\\\\right)".concat(zr.ctranspose)},det:{1:"\\\\det\\\\left(\${args[0]}\\\\right)"},dot:{2:"\\\\left(\${args[0]}\\\\cdot\${args[1]}\\\\right)"},expm:{1:"\\\\exp\\\\left(\${args[0]}\\\\right)"},inv:{1:"\\\\left(\${args[0]}\\\\right)^{-1}"},pinv:{1:"\\\\left(\${args[0]}\\\\right)^{+}"},sqrtm:{1:"{\${args[0]}}".concat(zr.pow,"{\\\\frac{1}{2}}")},trace:{1:"\\\\mathrm{tr}\\\\left(\${args[0]}\\\\right)"},transpose:{1:"\\\\left(\${args[0]}\\\\right)".concat(zr.transpose)},combinations:{2:"\\\\binom{\${args[0]}}{\${args[1]}}"},combinationsWithRep:{2:"\\\\left(\\\\!\\\\!{\\\\binom{\${args[0]}}{\${args[1]}}}\\\\!\\\\!\\\\right)"},factorial:{1:"\\\\left(\${args[0]}\\\\right)".concat(zr.factorial)},gamma:{1:"\\\\Gamma\\\\left(\${args[0]}\\\\right)"},lgamma:{1:"\\\\ln\\\\Gamma\\\\left(\${args[0]}\\\\right)"},equal:{2:"\\\\left(\${args[0]}".concat(zr.equal,"\${args[1]}\\\\right)")},larger:{2:"\\\\left(\${args[0]}".concat(zr.larger,"\${args[1]}\\\\right)")},largerEq:{2:"\\\\left(\${args[0]}".concat(zr.largerEq,"\${args[1]}\\\\right)")},smaller:{2:"\\\\left(\${args[0]}".concat(zr.smaller,"\${args[1]}\\\\right)")},smallerEq:{2:"\\\\left(\${args[0]}".concat(zr.smallerEq,"\${args[1]}\\\\right)")},unequal:{2:"\\\\left(\${args[0]}".concat(zr.unequal,"\${args[1]}\\\\right)")},erf:{1:"erf\\\\left(\${args[0]}\\\\right)"},max:"\\\\max\\\\left(\${args}\\\\right)",min:"\\\\min\\\\left(\${args}\\\\right)",variance:"\\\\mathrm{Var}\\\\left(\${args}\\\\right)",acos:{1:"\\\\cos^{-1}\\\\left(\${args[0]}\\\\right)"},acosh:{1:"\\\\cosh^{-1}\\\\left(\${args[0]}\\\\right)"},acot:{1:"\\\\cot^{-1}\\\\left(\${args[0]}\\\\right)"},acoth:{1:"\\\\coth^{-1}\\\\left(\${args[0]}\\\\right)"},acsc:{1:"\\\\csc^{-1}\\\\left(\${args[0]}\\\\right)"},acsch:{1:"\\\\mathrm{csch}^{-1}\\\\left(\${args[0]}\\\\right)"},asec:{1:"\\\\sec^{-1}\\\\left(\${args[0]}\\\\right)"},asech:{1:"\\\\mathrm{sech}^{-1}\\\\left(\${args[0]}\\\\right)"},asin:{1:"\\\\sin^{-1}\\\\left(\${args[0]}\\\\right)"},asinh:{1:"\\\\sinh^{-1}\\\\left(\${args[0]}\\\\right)"},atan:{1:"\\\\tan^{-1}\\\\left(\${args[0]}\\\\right)"},atan2:{2:"\\\\mathrm{atan2}\\\\left(\${args}\\\\right)"},atanh:{1:"\\\\tanh^{-1}\\\\left(\${args[0]}\\\\right)"},cos:{1:"\\\\cos\\\\left(\${args[0]}\\\\right)"},cosh:{1:"\\\\cosh\\\\left(\${args[0]}\\\\right)"},cot:{1:"\\\\cot\\\\left(\${args[0]}\\\\right)"},coth:{1:"\\\\coth\\\\left(\${args[0]}\\\\right)"},csc:{1:"\\\\csc\\\\left(\${args[0]}\\\\right)"},csch:{1:"\\\\mathrm{csch}\\\\left(\${args[0]}\\\\right)"},sec:{1:"\\\\sec\\\\left(\${args[0]}\\\\right)"},sech:{1:"\\\\mathrm{sech}\\\\left(\${args[0]}\\\\right)"},sin:{1:"\\\\sin\\\\left(\${args[0]}\\\\right)"},sinh:{1:"\\\\sinh\\\\left(\${args[0]}\\\\right)"},tan:{1:"\\\\tan\\\\left(\${args[0]}\\\\right)"},tanh:{1:"\\\\tanh\\\\left(\${args[0]}\\\\right)"},to:{2:"\\\\left(\${args[0]}".concat(zr.to,"\${args[1]}\\\\right)")},numeric:function(r,t){return r.args[0].toTex()},number:{0:"0",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)\${args[1]}\\\\right)"},string:{0:'\\\\mathtt{""}',1:"\\\\mathrm{string}\\\\left(\${args[0]}\\\\right)"},bignumber:{0:"0",1:"\\\\left(\${args[0]}\\\\right)"},complex:{0:"0",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)+".concat(mg.i,"\\\\cdot\\\\left(\${args[1]}\\\\right)\\\\right)")},matrix:{0:"\\\\begin{bmatrix}\\\\end{bmatrix}",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\${args[0]}\\\\right)"},sparse:{0:"\\\\begin{bsparse}\\\\end{bsparse}",1:"\\\\left(\${args[0]}\\\\right)"},unit:{1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)\${args[1]}\\\\right)"}},k2="\\\\mathrm{\${name}}\\\\left(\${args}\\\\right)",I2={deg:"^\\\\circ"};function Sp(e){return(0,P2.default)(e,{preserveFormatting:!0})}function Np(e,r){return r=typeof r>"u"?!1:r,r?$e(I2,e)?I2[e]:"\\\\mathrm{"+Sp(e)+"}":$e(mg,e)?mg[e]:Sp(e)}var Ap="ConstantNode",iz=["Node"],R2=T(Ap,iz,e=>{var{Node:r}=e;class t extends r{constructor(i){super(),this.value=i}get type(){return Ap}get isConstantNode(){return!0}_compile(i,a){var s=this.value;return function(){return s}}forEach(i){}map(i){return this.clone()}clone(){return new t(this.value)}_toString(i){return lr(this.value,i)}_toHTML(i){var a=this._toString(i);switch(_r(this.value)){case"number":case"BigNumber":case"Fraction":return''+a+"";case"string":return''+a+"";case"boolean":return''+a+"";case"null":return''+a+"";case"undefined":return''+a+"";default:return''+a+""}}toJSON(){return{mathjs:Ap,value:this.value}}static fromJSON(i){return new t(i.value)}_toTex(i){var a=this._toString(i),s=_r(this.value);switch(s){case"string":return"\\\\mathtt{"+Sp(a)+"}";case"number":case"BigNumber":{var l=s==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!l)return this.value.valueOf()<0?"-\\\\infty":"\\\\infty";var f=a.toLowerCase().indexOf("e");return f!==-1?a.substring(0,f)+"\\\\cdot10^{"+a.substring(f+1)+"}":a}case"Fraction":return this.value.toLatex();default:return a}}}return Ur(t,"name",Ap),t},{isClass:!0,isNode:!0});var Ep="FunctionAssignmentNode",az=["typed","Node"],L2=T(Ep,az,e=>{var{typed:r,Node:t}=e;function n(a,s,l){var f=Gr(a,s,l),o=Gr(a.expr,s,l);return s==="all"||o!==null&&o<=f}class i extends t{constructor(s,l,f){if(super(),typeof s!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(l))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!Sr(f))throw new TypeError('Node expected for parameter "expr"');if(hp.has(s))throw new Error('Illegal function name, "'+s+'" is a reserved keyword');var o=new Set;for(var u of l){var p=typeof u=="string"?u:u.name;if(o.has(p))throw new Error('Duplicate parameter name "'.concat(p,'"'));o.add(p)}this.name=s,this.params=l.map(function(h){return h&&h.name||h}),this.types=l.map(function(h){return h&&h.type||"any"}),this.expr=f}get type(){return Ep}get isFunctionAssignmentNode(){return!0}_compile(s,l){var f=Object.create(l);ho(this.params,function(x){f[x]=!0});var o=this.expr._compile(s,f),u=this.name,p=this.params,h=Hd(this.types,","),d=u+"("+Hd(this.params,", ")+")";return function(v,y,w){var C={};C[h]=function(){for(var A=Object.create(y),E=0;E'+Qt(this.params[o])+"");var u=this.expr.toHTML(s);return n(this,l,s&&s.implicit)&&(u='('+u+')'),''+Qt(this.name)+'('+f.join(',')+')='+u}_toTex(s){var l=s&&s.parenthesis?s.parenthesis:"keep",f=this.expr.toTex(s);return n(this,l,s&&s.implicit)&&(f="\\\\left(".concat(f,"\\\\right)")),"\\\\mathrm{"+this.name+"}\\\\left("+this.params.map(Np).join(",")+"\\\\right)="+f}}return Ur(i,"name",Ep),i},{isClass:!0,isNode:!0});var Cp="IndexNode",oz=["Node","size"],q2=T(Cp,oz,e=>{var{Node:r,size:t}=e;class n extends r{constructor(a,s){if(super(),this.dimensions=a,this.dotNotation=s||!1,!Array.isArray(a)||!a.every(Sr))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return Cp}get isIndexNode(){return!0}_compile(a,s){var l=Rn(this.dimensions,function(o,u){var p=o.filter(x=>x.isSymbolNode&&x.name==="end").length>0;if(p){var h=Object.create(s);h.end=!0;var d=o._compile(a,h);return function(v,y,w){if(!Ge(w)&&!Ar(w)&&!yt(w))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+_r(w));var C=t(w).valueOf(),b=Object.create(y);return b.end=C[u],d(v,b,w)}}else return o._compile(a,s)}),f=gt(a,"index");return function(u,p,h){var d=Rn(l,function(x){return x(u,p,h)});return f(...d)}}forEach(a){for(var s=0;s.'+Qt(this.getObjectProperty())+"":'['+s.join(',')+']'}_toTex(a){var s=this.dimensions.map(function(l){return l.toTex(a)});return this.dotNotation?"."+this.getObjectProperty():"_{"+s.join(",")+"}"}}return Ur(n,"name",Cp),n},{isClass:!0,isNode:!0});var Mp="ObjectNode",sz=["Node"],U2=T(Mp,sz,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(a){return Sr(i[a])})))throw new TypeError("Object containing Nodes expected")}get type(){return Mp}get isObjectNode(){return!0}_compile(i,a){var s={};for(var l in this.properties)if($e(this.properties,l)){var f=Ko(l),o=JSON.parse(f),u=gt(this.properties,l);s[o]=u._compile(i,a)}return function(h,d,x){var v={};for(var y in s)$e(s,y)&&(v[y]=s[y](h,d,x));return v}}forEach(i){for(var a in this.properties)$e(this.properties,a)&&i(this.properties[a],"properties["+Ko(a)+"]",this)}map(i){var a={};for(var s in this.properties)$e(this.properties,s)&&(a[s]=this._ifNode(i(this.properties[s],"properties["+Ko(s)+"]",this)));return new t(a)}clone(){var i={};for(var a in this.properties)$e(this.properties,a)&&(i[a]=this.properties[a]);return new t(i)}_toString(i){var a=[];for(var s in this.properties)$e(this.properties,s)&&a.push(Ko(s)+": "+this.properties[s].toString(i));return"{"+a.join(", ")+"}"}toJSON(){return{mathjs:Mp,properties:this.properties}}static fromJSON(i){return new t(i.properties)}_toHTML(i){var a=[];for(var s in this.properties)$e(this.properties,s)&&a.push(''+Qt(s)+':'+this.properties[s].toHTML(i));return'{'+a.join(',')+'}'}_toTex(i){var a=[];for(var s in this.properties)$e(this.properties,s)&&a.push("\\\\mathbf{"+s+":} & "+this.properties[s].toTex(i)+"\\\\\\\\");var l="\\\\left\\\\{\\\\begin{array}{ll}"+a.join(\` +\`)+"\\\\end{array}\\\\right\\\\}";return l}}return Ur(t,"name",Mp),t},{isClass:!0,isNode:!0});function os(e,r){return new eu(e,new rs(r),new Set(Object.keys(r)))}var _p="OperatorNode",uz=["Node"],z2=T(_p,uz,e=>{var{Node:r}=e;function t(a,s){var l=a;if(s==="auto")for(;Zt(l);)l=l.content;return yr(l)?!0:ut(l)?t(l.args[0],s):!1}function n(a,s,l,f,o){var u=Gr(a,s,l),p=hu(a,s);if(s==="all"||f.length>2&&a.getIdentifier()!=="OperatorNode:add"&&a.getIdentifier()!=="OperatorNode:multiply")return f.map(function(_){switch(_.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var h;switch(f.length){case 0:h=[];break;case 1:{var d=Gr(f[0],s,l,a);if(o&&d!==null){var x,v;if(s==="keep"?(x=f[0].getIdentifier(),v=a.getIdentifier()):(x=f[0].getContent().getIdentifier(),v=a.getContent().getIdentifier()),yi[u][v].latexLeftParens===!1){h=[!1];break}if(yi[d][x].latexParens===!1){h=[!1];break}}if(d===null){h=[!1];break}if(d<=u){h=[!0];break}h=[!1]}break;case 2:{var y,w=Gr(f[0],s,l,a),C=yp(a,f[0],s);w===null?y=!1:w===u&&p==="right"&&!C||w=2&&a.getIdentifier()==="OperatorNode:multiply"&&a.implicit&&s!=="all"&&l==="hide")for(var M=1;M2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var y=o.map(function(w,C){return w=w.toString(s),u[C]&&(w="("+w+")"),w});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?y.join(" "):y.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:_p,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(s){return new i(s.op,s.fn,s.args,s.implicit,s.isPercentage)}_toHTML(s){var l=s&&s.parenthesis?s.parenthesis:"keep",f=s&&s.implicit?s.implicit:"hide",o=this.args,u=n(this,l,f,o,!1);if(o.length===1){var p=hu(this,l),h=o[0].toHTML(s);return u[0]&&(h='('+h+')'),p==="right"?''+Qt(this.op)+""+h:h+''+Qt(this.op)+""}else if(o.length===2){var d=o[0].toHTML(s),x=o[1].toHTML(s);return u[0]&&(d='('+d+')'),u[1]&&(x='('+x+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?d+''+x:d+''+Qt(this.op)+""+x}else{var v=o.map(function(y,w){return y=y.toHTML(s),u[w]&&(y='('+y+')'),y});return o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?v.join(''):v.join(''+Qt(this.op)+""):''+Qt(this.fn)+'('+v.join(',')+')'}}_toTex(s){var l=s&&s.parenthesis?s.parenthesis:"keep",f=s&&s.implicit?s.implicit:"hide",o=this.args,u=n(this,l,f,o,!0),p=zr[this.fn];if(p=typeof p>"u"?this.op:p,o.length===1){var h=hu(this,l),d=o[0].toTex(s);return u[0]&&(d="\\\\left(".concat(d,"\\\\right)")),h==="right"?p+d:d+p}else if(o.length===2){var x=o[0],v=x.toTex(s);u[0]&&(v="\\\\left(".concat(v,"\\\\right)"));var y=o[1],w=y.toTex(s);u[1]&&(w="\\\\left(".concat(w,"\\\\right)"));var C;switch(l==="keep"?C=x.getIdentifier():C=x.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return p+"{"+v+"}{"+w+"}";case"OperatorNode:pow":switch(v="{"+v+"}",w="{"+w+"}",C){case"ConditionalNode":case"OperatorNode:divide":v="\\\\left(".concat(v,"\\\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&f==="hide")return v+"~"+w}return v+p+w}else if(o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var b=o.map(function(A,E){return A=A.toTex(s),u[E]&&(A="\\\\left(".concat(A,"\\\\right)")),A});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&f==="hide"?b.join("~"):b.join(p)}else return"\\\\mathrm{"+this.fn+"}\\\\left("+o.map(function(A){return A.toTex(s)}).join(",")+"\\\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Ur(i,"name",_p),i},{isClass:!0,isNode:!0});var Tp="ParenthesisNode",fz=["Node"],W2=T(Tp,fz,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),!Sr(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return Tp}get isParenthesisNode(){return!0}_compile(i,a){return this.content._compile(i,a)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var a=i(this.content,"content",this);return new t(a)}clone(){return new t(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:Tp,content:this.content}}static fromJSON(i){return new t(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'('+this.content.toHTML(i)+')':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\\\left(".concat(this.content.toTex(i),"\\\\right)"):this.content.toTex(i)}}return Ur(t,"name",Tp),t},{isClass:!0,isNode:!0});var Fp="RangeNode",lz=["Node"],V2=T(Fp,lz,e=>{var{Node:r}=e;function t(i,a,s){var l=Gr(i,a,s),f={},o=Gr(i.start,a,s);if(f.start=o!==null&&o<=l||a==="all",i.step){var u=Gr(i.step,a,s);f.step=u!==null&&u<=l||a==="all"}var p=Gr(i.end,a,s);return f.end=p!==null&&p<=l||a==="all",f}class n extends r{constructor(a,s,l){if(super(),!Sr(a))throw new TypeError("Node expected");if(!Sr(s))throw new TypeError("Node expected");if(l&&!Sr(l))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=a,this.end=s,this.step=l||null}get type(){return Fp}get isRangeNode(){return!0}needsEnd(){var a=this.filter(function(s){return rt(s)&&s.name==="end"});return a.length>0}_compile(a,s){var l=a.range,f=this.start._compile(a,s),o=this.end._compile(a,s);if(this.step){var u=this.step._compile(a,s);return function(h,d,x){return l(f(h,d,x),o(h,d,x),u(h,d,x))}}else return function(h,d,x){return l(f(h,d,x),o(h,d,x))}}forEach(a){a(this.start,"start",this),a(this.end,"end",this),this.step&&a(this.step,"step",this)}map(a){return new n(this._ifNode(a(this.start,"start",this)),this._ifNode(a(this.end,"end",this)),this.step&&this._ifNode(a(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=t(this,s,a&&a.implicit),f,o=this.start.toString(a);if(l.start&&(o="("+o+")"),f=o,this.step){var u=this.step.toString(a);l.step&&(u="("+u+")"),f+=":"+u}var p=this.end.toString(a);return l.end&&(p="("+p+")"),f+=":"+p,f}toJSON(){return{mathjs:Fp,start:this.start,end:this.end,step:this.step}}static fromJSON(a){return new n(a.start,a.end,a.step)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=t(this,s,a&&a.implicit),f,o=this.start.toHTML(a);if(l.start&&(o='('+o+')'),f=o,this.step){var u=this.step.toHTML(a);l.step&&(u='('+u+')'),f+=':'+u}var p=this.end.toHTML(a);return l.end&&(p='('+p+')'),f+=':'+p,f}_toTex(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=t(this,s,a&&a.implicit),f=this.start.toTex(a);if(l.start&&(f="\\\\left(".concat(f,"\\\\right)")),this.step){var o=this.step.toTex(a);l.step&&(o="\\\\left(".concat(o,"\\\\right)")),f+=":"+o}var u=this.end.toTex(a);return l.end&&(u="\\\\left(".concat(u,"\\\\right)")),f+=":"+u,f}}return Ur(n,"name",Fp),n},{isClass:!0,isNode:!0});var Op="RelationalNode",cz=["Node"],Y2=T(Op,cz,e=>{var{Node:r}=e,t={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends r{constructor(a,s){if(super(),!Array.isArray(a))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(s))throw new TypeError("Parameter params must be an array");if(a.length!==s.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=a,this.params=s}get type(){return Op}get isRelationalNode(){return!0}_compile(a,s){var l=this,f=this.params.map(o=>o._compile(a,s));return function(u,p,h){for(var d,x=f[0](u,p,h),v=0;va(s,"params["+l+"]",this),this)}map(a){return new n(this.conditionals.slice(),this.params.map((s,l)=>this._ifNode(a(s,"params["+l+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",l=Gr(this,s,a&&a.implicit),f=this.params.map(function(p,h){var d=Gr(p,s,a&&a.implicit);return s==="all"||d!==null&&d<=l?"("+p.toString(a)+")":p.toString(a)}),o=f[0],u=0;u('+p.toHTML(a)+')':p.toHTML(a)}),o=f[0],u=0;u'+Qt(t[this.conditionals[u]])+""+f[u+1];return o}_toTex(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",l=Gr(this,s,a&&a.implicit),f=this.params.map(function(p,h){var d=Gr(p,s,a&&a.implicit);return s==="all"||d!==null&&d<=l?"\\\\left("+p.toTex(a)+"\\right)":p.toTex(a)}),o=f[0],u=0;u{var{math:r,Unit:t,Node:n}=e;function i(s){return t?t.isValuelessUnit(s):!1}class a extends n{constructor(l){if(super(),typeof l!="string")throw new TypeError('String expected for parameter "name"');this.name=l}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(l,f){var o=this.name;if(f[o]===!0)return function(p,h,d){return gt(h,o)};if(o in l)return function(p,h,d){return p.has(o)?p.get(o):gt(l,o)};var u=i(o);return function(p,h,d){return p.has(o)?p.get(o):u?new t(null,o):a.onUndefinedSymbol(o)}}forEach(l){}map(l){return this.clone()}static onUndefinedSymbol(l){throw new Error("Undefined symbol "+l)}clone(){return new a(this.name)}_toString(l){return this.name}_toHTML(l){var f=Qt(this.name);return f==="true"||f==="false"?''+f+"":f==="i"?''+f+"":f==="Infinity"?''+f+"":f==="NaN"?''+f+"":f==="null"?''+f+"":f==="undefined"?''+f+"":''+f+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(l){return new a(l.name)}_toTex(l){var f=!1;typeof r[this.name]>"u"&&i(this.name)&&(f=!0);var o=Np(this.name,f);return o[0]==="\\\\"?o:" "+o}}return a},{isClass:!0,isNode:!0});var Bp="FunctionNode",hz=["math","Node","SymbolNode"],G2=T(Bp,hz,e=>{var r,{math:t,Node:n,SymbolNode:i}=e,a=f=>lr(f,{truncate:78});function s(f,o,u){for(var p="",h=/\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)/gi,d=0,x;(x=h.exec(f))!==null;)if(p+=f.substring(d,x.index),d=x.index,x[0]==="$$")p+="$",d++;else{d+=x[0].length;var v=o[x[1]];if(!v)throw new ReferenceError("Template: Property "+x[1]+" does not exist.");if(x[2]===void 0)switch(typeof v){case"string":p+=v;break;case"object":if(Sr(v))p+=v.toTex(u);else if(Array.isArray(v))p+=v.map(function(y,w){if(Sr(y))return y.toTex(u);throw new TypeError("Template: "+x[1]+"["+w+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes")}else if(Sr(v[x[2]]&&v[x[2]]))p+=v[x[2]].toTex(u);else throw new TypeError("Template: "+x[1]+"["+x[2]+"] is not a Node.")}return p+=f.slice(d),p}class l extends n{constructor(o,u){if(super(),typeof o=="string"&&(o=new i(o)),!Sr(o))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(u)||!u.every(Sr))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=o,this.args=u||[]}get name(){return this.fn.name||""}get type(){return Bp}get isFunctionNode(){return!0}_compile(o,u){var p=this.args.map(F=>F._compile(o,u));if(rt(this.fn)){var h=this.fn.name;if(u[h]){var w=this.args;return function(M,_,k){var L=gt(_,h);if(typeof L!="function")throw new TypeError("Argument '".concat(h,"' was not a function; received: ").concat(a(L)));if(L.rawArgs)return L(w,o,os(M,_));var Y=p.map($=>$(M,_,k));return L.apply(L,Y)}}else{var d=h in o?gt(o,h):void 0,x=typeof d=="function"&&d.rawArgs===!0,v=F=>{var M;if(F.has(h))M=F.get(h);else if(h in o)M=gt(o,h);else return l.onUndefinedFunction(h);if(typeof M=="function")return M;throw new TypeError("'".concat(h,\`' is not a function; its value is: + \`).concat(a(M)))};if(x){var y=this.args;return function(M,_,k){var L=v(M);return L(y,o,os(M,_))}}else switch(p.length){case 0:return function(M,_,k){var L=v(M);return L()};case 1:return function(M,_,k){var L=v(M),Y=p[0];return L(Y(M,_,k))};case 2:return function(M,_,k){var L=v(M),Y=p[0],$=p[1];return L(Y(M,_,k),$(M,_,k))};default:return function(M,_,k){var L=v(M),Y=p.map($=>$(M,_,k));return L(...Y)}}}}else if(Sn(this.fn)&&kn(this.fn.index)&&this.fn.index.isObjectProperty()){var C=this.fn.object._compile(o,u),b=this.fn.index.getObjectProperty(),A=this.args;return function(M,_,k){var L=C(M,_,k),Y=_y(L,b);if(Y!=null&&Y.rawArgs)return Y(A,o,os(M,_));var $=p.map(V=>V(M,_,k));return Y.apply(L,$)}}else{var E=this.fn.toString(),S=this.fn._compile(o,u),O=this.args;return function(M,_,k){var L=S(M,_,k);if(typeof L!="function")throw new TypeError("Expression '".concat(E,"' did not evaluate to a function; value is:")+\` + \`.concat(a(L)));if(L.rawArgs)return L(O,o,os(M,_));var Y=p.map($=>$(M,_,k));return L.apply(L,Y)}}}forEach(o){o(this.fn,"fn",this);for(var u=0;u'+Qt(this.fn)+'('+u.join(',')+')'}toTex(o){var u;return o&&typeof o.handler=="object"&&$e(o.handler,this.name)&&(u=o.handler[this.name](this,o)),typeof u<"u"?u:super.toTex(o)}_toTex(o){var u=this.args.map(function(d){return d.toTex(o)}),p;hg[this.name]&&(p=hg[this.name]),t[this.name]&&(typeof t[this.name].toTex=="function"||typeof t[this.name].toTex=="object"||typeof t[this.name].toTex=="string")&&(p=t[this.name].toTex);var h;switch(typeof p){case"function":h=p(this,o);break;case"string":h=s(p,this,o);break;case"object":switch(typeof p[u.length]){case"function":h=p[u.length](this,o);break;case"string":h=s(p[u.length],this,o);break}}return typeof h<"u"?h:s(k2,this,o)}getIdentifier(){return this.type+":"+this.name}}return r=l,Ur(l,"name",Bp),Ur(l,"onUndefinedFunction",function(f){throw new Error("Undefined function "+f)}),Ur(l,"fromJSON",function(f){return new r(f.fn,f.args)}),l},{isClass:!0,isNode:!0});var $2="parse",dz=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],Z2=T($2,dz,e=>{var{typed:r,numeric:t,config:n,AccessorNode:i,ArrayNode:a,AssignmentNode:s,BlockNode:l,ConditionalNode:f,ConstantNode:o,FunctionAssignmentNode:u,FunctionNode:p,IndexNode:h,ObjectNode:d,OperatorNode:x,ParenthesisNode:v,RangeNode:y,RelationalNode:w,SymbolNode:C}=e,b=r($2,{string:function(Q){return me(Q,{})},"Array | Matrix":function(Q){return A(Q,{})},"string, Object":function(Q,ve){var Be=ve.nodes!==void 0?ve.nodes:{};return me(Q,Be)},"Array | Matrix, Object":A});function A(B){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ve=Q.nodes!==void 0?Q.nodes:{};return Je(B,function(Be){if(typeof Be!="string")throw new TypeError("String expected");return me(Be,ve)})}var E={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},S={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},O={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},F={true:!0,false:!1,null:null,undefined:void 0},M=["NaN","Infinity"],_={'"':'"',"'":"'","\\\\":"\\\\","/":"/",b:"\\b",f:"\\f",n:\` \`,r:"\\r",t:" "};function k(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:E.NULL,nestingLevel:0,conditionalLevel:null}}function L(B,Q){return B.expression.substr(B.index,Q)}function Y(B){return L(B,1)}function $(B){B.index++}function V(B){return B.expression.charAt(B.index-1)}function q(B){return B.expression.charAt(B.index+1)}function R(B){for(B.tokenType=E.NULL,B.token="",B.comment="";;){if(Y(B)==="#")for(;Y(B)!==\` \`&&Y(B)!=="";)B.comment+=Y(B),$(B);if(b.isWhitespace(Y(B),B.nestingLevel))$(B);else break}if(Y(B)===""){B.tokenType=E.DELIMITER;return}if(Y(B)===\` \`&&!B.nestingLevel){B.tokenType=E.DELIMITER,B.token=Y(B),$(B);return}var Q=Y(B),ve=L(B,2),Be=L(B,3);if(Be.length===3&&S[Be]){B.tokenType=E.DELIMITER,B.token=Be,$(B),$(B),$(B);return}if(ve.length===2&&S[ve]){B.tokenType=E.DELIMITER,B.token=ve,$(B),$(B);return}if(S[Q]){B.tokenType=E.DELIMITER,B.token=Q,$(B);return}if(b.isDigitDot(Q)){B.tokenType=E.NUMBER;var er=L(B,2);if(er==="0b"||er==="0o"||er==="0x"){for(B.token+=Y(B),$(B),B.token+=Y(B),$(B);b.isHexDigit(Y(B));)B.token+=Y(B),$(B);if(Y(B)===".")for(B.token+=".",$(B);b.isHexDigit(Y(B));)B.token+=Y(B),$(B);else if(Y(B)==="i")for(B.token+="i",$(B);b.isDigit(Y(B));)B.token+=Y(B),$(B);return}if(Y(B)==="."){if(B.token+=Y(B),$(B),!b.isDigit(Y(B))){B.tokenType=E.DELIMITER;return}}else{for(;b.isDigit(Y(B));)B.token+=Y(B),$(B);b.isDecimalMark(Y(B),q(B))&&(B.token+=Y(B),$(B))}for(;b.isDigit(Y(B));)B.token+=Y(B),$(B);if(Y(B)==="E"||Y(B)==="e"){if(b.isDigit(q(B))||q(B)==="-"||q(B)==="+"){if(B.token+=Y(B),$(B),(Y(B)==="+"||Y(B)==="-")&&(B.token+=Y(B),$(B)),!b.isDigit(Y(B)))throw Pe(B,'Digit expected, got "'+Y(B)+'"');for(;b.isDigit(Y(B));)B.token+=Y(B),$(B);if(b.isDecimalMark(Y(B),q(B)))throw Pe(B,'Digit expected, got "'+Y(B)+'"')}else if(q(B)===".")throw $(B),Pe(B,'Digit expected, got "'+Y(B)+'"')}return}if(b.isAlpha(Y(B),V(B),q(B))){for(;b.isAlpha(Y(B),V(B),q(B))||b.isDigit(Y(B));)B.token+=Y(B),$(B);$e(O,B.token)?B.tokenType=E.DELIMITER:B.tokenType=E.SYMBOL;return}for(B.tokenType=E.UNKNOWN;Y(B)!=="";)B.token+=Y(B),$(B);throw Pe(B,'Syntax error in part "'+B.token+'"')}function j(B){do R(B);while(B.token===\` @@ -88251,16 +88479,16 @@ Arguments: \`+Array.prototype.slice.call(z).join("")+\` \`&&ve>0},b.isDecimalMark=function(Q,ve){return Q==="."&&ve!=="/"&&ve!=="*"&&ve!=="^"},b.isDigitDot=function(Q){return Q>="0"&&Q<="9"||Q==="."},b.isDigit=function(Q){return Q>="0"&&Q<="9"},b.isHexDigit=function(Q){return Q>="0"&&Q<="9"||Q>="a"&&Q<="f"||Q>="A"&&Q<="F"};function me(B,Q){var ve=k();Mt(ve,{expression:B,extraNodes:Q}),R(ve);var Be=ie(ve);if(ve.token!=="")throw ve.tokenType===E.DELIMITER?We(ve,"Unexpected operator "+ve.token):Pe(ve,'Unexpected part "'+ve.token+'"');return Be}function ie(B){var Q,ve=[],Be;for(B.token!==""&&B.token!==\` \`&&B.token!==";"&&(Q=H(B),B.comment&&(Q.comment=B.comment));B.token===\` \`||B.token===";";)ve.length===0&&Q&&(Be=B.token!==";",ve.push({node:Q,visible:Be})),R(B),B.token!==\` -\`&&B.token!==";"&&B.token!==""&&(Q=H(B),B.comment&&(Q.comment=B.comment),Be=B.token!==";",ve.push({node:Q,visible:Be}));return ve.length>0?new c(ve):(Q||(Q=new o(void 0),B.comment&&(Q.comment=B.comment)),Q)}function H(B){var Q,ve,Be,er,fr=ce(B);if(B.token==="="){if(rt(fr))return Q=fr.name,j(B),Be=H(B),new s(new C(Q),Be);if(Sn(fr))return j(B),Be=H(B),new s(fr.object,fr.index,Be);if(fn(fr)&&rt(fr.fn)&&(er=!0,ve=[],Q=fr.name,fr.args.forEach(function(Zr,_t){rt(Zr)?ve[_t]=Zr.name:er=!1}),er))return j(B),Be=H(B),new u(Q,ve,Be);throw Pe(B,"Invalid left hand side of assignment operator =")}return fr}function ce(B){for(var Q=Me(B);B.token==="?";){var ve=B.conditionalLevel;B.conditionalLevel=B.nestingLevel,j(B);var Be=Q,er=H(B);if(B.token!==":")throw Pe(B,"False part of conditional expression expected");B.conditionalLevel=null,j(B);var fr=H(B);Q=new f(Be,er,fr),B.conditionalLevel=ve}return Q}function Me(B){for(var Q=pe(B);B.token==="or";)j(B),Q=new x("or","or",[Q,pe(B)]);return Q}function pe(B){for(var Q=ge(B);B.token==="xor";)j(B),Q=new x("xor","xor",[Q,ge(B)]);return Q}function ge(B){for(var Q=Se(B);B.token==="and";)j(B),Q=new x("and","and",[Q,Se(B)]);return Q}function Se(B){for(var Q=xe(B);B.token==="|";)j(B),Q=new x("|","bitOr",[Q,xe(B)]);return Q}function xe(B){for(var Q=be(B);B.token==="^|";)j(B),Q=new x("^|","bitXor",[Q,be(B)]);return Q}function be(B){for(var Q=De(B);B.token==="&";)j(B),Q=new x("&","bitAnd",[Q,De(B)]);return Q}function De(B){for(var Q=[Ae(B)],ve=[],Be={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};$e(Be,B.token);){var er={name:B.token,fn:Be[B.token]};ve.push(er),j(B),Q.push(Ae(B))}return Q.length===1?Q[0]:Q.length===2?new x(ve[0].name,ve[0].fn,Q):new w(ve.map(fr=>fr.fn),Q)}function Ae(B){var Q,ve,Be,er;Q=ze(B);for(var fr={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};$e(fr,B.token);)ve=B.token,Be=fr[ve],j(B),er=[Q,ze(B)],Q=new x(ve,Be,er);return Q}function ze(B){var Q,ve,Be,er;Q=Ze(B);for(var fr={to:"to",in:"to"};$e(fr,B.token);)ve=B.token,Be=fr[ve],j(B),ve==="in"&&B.token===""?Q=new x("*","multiply",[Q,new C("in")],!0):(er=[Q,Ze(B)],Q=new x(ve,Be,er));return Q}function Ze(B){var Q,ve=[];if(B.token===":"?Q=new o(1):Q=K(B),B.token===":"&&B.conditionalLevel!==B.nestingLevel){for(ve.push(Q);B.token===":"&&ve.length<3;)j(B),B.token===")"||B.token==="]"||B.token===","||B.token===""?ve.push(new C("end")):ve.push(K(B));ve.length===3?Q=new y(ve[0],ve[2],ve[1]):Q=new y(ve[0],ve[1])}return Q}function K(B){var Q,ve,Be,er;Q=te(B);for(var fr={"+":"add","-":"subtract"};$e(fr,B.token);){ve=B.token,Be=fr[ve],j(B);var Zr=te(B);Zr.isPercentage?er=[Q,new x("*","multiply",[Q,Zr])]:er=[Q,Zr],Q=new x(ve,Be,er)}return Q}function te(B){var Q,ve,Be,er;Q=ye(B),ve=Q;for(var fr={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};$e(fr,B.token);)Be=B.token,er=fr[Be],j(B),ve=ye(B),Q=new x(Be,er,[Q,ve]);return Q}function ye(B){var Q,ve;for(Q=ee(B),ve=Q;B.tokenType===E.SYMBOL||B.token==="in"&&yr(Q)||B.tokenType===E.NUMBER&&!yr(ve)&&(!ut(ve)||ve.op==="!")||B.token==="(";)ve=ee(B),Q=new x("*","multiply",[Q,ve],!0);return Q}function ee(B){for(var Q=ne(B),ve=Q,Be=[];B.token==="/"&&hf(ve);)if(Be.push(Mt({},B)),j(B),B.tokenType===E.NUMBER)if(Be.push(Mt({},B)),j(B),B.tokenType===E.SYMBOL||B.token==="(")Mt(B,Be.pop()),Be.pop(),ve=ne(B),Q=new x("/","divide",[Q,ve]);else{Be.pop(),Mt(B,Be.pop());break}else{Mt(B,Be.pop());break}return Q}function ne(B){var Q,ve,Be,er;Q=ue(B);for(var fr={"%":"mod",mod:"mod"};$e(fr,B.token);)ve=B.token,Be=fr[ve],j(B),ve==="%"&&B.tokenType===E.DELIMITER&&B.token!=="("?Q=new x("/","divide",[Q,new o(100)],!1,!0):(er=[Q,ue(B)],Q=new x(ve,Be,er));return Q}function ue(B){var Q,ve,Be,er={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return $e(er,B.token)?(Be=er[B.token],Q=B.token,j(B),ve=[ue(B)],new x(Q,Be,ve)):Ee(B)}function Ee(B){var Q,ve,Be,er;return Q=Ce(B),(B.token==="^"||B.token===".^")&&(ve=B.token,Be=ve==="^"?"pow":"dotPow",j(B),er=[Q,ue(B)],Q=new x(ve,Be,er)),Q}function Ce(B){var Q,ve,Be,er;Q=Le(B);for(var fr={"!":"factorial","'":"ctranspose"};$e(fr,B.token);)ve=B.token,Be=fr[ve],R(B),er=[Q],Q=new x(ve,Be,er),Q=sr(B,Q);return Q}function Le(B){var Q=[];if(B.tokenType===E.SYMBOL&&$e(B.extraNodes,B.token)){var ve=B.extraNodes[B.token];if(R(B),B.token==="("){if(Q=[],U(B),R(B),B.token!==")")for(Q.push(H(B));B.token===",";)R(B),Q.push(H(B));if(B.token!==")")throw Pe(B,"Parenthesis ) expected");oe(B),R(B)}return new ve(Q)}return Ie(B)}function Ie(B){var Q,ve;return B.tokenType===E.SYMBOL||B.tokenType===E.DELIMITER&&B.token in O?(ve=B.token,R(B),$e(F,ve)?Q=new o(F[ve]):M.indexOf(ve)!==-1?Q=new o(t(ve,"number")):Q=new C(ve),Q=sr(B,Q),Q):ir(B)}function sr(B,Q,ve){for(var Be;(B.token==="("||B.token==="["||B.token===".")&&(!ve||ve.indexOf(B.token)!==-1);)if(Be=[],B.token==="(")if(rt(Q)||Sn(Q)){if(U(B),R(B),B.token!==")")for(Be.push(H(B));B.token===",";)R(B),Be.push(H(B));if(B.token!==")")throw Pe(B,"Parenthesis ) expected");oe(B),R(B),Q=new p(Q,Be)}else return Q;else if(B.token==="["){if(U(B),R(B),B.token!=="]")for(Be.push(H(B));B.token===",";)R(B),Be.push(H(B));if(B.token!=="]")throw Pe(B,"Parenthesis ] expected");oe(B),R(B),Q=new i(Q,new h(Be))}else{R(B);var er=B.tokenType===E.SYMBOL||B.tokenType===E.DELIMITER&&B.token in O;if(!er)throw Pe(B,"Property name expected after dot");Be.push(new o(B.token)),R(B);var fr=!0;Q=new i(Q,new h(Be,fr))}return Q}function ir(B){var Q,ve;return B.token==='"'||B.token==="'"?(ve=Xe(B,B.token),Q=new o(ve),Q=sr(B,Q),Q):Or(B)}function Xe(B,Q){for(var ve="";Y(B)!==""&&Y(B)!==Q;)if(Y(B)==="\\\\"){$(B);var Be=Y(B),er=_[Be];if(er!==void 0)ve+=er,B.index+=1;else if(Be==="u"){var fr=B.expression.slice(B.index+1,B.index+5);if(/^[0-9A-Fa-f]{4}$/.test(fr))ve+=String.fromCharCode(parseInt(fr,16)),B.index+=5;else throw Pe(B,"Invalid unicode character \\\\u".concat(fr))}else throw Pe(B,"Bad escape character \\\\".concat(Be))}else ve+=Y(B),$(B);if(R(B),B.token!==Q)throw Pe(B,"End of string ".concat(Q," expected"));return R(B),ve}function Or(B){var Q,ve,Be,er;if(B.token==="["){if(U(B),R(B),B.token!=="]"){var fr=re(B);if(B.token===";"){for(Be=1,ve=[fr];B.token===";";)R(B),B.token!=="]"&&(ve[Be]=re(B),Be++);if(B.token!=="]")throw Pe(B,"End of matrix ] expected");oe(B),R(B),er=ve[0].items.length;for(var Zr=1;Zr{var{typed:r,parse:t}=e;return r(Z2,{string:function(i){return t(i).compile()},"Array | Matrix":function(i){return Je(i,function(a){return t(a).compile()})}})});var X2="evaluate",dz=["typed","parse"],J2=T(X2,dz,e=>{var{typed:r,parse:t}=e;return r(X2,{string:function(i){var a=vo();return t(i).compile().evaluate(a)},"string, Map | Object":function(i,a){return t(i).compile().evaluate(a)},"Array | Matrix":function(i){var a=vo();return Je(i,function(s){return t(s).compile().evaluate(a)})},"Array | Matrix, Map | Object":function(i,a){return Je(i,function(s){return t(s).compile().evaluate(a)})}})});var vz="Parser",gz=["evaluate"],K2=T(vz,gz,e=>{var{evaluate:r}=e;function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:vo(),writable:!1})}return t.prototype.type="Parser",t.prototype.isParser=!0,t.prototype.evaluate=function(n){return r(n,this.scope)},t.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},t.prototype.getAll=function(){return Fy(this.scope)},t.prototype.getAllAsMap=function(){return this.scope},t.prototype.set=function(n,i){return this.scope.set(n,i),i},t.prototype.remove=function(n){this.scope.delete(n)},t.prototype.clear=function(){this.scope.clear()},t},{isClass:!0});var j2="parser",xz=["typed","Parser"],eA=T(j2,xz,e=>{var{typed:r,Parser:t}=e;return r(j2,{"":function(){return new t}})});var rA="lup",yz=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],tA=T(rA,yz,e=>{var{typed:r,matrix:t,abs:n,addScalar:i,divideScalar:a,multiplyScalar:s,subtractScalar:c,larger:f,equalScalar:o,unaryMinus:u,DenseMatrix:p,SparseMatrix:h,Spa:d}=e;return r(rA,{DenseMatrix:function(w){return x(w)},SparseMatrix:function(w){return v(w)},Array:function(w){var C=t(w),b=x(C);return{L:b.L.valueOf(),U:b.U.valueOf(),p:b.p}}});function x(y){var w=y._size[0],C=y._size[1],b=Math.min(w,C),A=tr(y._data),E=[],S=[w,b],O=[],F=[b,C],M,_,k,L=[];for(M=0;M0)for(M=0;M0?new l(ve):(Q||(Q=new o(void 0),B.comment&&(Q.comment=B.comment)),Q)}function H(B){var Q,ve,Be,er,fr=ce(B);if(B.token==="="){if(rt(fr))return Q=fr.name,j(B),Be=H(B),new s(new C(Q),Be);if(Sn(fr))return j(B),Be=H(B),new s(fr.object,fr.index,Be);if(fn(fr)&&rt(fr.fn)&&(er=!0,ve=[],Q=fr.name,fr.args.forEach(function(Zr,_t){rt(Zr)?ve[_t]=Zr.name:er=!1}),er))return j(B),Be=H(B),new u(Q,ve,Be);throw Pe(B,"Invalid left hand side of assignment operator =")}return fr}function ce(B){for(var Q=Me(B);B.token==="?";){var ve=B.conditionalLevel;B.conditionalLevel=B.nestingLevel,j(B);var Be=Q,er=H(B);if(B.token!==":")throw Pe(B,"False part of conditional expression expected");B.conditionalLevel=null,j(B);var fr=H(B);Q=new f(Be,er,fr),B.conditionalLevel=ve}return Q}function Me(B){for(var Q=pe(B);B.token==="or";)j(B),Q=new x("or","or",[Q,pe(B)]);return Q}function pe(B){for(var Q=ge(B);B.token==="xor";)j(B),Q=new x("xor","xor",[Q,ge(B)]);return Q}function ge(B){for(var Q=Se(B);B.token==="and";)j(B),Q=new x("and","and",[Q,Se(B)]);return Q}function Se(B){for(var Q=xe(B);B.token==="|";)j(B),Q=new x("|","bitOr",[Q,xe(B)]);return Q}function xe(B){for(var Q=be(B);B.token==="^|";)j(B),Q=new x("^|","bitXor",[Q,be(B)]);return Q}function be(B){for(var Q=De(B);B.token==="&";)j(B),Q=new x("&","bitAnd",[Q,De(B)]);return Q}function De(B){for(var Q=[Ae(B)],ve=[],Be={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};$e(Be,B.token);){var er={name:B.token,fn:Be[B.token]};ve.push(er),j(B),Q.push(Ae(B))}return Q.length===1?Q[0]:Q.length===2?new x(ve[0].name,ve[0].fn,Q):new w(ve.map(fr=>fr.fn),Q)}function Ae(B){var Q,ve,Be,er;Q=ze(B);for(var fr={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};$e(fr,B.token);)ve=B.token,Be=fr[ve],j(B),er=[Q,ze(B)],Q=new x(ve,Be,er);return Q}function ze(B){var Q,ve,Be,er;Q=Ze(B);for(var fr={to:"to",in:"to"};$e(fr,B.token);)ve=B.token,Be=fr[ve],j(B),ve==="in"&&B.token===""?Q=new x("*","multiply",[Q,new C("in")],!0):(er=[Q,Ze(B)],Q=new x(ve,Be,er));return Q}function Ze(B){var Q,ve=[];if(B.token===":"?Q=new o(1):Q=K(B),B.token===":"&&B.conditionalLevel!==B.nestingLevel){for(ve.push(Q);B.token===":"&&ve.length<3;)j(B),B.token===")"||B.token==="]"||B.token===","||B.token===""?ve.push(new C("end")):ve.push(K(B));ve.length===3?Q=new y(ve[0],ve[2],ve[1]):Q=new y(ve[0],ve[1])}return Q}function K(B){var Q,ve,Be,er;Q=te(B);for(var fr={"+":"add","-":"subtract"};$e(fr,B.token);){ve=B.token,Be=fr[ve],j(B);var Zr=te(B);Zr.isPercentage?er=[Q,new x("*","multiply",[Q,Zr])]:er=[Q,Zr],Q=new x(ve,Be,er)}return Q}function te(B){var Q,ve,Be,er;Q=ye(B),ve=Q;for(var fr={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};$e(fr,B.token);)Be=B.token,er=fr[Be],j(B),ve=ye(B),Q=new x(Be,er,[Q,ve]);return Q}function ye(B){var Q,ve;for(Q=ee(B),ve=Q;B.tokenType===E.SYMBOL||B.token==="in"&&yr(Q)||B.tokenType===E.NUMBER&&!yr(ve)&&(!ut(ve)||ve.op==="!")||B.token==="(";)ve=ee(B),Q=new x("*","multiply",[Q,ve],!0);return Q}function ee(B){for(var Q=ne(B),ve=Q,Be=[];B.token==="/"&&df(ve);)if(Be.push(Mt({},B)),j(B),B.tokenType===E.NUMBER)if(Be.push(Mt({},B)),j(B),B.tokenType===E.SYMBOL||B.token==="(")Mt(B,Be.pop()),Be.pop(),ve=ne(B),Q=new x("/","divide",[Q,ve]);else{Be.pop(),Mt(B,Be.pop());break}else{Mt(B,Be.pop());break}return Q}function ne(B){var Q,ve,Be,er;Q=ue(B);for(var fr={"%":"mod",mod:"mod"};$e(fr,B.token);)ve=B.token,Be=fr[ve],j(B),ve==="%"&&B.tokenType===E.DELIMITER&&B.token!=="("?Q=new x("/","divide",[Q,new o(100)],!1,!0):(er=[Q,ue(B)],Q=new x(ve,Be,er));return Q}function ue(B){var Q,ve,Be,er={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return $e(er,B.token)?(Be=er[B.token],Q=B.token,j(B),ve=[ue(B)],new x(Q,Be,ve)):Ee(B)}function Ee(B){var Q,ve,Be,er;return Q=Ce(B),(B.token==="^"||B.token===".^")&&(ve=B.token,Be=ve==="^"?"pow":"dotPow",j(B),er=[Q,ue(B)],Q=new x(ve,Be,er)),Q}function Ce(B){var Q,ve,Be,er;Q=Le(B);for(var fr={"!":"factorial","'":"ctranspose"};$e(fr,B.token);)ve=B.token,Be=fr[ve],R(B),er=[Q],Q=new x(ve,Be,er),Q=sr(B,Q);return Q}function Le(B){var Q=[];if(B.tokenType===E.SYMBOL&&$e(B.extraNodes,B.token)){var ve=B.extraNodes[B.token];if(R(B),B.token==="("){if(Q=[],U(B),R(B),B.token!==")")for(Q.push(H(B));B.token===",";)R(B),Q.push(H(B));if(B.token!==")")throw Pe(B,"Parenthesis ) expected");oe(B),R(B)}return new ve(Q)}return Ie(B)}function Ie(B){var Q,ve;return B.tokenType===E.SYMBOL||B.tokenType===E.DELIMITER&&B.token in O?(ve=B.token,R(B),$e(F,ve)?Q=new o(F[ve]):M.indexOf(ve)!==-1?Q=new o(t(ve,"number")):Q=new C(ve),Q=sr(B,Q),Q):ir(B)}function sr(B,Q,ve){for(var Be;(B.token==="("||B.token==="["||B.token===".")&&(!ve||ve.indexOf(B.token)!==-1);)if(Be=[],B.token==="(")if(rt(Q)||Sn(Q)){if(U(B),R(B),B.token!==")")for(Be.push(H(B));B.token===",";)R(B),Be.push(H(B));if(B.token!==")")throw Pe(B,"Parenthesis ) expected");oe(B),R(B),Q=new p(Q,Be)}else return Q;else if(B.token==="["){if(U(B),R(B),B.token!=="]")for(Be.push(H(B));B.token===",";)R(B),Be.push(H(B));if(B.token!=="]")throw Pe(B,"Parenthesis ] expected");oe(B),R(B),Q=new i(Q,new h(Be))}else{R(B);var er=B.tokenType===E.SYMBOL||B.tokenType===E.DELIMITER&&B.token in O;if(!er)throw Pe(B,"Property name expected after dot");Be.push(new o(B.token)),R(B);var fr=!0;Q=new i(Q,new h(Be,fr))}return Q}function ir(B){var Q,ve;return B.token==='"'||B.token==="'"?(ve=Xe(B,B.token),Q=new o(ve),Q=sr(B,Q),Q):Or(B)}function Xe(B,Q){for(var ve="";Y(B)!==""&&Y(B)!==Q;)if(Y(B)==="\\\\"){$(B);var Be=Y(B),er=_[Be];if(er!==void 0)ve+=er,B.index+=1;else if(Be==="u"){var fr=B.expression.slice(B.index+1,B.index+5);if(/^[0-9A-Fa-f]{4}$/.test(fr))ve+=String.fromCharCode(parseInt(fr,16)),B.index+=5;else throw Pe(B,"Invalid unicode character \\\\u".concat(fr))}else throw Pe(B,"Bad escape character \\\\".concat(Be))}else ve+=Y(B),$(B);if(R(B),B.token!==Q)throw Pe(B,"End of string ".concat(Q," expected"));return R(B),ve}function Or(B){var Q,ve,Be,er;if(B.token==="["){if(U(B),R(B),B.token!=="]"){var fr=re(B);if(B.token===";"){for(Be=1,ve=[fr];B.token===";";)R(B),B.token!=="]"&&(ve[Be]=re(B),Be++);if(B.token!=="]")throw Pe(B,"End of matrix ] expected");oe(B),R(B),er=ve[0].items.length;for(var Zr=1;Zr{var{typed:r,parse:t}=e;return r(Q2,{string:function(i){return t(i).compile()},"Array | Matrix":function(i){return Je(i,function(a){return t(a).compile()})}})});var J2="evaluate",gz=["typed","parse"],K2=T(J2,gz,e=>{var{typed:r,parse:t}=e;return r(J2,{string:function(i){var a=go();return t(i).compile().evaluate(a)},"string, Map | Object":function(i,a){return t(i).compile().evaluate(a)},"Array | Matrix":function(i){var a=go();return Je(i,function(s){return t(s).compile().evaluate(a)})},"Array | Matrix, Map | Object":function(i,a){return Je(i,function(s){return t(s).compile().evaluate(a)})}})});var xz="Parser",yz=["evaluate"],j2=T(xz,yz,e=>{var{evaluate:r}=e;function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:go(),writable:!1})}return t.prototype.type="Parser",t.prototype.isParser=!0,t.prototype.evaluate=function(n){return r(n,this.scope)},t.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},t.prototype.getAll=function(){return Oy(this.scope)},t.prototype.getAllAsMap=function(){return this.scope},t.prototype.set=function(n,i){return this.scope.set(n,i),i},t.prototype.remove=function(n){this.scope.delete(n)},t.prototype.clear=function(){this.scope.clear()},t},{isClass:!0});var eA="parser",bz=["typed","Parser"],rA=T(eA,bz,e=>{var{typed:r,Parser:t}=e;return r(eA,{"":function(){return new t}})});var tA="lup",wz=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],nA=T(tA,wz,e=>{var{typed:r,matrix:t,abs:n,addScalar:i,divideScalar:a,multiplyScalar:s,subtractScalar:l,larger:f,equalScalar:o,unaryMinus:u,DenseMatrix:p,SparseMatrix:h,Spa:d}=e;return r(tA,{DenseMatrix:function(w){return x(w)},SparseMatrix:function(w){return v(w)},Array:function(w){var C=t(w),b=x(C);return{L:b.L.valueOf(),U:b.U.valueOf(),p:b.p}}});function x(y){var w=y._size[0],C=y._size[1],b=Math.min(w,C),A=tr(y._data),E=[],S=[w,b],O=[],F=[b,C],M,_,k,L=[];for(M=0;M0)for(M=0;M0&&H.forEach(0,q-1,function(xe,be){h._forEachRow(xe,O,F,M,function(De,Ae){De>xe&&H.accumulate(De,u(s(Ae,be)))})});var pe=q,ge=H.get(q),Se=n(ge);H.forEach(q+1,w-1,function(xe,be){var De=n(be);f(De,Se)&&(pe=xe,Se=De,ge=be)}),q!==pe&&(h._swapRows(q,pe,_[1],O,F,M),h._swapRows(q,pe,$[1],k,L,Y),H.swap(q,pe),oe(q,pe)),H.forEach(0,w-1,function(xe,be){xe<=q?(k.push(be),L.push(xe)):(be=a(be,ge),o(be,0)||(O.push(be),F.push(xe)))})};for(q=0;q{var{typed:r,matrix:t,zeros:n,identity:i,isZero:a,equal:s,sign:c,sqrt:f,conj:o,unaryMinus:u,addScalar:p,divideScalar:h,multiplyScalar:d,subtractScalar:x,complex:v}=e;return Mt(r(nA,{DenseMatrix:function(A){return w(A)},SparseMatrix:function(A){return C(A)},Array:function(A){var E=t(A),S=w(E);return{Q:S.Q.valueOf(),R:S.R.valueOf()}}}),{_denseQRimpl:y});function y(b){var A=b._size[0],E=b._size[1],S=i([A],"dense"),O=S._data,F=b.clone(),M=F._data,_,k,L,Y=n([A],"");for(L=0;L0)for(var S=E[0][0].type==="Complex"?v(0):0,O=0;O=0;){var f=t[s+c],o=t[n+f];o===-1?(c--,a[r++]=f):(t[n+f]=t[i+o],++c,t[s+c]=o)}return r}function oA(e,r){if(!e)return null;var t=0,n,i=[],a=[],s=0,c=r,f=2*r;for(n=0;n=0;n--)e[n]!==-1&&(a[c+n]=a[s+e[n]],a[s+e[n]]=n);for(n=0;n{var{add:r,multiply:t,transpose:n}=e;return function(u,p){if(!p||u<=0||u>3)return null;var h=p._size,d=h[0],x=h[1],v=0,y=Math.max(16,10*Math.sqrt(x));y=Math.min(x-2,y);var w=i(u,p,d,x,y);uA(w,f,null);for(var C=w._index,b=w._ptr,A=b[x],E=[],S=[],O=0,F=x+1,M=2*(x+1),_=3*(x+1),k=4*(x+1),L=5*(x+1),Y=6*(x+1),$=7*(x+1),V=E,q=a(x,b,S,O,_,V,M,$,F,Y,k,L),R=s(x,b,S,L,k,Y,y,F,_,V,M),j=0,U,oe,me,ie,H,ce,Me,pe,ge,Se,xe,be,De,Ae,ze,Ze;RK?(ce=me,Me=ee,pe=S[O+me]-K):(ce=C[ee++],Me=b[ce],pe=S[O+ce]),H=1;H<=pe;H++)U=C[Me++],!((ge=S[F+U])<=0)&&(ye+=ge,S[F+U]=-ge,C[ue++]=U,S[M+U]!==-1&&(V[S[M+U]]=V[U]),V[U]!==-1?S[M+V[U]]=S[M+U]:S[_+S[L+U]]=S[M+U]);ce!==me&&(b[ce]=Hi(me),S[Y+ce]=0)}for(K!==0&&(A=ue),S[L+me]=ye,b[me]=ne,S[O+me]=ue-ne,S[k+me]=-2,q=c(q,v,S,Y,x),Se=ne;Se=q?S[Y+ce]-=ge:S[Y+ce]!==0&&(S[Y+ce]=S[L+ce]+Ee)}for(Se=ne;Se0?(Ze+=Ce,C[Ae++]=ce,ze+=ce):(b[ce]=Hi(me),S[Y+ce]=0)}S[k+U]=Ae-be+1;var Le=Ae,Ie=be+S[O+U];for(ee=De+1;ee=0))for(ze=V[U],U=S[$+ze],S[$+ze]=-1;U!==-1&&S[M+U]!==-1;U=S[M+U],q++){for(pe=S[O+U],xe=S[k+U],ee=b[U]+1;ee<=b[U]+pe-1;ee++)S[Y+C[ee]]=q;var ir=U;for(oe=S[M+U];oe!==-1;){var Xe=S[O+oe]===pe&&S[k+oe]===xe;for(ee=b[oe]+1;Xe&&ee<=b[oe]+pe-1;ee++)S[Y+C[ee]]!==q&&(Xe=0);Xe?(b[oe]=Hi(U),S[F+U]+=S[F+oe],S[F+oe]=0,S[k+oe]=-1,oe=S[M+oe],S[M+ir]=oe):(ir=oe,oe=S[M+oe])}}for(ee=ne,Se=ne;Se=0;oe--)S[F+oe]>0||(S[M+oe]=S[_+b[oe]],S[_+b[oe]]=oe);for(ce=x;ce>=0;ce--)S[F+ce]<=0||b[ce]!==-1&&(S[M+ce]=S[_+b[ce]],S[_+b[ce]]=ce);for(me=0,U=0;U<=x;U++)b[U]===-1&&(me=Bp(U,me,S,_,M,E,Y));return E.splice(E.length-1,1),E};function i(o,u,p,h,d){var x=n(u);if(o===1&&h===p)return r(u,x);if(o===2){for(var v=x._index,y=x._ptr,w=0,C=0;Cd))for(var A=y[C+1];bv)p[y+E]=0,p[d+E]=-1,A++,u[E]=Hi(o),p[y+o]++;else{var O=p[w+S];O!==-1&&(C[O]=E),p[b+E]=p[w+S],p[w+S]=E}}return A}function c(o,u,p,h,d){if(o<2||o+u<0){for(var x=0;x{var{transpose:r}=e;return function(t,n,i,a){if(!t||!n||!i)return null;var s=t._size,c=s[0],f=s[1],o,u,p,h,d,x,v,y=4*f+(a?f+c+1:0),w=[],C=0,b=f,A=2*f,E=3*f,S=4*f,O=5*f+1;for(p=0;p=1&&F[u]++,L.jleaf===2&&F[L.q]--}n[u]!==-1&&(w[C+u]=n[u])}for(u=0;u{var{add:r,multiply:t,transpose:n}=e,i=fA({add:r,multiply:t,transpose:n}),a=cA({transpose:n});return function(f,o,u){var p=o._ptr,h=o._size,d=h[1],x,v={};if(v.q=i(f,o),f&&!v.q)return null;if(u){var y=f?aA(o,null,v.q,0):o;v.parent=sA(y,1);var w=oA(v.parent,d);if(v.cp=a(y,v.parent,w,1),y&&v.parent&&v.cp&&s(y,v))for(v.unz=0,x=0;x=0;O--)for(M=o[O],_=o[O+1],F=M;F<_;F++)y[u[F]]=O;for(S=h-1;S>=0;S--)v[S]=-1,O=y[S],O!==-1&&(w[E+O]++===0&&(w[A+O]=S),w[C+S]=w[b+O],w[b+O]=S);for(f.lnz=0,f.m2=h,O=0;O=0;){e=n[h];var d=i?i[e]:e;Ef(s,e)||(Ip(s,e),n[f+h]=d<0?0:hg(s[d]));var x=1;for(u=n[f+h],p=d<0?0:hg(s[d+1]);u{var{divideScalar:r,multiply:t,subtract:n}=e;return function(a,s,c,f,o,u,p){var h=a._values,d=a._index,x=a._ptr,v=a._size,y=v[1],w=s._values,C=s._index,b=s._ptr,A,E,S,O,F=hA(a,s,c,f,u);for(A=F;A{var{abs:r,divideScalar:t,multiply:n,subtract:i,larger:a,largerEq:s,SparseMatrix:c}=e,f=dA({divideScalar:t,multiply:n,subtract:i});return function(u,p,h){if(!u)return null;var d=u._size,x=d[1],v,y=100,w=100;p&&(v=p.q,y=p.lnz||y,w=p.unz||w);var C=[],b=[],A=[],E=new c({values:C,index:b,ptr:A,size:[x,x]}),S=[],O=[],F=[],M=new c({values:S,index:O,ptr:F,size:[x,x]}),_=[],k,L,Y=[],$=[];for(k=0;k{var{typed:r,abs:t,add:n,multiply:i,transpose:a,divideScalar:s,subtract:c,larger:f,largerEq:o,SparseMatrix:u}=e,p=pA({add:n,multiply:i,transpose:a}),h=vA({abs:t,divideScalar:s,multiply:i,subtract:c,larger:f,largerEq:o,SparseMatrix:u});return r(gA,{"SparseMatrix, number, number":function(x,v,y){if(!He(v)||v<0||v>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(y<0||y>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var w=p(v,x,!1),C=h(x,w,y);return{L:C.L,U:C.U,p:C.pinv,q:w.q,toString:function(){return"L: "+this.L.toString()+\` +P: \`+this.p}}}});var iA="qr",Dz=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],aA=T(iA,Dz,e=>{var{typed:r,matrix:t,zeros:n,identity:i,isZero:a,equal:s,sign:l,sqrt:f,conj:o,unaryMinus:u,addScalar:p,divideScalar:h,multiplyScalar:d,subtractScalar:x,complex:v}=e;return Mt(r(iA,{DenseMatrix:function(A){return w(A)},SparseMatrix:function(A){return C(A)},Array:function(A){var E=t(A),S=w(E);return{Q:S.Q.valueOf(),R:S.R.valueOf()}}}),{_denseQRimpl:y});function y(b){var A=b._size[0],E=b._size[1],S=i([A],"dense"),O=S._data,F=b.clone(),M=F._data,_,k,L,Y=n([A],"");for(L=0;L0)for(var S=E[0][0].type==="Complex"?v(0):0,O=0;O=0;){var f=t[s+l],o=t[n+f];o===-1?(l--,a[r++]=f):(t[n+f]=t[i+o],++l,t[s+l]=o)}return r}function sA(e,r){if(!e)return null;var t=0,n,i=[],a=[],s=0,l=r,f=2*r;for(n=0;n=0;n--)e[n]!==-1&&(a[l+n]=a[s+e[n]],a[s+e[n]]=n);for(n=0;n{var{add:r,multiply:t,transpose:n}=e;return function(u,p){if(!p||u<=0||u>3)return null;var h=p._size,d=h[0],x=h[1],v=0,y=Math.max(16,10*Math.sqrt(x));y=Math.min(x-2,y);var w=i(u,p,d,x,y);fA(w,f,null);for(var C=w._index,b=w._ptr,A=b[x],E=[],S=[],O=0,F=x+1,M=2*(x+1),_=3*(x+1),k=4*(x+1),L=5*(x+1),Y=6*(x+1),$=7*(x+1),V=E,q=a(x,b,S,O,_,V,M,$,F,Y,k,L),R=s(x,b,S,L,k,Y,y,F,_,V,M),j=0,U,oe,me,ie,H,ce,Me,pe,ge,Se,xe,be,De,Ae,ze,Ze;RK?(ce=me,Me=ee,pe=S[O+me]-K):(ce=C[ee++],Me=b[ce],pe=S[O+ce]),H=1;H<=pe;H++)U=C[Me++],!((ge=S[F+U])<=0)&&(ye+=ge,S[F+U]=-ge,C[ue++]=U,S[M+U]!==-1&&(V[S[M+U]]=V[U]),V[U]!==-1?S[M+V[U]]=S[M+U]:S[_+S[L+U]]=S[M+U]);ce!==me&&(b[ce]=Gi(me),S[Y+ce]=0)}for(K!==0&&(A=ue),S[L+me]=ye,b[me]=ne,S[O+me]=ue-ne,S[k+me]=-2,q=l(q,v,S,Y,x),Se=ne;Se=q?S[Y+ce]-=ge:S[Y+ce]!==0&&(S[Y+ce]=S[L+ce]+Ee)}for(Se=ne;Se0?(Ze+=Ce,C[Ae++]=ce,ze+=ce):(b[ce]=Gi(me),S[Y+ce]=0)}S[k+U]=Ae-be+1;var Le=Ae,Ie=be+S[O+U];for(ee=De+1;ee=0))for(ze=V[U],U=S[$+ze],S[$+ze]=-1;U!==-1&&S[M+U]!==-1;U=S[M+U],q++){for(pe=S[O+U],xe=S[k+U],ee=b[U]+1;ee<=b[U]+pe-1;ee++)S[Y+C[ee]]=q;var ir=U;for(oe=S[M+U];oe!==-1;){var Xe=S[O+oe]===pe&&S[k+oe]===xe;for(ee=b[oe]+1;Xe&&ee<=b[oe]+pe-1;ee++)S[Y+C[ee]]!==q&&(Xe=0);Xe?(b[oe]=Gi(U),S[F+U]+=S[F+oe],S[F+oe]=0,S[k+oe]=-1,oe=S[M+oe],S[M+ir]=oe):(ir=oe,oe=S[M+oe])}}for(ee=ne,Se=ne;Se=0;oe--)S[F+oe]>0||(S[M+oe]=S[_+b[oe]],S[_+b[oe]]=oe);for(ce=x;ce>=0;ce--)S[F+ce]<=0||b[ce]!==-1&&(S[M+ce]=S[_+b[ce]],S[_+b[ce]]=ce);for(me=0,U=0;U<=x;U++)b[U]===-1&&(me=Ip(U,me,S,_,M,E,Y));return E.splice(E.length-1,1),E};function i(o,u,p,h,d){var x=n(u);if(o===1&&h===p)return r(u,x);if(o===2){for(var v=x._index,y=x._ptr,w=0,C=0;Cd))for(var A=y[C+1];bv)p[y+E]=0,p[d+E]=-1,A++,u[E]=Gi(o),p[y+o]++;else{var O=p[w+S];O!==-1&&(C[O]=E),p[b+E]=p[w+S],p[w+S]=E}}return A}function l(o,u,p,h,d){if(o<2||o+u<0){for(var x=0;x{var{transpose:r}=e;return function(t,n,i,a){if(!t||!n||!i)return null;var s=t._size,l=s[0],f=s[1],o,u,p,h,d,x,v,y=4*f+(a?f+l+1:0),w=[],C=0,b=f,A=2*f,E=3*f,S=4*f,O=5*f+1;for(p=0;p=1&&F[u]++,L.jleaf===2&&F[L.q]--}n[u]!==-1&&(w[C+u]=n[u])}for(u=0;u{var{add:r,multiply:t,transpose:n}=e,i=lA({add:r,multiply:t,transpose:n}),a=pA({transpose:n});return function(f,o,u){var p=o._ptr,h=o._size,d=h[1],x,v={};if(v.q=i(f,o),f&&!v.q)return null;if(u){var y=f?oA(o,null,v.q,0):o;v.parent=uA(y,1);var w=sA(v.parent,d);if(v.cp=a(y,v.parent,w,1),y&&v.parent&&v.cp&&s(y,v))for(v.unz=0,x=0;x=0;O--)for(M=o[O],_=o[O+1],F=M;F<_;F++)y[u[F]]=O;for(S=h-1;S>=0;S--)v[S]=-1,O=y[S],O!==-1&&(w[E+O]++===0&&(w[A+O]=S),w[C+S]=w[b+O],w[b+O]=S);for(f.lnz=0,f.m2=h,O=0;O=0;){e=n[h];var d=i?i[e]:e;Cf(s,e)||(Pp(s,e),n[f+h]=d<0?0:dg(s[d]));var x=1;for(u=n[f+h],p=d<0?0:dg(s[d+1]);u{var{divideScalar:r,multiply:t,subtract:n}=e;return function(a,s,l,f,o,u,p){var h=a._values,d=a._index,x=a._ptr,v=a._size,y=v[1],w=s._values,C=s._index,b=s._ptr,A,E,S,O,F=dA(a,s,l,f,u);for(A=F;A{var{abs:r,divideScalar:t,multiply:n,subtract:i,larger:a,largerEq:s,SparseMatrix:l}=e,f=vA({divideScalar:t,multiply:n,subtract:i});return function(u,p,h){if(!u)return null;var d=u._size,x=d[1],v,y=100,w=100;p&&(v=p.q,y=p.lnz||y,w=p.unz||w);var C=[],b=[],A=[],E=new l({values:C,index:b,ptr:A,size:[x,x]}),S=[],O=[],F=[],M=new l({values:S,index:O,ptr:F,size:[x,x]}),_=[],k,L,Y=[],$=[];for(k=0;k{var{typed:r,abs:t,add:n,multiply:i,transpose:a,divideScalar:s,subtract:l,larger:f,largerEq:o,SparseMatrix:u}=e,p=mA({add:n,multiply:i,transpose:a}),h=gA({abs:t,divideScalar:s,multiply:i,subtract:l,larger:f,largerEq:o,SparseMatrix:u});return r(xA,{"SparseMatrix, number, number":function(x,v,y){if(!He(v)||v<0||v>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(y<0||y>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var w=p(v,x,!1),C=h(x,w,y);return{L:C.L,U:C.U,p:C.pinv,q:w.q,toString:function(){return"L: "+this.L.toString()+\` U: \`+this.U.toString()+\` p: \`+this.p.toString()+(this.q?\` q: \`+this.q.toString():"")+\` -\`}}}})});function dg(e,r){var t,n=r.length,i=[];if(e)for(t=0;t{var{typed:r,matrix:t,lup:n,slu:i,usolve:a,lsolve:s,DenseMatrix:c}=e,f=ma({DenseMatrix:c});return r(yA,{"Array, Array | Matrix":function(h,d){h=t(h);var x=n(h),v=u(x.L,x.U,x.p,null,d);return v.valueOf()},"DenseMatrix, Array | Matrix":function(h,d){var x=n(h);return u(x.L,x.U,x.p,null,d)},"SparseMatrix, Array | Matrix":function(h,d){var x=n(h);return u(x.L,x.U,x.p,null,d)},"SparseMatrix, Array | Matrix, number, number":function(h,d,x,v){var y=i(h,x,v);return u(y.L,y.U,y.p,y.q,d)},"Object, Array | Matrix":function(h,d){return u(h.L,h.U,h.p,h.q,d)}});function o(p){if(Ge(p))return p;if(Ar(p))return t(p);throw new TypeError("Invalid Matrix LU decomposition")}function u(p,h,d,x,v){p=o(p),h=o(h),d&&(v=f(p,v,!0),v._data=dg(d,v._data));var y=s(p,v),w=a(h,y);return x&&(w._data=dg(x,w._data)),w}});var wA="polynomialRoot",Bz=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],DA=T(wA,Bz,e=>{var{typed:r,isZero:t,equalScalar:n,add:i,subtract:a,multiply:s,divide:c,sqrt:f,unaryMinus:o,cbrt:u,typeOf:p,im:h,re:d}=e;return r(wA,{"number|Complex, ...number|Complex":(x,v)=>{for(var y=[x,...v];y.length>0&&t(y[y.length-1]);)y.pop();if(y.length<2)throw new RangeError("Polynomial [".concat(x,", ").concat(v,"] must have a non-zero non-constant coefficient"));switch(y.length){case 2:return[o(c(y[0],y[1]))];case 3:{var[w,C,b]=y,A=s(2,b),E=s(C,C),S=s(4,b,w);if(n(E,S))return[c(o(C),A)];var O=f(a(E,S));return[c(a(O,C),A),c(a(o(O),C),A)]}case 4:{var[F,M,_,k]=y,L=o(s(3,k)),Y=s(_,_),$=s(3,k,M),V=i(s(2,_,_,_),s(27,k,k,F)),q=s(9,k,_,M);if(n(Y,$)&&n(V,q))return[c(_,L)];var R=a(Y,$),j=a(V,q),U=i(s(18,k,_,M,F),s(_,_,M,M)),oe=i(s(4,_,_,_,F),s(4,k,M,M,M),s(27,k,k,F,F));if(n(U,oe))return[c(a(s(4,k,_,M),i(s(9,k,k,F),s(_,_,_))),s(k,R)),c(a(s(9,k,F),s(_,M)),s(2,R))];var me;n(Y,$)?me=j:me=c(i(j,f(a(s(j,j),s(4,R,R,R)))),2);var ie=!0,H=u(me,ie).toArray().map(ce=>c(i(_,ce,c(R,ce)),L));return H.map(ce=>p(ce)==="Complex"&&n(d(ce),d(ce)+h(ce))?d(ce):ce)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(y))}}})});var Iz="Help",Pz=["evaluate"],SA=T(Iz,Pz,e=>{var{evaluate:r}=e;function t(n){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return t.prototype.type="Help",t.prototype.isHelp=!0,t.prototype.toString=function(){var n=this.doc||{},i=\` +\`}}}})});function vg(e,r){var t,n=r.length,i=[];if(e)for(t=0;t{var{typed:r,matrix:t,lup:n,slu:i,usolve:a,lsolve:s,DenseMatrix:l}=e,f=ha({DenseMatrix:l});return r(bA,{"Array, Array | Matrix":function(h,d){h=t(h);var x=n(h),v=u(x.L,x.U,x.p,null,d);return v.valueOf()},"DenseMatrix, Array | Matrix":function(h,d){var x=n(h);return u(x.L,x.U,x.p,null,d)},"SparseMatrix, Array | Matrix":function(h,d){var x=n(h);return u(x.L,x.U,x.p,null,d)},"SparseMatrix, Array | Matrix, number, number":function(h,d,x,v){var y=i(h,x,v);return u(y.L,y.U,y.p,y.q,d)},"Object, Array | Matrix":function(h,d){return u(h.L,h.U,h.p,h.q,d)}});function o(p){if(Ge(p))return p;if(Ar(p))return t(p);throw new TypeError("Invalid Matrix LU decomposition")}function u(p,h,d,x,v){p=o(p),h=o(h),d&&(v=f(p,v,!0),v._data=vg(d,v._data));var y=s(p,v),w=a(h,y);return x&&(w._data=vg(x,w._data)),w}});var DA="polynomialRoot",Pz=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],SA=T(DA,Pz,e=>{var{typed:r,isZero:t,equalScalar:n,add:i,subtract:a,multiply:s,divide:l,sqrt:f,unaryMinus:o,cbrt:u,typeOf:p,im:h,re:d}=e;return r(DA,{"number|Complex, ...number|Complex":(x,v)=>{for(var y=[x,...v];y.length>0&&t(y[y.length-1]);)y.pop();if(y.length<2)throw new RangeError("Polynomial [".concat(x,", ").concat(v,"] must have a non-zero non-constant coefficient"));switch(y.length){case 2:return[o(l(y[0],y[1]))];case 3:{var[w,C,b]=y,A=s(2,b),E=s(C,C),S=s(4,b,w);if(n(E,S))return[l(o(C),A)];var O=f(a(E,S));return[l(a(O,C),A),l(a(o(O),C),A)]}case 4:{var[F,M,_,k]=y,L=o(s(3,k)),Y=s(_,_),$=s(3,k,M),V=i(s(2,_,_,_),s(27,k,k,F)),q=s(9,k,_,M);if(n(Y,$)&&n(V,q))return[l(_,L)];var R=a(Y,$),j=a(V,q),U=i(s(18,k,_,M,F),s(_,_,M,M)),oe=i(s(4,_,_,_,F),s(4,k,M,M,M),s(27,k,k,F,F));if(n(U,oe))return[l(a(s(4,k,_,M),i(s(9,k,k,F),s(_,_,_))),s(k,R)),l(a(s(9,k,F),s(_,M)),s(2,R))];var me;n(Y,$)?me=j:me=l(i(j,f(a(s(j,j),s(4,R,R,R)))),2);var ie=!0,H=u(me,ie).toArray().map(ce=>l(i(_,ce,l(R,ce)),L));return H.map(ce=>p(ce)==="Complex"&&n(d(ce),d(ce)+h(ce))?d(ce):ce)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(y))}}})});var kz="Help",Rz=["evaluate"],NA=T(kz,Rz,e=>{var{evaluate:r}=e;function t(n){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return t.prototype.type="Help",t.prototype.isHelp=!0,t.prototype.toString=function(){var n=this.doc||{},i=\` \`;if(n.name&&(i+="Name: "+n.name+\` \`),n.category&&(i+="Category: "+n.category+\` @@ -88273,31 +88501,31 @@ q: \`+this.q.toString():"")+\` \`)+\` \`),n.examples){i+=\`Examples: -\`;for(var a=!1,s=r("config()"),c={config:p=>(a=!0,r("config(newConfig)",{newConfig:p}))},f=0;f(a=!0,r("config(newConfig)",{newConfig:p}))},f=0;fa!=="mathjs").forEach(a=>{i[a]=n[a]}),new t(i)},t.prototype.valueOf=t.prototype.toString,t},{isClass:!0});var kz="Chain",Rz=["?on","math","typed"],NA=T(kz,Rz,e=>{var{on:r,math:t,typed:n}=e;function i(o){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");Hs(o)?this.value=o.value:this.value=o}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return lr(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(o){return new i(o.value)};function a(o,u){typeof u=="function"&&(i.prototype[o]=c(u))}function s(o,u){$s(i.prototype,o,function(){var h=u();if(typeof h=="function")return c(h)})}function c(o){return function(){if(arguments.length===0)return new i(o(this.value));for(var u=[this.value],p=0;po[x])};for(var h in o)p(h)}};var f={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(t),r&&r("import",function(o,u,p){p||s(o,u)}),i},{isClass:!0});var vg={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]};var AA={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};var EA={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]};var CA={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]};var MA={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};var _A={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};var TA={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]};var FA={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]};var OA={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};var BA={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};var IA={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as \`(1 + sqrt(5)) / 2\` and is approximately 1.618034...",examples:["phi"],seealso:[]};var gg={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]};var PA={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]};var kA={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};var RA={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]};var LA={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};var qA={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};var UA={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]};var zA={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]};var WA={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]};var VA={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]};var YA={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]};var HA={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]};var GA={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]};var $A={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]};var ZA={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]};var QA={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]};var XA={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]};var JA={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]};var KA={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]};var jA={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]};var eE={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]};var rE={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]};var tE={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]};var nE={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]};var iE={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]};var aE={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]};var oE={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]};var sE={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]};var uE={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix \`A\` is decomposed in two matrices (\`Q\`, \`R\`) where \`Q\` is an orthogonal matrix and \`R\` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]};var fE={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]};var lE={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]};var cE={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]};var pE={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]};var mE={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]};var hE={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]};var dE={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]};var vE={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]};var gE={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]};var xE={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};var yE={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]};var bE={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When \`x\` is a number or complex number, an optional second argument \`allRoots\` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]};var wE={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]};var DE={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]};var SE={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]};var NE={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]};var AE={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]};var EE={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]};var CE={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]};var ME={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]};var _E={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]};var TE={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]};var FE={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]};var OE={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]};var BE={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]};var IE={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \\u2263 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]};var PE={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]};var kE={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]};var RE={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]};var LE={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a \`value+1\`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]};var qE={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating \`log(x, 2)\`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]};var UE={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]};var zE={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]};var WE={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']};var VE={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]};var YE={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]};var HE={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]};var GE={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]};var $E={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]};var ZE={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]};var QE={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix \`X\` of another matrix \`A\` is such that \`X * X = A\`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]};var XE={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]};var JE={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]};var KE={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]};var jE={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]};var eC={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]};var rC={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]};var tC={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};var nC={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]};var iC={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var aC={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var oC={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]};var sC={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]};var uC={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]};var fC={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]};var lC={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]};var cC={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. \`bellNumbers\` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]};var pC={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]};var mC={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]};var hC={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. \`stirlingS2\` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]};var dC={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]};var vC={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]};var gC={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]};var xC={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]};var yC={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]};var bC={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};var wC={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]};var DC={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]};var SC={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]};var NC={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]};var AC={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]};var EC={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]};var CC={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]};var MC={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var _C={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]};var TC={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]};var FC={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var OC={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var BC={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var IC={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]};var PC={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]};var kC={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]};var RC={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]};var LC={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]};var qC={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]};var UC={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]};var zC={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var WC={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var VC={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore\\u2013Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]};var YC={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]};var HC={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]};var GC={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]};var $C={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]};var ZC={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]};var QC={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]};var XC={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]};var JC={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]};var KC={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]};var jC={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]};var eM={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]};var rM={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]};var tM={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]};var nM={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]};var iM={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]};var aM={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]};var oM={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation \`l:u\`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]};var sM={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]};var uM={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var fM={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]};var lM={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};var cM={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};var pM={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]};var mM={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]};var hM={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]};var dM={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]};var vM={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]};var gM={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]};var xM={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from \`n\` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]};var yM={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]};var bM={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]};var wM={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]};var DM={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]};var SM={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]};var NM={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]};var AM={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]};var EM={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]};var CM={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]};var MM={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]};var _M={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]};var TM={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]};var FM={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]};var OM={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]};var BM={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]};var IM={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]};var PM={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]};var kM={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]};var RM={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]};var LM={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]};var qM={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]};var UM={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]};var zM={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]};var WM={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]};var VM={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]};var YM={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]};var HM={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]};var GM={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]};var $M={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]};var ZM={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]};var QM={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]};var XM={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]};var JM={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]};var KM={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]};var jM={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]};var e_={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]};var r_={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:\`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. +\`),i},t.prototype.toJSON=function(){var n=tr(this.doc);return n.mathjs="Help",n},t.fromJSON=function(n){var i={};return Object.keys(n).filter(a=>a!=="mathjs").forEach(a=>{i[a]=n[a]}),new t(i)},t.prototype.valueOf=t.prototype.toString,t},{isClass:!0});var Lz="Chain",qz=["?on","math","typed"],AA=T(Lz,qz,e=>{var{on:r,math:t,typed:n}=e;function i(o){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");Gs(o)?this.value=o.value:this.value=o}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return lr(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(o){return new i(o.value)};function a(o,u){typeof u=="function"&&(i.prototype[o]=l(u))}function s(o,u){Zs(i.prototype,o,function(){var h=u();if(typeof h=="function")return l(h)})}function l(o){return function(){if(arguments.length===0)return new i(o(this.value));for(var u=[this.value],p=0;po[x])};for(var h in o)p(h)}};var f={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(t),r&&r("import",function(o,u,p){p||s(o,u)}),i},{isClass:!0});var gg={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]};var EA={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};var CA={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]};var MA={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]};var _A={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};var TA={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};var FA={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]};var OA={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]};var BA={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};var IA={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};var PA={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as \`(1 + sqrt(5)) / 2\` and is approximately 1.618034...",examples:["phi"],seealso:[]};var xg={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]};var kA={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]};var RA={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};var LA={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]};var qA={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};var UA={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};var zA={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]};var WA={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]};var VA={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]};var YA={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]};var HA={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]};var GA={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]};var $A={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]};var ZA={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]};var QA={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]};var XA={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]};var JA={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]};var KA={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]};var jA={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]};var eE={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]};var rE={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]};var tE={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]};var nE={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]};var iE={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]};var aE={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]};var oE={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]};var sE={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]};var uE={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]};var fE={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix \`A\` is decomposed in two matrices (\`Q\`, \`R\`) where \`Q\` is an orthogonal matrix and \`R\` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]};var lE={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]};var cE={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]};var pE={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]};var mE={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]};var hE={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]};var dE={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]};var vE={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]};var gE={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]};var xE={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]};var yE={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};var bE={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]};var wE={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When \`x\` is a number or complex number, an optional second argument \`allRoots\` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]};var DE={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]};var SE={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]};var NE={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]};var AE={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]};var EE={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]};var CE={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]};var ME={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]};var _E={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]};var TE={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]};var FE={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]};var OE={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]};var BE={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]};var IE={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]};var PE={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \\u2263 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]};var kE={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]};var RE={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]};var LE={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]};var qE={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a \`value+1\`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]};var UE={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating \`log(x, 2)\`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]};var zE={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]};var WE={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]};var VE={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']};var YE={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]};var HE={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]};var GE={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]};var $E={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]};var ZE={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]};var QE={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]};var XE={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix \`X\` of another matrix \`A\` is such that \`X * X = A\`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]};var JE={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]};var KE={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]};var jE={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]};var eC={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]};var rC={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]};var tC={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]};var nC={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};var iC={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]};var aC={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var oC={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var sC={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]};var uC={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]};var fC={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]};var lC={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]};var cC={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]};var pC={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. \`bellNumbers\` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]};var mC={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]};var hC={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]};var dC={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. \`stirlingS2\` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]};var vC={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]};var gC={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]};var xC={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]};var yC={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]};var bC={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]};var wC={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};var DC={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]};var SC={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]};var NC={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]};var AC={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]};var EC={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]};var CC={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]};var MC={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]};var _C={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var TC={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]};var FC={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]};var OC={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var BC={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var IC={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var PC={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]};var kC={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]};var RC={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]};var LC={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]};var qC={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]};var UC={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]};var zC={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]};var WC={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var VC={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var YC={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore\\u2013Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]};var HC={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]};var GC={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]};var $C={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]};var ZC={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]};var QC={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]};var XC={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]};var JC={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]};var KC={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]};var jC={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]};var eM={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]};var rM={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]};var tM={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]};var nM={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]};var iM={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]};var aM={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]};var oM={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]};var sM={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation \`l:u\`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]};var uM={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]};var fM={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var lM={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]};var cM={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};var pM={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};var mM={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]};var hM={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]};var dM={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]};var vM={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]};var gM={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]};var xM={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]};var yM={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from \`n\` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]};var bM={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]};var wM={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]};var DM={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]};var SM={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]};var NM={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]};var AM={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]};var EM={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]};var CM={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]};var MM={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]};var _M={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]};var TM={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]};var FM={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]};var OM={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]};var BM={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]};var IM={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]};var PM={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]};var kM={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]};var RM={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]};var LM={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]};var qM={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]};var UM={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]};var zM={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]};var WM={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]};var VM={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]};var YM={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]};var HM={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]};var GM={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]};var $M={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]};var ZM={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]};var QM={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]};var XM={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]};var JM={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]};var KM={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]};var jM={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]};var e_={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]};var r_={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]};var t_={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:\`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. -In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.\`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]};var t_={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]};var n_={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var i_={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var a_={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]};var o_={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]};var s_={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]};var u_={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as \`acosh(x) = ln(sqrt(x^2 - 1) + x)\`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]};var f_={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]};var l_={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as \`acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2\`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]};var c_={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]};var p_={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as \`acsch(x) = ln(1/x + sqrt(1/x^2 + 1))\`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]};var m_={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]};var h_={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};var d_={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]};var v_={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as \`asinh(x) = ln(x + sqrt(x^2 + 1))\`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]};var g_={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]};var x_={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]};var y_={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as \`atanh(x) = ln((1 + x)/(1 - x)) / 2\`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]};var b_={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]};var w_={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]};var D_={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]};var S_={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]};var N_={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]};var A_={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]};var E_={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]};var C_={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]};var M_={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]};var __={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};var T_={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]};var F_={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]};var O_={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]};var B_={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};var I_={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]};var P_={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]};var k_={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]};var R_={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};var L_={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var q_={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var U_={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]};var z_={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]};var W_={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var V_={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var Y_={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]};var H_={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]};var G_={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};var $_={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]};var Z_={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]};var Q_={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]};var X_={bignumber:UA,boolean:zA,complex:WA,createUnit:VA,fraction:YA,index:HA,matrix:GA,number:$A,sparse:ZA,splitUnit:QA,string:XA,unit:JA,e:vg,E:vg,false:AA,i:EA,Infinity:CA,LN2:_A,LN10:MA,LOG2E:FA,LOG10E:TA,NaN:OA,null:BA,pi:gg,PI:gg,phi:IA,SQRT1_2:PA,SQRT2:kA,tau:RA,true:LA,version:qA,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:rE,lsolve:nE,lsolveAll:iE,lup:aE,lusolve:oE,leafCount:tE,polynomialRoot:sE,resolve:lE,simplify:cE,simplifyConstant:pE,simplifyCore:mE,symbolicEqual:dE,rationalize:fE,slu:hE,usolve:vE,usolveAll:gE,qr:uE,abs:xE,add:yE,cbrt:bE,ceil:wE,cube:DE,divide:SE,dotDivide:NE,dotMultiply:AE,dotPow:EE,exp:CE,expm:ME,expm1:_E,fix:TE,floor:FE,gcd:OE,hypot:BE,lcm:PE,log:kE,log2:qE,log1p:LE,log10:RE,mod:UE,multiply:zE,norm:WE,nthRoot:VE,nthRoots:YE,pow:HE,round:GE,sign:$E,sqrt:ZE,sqrtm:QE,square:jE,subtract:eC,unaryMinus:rC,unaryPlus:tC,xgcd:nC,invmod:IE,bitAnd:iC,bitNot:aC,bitOr:oC,bitXor:sC,leftShift:uC,rightArithShift:fC,rightLogShift:lC,bellNumbers:cC,catalan:pC,composition:mC,stirlingS2:hC,config:KA,import:jA,typed:eE,arg:dC,conj:vC,re:xC,im:gC,evaluate:yC,help:bC,distance:wC,intersect:DC,and:SC,not:NC,or:AC,xor:EC,concat:MC,count:_C,cross:TC,column:CC,ctranspose:FC,det:OC,diag:BC,diff:IC,dot:PC,getMatrixDataType:UC,identity:zC,filter:RC,flatten:LC,forEach:qC,inv:WC,pinv:VC,eigs:kC,kron:YC,matrixFromFunction:$C,matrixFromRows:ZC,matrixFromColumns:GC,map:HC,ones:QC,partitionSelect:XC,range:JC,resize:jC,reshape:KC,rotate:eM,rotationMatrix:rM,row:tM,size:nM,sort:iM,squeeze:aM,subset:oM,trace:sM,transpose:uM,zeros:fM,fft:lM,ifft:cM,sylvester:XE,schur:JE,lyap:KE,solveODE:Q_,combinations:pM,combinationsWithRep:mM,factorial:hM,gamma:dM,kldivergence:gM,lgamma:vM,multinomial:xM,permutations:yM,pickRandom:bM,random:wM,randomInt:DM,compare:SM,compareNatural:NM,compareText:AM,deepEqual:EM,equal:CM,equalText:MM,larger:_M,largerEq:TM,smaller:FM,smallerEq:OM,unequal:BM,setCartesian:IM,setDifference:PM,setDistinct:kM,setIntersect:RM,setIsSubset:LM,setMultiplicity:qM,setPowerset:UM,setSize:zM,setSymDifference:WM,setUnion:VM,zpk2tf:YM,freqz:HM,erf:GM,zeta:$M,cumsum:n_,mad:ZM,max:QM,mean:XM,median:JM,min:KM,mode:jM,prod:e_,quantileSeq:r_,std:t_,sum:i_,variance:a_,corr:o_,acos:s_,acosh:u_,acot:f_,acoth:l_,acsc:c_,acsch:p_,asec:m_,asech:h_,asin:d_,asinh:v_,atan:g_,atanh:y_,atan2:x_,cos:b_,cosh:w_,cot:D_,coth:S_,csc:N_,csch:A_,sec:E_,sech:C_,sin:M_,sinh:__,tan:T_,tanh:F_,to:O_,clone:I_,format:P_,bin:B_,oct:G_,hex:R_,isNaN:q_,isInteger:L_,isNegative:U_,isNumeric:z_,hasNumericValue:k_,isPositive:W_,isPrime:V_,isZero:Y_,print:$_,typeOf:Z_,numeric:H_};var J_="help",Lz=["typed","mathWithTransform","Help"],K_=T(J_,Lz,e=>{var{typed:r,mathWithTransform:t,Help:n}=e;return r(J_,{any:function(a){var s,c=a;if(typeof a!="string"){for(s in t)if($e(t,s)&&a===t[s]){c=s;break}}var f=gt(X_,c);if(!f){var o=typeof c=="function"?c.name:c;throw new Error('No documentation found on "'+o+'"')}return new n(f)}})});var j_="chain",qz=["typed","Chain"],eT=T(j_,qz,e=>{var{typed:r,Chain:t}=e;return r(j_,{"":function(){return new t},any:function(i){return new t(i)}})});var rT="det",Uz=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],tT=T(rT,Uz,e=>{var{typed:r,matrix:t,subtractScalar:n,multiply:i,divideScalar:a,isZero:s,unaryMinus:c}=e;return r(rT,{any:function(u){return tr(u)},"Array | Matrix":function(u){var p;switch(Ge(u)?p=u.size():Array.isArray(u)?(u=t(u),p=u.size()):p=[],p.length){case 0:return tr(u);case 1:if(p[0]===1)return tr(u.valueOf()[0]);if(p[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(p)+")");case 2:{var h=p[0],d=p[1];if(h===d)return f(u.clone().valueOf(),h,d);if(d===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(p)+")")}}});function f(o,u,p){if(u===1)return tr(o[0][0]);if(u===2)return n(i(o[0][0],o[1][1]),i(o[1][0],o[0][1]));for(var h=!1,d=new Array(u).fill(0).map((O,F)=>F),x=0;x{var{typed:r,matrix:t,divideScalar:n,addScalar:i,multiply:a,unaryMinus:s,det:c,identity:f,abs:o}=e;return r(nT,{"Array | Matrix":function(h){var d=Ge(h)?h.size():or(h);switch(d.length){case 1:if(d[0]===1)return Ge(h)?t([n(1,h.valueOf()[0])]):[n(1,h[0])];throw new RangeError("Matrix must be square (size: "+lr(d)+")");case 2:{var x=d[0],v=d[1];if(x===v)return Ge(h)?t(u(h.valueOf(),x,v),h.storage()):u(h,x,v);throw new RangeError("Matrix must be square (size: "+lr(d)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(d)+")")}},any:function(h){return n(1,h)}});function u(p,h,d){var x,v,y,w,C;if(h===1){if(w=p[0][0],w===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,w)]]}else if(h===2){var b=c(p);if(b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(p[1][1],b),n(s(p[0][1]),b)],[n(s(p[1][0]),b),n(p[0][0],b)]]}else{var A=p.concat();for(x=0;xO&&(O=o(A[x][S]),F=x),x++;if(O===0)throw Error("Cannot calculate inverse, determinant is zero");x=F,x!==S&&(C=A[S],A[S]=A[x],A[x]=C,C=E[S],E[S]=E[x],E[x]=C);var M=A[S],_=E[S];for(x=0;x{var{typed:r,matrix:t,inv:n,deepEqual:i,equal:a,dotDivide:s,dot:c,ctranspose:f,divideScalar:o,multiply:u,add:p,Complex:h}=e;return r(aT,{"Array | Matrix":function(b){var A=Ge(b)?b.size():or(b);switch(A.length){case 1:return w(b)?f(b):A[0]===1?n(b):s(f(b),c(b,b));case 2:{if(w(b))return f(b);var E=A[0],S=A[1];if(E===S)try{return n(b)}catch(O){if(!(O instanceof Error&&O.message.match(/Cannot calculate inverse, determinant is zero/)))throw O}return Ge(b)?t(d(b.valueOf(),E,S),b.storage()):d(b,E,S)}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(A)+")")}},any:function(b){return a(b,0)?tr(b):o(1,b)}});function d(C,b,A){var{C:E,F:S}=v(C,b,A),O=u(n(u(f(E),E)),f(E)),F=u(f(S),n(u(S,f(S))));return u(F,O)}function x(C,b,A){for(var E=tr(C),S=0,O=0;OF.filter((_,k)=>k!y(c(E[M],E[M])));return{C:S,F:O}}function y(C){return a(p(C,h(1,1)),p(0,h(1,1)))}function w(C){return i(p(C,h(1,1)),p(u(C,0),h(1,1)))}});function sT(e){var{addScalar:r,subtract:t,flatten:n,multiply:i,multiplyScalar:a,divideScalar:s,sqrt:c,abs:f,bignumber:o,diag:u,size:p,reshape:h,inv:d,qr:x,usolve:v,usolveAll:y,equal:w,complex:C,larger:b,smaller:A,matrixFromColumns:E,dot:S}=e;function O(ie,H,ce,Me){var pe=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ge=F(ie,H,ce,Me,pe);M(ie,H,ce,Me,pe,ge);var{values:Se,C:xe}=_(ie,H,ce,Me,pe);if(pe){var be=k(ie,H,xe,ge,Se,ce,Me);return{values:Se,eigenvectors:be}}return{values:Se}}function F(ie,H,ce,Me,pe){var ge=Me==="BigNumber",Se=Me==="Complex",xe=ge?o(0):0,be=ge?o(1):Se?C(1):1,De=ge?o(1):1,Ae=ge?o(10):2,ze=a(Ae,Ae),Ze;pe&&(Ze=Array(H).fill(be));for(var K=!1;!K;){K=!0;for(var te=0;te1&&(K=u(Array(Ae-1).fill(xe)))),Ae-=1,be.pop();for(var Ce=0;Ce2&&(K=u(Array(Ae-2).fill(xe)))),Ae-=2,be.pop(),be.pop();for(var Ie=0;Ie+t(f(Xe),f(Or))),te>100){var sr=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+De.join(", "));throw sr.values=De,sr.vectors=[],sr}var ir=pe?i(Ze,V(ze,H)):void 0;return{values:De,C:ir}}function k(ie,H,ce,Me,pe,ge,Se){var xe=d(ce),be=i(xe,ie,ce),De=Se==="BigNumber",Ae=Se==="Complex",ze=De?o(0):Ae?C(0):0,Ze=De?o(1):Ae?C(1):1,K=[],te=[];for(var ye of pe){var ee=q(K,ye,w);ee===-1?(K.push(ye),te.push(1)):te[ee]+=1}for(var ne=[],ue=K.length,Ee=Array(H).fill(ze),Ce=u(Array(H).fill(Ze)),Le=function(){var ir=K[Ie],Xe=t(be,i(ir,Ce)),Or=y(Xe,Ee);for(Or.shift();Or.lengthi(le,we)),ne.push(...Or.map(we=>({value:ir,vector:n(we)})))},Ie=0;Ie=5)return null;for(xe=0;;){var be=v(ie,Se);if(A(oe(U(Se,[be])),Me))break;if(++xe>=10)return null;Se=me(be)}return Se}function j(ie,H,ce){var Me=ce==="BigNumber",pe=ce==="Complex",ge=Array(ie).fill(0).map(Se=>2*Math.random()-1);return Me&&(ge=ge.map(Se=>o(Se))),pe&&(ge=ge.map(Se=>C(Se))),ge=U(ge,H),me(ge,ce)}function U(ie,H){var ce=p(ie);for(var Me of H)Me=h(Me,ce),ie=t(ie,i(s(S(Me,ie),S(Me,Me)),Me));return ie}function oe(ie){return f(c(S(ie,ie)))}function me(ie,H){var ce=H==="BigNumber",Me=H==="Complex",pe=ce?o(1):Me?C(1):1;return i(s(pe,oe(ie)),ie)}return O}function uT(e){var{config:r,addScalar:t,subtract:n,abs:i,atan:a,cos:s,sin:c,multiplyScalar:f,inv:o,bignumber:u,multiply:p,add:h}=e;function d(M,_){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.epsilon,L=arguments.length>3?arguments[3]:void 0,Y=arguments.length>4?arguments[4]:void 0;if(L==="number")return x(M,k,Y);if(L==="BigNumber")return v(M,k,Y);throw TypeError("Unsupported data type: "+L)}function x(M,_,k){var L=M.length,Y=Math.abs(_/L),$,V;if(k){V=new Array(L);for(var q=0;q=Math.abs(Y);){var j=R[0][0],U=R[0][1];$=y(M[j][j],M[U][U],M[j][U]),M=E(M,$,j,U),k&&(V=C(V,$,j,U)),R=S(M)}for(var oe=Array(L).fill(0),me=0;me=i(Y);){var j=R[0][0],U=R[0][1];$=w(M[j][j],M[U][U],M[j][U]),M=A(M,$,j,U),k&&(V=b(V,$,j,U)),R=O(M)}for(var oe=Array(L).fill(0),me=0;me({value:Y[H],vector:ie}));return{values:Y,eigenvectors:me}}return d}var Vz="eigs",Yz=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],fT=T(Vz,Yz,e=>{var{config:r,typed:t,matrix:n,addScalar:i,subtract:a,equal:s,abs:c,atan:f,cos:o,sin:u,multiplyScalar:p,divideScalar:h,inv:d,bignumber:x,multiply:v,add:y,larger:w,column:C,flatten:b,number:A,complex:E,sqrt:S,diag:O,size:F,reshape:M,qr:_,usolve:k,usolveAll:L,im:Y,re:$,smaller:V,matrixFromColumns:q,dot:R}=e,j=uT({config:r,addScalar:i,subtract:a,column:C,flatten:b,equal:s,abs:c,atan:f,cos:o,sin:u,multiplyScalar:p,inv:d,bignumber:x,complex:E,multiply:v,add:y}),U=sT({config:r,addScalar:i,subtract:a,multiply:v,multiplyScalar:p,flatten:b,divideScalar:h,sqrt:S,abs:c,bignumber:x,diag:O,size:F,reshape:M,qr:_,inv:d,usolve:k,usolveAll:L,equal:s,complex:E,larger:w,smaller:V,matrixFromColumns:q,dot:R});return t("eigs",{Array:function(ge){return oe(n(ge))},"Array, number|BigNumber":function(ge,Se){return oe(n(ge),{precision:Se})},"Array, Object"(pe,ge){return oe(n(pe),ge)},Matrix:function(ge){return oe(ge,{matricize:!0})},"Matrix, number|BigNumber":function(ge,Se){return oe(ge,{precision:Se,matricize:!0})},"Matrix, Object":function(ge,Se){var xe={matricize:!0};return Mt(xe,Se),oe(ge,xe)}});function oe(pe){var ge,Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},xe="eigenvectors"in Se?Se.eigenvectors:!0,be=(ge=Se.precision)!==null&&ge!==void 0?ge:r.epsilon,De=me(pe,be,xe);return Se.matricize&&(De.values=n(De.values),xe&&(De.eigenvectors=De.eigenvectors.map(Ae=>{var{value:ze,vector:Ze}=Ae;return{value:ze,vector:n(Ze)}}))),xe&&Object.defineProperty(De,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),De}function me(pe,ge,Se){var xe=pe.toArray(),be=pe.size();if(be.length!==2||be[0]!==be[1])throw new RangeError("Matrix must be square (size: ".concat(lr(be),")"));var De=be[0];if(H(xe,De,ge)&&(ce(xe,De),ie(xe,De,ge))){var Ae=Me(pe,xe,De);return j(xe,De,ge,Ae,Se)}var ze=Me(pe,xe,De);return U(xe,De,ge,ze,Se)}function ie(pe,ge,Se){for(var xe=0;xe{var{typed:r,abs:t,add:n,identity:i,inv:a,multiply:s}=e;return r(lT,{Matrix:function(p){var h=p.size();if(h.length!==2||h[0]!==h[1])throw new RangeError("Matrix must be square (size: "+lr(h)+")");for(var d=h[0],x=1e-15,v=c(p),y=f(v,x),w=y.q,C=y.j,b=s(p,Math.pow(2,-C)),A=i(d),E=i(d),S=1,O=b,F=-1,M=1;M<=w;M++)M>1&&(O=s(O,b),F=-F),S=S*(w-M+1)/((2*w-M+1)*M),A=n(A,s(S,O)),E=n(E,s(S*F,O));for(var _=s(a(E),A),k=0;k{var{typed:r,abs:t,add:n,multiply:i,map:a,sqrt:s,subtract:c,inv:f,size:o,max:u,identity:p}=e,h=1e3,d=1e-6;function x(v){var y,w=0,C=v,b=p(o(v));do{var A=C;if(C=i(.5,n(A,f(b))),b=i(.5,n(b,f(A))),y=u(t(c(C,A))),y>d&&++w>h)throw new Error("computing square root of matrix: iterative method could not converge")}while(y>d);return C}return r(pT,{"Array | Matrix":function(y){var w=Ge(y)?y.size():or(y);switch(w.length){case 1:if(w[0]===1)return a(y,s);throw new RangeError("Matrix must be square (size: "+lr(w)+")");case 2:{var C=w[0],b=w[1];if(C===b)return x(y);throw new RangeError("Matrix must be square (size: "+lr(w)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+lr(w)+")")}}})});var hT="sylvester",$z=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],dT=T(hT,$z,e=>{var{typed:r,schur:t,matrixFromColumns:n,matrix:i,multiply:a,range:s,concat:c,transpose:f,index:o,subset:u,add:p,subtract:h,identity:d,lusolve:x,abs:v}=e;return r(hT,{"Matrix, Matrix, Matrix":y,"Array, Matrix, Matrix":function(C,b,A){return y(i(C),b,A)},"Array, Array, Matrix":function(C,b,A){return y(i(C),i(b),A)},"Array, Matrix, Array":function(C,b,A){return y(i(C),b,i(A))},"Matrix, Array, Matrix":function(C,b,A){return y(C,i(b),A)},"Matrix, Array, Array":function(C,b,A){return y(C,i(b),i(A))},"Matrix, Matrix, Array":function(C,b,A){return y(C,b,i(A))},"Array, Array, Array":function(C,b,A){return y(i(C),i(b),i(A)).toArray()}});function y(w,C,b){for(var A=C.size()[0],E=w.size()[0],S=t(w),O=S.T,F=S.U,M=t(a(-1,C)),_=M.T,k=M.U,L=a(a(f(F),b),k),Y=s(0,E),$=[],V=(Ae,ze)=>c(Ae,ze,1),q=(Ae,ze)=>c(Ae,ze,0),R=0;R1e-5){for(var j=q(u(L,o(Y,R)),u(L,o(Y,R+1))),U=0;U{var{typed:r,matrix:t,identity:n,multiply:i,qr:a,norm:s,subtract:c}=e;return r(vT,{Array:function(u){var p=f(t(u));return{U:p.U.valueOf(),T:p.T.valueOf()}},Matrix:function(u){return f(u)}});function f(o){var u=o.size()[0],p=o,h=n(u),d=0,x;do{x=p;var v=a(p),y=v.Q,w=v.R;if(p=i(w,y),h=i(h,y),d++>100)break}while(s(c(p,x))>1e-4);return{U:h,T:p}}});var xT="lyap",Qz=["typed","matrix","sylvester","multiply","transpose"],yT=T(xT,Qz,e=>{var{typed:r,matrix:t,sylvester:n,multiply:i,transpose:a}=e;return r(xT,{"Matrix, Matrix":function(c,f){return n(c,a(c),i(-1,f))},"Array, Matrix":function(c,f){return n(t(c),a(t(c)),i(-1,f))},"Matrix, Array":function(c,f){return n(c,a(t(c)),t(i(-1,f)))},"Array, Array":function(c,f){return n(t(c),a(t(c)),t(i(-1,f))).toArray()}})});var Xz="divide",Jz=["typed","matrix","multiply","equalScalar","divideScalar","inv"],bT=T(Xz,Jz,e=>{var{typed:r,matrix:t,multiply:n,equalScalar:i,divideScalar:a,inv:s}=e,c=Jr({typed:r,equalScalar:i}),f=Bt({typed:r});return r("divide",dc({"Array | Matrix, Array | Matrix":function(u,p){return n(u,s(p))},"DenseMatrix, any":function(u,p){return f(u,p,a,!1)},"SparseMatrix, any":function(u,p){return c(u,p,a,!1)},"Array, any":function(u,p){return f(t(u),p,a,!1).valueOf()},"any, Array | Matrix":function(u,p){return n(u,s(p))}},a.signatures))});var wT="distance",Kz=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],DT=T(wT,Kz,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:i,divideScalar:a,deepEqual:s,sqrt:c,abs:f}=e;return r(wT,{"Array, Array, Array":function(E,S,O){if(E.length===2&&S.length===2&&O.length===2){if(!u(E))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!u(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!u(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(s(S,O))throw new TypeError("LinePoint1 should not be same with LinePoint2");var F=n(O[1],S[1]),M=n(S[0],O[0]),_=n(i(O[0],S[1]),i(S[0],O[1]));return y(E[0],E[1],F,M,_)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(E,S,O){if(Object.keys(E).length===2&&Object.keys(S).length===2&&Object.keys(O).length===2){if(!u(E))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!u(S))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!u(O))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(s(x(S),x(O)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in E&&"pointY"in E&&"lineOnePtX"in S&&"lineOnePtY"in S&&"lineTwoPtX"in O&&"lineTwoPtY"in O){var F=n(O.lineTwoPtY,S.lineOnePtY),M=n(S.lineOnePtX,O.lineTwoPtX),_=n(i(O.lineTwoPtX,S.lineOnePtY),i(S.lineOnePtX,O.lineTwoPtY));return y(E.pointX,E.pointY,F,M,_)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(E,S){if(E.length===2&&S.length===3){if(!u(E))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return y(E[0],E[1],S[0],S[1],S[2])}else if(E.length===3&&S.length===6){if(!p(E))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!d(S))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return w(E[0],E[1],E[2],S[0],S[1],S[2],S[3],S[4],S[5])}else if(E.length===S.length&&E.length>0){if(!h(E))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!h(S))throw new TypeError("All values of an array should be numbers or BigNumbers");return C(E,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(E,S){if(Object.keys(E).length===2&&Object.keys(S).length===3){if(!u(E))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(S))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in E&&"pointY"in E&&"xCoeffLine"in S&&"yCoeffLine"in S&&"constant"in S)return y(E.pointX,E.pointY,S.xCoeffLine,S.yCoeffLine,S.constant);throw new TypeError("Key names do not match")}else if(Object.keys(E).length===3&&Object.keys(S).length===6){if(!p(E))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!d(S))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in E&&"pointY"in E&&"x0"in S&&"y0"in S&&"z0"in S&&"a"in S&&"b"in S&&"c"in S)return w(E.pointX,E.pointY,E.pointZ,S.x0,S.y0,S.z0,S.a,S.b,S.c);throw new TypeError("Key names do not match")}else if(Object.keys(E).length===2&&Object.keys(S).length===2){if(!u(E))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!u(S))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in E&&"pointOneY"in E&&"pointTwoX"in S&&"pointTwoY"in S)return C([E.pointOneX,E.pointOneY],[S.pointTwoX,S.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(E).length===3&&Object.keys(S).length===3){if(!p(E))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!p(S))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in E&&"pointOneY"in E&&"pointOneZ"in E&&"pointTwoX"in S&&"pointTwoY"in S&&"pointTwoZ"in S)return C([E.pointOneX,E.pointOneY,E.pointOneZ],[S.pointTwoX,S.pointTwoY,S.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(E){if(!v(E))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return b(E)}});function o(A){return typeof A=="number"||je(A)}function u(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])}function p(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])&&o(A[2])}function h(A){return Array.isArray(A)||(A=x(A)),A.every(o)}function d(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])&&o(A[2])&&o(A[3])&&o(A[4])&&o(A[5])}function x(A){for(var E=Object.keys(A),S=[],O=0;OE.length!==2||!o(E[0])||!o(E[1])))return!1}else if(A[0].length===3&&o(A[0][0])&&o(A[0][1])&&o(A[0][2])){if(A.some(E=>E.length!==3||!o(E[0])||!o(E[1])||!o(E[2])))return!1}else return!1;return!0}function y(A,E,S,O,F){var M=f(t(t(i(S,A),i(O,E)),F)),_=c(t(i(S,S),i(O,O)));return a(M,_)}function w(A,E,S,O,F,M,_,k,L){var Y=[n(i(n(F,E),L),i(n(M,S),k)),n(i(n(M,S),_),i(n(O,A),L)),n(i(n(O,A),k),i(n(F,E),_))];Y=c(t(t(i(Y[0],Y[0]),i(Y[1],Y[1])),i(Y[2],Y[2])));var $=c(t(t(i(_,_),i(k,k)),i(L,L)));return a(Y,$)}function C(A,E){for(var S=A.length,O=0,F=0,M=0;M{var{typed:r,config:t,abs:n,add:i,addScalar:a,matrix:s,multiply:c,multiplyScalar:f,divideScalar:o,subtract:u,smaller:p,equalScalar:h,flatten:d,isZero:x,isNumeric:v}=e;return r("intersect",{"Array, Array, Array":y,"Array, Array, Array, Array":w,"Matrix, Matrix, Matrix":function(k,L,Y){var $=y(k.valueOf(),L.valueOf(),Y.valueOf());return $===null?null:s($)},"Matrix, Matrix, Matrix, Matrix":function(k,L,Y,$){var V=w(k.valueOf(),L.valueOf(),Y.valueOf(),$.valueOf());return V===null?null:s(V)}});function y(_,k,L){if(_=C(_),k=C(k),L=C(L),!A(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!A(k))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!E(L))throw new TypeError("Array with 4 numbers expected as third argument");return M(_[0],_[1],_[2],k[0],k[1],k[2],L[0],L[1],L[2],L[3])}function w(_,k,L,Y){if(_=C(_),k=C(k),L=C(L),Y=C(Y),_.length===2){if(!b(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(k))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!b(L))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!b(Y))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return S(_,k,L,Y)}else if(_.length===3){if(!A(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!A(k))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!A(L))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!A(Y))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return F(_[0],_[1],_[2],k[0],k[1],k[2],L[0],L[1],L[2],Y[0],Y[1],Y[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function C(_){return _.length===1?_[0]:_.length>1&&Array.isArray(_[0])&&_.every(k=>Array.isArray(k)&&k.length===1)?d(_):_}function b(_){return _.length===2&&v(_[0])&&v(_[1])}function A(_){return _.length===3&&v(_[0])&&v(_[1])&&v(_[2])}function E(_){return _.length===4&&v(_[0])&&v(_[1])&&v(_[2])&&v(_[3])}function S(_,k,L,Y){var $=_,V=L,q=u($,k),R=u(V,Y),j=u(f(q[0],R[1]),f(R[0],q[1]));if(x(j)||p(n(j),t.epsilon))return null;var U=f(R[0],$[1]),oe=f(R[1],$[0]),me=f(R[0],V[1]),ie=f(R[1],V[0]),H=o(a(u(u(U,oe),me),ie),j);return i(c(q,H),$)}function O(_,k,L,Y,$,V,q,R,j,U,oe,me){var ie=f(u(_,k),u(L,Y)),H=f(u($,V),u(q,R)),ce=f(u(j,U),u(oe,me));return a(a(ie,H),ce)}function F(_,k,L,Y,$,V,q,R,j,U,oe,me){var ie=O(_,q,U,q,k,R,oe,R,L,j,me,j),H=O(U,q,Y,_,oe,R,$,k,me,j,V,L),ce=O(_,q,Y,_,k,R,$,k,L,j,V,L),Me=O(U,q,U,q,oe,R,oe,R,me,j,me,j),pe=O(Y,_,Y,_,$,k,$,k,V,L,V,L),ge=u(f(ie,H),f(ce,Me)),Se=u(f(pe,Me),f(H,H));if(x(Se))return null;var xe=o(ge,Se),be=o(a(ie,f(xe,H)),Me),De=a(_,f(xe,u(Y,_))),Ae=a(k,f(xe,u($,k))),ze=a(L,f(xe,u(V,L))),Ze=a(q,f(be,u(U,q))),K=a(R,f(be,u(oe,R))),te=a(j,f(be,u(me,j)));return h(De,Ze)&&h(Ae,K)&&h(ze,te)?[De,Ae,ze]:null}function M(_,k,L,Y,$,V,q,R,j,U){var oe=f(_,q),me=f(Y,q),ie=f(k,R),H=f($,R),ce=f(L,j),Me=f(V,j),pe=u(u(u(U,oe),ie),ce),ge=u(u(u(a(a(me,H),Me),oe),ie),ce),Se=o(pe,ge),xe=a(_,f(Se,u(Y,_))),be=a(k,f(Se,u($,k))),De=a(L,f(Se,u(V,L)));return[xe,be,De]}});var NT="sum",rW=["typed","config","add","numeric"],Pp=T(NT,rW,e=>{var{typed:r,config:t,add:n,numeric:i}=e;return r(NT,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":s,"...":function(f){if(hi(f))throw new TypeError("Scalar values expected in function sum");return a(f)}});function a(c){var f;return hn(c,function(o){try{f=f===void 0?o:n(f,o)}catch(u){throw St(u,"sum",o)}}),f===void 0&&(f=i(0,t.number)),typeof f=="string"&&(f=i(f,t.number)),f}function s(c,f){try{var o=wo(c,f,n);return o}catch(u){throw St(u,"sum")}}});var kp="cumsum",tW=["typed","add","unaryPlus"],Rp=T(kp,tW,e=>{var{typed:r,add:t,unaryPlus:n}=e;return r(kp,{Array:i,Matrix:function(o){return o.create(i(o.valueOf()))},"Array, number | BigNumber":s,"Matrix, number | BigNumber":function(o,u){return o.create(s(o.valueOf(),u))},"...":function(o){if(hi(o))throw new TypeError("All values expected to be scalar in function cumsum");return i(o)}});function i(f){try{return a(f)}catch(o){throw St(o,kp)}}function a(f){if(f.length===0)return[];for(var o=[n(f[0])],u=1;u=u.length)throw new Xt(o,u.length);try{return c(f,o)}catch(p){throw St(p,kp)}}function c(f,o){var u,p,h;if(o<=0){var d=f[0][0];if(Array.isArray(d)){for(h=Ic(f),p=[],u=0;u{var{typed:r,add:t,divide:n}=e;return r(AT,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(c){if(hi(c))throw new TypeError("Scalar values expected in function mean");return a(c)}});function i(s,c){try{var f=wo(s,c,t),o=Array.isArray(s)?or(s):s.size();return n(f,o[c])}catch(u){throw St(u,"mean")}}function a(s){var c,f=0;if(hn(s,function(o){try{c=c===void 0?o:t(c,o),f++}catch(u){throw St(u,"mean",o)}}),f===0)throw new Error("Cannot calculate the mean of an empty array");return n(c,f)}});var ET="median",iW=["typed","add","divide","compare","partitionSelect"],CT=T(ET,iW,e=>{var{typed:r,add:t,divide:n,compare:i,partitionSelect:a}=e;function s(o){try{o=gr(o.valueOf());var u=o.length;if(u===0)throw new Error("Cannot calculate median of an empty array");if(u%2===0){for(var p=u/2-1,h=a(o,p+1),d=o[p],x=0;x0&&(d=o[x]);return f(d,h)}else{var v=a(o,(u-1)/2);return c(v)}}catch(y){throw St(y,"median")}}var c=r({"number | BigNumber | Complex | Unit":function(u){return u}}),f=r({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(u,p){return n(t(u,p),2)}});return r(ET,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,p){throw new Error("median(A, dim) is not yet supported")},"...":function(u){if(hi(u))throw new TypeError("Scalar values expected in function median");return s(u)}})});var MT="mad",aW=["typed","abs","map","median","subtract"],_T=T(MT,aW,e=>{var{typed:r,abs:t,map:n,median:i,subtract:a}=e;return r(MT,{"Array | Matrix":s,"...":function(f){return s(f)}});function s(c){if(c=gr(c.valueOf()),c.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var f=i(c);return i(n(c,function(o){return t(a(o,f))}))}catch(o){throw o instanceof TypeError&&o.message.indexOf("median")!==-1?new TypeError(o.message.replace("median","mad")):St(o,"mad")}}});var xg="unbiased",TT="variance",oW=["typed","add","subtract","multiply","divide","apply","isNaN"],qp=T(TT,oW,e=>{var{typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:c}=e;return r(TT,{"Array | Matrix":function(p){return f(p,xg)},"Array | Matrix, string":f,"Array | Matrix, number | BigNumber":function(p,h){return o(p,h,xg)},"Array | Matrix, number | BigNumber, string":o,"...":function(p){return f(p,xg)}});function f(u,p){var h,d=0;if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(hn(u,function(y){try{h=h===void 0?y:t(h,y),d++}catch(w){throw St(w,"variance",y)}}),d===0)throw new Error("Cannot calculate variance of an empty array");var x=a(h,d);if(h=void 0,hn(u,function(y){var w=n(y,x);h=h===void 0?i(w,w):t(h,i(w,w))}),c(h))return h;switch(p){case"uncorrected":return a(h,d);case"biased":return a(h,d+1);case"unbiased":{var v=je(h)?h.mul(0):0;return d===1?v:a(h,d-1)}default:throw new Error('Unknown normalization "'+p+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function o(u,p,h){try{if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return s(u,p,d=>f(d,h))}catch(d){throw St(d,"variance")}}});var FT="quantileSeq",sW=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Up=T(FT,sW,e=>{var{typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:c,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:h}=e,d=au({typed:r,isInteger:o});return r(FT,{"Array | Matrix, number | BigNumber":(C,b)=>v(C,b,!1),"Array | Matrix, number | BigNumber, number":(C,b,A)=>x(C,b,!1,A,v),"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":(C,b,A,E)=>x(C,b,A,E,v),"Array | Matrix, Array | Matrix":(C,b)=>y(C,b,!1),"Array | Matrix, Array | Matrix, number":(C,b,A)=>x(C,b,!1,A,y),"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":(C,b,A,E)=>x(C,b,A,E,y)});function x(C,b,A,E,S){return d(C,E,O=>S(O,b,A))}function v(C,b,A){var E,S=C.valueOf();if(u(b,0))throw new Error("N/prob must be non-negative");if(p(b,1))return ar(b)?w(S,b,A):t(w(S,b,A));if(h(b,1)){if(!o(b))throw new Error("N must be a positive integer");if(h(b,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var O=n(b,1);E=[];for(var F=0;u(F,b);F++){var M=a(F+1,O);E.push(w(S,M,A))}return ar(b)?E:t(E)}}function y(C,b,A){for(var E=C.valueOf(),S=b.valueOf(),O=[],F=0;F0&&(_=E[L])}return n(s(_,i(1,M)),s(k,M))}});var OT="std",uW=["typed","map","sqrt","variance"],zp=T(OT,uW,e=>{var{typed:r,map:t,sqrt:n,variance:i}=e;return r(OT,{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(c){return a(c)}});function a(s,c){if(s.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var f=i.apply(null,arguments);return bt(f)?t(f,n):n(f)}catch(o){throw o instanceof TypeError&&o.message.indexOf(" variance")!==-1?new TypeError(o.message.replace(" variance"," std")):o}}});var BT="corr",fW=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],IT=T(BT,fW,e=>{var{typed:r,matrix:t,sqrt:n,sum:i,add:a,subtract:s,multiply:c,pow:f,divide:o}=e;return r(BT,{"Array, Array":function(d,x){return u(d,x)},"Matrix, Matrix":function(d,x){var v=u(d.toArray(),x.toArray());return Array.isArray(v)?t(v):v}});function u(h,d){var x=[];if(Array.isArray(h[0])&&Array.isArray(d[0])){if(h.length!==d.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var v=0;va(S,c(O,d[F])),0),C=i(h.map(S=>f(S,2))),b=i(d.map(S=>f(S,2))),A=s(c(x,w),c(v,y)),E=n(c(s(c(x,C),f(v,2)),s(c(x,b),f(y,2))));return o(A,E)}});var PT="combinations",lW=["typed"],RT=T(PT,lW,e=>{var{typed:r}=e;return r(PT,{"number, number":Fv,"BigNumber, BigNumber":function(n,i){var a=n.constructor,s,c,f=n.minus(i),o=new a(1);if(!kT(n)||!kT(i))throw new TypeError("Positive integer value expected in function combinations");if(i.gt(n))throw new TypeError("k must be less than n in function combinations");if(s=o,i.lt(f))for(c=o;c.lte(f);c=c.plus(o))s=s.times(i.plus(c)).dividedBy(c);else for(c=o;c.lte(i);c=c.plus(o))s=s.times(f.plus(c)).dividedBy(c);return s}})});function kT(e){return e.isInteger()&&e.gte(0)}var LT="combinationsWithRep",cW=["typed"],UT=T(LT,cW,e=>{var{typed:r}=e;return r(LT,{"number, number":function(n,i){if(!He(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!He(i)||i<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(i{var{typed:r,config:t,multiplyScalar:n,pow:i,BigNumber:a,Complex:s}=e;function c(o){if(o.im===0)return wf(o.re);if(o.re<.5){var u=new s(1-o.re,-o.im),p=new s(Math.PI*o.re,Math.PI*o.im);return new s(Math.PI).div(p.sin()).div(c(u))}o=new s(o.re-1,o.im);for(var h=new s(ns[0],0),d=1;d2;)h-=2,x+=h,d=d.times(x);return new a(d.toPrecision(a.precision))}});var VT="lgamma",mW=["Complex","typed"],YT=T(VT,mW,e=>{var{Complex:r,typed:t}=e,n=7,i=7,a=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(VT,{number:Df,Complex:s,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function s(o){var u=6.283185307179586,p=1.1447298858494002,h=.1;if(o.isNaN())return new r(NaN,NaN);if(o.im===0)return new r(Df(o.re),0);if(o.re>=n||Math.abs(o.im)>=i)return c(o);if(o.re<=h){var d=hy(u,o.im)*Math.floor(.5*o.re+.25),x=o.mul(Math.PI).sin().log(),v=s(new r(1-o.re,-o.im));return new r(p,d).sub(x).sub(v)}else return o.im>=0?f(o):f(o.conjugate()).conjugate()}function c(o){for(var u=o.sub(.5).mul(o.log()).sub(o).add(Lv),p=new r(1,0).div(o),h=p.div(o),d=a[0],x=a[1],v=2*h.re,y=h.re*h.re+h.im*h.im,w=2;w<8;w++){var C=x;x=-y*d+a[w],d=v*d+C}var b=p.mul(h.mul(d).add(x));return u.add(b)}function f(o){var u=0,p=0,h=o;for(o=o.add(1);o.re<=n;){h=h.mul(o);var d=h.im<0?1:0;d!==0&&p===0&&u++,p=d,o=o.add(1)}return c(o).sub(h.log()).sub(new r(0,u*2*Math.PI*1))}});var HT="factorial",hW=["typed","gamma"],GT=T(HT,hW,e=>{var{typed:r,gamma:t}=e;return r(HT,{number:function(i){if(i<0)throw new Error("Value must be non-negative");return t(i+1)},BigNumber:function(i){if(i.isNegative())throw new Error("Value must be non-negative");return t(i.plus(1))},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var $T="kldivergence",dW=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],ZT=T($T,dW,e=>{var{typed:r,matrix:t,divide:n,sum:i,multiply:a,map:s,dotDivide:c,log:f,isNumeric:o}=e;return r($T,{"Array, Array":function(h,d){return u(t(h),t(d))},"Matrix, Array":function(h,d){return u(h,t(d))},"Array, Matrix":function(h,d){return u(t(h),d)},"Matrix, Matrix":function(h,d){return u(h,d)}});function u(p,h){var d=h.size().length,x=p.size().length;if(d>1)throw new Error("first object must be one dimensional");if(x>1)throw new Error("second object must be one dimensional");if(d!==x)throw new Error("Length of two vectors must be equal");var v=i(p);if(v===0)throw new Error("Sum of elements in first object must be non zero");var y=i(h);if(y===0)throw new Error("Sum of elements in second object must be non zero");var w=n(p,i(p)),C=n(h,i(h)),b=i(a(w,s(c(w,C),A=>f(A))));return o(b)?b:Number.NaN}});var QT="multinomial",vW=["typed","add","divide","multiply","factorial","isInteger","isPositive"],XT=T(QT,vW,e=>{var{typed:r,add:t,divide:n,multiply:i,factorial:a,isInteger:s,isPositive:c}=e;return r(QT,{"Array | Matrix":function(o){var u=0,p=1;return hn(o,function(h){if(!s(h)||!c(h))throw new TypeError("Positive integer value expected in function multinomial");u=t(u,h),p=i(p,a(h))}),n(a(u),p)}})});var JT="permutations",gW=["typed","factorial"],jT=T(JT,gW,e=>{var{typed:r,factorial:t}=e;return r(JT,{"number | BigNumber":t,"number, number":function(i,a){if(!He(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(!He(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(a>i)throw new TypeError("second argument k must be less than or equal to first argument n");return Kn(i-a+1,i)},"BigNumber, BigNumber":function(i,a){var s,c;if(!KT(i)||!KT(a))throw new TypeError("Positive integer value expected in function permutations");if(a.gt(i))throw new TypeError("second argument k must be less than or equal to first argument n");var f=i.mul(0).add(1);for(s=f,c=i.minus(a).plus(1);c.lte(i);c=c.plus(1))s=s.times(c);return s}})});function KT(e){return e.isInteger()&&e.gte(0)}var Ag=li(vF(),1),NW=(0,Ag.default)(Date.now());function qa(e){var r;function t(i){r=i===null?NW:(0,Ag.default)(String(i))}t(e);function n(){return r()}return n}var gF="pickRandom",AW=["typed","config","?on"],xF=T(gF,AW,e=>{var{typed:r,config:t,on:n}=e,i=qa(t.randomSeed);return n&&n("config",function(s,c){s.randomSeed!==c.randomSeed&&(i=qa(s.randomSeed))}),r(gF,{"Array | Matrix":function(c){return a(c,{})},"Array | Matrix, Object":function(c,f){return a(c,f)},"Array | Matrix, number":function(c,f){return a(c,{number:f})},"Array | Matrix, Array | Matrix":function(c,f){return a(c,{weights:f})},"Array | Matrix, Array | Matrix, number":function(c,f,o){return a(c,{number:o,weights:f})},"Array | Matrix, number, Array | Matrix":function(c,f,o){return a(c,{number:f,weights:o})}});function a(s,c){var{number:f,weights:o,elementWise:u=!0}=c,p=typeof f>"u";p&&(f=1);var h=Ge(s)?s.create:Ge(o)?o.create:null;s=s.valueOf(),o&&(o=o.valueOf()),u===!0&&(s=gr(s),o=gr(o));var d=0;if(typeof o<"u"){if(o.length!==s.length)throw new Error("Weights must have the same length as possibles");for(var x=0,v=o.length;x"u")C=s[Math.floor(i()*y)];else for(var b=i()*d,A=0,E=s.length;A1)for(var n=0,i=e.shift();n{var{typed:r,config:t,on:n}=e,i=qa(t.randomSeed);return n&&n("config",function(c,f){c.randomSeed!==f.randomSeed&&(i=qa(c.randomSeed))}),r(yF,{"":()=>s(0,1),number:c=>s(0,c),"number, number":(c,f)=>s(c,f),"Array | Matrix":c=>a(c,0,1),"Array | Matrix, number":(c,f)=>a(c,0,f),"Array | Matrix, number, number":(c,f,o)=>a(c,f,o)});function a(c,f,o){var u=Cf(c.valueOf(),()=>s(f,o));return Ge(c)?c.create(u):u}function s(c,f){return c+i()*(f-c)}});var wF="randomInt",CW=["typed","config","?on"],DF=T(wF,CW,e=>{var{typed:r,config:t,on:n}=e,i=qa(t.randomSeed);return n&&n("config",function(c,f){c.randomSeed!==f.randomSeed&&(i=qa(c.randomSeed))}),r(wF,{"":()=>s(0,1),number:c=>s(0,c),"number, number":(c,f)=>s(c,f),"Array | Matrix":c=>a(c,0,1),"Array | Matrix, number":(c,f)=>a(c,0,f),"Array | Matrix, number, number":(c,f,o)=>a(c,f,o)});function a(c,f,o){var u=Cf(c.valueOf(),()=>s(f,o));return Ge(c)?c.create(u):u}function s(c,f){return Math.floor(c+i()*(f-c))}});var SF="stirlingS2",MW=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],NF=T(SF,MW,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:i,divideScalar:a,pow:s,factorial:c,combinations:f,isNegative:o,isInteger:u,number:p,bignumber:h,larger:d}=e,x=[],v=[];return r(SF,{"number | BigNumber, number | BigNumber":function(w,C){if(!u(w)||o(w)||!u(C)||o(C))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(d(C,w))throw new TypeError("k must be less than or equal to n in function stirlingS2");var b=!(ar(w)&&ar(C)),A=b?v:x,E=b?h:p,S=p(w),O=p(C);if(A[S]&&A[S].length>O)return A[S][O];for(var F=0;F<=S;++F)if(A[F]||(A[F]=[E(F===0?1:0)]),F!==0)for(var M=A[F],_=A[F-1],k=M.length;k<=F&&k<=O;++k)k===F?M[k]=1:M[k]=t(i(E(k),_[k]),_[k-1]);return A[S][O]}})});var AF="bellNumbers",_W=["typed","addScalar","isNegative","isInteger","stirlingS2"],EF=T(AF,_W,e=>{var{typed:r,addScalar:t,isNegative:n,isInteger:i,stirlingS2:a}=e;return r(AF,{"number | BigNumber":function(c){if(!i(c)||n(c))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var f=0,o=0;o<=c;o++)f=t(f,a(c,o));return f}})});var CF="catalan",TW=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],MF=T(CF,TW,e=>{var{typed:r,addScalar:t,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:s,isInteger:c}=e;return r(CF,{"number | BigNumber":function(o){if(!c(o)||s(o))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(o,2),o),t(o,1))}})});var _F="composition",FW=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],TF=T(_F,FW,e=>{var{typed:r,addScalar:t,combinations:n,isPositive:i,isNegative:a,isInteger:s,larger:c}=e;return r(_F,{"number | BigNumber, number | BigNumber":function(o,u){if(!s(o)||!i(o)||!s(u)||!i(u))throw new TypeError("Positive integer value expected in function composition");if(c(u,o))throw new TypeError("k must be less than or equal to n in function composition");return n(t(o,-1),t(u,-1))}})});var FF="leafCount",OW=["parse","typed"],OF=T(FF,OW,e=>{var{parse:r,typed:t}=e;function n(i){var a=0;return i.forEach(s=>{a+=n(s)}),a||1}return t(FF,{Node:function(a){return n(a)}})});function Eg(e){return yr(e)||ut(e)&&e.isUnary()&&yr(e.args[0])}function Mf(e){return!!(yr(e)||(fn(e)||ut(e))&&e.args.every(Mf)||Zt(e)&&Mf(e.content))}function BF(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Cg(e){for(var r=1;r{var{FunctionNode:r,OperatorNode:t,SymbolNode:n}=e,i=!0,a=!1,s="defaultF",c={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:a,total:i,commutative:a,associative:a},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:a,total:i,commutative:a,associative:a},paren:{trivial:i,total:i,commutative:i,associative:a},defaultF:{trivial:a,total:i,commutative:a,associative:a}},f={divide:{total:a},log:{total:a}},o={subtract:{total:a},abs:{trivial:i},log:{total:i}};function u(b,A){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:c,S=s;if(typeof b=="string"?S=b:ut(b)?S=b.fn.toString():fn(b)?S=b.name:Zt(b)&&(S="paren"),$e(E,S)){var O=E[S];if($e(O,A))return O[A];if($e(c,S))return c[S][A]}if($e(E,s)){var F=E[s];return $e(F,A)?F[A]:c[s][A]}if($e(c,S)){var M=c[S];if($e(M,A))return M[A]}return c[s][A]}function p(b){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return u(b,"commutative",A)}function h(b){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return u(b,"associative",A)}function d(b,A){var E=Cg({},b);for(var S in A)$e(b,S)?E[S]=Cg(Cg({},A[S]),b[S]):E[S]=A[S];return E}function x(b,A){if(!b.args||b.args.length===0)return b;b.args=v(b,A);for(var E=0;E2&&h(b,A)){for(var F=b.args.pop();b.args.length>0;)F=E([b.args.pop(),F]);b.args=F.args}}}function w(b,A){if(!(!b.args||b.args.length===0)){for(var E=C(b),S=b.args.length,O=0;O2&&h(b,A)){for(var F=b.args.shift();b.args.length>0;)F=E([F,b.args.shift()]);b.args=F.args}}}function C(b){return ut(b)?function(A){try{return new t(b.op,b.fn,A,b.implicit)}catch(E){return console.error(E),[]}}:function(A){return new r(new n(b.name),A)}}return{createMakeNodeFunction:C,hasProperty:u,isCommutative:p,isAssociative:h,mergeContext:d,flatten:x,allChildren:v,unflattenr:y,unflattenl:w,defaultContext:c,realContext:f,positiveContext:o}});var PW="simplify",kW=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],IF=T(PW,kW,e=>{var{config:r,typed:t,parse:n,add:i,subtract:a,multiply:s,divide:c,pow:f,isZero:o,equal:u,resolve:p,simplifyConstant:h,simplifyCore:d,fraction:x,bignumber:v,mathWithTransform:y,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:A,FunctionNode:E,IndexNode:S,ObjectNode:O,OperatorNode:F,ParenthesisNode:M,SymbolNode:_}=e,{hasProperty:k,isCommutative:L,isAssociative:Y,mergeContext:$,flatten:V,unflattenr:q,unflattenl:R,createMakeNodeFunction:j,defaultContext:U,realContext:oe,positiveContext:me}=hu({FunctionNode:E,OperatorNode:F,SymbolNode:_});t.addConversion({from:"Object",to:"Map",convert:Pa});var ie=t("simplify",{Node:xe,"Node, Map":(ee,ne)=>xe(ee,!1,ne),"Node, Map, Object":(ee,ne,ue)=>xe(ee,!1,ne,ue),"Node, Array":xe,"Node, Array, Map":xe,"Node, Array, Map, Object":xe});t.removeConversion({from:"Object",to:"Map",convert:Pa}),ie.defaultContext=U,ie.realContext=oe,ie.positiveContext=me;function H(ee){return ee.transform(function(ne,ue,Ee){return Zt(ne)?H(ne.content):ne})}var ce={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};ie.rules=[d,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},h,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},h,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function Me(ee,ne){var ue={};if(ee.s){var Ee=ee.s.split("->");if(Ee.length===2)ue.l=Ee[0],ue.r=Ee[1];else throw SyntaxError("Could not parse rule: "+ee.s)}else ue.l=ee.l,ue.r=ee.r;ue.l=H(n(ue.l)),ue.r=H(n(ue.r));for(var Ce of["imposeContext","repeat","assuming"])Ce in ee&&(ue[Ce]=ee[Ce]);if(ee.evaluate&&(ue.evaluate=n(ee.evaluate)),Y(ue.l,ne)){var Le=!L(ue.l,ne),Ie;Le&&(Ie=Se());var sr=j(ue.l),ir=Se();ue.expanded={},ue.expanded.l=sr([ue.l,ir]),V(ue.expanded.l,ne),q(ue.expanded.l,ne),ue.expanded.r=sr([ue.r,ir]),Le&&(ue.expandedNC1={},ue.expandedNC1.l=sr([Ie,ue.l]),ue.expandedNC1.r=sr([Ie,ue.r]),ue.expandedNC2={},ue.expandedNC2.l=sr([Ie,ue.expanded.l]),ue.expandedNC2.r=sr([Ie,ue.expanded.r]))}return ue}function pe(ee,ne){for(var ue=[],Ee=0;Ee2&&arguments[2]!==void 0?arguments[2]:vo(),Ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ce=Ee.consoleDebug;ne=pe(ne||ie.rules,Ee.context);var Le=p(ee,ue);Le=H(Le);for(var Ie={},sr=Le.toString({parenthesis:"all"});!Ie[sr];){Ie[sr]=!0,ge=0;var ir=sr;Ce&&console.log("Working on: ",sr);for(var Xe=0;Xe ").concat(ne[Xe].r.toString()))),Ce){var re=Le.toString({parenthesis:"all"});re!==ir&&(console.log("Applying",Or,"produced",re),ir=re)}R(Le,Ee.context)}sr=Le.toString({parenthesis:"all"})}return Le}function be(ee,ne,ue){var Ee=ee;if(ee)for(var Ce=0;Ce1&&(ir=Le(ee.args.slice(0,sr))),Ce=ee.args.slice(sr),Ee=Ce.length===1?Ce[0]:Le(Ce),ue.push(Le([ir,Ee]))}return ue}function ze(ee,ne){var ue={placeholders:{}};if(!ee.placeholders&&!ne.placeholders)return ue;if(ee.placeholders){if(!ne.placeholders)return ee}else return ne;for(var Ee in ee.placeholders)if($e(ee.placeholders,Ee)&&(ue.placeholders[Ee]=ee.placeholders[Ee],$e(ne.placeholders,Ee)&&!ye(ee.placeholders[Ee],ne.placeholders[Ee])))return null;for(var Ce in ne.placeholders)$e(ne.placeholders,Ce)&&(ue.placeholders[Ce]=ne.placeholders[Ce]);return ue}function Ze(ee,ne){var ue=[];if(ee.length===0||ne.length===0)return ue;for(var Ee,Ce=0;Ce2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var ir=te(ee.args[0],ne.args[1],ue);if(ir.length===0)return[];var Xe=te(ee.args[1],ne.args[0],ue);if(Xe.length===0)return[];Le=[ir,Xe]}Ce=K(Le)}else if(ne.args.length>=2&&ee.args.length===2){for(var Or=Ae(ne,ue),re=[],le=0;le2)throw Error("Unexpected non-binary associative function: "+ee.toString());return[]}}else if(ee instanceof _){if(ee.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(ce[ee.name]){if(ee.name!==ne.name)return[]}else switch(ee.name[1]>="a"&&ee.name[1]<="z"?ee.name.substring(0,2):ee.name[0]){case"n":case"_p":Ce[0].placeholders[ee.name]=ne;break;case"c":case"cl":if(yr(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"v":if(!yr(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"vl":if(rt(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"cd":if(Eg(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"vd":if(!Eg(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"ce":if(Mf(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"ve":if(!Mf(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;default:throw new Error("Invalid symbol in rule: "+ee.name)}}else if(ee instanceof A){if(!u(ee.value,ne.value))return[]}else return[];return Ce}function ye(ee,ne){if(ee instanceof A&&ne instanceof A){if(!u(ee.value,ne.value))return!1}else if(ee instanceof _&&ne instanceof _){if(ee.name!==ne.name)return!1}else if(ee instanceof F&&ne instanceof F||ee instanceof E&&ne instanceof E){if(ee instanceof F){if(ee.op!==ne.op||ee.fn!==ne.fn)return!1}else if(ee instanceof E&&ee.name!==ne.name)return!1;if(ee.args.length!==ne.args.length)return!1;for(var ue=0;ue{var{typed:r,config:t,mathWithTransform:n,matrix:i,fraction:a,bignumber:s,AccessorNode:c,ArrayNode:f,ConstantNode:o,FunctionNode:u,IndexNode:p,ObjectNode:h,OperatorNode:d,SymbolNode:x}=e,{isCommutative:v,isAssociative:y,allChildren:w,createMakeNodeFunction:C}=hu({FunctionNode:u,OperatorNode:d,SymbolNode:x}),b=r("simplifyConstant",{Node:V=>O($(V,{})),"Node, Object":function(q,R){return O($(q,R))}});function A(V){return Xn(V)?V.valueOf():V instanceof Array?V.map(A):Ge(V)?i(A(V.valueOf())):V}function E(V,q,R){try{return n[V].apply(null,q)}catch{return q=q.map(A),M(n[V].apply(null,q),R)}}var S=r({Fraction:k,number:function(q){return q<0?_(new o(-q)):new o(q)},BigNumber:function(q){return q<0?_(new o(-q)):new o(q)},Complex:function(q){throw new Error("Cannot convert Complex number to Node")},string:function(q){return new o(q)},Matrix:function(q){return new f(q.valueOf().map(R=>S(R)))}});function O(V){return Sr(V)?V:S(V)}function F(V,q){var R=q&&q.exactFractions!==!1;if(R&&isFinite(V)&&a){var j=a(V),U=q&&typeof q.fractionsLimit=="number"?q.fractionsLimit:1/0;if(j.valueOf()===V&&j.n0;)if(yr(j[0])&&typeof j[0].value!="string"){var U=M(j.shift().value,R);$t(V)?V=V.items[U-1]:(V=V.valueOf()[U-1],V instanceof Array&&(V=i(V)))}else if(j.length>1&&yr(j[1])&&typeof j[1].value!="string"){var oe=M(j[1].value,R),me=[],ie=$t(V)?V.items:V.valueOf();for(var H of ie)if($t(H))me.push(H.items[oe-1]);else if(Ge(V))me.push(H[oe-1]);else break;if(me.length===ie.length)$t(V)?V=new f(me):V=i(me),j.splice(1,1);else break}else break;return j.length===q.dimensions.length?new c(O(V),q):j.length>0?(q=new p(j),new c(O(V),q)):V}if(fa(V)&&q.dimensions.length===1&&yr(q.dimensions[0])){var ce=q.dimensions[0].value;return ce in V.properties?V.properties[ce]:new o}return new c(O(V),q)}function Y(V,q,R,j){var U=q.shift(),oe=q.reduce((me,ie)=>{if(!Sr(ie)){var H=me.pop();if(Sr(H))return[H,ie];try{return me.push(E(V,[H,ie],j)),me}catch{me.push(H)}}me.push(O(me.pop()));var ce=me.length===1?me[0]:R(me);return[R([ce,O(ie)])]},[U]);return oe.length===1?oe[0]:R([oe[0],S(oe[1])])}function $(V,q){switch(V.type){case"SymbolNode":return V;case"ConstantNode":switch(typeof V.value){case"number":return M(V.value,q);case"string":return V.value;default:if(!isNaN(V.value))return M(V.value,q)}return V;case"FunctionNode":if(n[V.name]&&n[V.name].rawArgs)return V;{var R=["add","multiply"];if(R.indexOf(V.name)===-1){var j=V.args.map(De=>$(De,q));if(!j.some(Sr))try{return E(V.name,j,q)}catch{}if(V.name==="size"&&j.length===1&&$t(j[0])){for(var U=[],oe=j[0];$t(oe);)U.push(oe.items.length),oe=oe.items[0];return i(U)}return new u(V.name,j.map(O))}}case"OperatorNode":{var me=V.fn.toString(),ie,H,ce=C(V);if(ut(V)&&V.isUnary())ie=[$(V.args[0],q)],Sr(ie[0])?H=ce(ie):H=E(me,ie,q);else if(y(V,q.context))if(ie=w(V,q.context),ie=ie.map(De=>$(De,q)),v(me,q.context)){for(var Me=[],pe=[],ge=0;ge1?(H=Y(me,Me,ce,q),pe.unshift(H),H=Y(me,pe,ce,q)):H=Y(me,ie,ce,q)}else H=Y(me,ie,ce,q);else ie=V.args.map(De=>$(De,q)),H=Y(me,ie,ce,q);return H}case"ParenthesisNode":return $(V.content,q);case"AccessorNode":return L($(V.object,q),$(V.index,q),q);case"ArrayNode":{var Se=V.items.map(De=>$(De,q));return Se.some(Sr)?new f(Se.map(O)):i(Se)}case"IndexNode":return new p(V.dimensions.map(De=>b(De,q)));case"ObjectNode":{var xe={};for(var be in V.properties)xe[be]=b(V.properties[be],q);return new h(xe)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(V.type))}}return b});var kF="simplifyCore",qW=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],RF=T(kF,qW,e=>{var{typed:r,parse:t,equal:n,isZero:i,add:a,subtract:s,multiply:c,divide:f,pow:o,AccessorNode:u,ArrayNode:p,ConstantNode:h,FunctionNode:d,IndexNode:x,ObjectNode:v,OperatorNode:y,ParenthesisNode:w,SymbolNode:C}=e,b=new h(0),A=new h(1),E=new h(!0),S=new h(!1);function O(k){return ut(k)&&["and","not","or"].includes(k.op)}var{hasProperty:F,isCommutative:M}=hu({FunctionNode:d,OperatorNode:y,SymbolNode:C});function _(k){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=L?L.context:void 0;if(F(k,"trivial",Y)){if(fn(k)&&k.args.length===1)return _(k.args[0],L);var $=!1,V=0;if(k.forEach(pe=>{++V,V===1&&($=_(pe,L))}),V===1)return $}var q=k;if(fn(q)){var R=C2(q.name);if(R){if(q.args.length>2&&F(q,"associative",Y))for(;q.args.length>2;){var j=q.args.pop(),U=q.args.pop();q.args.push(new y(R,q.name,[j,U]))}q=new y(R,q.name,q.args)}else return new d(_(q.fn),q.args.map(pe=>_(pe,L)))}if(ut(q)&&q.isUnary()){var oe=_(q.args[0],L);if(q.op==="~"&&ut(oe)&&oe.isUnary()&&oe.op==="~"||q.op==="not"&&ut(oe)&&oe.isUnary()&&oe.op==="not"&&O(oe.args[0]))return oe.args[0];var me=!0;if(q.op==="-"&&ut(oe)&&(oe.isBinary()&&oe.fn==="subtract"&&(q=new y("-","subtract",[oe.args[1],oe.args[0]]),me=!1),oe.isUnary()&&oe.op==="-"))return oe.args[0];if(me)return new y(q.op,q.fn,[oe])}if(ut(q)&&q.isBinary()){var ie=_(q.args[0],L),H=_(q.args[1],L);if(q.op==="+"){if(yr(ie)&&i(ie.value))return H;if(yr(H)&&i(H.value))return ie;ut(H)&&H.isUnary()&&H.op==="-"&&(H=H.args[0],q=new y("-","subtract",[ie,H]))}if(q.op==="-")return ut(H)&&H.isUnary()&&H.op==="-"?_(new y("+","add",[ie,H.args[0]]),L):yr(ie)&&i(ie.value)?_(new y("-","unaryMinus",[H])):yr(H)&&i(H.value)?ie:new y(q.op,q.fn,[ie,H]);if(q.op==="*"){if(yr(ie)){if(i(ie.value))return b;if(n(ie.value,1))return H}if(yr(H)){if(i(H.value))return b;if(n(H.value,1))return ie;if(M(q,Y))return new y(q.op,q.fn,[H,ie],q.implicit)}return new y(q.op,q.fn,[ie,H],q.implicit)}if(q.op==="/")return yr(ie)&&i(ie.value)?b:yr(H)&&n(H.value,1)?ie:new y(q.op,q.fn,[ie,H]);if(q.op==="^"&&yr(H)){if(i(H.value))return A;if(n(H.value,1))return ie}if(q.op==="and"){if(yr(ie))if(ie.value){if(O(H))return H;if(yr(H))return H.value?E:S}else return S;if(yr(H))if(H.value){if(O(ie))return ie}else return S}if(q.op==="or"){if(yr(ie)){if(ie.value)return E;if(O(H))return H}if(yr(H)){if(H.value)return E;if(O(ie))return ie}}return new y(q.op,q.fn,[ie,H])}if(ut(q))return new y(q.op,q.fn,q.args.map(pe=>_(pe,L)));if($t(q))return new p(q.items.map(pe=>_(pe,L)));if(Sn(q))return new u(_(q.object,L),_(q.index,L));if(kn(q))return new x(q.dimensions.map(pe=>_(pe,L)));if(fa(q)){var ce={};for(var Me in q.properties)ce[Me]=_(q.properties[Me],L);return new v(ce)}return q}return r(kF,{Node:_,"Node,Object":_})});var UW="resolve",zW=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],LF=T(UW,zW,e=>{var{typed:r,parse:t,ConstantNode:n,FunctionNode:i,OperatorNode:a,ParenthesisNode:s}=e;function c(f,o){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!o)return f;if(rt(f)){if(u.has(f.name)){var p=Array.from(u).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(p,"}"))}var h=o.get(f.name);if(Sr(h)){var d=new Set(u);return d.add(f.name),c(h,o,d)}else return typeof h=="number"?t(String(h)):h!==void 0?new n(h):f}else if(ut(f)){var x=f.args.map(function(y){return c(y,o,u)});return new a(f.op,f.fn,x,f.implicit)}else{if(Zt(f))return new s(c(f.content,o,u));if(fn(f)){var v=f.args.map(function(y){return c(y,o,u)});return new i(f.name,v)}}return f.map(y=>c(y,o,u))}return r("resolve",{Node:c,"Node, Map | null | undefined":c,"Node, Object":(f,o)=>c(f,Pa(o)),"Array | Matrix":r.referToSelf(f=>o=>o.map(u=>f(u))),"Array | Matrix, null | undefined":r.referToSelf(f=>o=>o.map(u=>f(u))),"Array, Object":r.referTo("Array,Map",f=>(o,u)=>f(o,Pa(u))),"Matrix, Object":r.referTo("Matrix,Map",f=>(o,u)=>f(o,Pa(u))),"Array | Matrix, Map":r.referToSelf(f=>(o,u)=>o.map(p=>f(p,u)))})});var qF="symbolicEqual",WW=["parse","simplify","typed","OperatorNode"],UF=T(qF,WW,e=>{var{parse:r,simplify:t,typed:n,OperatorNode:i}=e;function a(s,c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=new i("-","subtract",[s,c]),u=t(o,{},f);return yr(u)&&!u.value}return n(qF,{"Node, Node":a,"Node, Node, Object":a})});var zF="derivative",VW=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],WF=T(zF,VW,e=>{var{typed:r,config:t,parse:n,simplify:i,equal:a,isZero:s,numeric:c,ConstantNode:f,FunctionNode:o,OperatorNode:u,ParenthesisNode:p,SymbolNode:h}=e;function d(b,A){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},S={};y(S,b,A.name);var O=w(b,S);return E.simplify?i(O):O}r.addConversion({from:"identifier",to:"SymbolNode",convert:n});var x=r(zF,{"Node, SymbolNode":d,"Node, SymbolNode, Object":d});r.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),x._simplify=!0,x.toTex=function(b){return v.apply(null,b.args)};var v=r("_derivTex",{"Node, SymbolNode":function(A,E){return yr(A)&&_r(A.value)==="string"?v(n(A.value).toString(),E.toString(),1):v(A.toTex(),E.toString(),1)},"Node, ConstantNode":function(A,E){if(_r(E.value)==="string")return v(A,n(E.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(A,E,S){return v(A.toString(),E.name,S.value)},"string, string, number":function(A,E,S){var O;return S===1?O="{d\\\\over d"+E+"}":O="{d^{"+S+"}\\\\over d"+E+"^{"+S+"}}",O+"\\\\left[".concat(A,"\\\\right]")}}),y=r("constTag",{"Object, ConstantNode, string":function(A,E){return A[E]=!0,!0},"Object, SymbolNode, string":function(A,E,S){return E.name!==S?(A[E]=!0,!0):!1},"Object, ParenthesisNode, string":function(A,E,S){return y(A,E.content,S)},"Object, FunctionAssignmentNode, string":function(A,E,S){return E.params.indexOf(S)===-1?(A[E]=!0,!0):y(A,E.expr,S)},"Object, FunctionNode | OperatorNode, string":function(A,E,S){if(E.args.length>0){for(var O=y(A,E.args[0],S),F=1;F0){var O=A.args.filter(function(V){return E[V]===void 0}),F=O.length===1?O[0]:new u("*","multiply",O),M=S.concat(w(F,E));return new u("*","multiply",M)}return new u("+","add",A.args.map(function(V){return new u("*","multiply",A.args.map(function(q){return q===V?w(q,E):q.clone()}))}))}if(A.op==="/"&&A.isBinary()){var _=A.args[0],k=A.args[1];return E[k]!==void 0?new u("/","divide",[w(_,E),k]):E[_]!==void 0?new u("*","multiply",[new u("-","unaryMinus",[_]),new u("/","divide",[w(k,E),new u("^","pow",[k.clone(),C(2)])])]):new u("/","divide",[new u("-","subtract",[new u("*","multiply",[w(_,E),k.clone()]),new u("*","multiply",[_.clone(),w(k,E)])]),new u("^","pow",[k.clone(),C(2)])])}if(A.op==="^"&&A.isBinary()){var L=A.args[0],Y=A.args[1];if(E[L]!==void 0)return yr(L)&&(s(L.value)||a(L.value,1))?C(0):new u("*","multiply",[A,new u("*","multiply",[new o("log",[L.clone()]),w(Y.clone(),E)])]);if(E[Y]!==void 0){if(yr(Y)){if(s(Y.value))return C(0);if(a(Y.value,1))return w(L,E)}var $=new u("^","pow",[L.clone(),new u("-","subtract",[Y,C(1)])]);return new u("*","multiply",[Y.clone(),new u("*","multiply",[w(L,E),$])])}return new u("*","multiply",[new u("^","pow",[L.clone(),Y.clone()]),new u("+","add",[new u("*","multiply",[w(L,E),new u("/","divide",[Y.clone(),L.clone()])]),new u("*","multiply",[w(Y,E),new o("log",[L.clone()])])])])}throw new Error('Cannot process operator "'+A.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function C(b,A){return new f(c(b,A||t.number))}return x});var VF="rationalize",YW=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],YF=T(VF,YW,e=>{var{config:r,typed:t,equal:n,isZero:i,add:a,subtract:s,multiply:c,divide:f,pow:o,parse:u,simplifyConstant:p,simplifyCore:h,simplify:d,fraction:x,bignumber:v,mathWithTransform:y,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:A,FunctionNode:E,IndexNode:S,ObjectNode:O,OperatorNode:F,SymbolNode:M,ParenthesisNode:_}=e;function k(q){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,U=Y(),oe=L(q,R,!0,U.firstRules),me=oe.variables.length,ie={exactFractions:!1},H={exactFractions:!0};if(q=oe.expression,me>=1){q=$(q);var ce,Me,pe=!0,ge=!1;q=d(q,U.firstRules,{},ie);for(var Se;Me=pe?U.distrDivRules:U.sucDivRules,q=d(q,Me,{},H),pe=!pe,Se=q.toString(),Se!==ce;)ge=!0,ce=Se;ge&&(q=d(q,U.firstRulesAgain,{},ie)),q=d(q,U.finalRules,{},ie)}var xe=[],be={};return q.type==="OperatorNode"&&q.isBinary()&&q.op==="/"?(me===1&&(q.args[0]=V(q.args[0],xe),q.args[1]=V(q.args[1])),j&&(be.numerator=q.args[0],be.denominator=q.args[1])):(me===1&&(q=V(q,xe)),j&&(be.numerator=q,be.denominator=null)),j?(be.coefficients=xe,be.variables=oe.variables,be.expression=q,be):q}return t(VF,{Node:k,"Node, boolean":(q,R)=>k(q,{},R),"Node, Object":k,"Node, Object, boolean":k});function L(q,R,j,U){var oe=[],me=d(q,U,R,{exactFractions:!1});j=!!j;var ie="+-*"+(j?"/":"");ce(me);var H={};return H.expression=me,H.variables=oe,H;function ce(Me){var pe=Me.type;if(pe==="FunctionNode")throw new Error("There is an unsolved function call");if(pe==="OperatorNode")if(Me.op==="^"){if(Me.args[1].type!=="ConstantNode"||!He(parseFloat(Me.args[1].value)))throw new Error("There is a non-integer exponent");ce(Me.args[0])}else{if(ie.indexOf(Me.op)===-1)throw new Error("Operator "+Me.op+" invalid in polynomial expression");for(var ge=0;ge1;if(U==="OperatorNode"&&q.isBinary()){var me=!1,ie;if(q.op==="^"&&(q.args[0].type==="ParenthesisNode"||q.args[0].type==="OperatorNode")&&q.args[1].type==="ConstantNode"&&(ie=parseFloat(q.args[1].value),me=ie>=2&&He(ie)),me){if(ie>2){var H=q.args[0],ce=new F("^","pow",[q.args[0].cloneDeep(),new A(ie-1)]);q=new F("*","multiply",[H,ce])}else q=new F("*","multiply",[q.args[0],q.args[0].cloneDeep()]);oe&&(j==="content"?R.content=q:R.args[j]=q)}}if(U==="ParenthesisNode")$(q.content,q,"content");else if(U!=="ConstantNode"&&U!=="SymbolNode")for(var Me=0;Me=0;H--)if(R[H]!==0){var ce=new A(me?R[H]:Math.abs(R[H])),Me=R[H]<0?"-":"+";if(H>0){var pe=new M(oe);if(H>1){var ge=new A(H);pe=new F("^","pow",[pe,ge])}R[H]===-1&&me?ce=new F("-","unaryMinus",[pe]):Math.abs(R[H])===1?ce=pe:ce=new F("*","multiply",[ce,pe])}me?ie=ce:Me==="+"?ie=new F("+","add",[ie,ce]):ie=new F("-","subtract",[ie,ce]),me=!1}if(me)return new A(0);return ie;function Se(xe,be,De){var Ae=xe.type;if(Ae==="FunctionNode")throw new Error("There is an unsolved function call");if(Ae==="OperatorNode"){if("+-*^".indexOf(xe.op)===-1)throw new Error("Operator "+xe.op+" invalid");if(be!==null){if((xe.fn==="unaryMinus"||xe.fn==="pow")&&be.fn!=="add"&&be.fn!=="subtract"&&be.fn!=="multiply")throw new Error("Invalid "+xe.op+" placing");if((xe.fn==="subtract"||xe.fn==="add"||xe.fn==="multiply")&&be.fn!=="add"&&be.fn!=="subtract")throw new Error("Invalid "+xe.op+" placing");if((xe.fn==="subtract"||xe.fn==="add"||xe.fn==="unaryMinus")&&De.noFil!==0)throw new Error("Invalid "+xe.op+" placing")}(xe.op==="^"||xe.op==="*")&&(De.fire=xe.op);for(var ze=0;zeU&&(R[Ze]=0),R[Ze]+=De.cte*(De.oper==="+"?1:-1),U=Math.max(Ze,U);return}De.cte=Ze,De.fire===""&&(R[0]+=De.cte*(De.oper==="+"?1:-1))}else throw new Error("Type "+Ae+" is not allowed")}}});var HF="zpk2tf",HW=["typed","add","multiply","Complex","number"],GF=T(HF,HW,e=>{var{typed:r,add:t,multiply:n,Complex:i,number:a}=e;return r(HF,{"Array,Array,number":function(o,u,p){return s(o,u,p)},"Array,Array":function(o,u){return s(o,u,1)},"Matrix,Matrix,number":function(o,u,p){return s(o.valueOf(),u.valueOf(),p)},"Matrix,Matrix":function(o,u){return s(o.valueOf(),u.valueOf(),1)}});function s(f,o,u){f.some(C=>C.type==="BigNumber")&&(f=f.map(C=>a(C))),o.some(C=>C.type==="BigNumber")&&(o=o.map(C=>a(C)));for(var p=[i(1,0)],h=[i(1,0)],d=0;d=0&&p-h{var{typed:r,add:t,multiply:n,Complex:i,divide:a,matrix:s}=e;return r($F,{"Array, Array":function(u,p){var h=f(512);return c(u,p,h)},"Array, Array, Array":function(u,p,h){return c(u,p,h)},"Array, Array, number":function(u,p,h){if(h<0)throw new Error("w must be a positive number");var d=f(h);return c(u,p,d)},"Matrix, Matrix":function(u,p){var h=f(512),{w:d,h:x}=c(u.valueOf(),p.valueOf(),h);return{w:s(d),h:s(x)}},"Matrix, Matrix, Matrix":function(u,p,h){var{h:d}=c(u.valueOf(),p.valueOf(),h.valueOf());return{h:s(d),w:s(h)}},"Matrix, Matrix, number":function(u,p,h){if(h<0)throw new Error("w must be a positive number");var d=f(h),{h:x}=c(u.valueOf(),p.valueOf(),d);return{h:s(x),w:s(d)}}});function c(o,u,p){for(var h=[],d=[],x=0;x{var{classes:r}=e;return function(n,i){var a=r[i&&i.mathjs];return a&&typeof a.fromJSON=="function"?a.fromJSON(i):i}});var QW="replacer",XW=[],XF=T(QW,XW,()=>function(r,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t});var JF="12.4.1";var KF=T("true",[],()=>!0),jF=T("false",[],()=>!1),e3=T("null",[],()=>null),r3=ei("Infinity",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1/0):1/0}),t3=ei("NaN",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(NaN):NaN}),n3=ei("pi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?Af(t):c1}),i3=ei("tau",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?YS(t):p1}),a3=ei("e",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?WS(t):m1}),o3=ei("phi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?VS(t):h1}),s3=ei("LN2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).ln():Math.LN2}),u3=ei("LN10",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(10).ln():Math.LN10}),f3=ei("LOG2E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),l3=ei("LOG10E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),c3=ei("SQRT1_2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),p3=ei("SQRT2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),m3=ei("i",["Complex"],e=>{var{Complex:r}=e;return r.I}),h3=T("PI",["pi"],e=>{var{pi:r}=e;return r}),d3=T("E",["e"],e=>{var{e:r}=e;return r}),v3=T("version",[],()=>JF);function ei(e,r,t){return T(e,r,t,{recreateOnConfigChange:!0})}var g3=Cr("speedOfLight","299792458","m s^-1"),x3=Cr("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),y3=Cr("planckConstant","6.62607015e-34","J s"),b3=Cr("reducedPlanckConstant","1.0545718176461565e-34","J s"),w3=Cr("magneticConstant","1.25663706212e-6","N A^-2"),D3=Cr("electricConstant","8.8541878128e-12","F m^-1"),S3=Cr("vacuumImpedance","376.730313667","ohm"),N3=Cr("coulomb","8.987551792261171e9","N m^2 C^-2"),A3=Cr("elementaryCharge","1.602176634e-19","C"),E3=Cr("bohrMagneton","9.2740100783e-24","J T^-1"),C3=Cr("conductanceQuantum","7.748091729863649e-5","S"),M3=Cr("inverseConductanceQuantum","12906.403729652257","ohm"),_3=Cr("magneticFluxQuantum","2.0678338484619295e-15","Wb"),T3=Cr("nuclearMagneton","5.0507837461e-27","J T^-1"),F3=Cr("klitzing","25812.807459304513","ohm");var O3=Cr("bohrRadius","5.29177210903e-11","m"),B3=Cr("classicalElectronRadius","2.8179403262e-15","m"),I3=Cr("electronMass","9.1093837015e-31","kg"),P3=Cr("fermiCoupling","1.1663787e-5","GeV^-2"),k3=Vp("fineStructure",.0072973525693),R3=Cr("hartreeEnergy","4.3597447222071e-18","J"),L3=Cr("protonMass","1.67262192369e-27","kg"),q3=Cr("deuteronMass","3.3435830926e-27","kg"),U3=Cr("neutronMass","1.6749271613e-27","kg"),z3=Cr("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),W3=Cr("rydberg","10973731.568160","m^-1"),V3=Cr("thomsonCrossSection","6.6524587321e-29","m^2"),Y3=Vp("weakMixingAngle",.2229),H3=Vp("efimovFactor",22.7),G3=Cr("atomicMass","1.66053906660e-27","kg"),$3=Cr("avogadro","6.02214076e23","mol^-1"),Z3=Cr("boltzmann","1.380649e-23","J K^-1"),Q3=Cr("faraday","96485.33212331001","C mol^-1"),X3=Cr("firstRadiation","3.7417718521927573e-16","W m^2"),J3=Cr("loschmidt","2.686780111798444e25","m^-3"),K3=Cr("gasConstant","8.31446261815324","J K^-1 mol^-1"),j3=Cr("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),eO=Cr("molarVolume","0.022413969545014137","m^3 mol^-1"),rO=Vp("sackurTetrode",-1.16487052358),tO=Cr("secondRadiation","0.014387768775039337","m K"),nO=Cr("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),iO=Cr("wienDisplacement","2.897771955e-3","m K"),aO=Cr("molarMass","0.99999999965e-3","kg mol^-1"),oO=Cr("molarMassC12","11.9999999958e-3","kg mol^-1"),sO=Cr("gravity","9.80665","m s^-2"),uO=Cr("planckLength","1.616255e-35","m"),fO=Cr("planckMass","2.176435e-8","kg"),lO=Cr("planckTime","5.391245e-44","s"),cO=Cr("planckCharge","1.87554603778e-18","C"),pO=Cr("planckTemperature","1.416785e+32","K");function Cr(e,r,t){var n=["config","Unit","BigNumber"];return T(e,n,i=>{var{config:a,Unit:s,BigNumber:c}=i,f=a.number==="BigNumber"?new c(r):parseFloat(r),o=new s(f,t);return o.fixPrefix=!0,o})}function Vp(e,r){var t=["config","BigNumber"];return T(e,t,n=>{var{config:i,BigNumber:a}=n;return i.number==="BigNumber"?new a(r):r})}var JW="apply",KW=["typed","isInteger"],mO=T(JW,KW,e=>{var{typed:r,isInteger:t}=e,n=au({typed:r,isInteger:t});return r("apply",{"...any":function(a){var s=a[1];ar(s)?a[1]=s-1:je(s)&&(a[1]=s.minus(1));try{return n.apply(null,a)}catch(c){throw lt(c)}}})},{isTransformFunction:!0});var jW="column",eV=["typed","Index","matrix","range"],hO=T(jW,eV,e=>{var{typed:r,Index:t,matrix:n,range:i}=e,a=$c({typed:r,Index:t,matrix:n,range:i});return r("column",{"...any":function(c){var f=c.length-1,o=c[f];ar(o)&&(c[f]=o-1);try{return a.apply(null,c)}catch(u){throw lt(u)}}})},{isTransformFunction:!0});function du(e,r,t){var n=e.filter(function(f){return rt(f)&&!(f.name in r)&&!t.has(f.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=new Map,s=new js(t,a,new Set([i])),c=e.compile();return function(o){return a.set(i,o),c.evaluate(s)}}var rV="filter",tV=["typed"],vO=T(rV,tV,e=>{var{typed:r}=e;function t(i,a,s){var c,f;return i[0]&&(c=i[0].compile().evaluate(s)),i[1]&&(rt(i[1])||pi(i[1])?f=i[1].compile().evaluate(s):f=du(i[1],a,s)),n(c,f)}t.rawArgs=!0;var n=r("filter",{"Array, function":dO,"Matrix, function":function(a,s){return a.create(dO(a.toArray(),s))},"Array, RegExp":Js,"Matrix, RegExp":function(a,s){return a.create(Js(a.toArray(),s))}});return t},{isTransformFunction:!0});function dO(e,r){return Sc(e,function(t,n,i){return vi(r,t,[n+1],i,"filter")})}var nV="forEach",iV=["typed"],gO=T(nV,iV,e=>{var{typed:r}=e;function t(i,a,s){var c,f;return i[0]&&(c=i[0].compile().evaluate(s)),i[1]&&(rt(i[1])||pi(i[1])?f=i[1].compile().evaluate(s):f=du(i[1],a,s)),n(c,f)}t.rawArgs=!0;var n=r("forEach",{"Array | Matrix, function":function(a,s){var c=function f(o,u){if(Array.isArray(o))mo(o,function(p,h){f(p,u.concat(h+1))});else return vi(s,o,u,a,"forEach")};c(a.valueOf(),[])}});return t},{isTransformFunction:!0});var aV="index",oV=["Index","getMatrixDataType"],xO=T(aV,oV,e=>{var{Index:r,getMatrixDataType:t}=e;return function(){for(var i=[],a=0,s=arguments.length;a0?0:2;else if(c&&c.isSet===!0)c=c.map(function(o){return o-1});else if(Ar(c)||Ge(c))t(c)!=="boolean"&&(c=c.map(function(o){return o-1}));else if(ar(c))c--;else if(je(c))c=c.toNumber()-1;else if(typeof c!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");i[a]=c}var f=new r;return r.apply(f,i),f}},{isTransformFunction:!0});var sV="map",uV=["typed"],bO=T(sV,uV,e=>{var{typed:r}=e;function t(i,a,s){var c,f;return i[0]&&(c=i[0].compile().evaluate(s)),i[1]&&(rt(i[1])||pi(i[1])?f=i[1].compile().evaluate(s):f=du(i[1],a,s)),n(c,f)}t.rawArgs=!0;var n=r("map",{"Array, function":function(a,s){return yO(a,s,a)},"Matrix, function":function(a,s){return a.create(yO(a.valueOf(),s,a))}});return t},{isTransformFunction:!0});function yO(e,r,t){function n(i,a){return Array.isArray(i)?Rn(i,function(s,c){return n(s,a.concat(c+1))}):vi(r,i,a,t,"map")}return n(e,[])}function vn(e){if(e.length===2&&bt(e[0])){e=e.slice();var r=e[1];ar(r)?e[1]=r-1:je(r)&&(e[1]=r.minus(1))}return e}var fV="max",lV=["typed","config","numeric","larger"],wO=T(fV,lV,e=>{var{typed:r,config:t,numeric:n,larger:i}=e,a=lp({typed:r,config:t,numeric:n,larger:i});return r("max",{"...any":function(c){c=vn(c);try{return a.apply(null,c)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var cV="mean",pV=["typed","add","divide"],DO=T(cV,pV,e=>{var{typed:r,add:t,divide:n}=e,i=Lp({typed:r,add:t,divide:n});return r("mean",{"...any":function(s){s=vn(s);try{return i.apply(null,s)}catch(c){throw lt(c)}}})},{isTransformFunction:!0});var mV="min",hV=["typed","config","numeric","smaller"],SO=T(mV,hV,e=>{var{typed:r,config:t,numeric:n,smaller:i}=e,a=cp({typed:r,config:t,numeric:n,smaller:i});return r("min",{"...any":function(c){c=vn(c);try{return a.apply(null,c)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var dV="range",vV=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],NO=T(dV,vV,e=>{var{typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:c,largerEq:f,add:o,isPositive:u}=e,p=Jc({typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:c,largerEq:f,add:o,isPositive:u});return r("range",{"...any":function(d){var x=d.length-1,v=d[x];return typeof v!="boolean"&&d.push(!0),p.apply(null,d)}})},{isTransformFunction:!0});var gV="row",xV=["typed","Index","matrix","range"],AO=T(gV,xV,e=>{var{typed:r,Index:t,matrix:n,range:i}=e,a=Kc({typed:r,Index:t,matrix:n,range:i});return r("row",{"...any":function(c){var f=c.length-1,o=c[f];ar(o)&&(c[f]=o-1);try{return a.apply(null,c)}catch(u){throw lt(u)}}})},{isTransformFunction:!0});var yV="subset",bV=["typed","matrix","zeros","add"],EO=T(yV,bV,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e,a=jc({typed:r,matrix:t,zeros:n,add:i});return r("subset",{"...any":function(c){try{return a.apply(null,c)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var wV="concat",DV=["typed","matrix","isInteger"],CO=T(wV,DV,e=>{var{typed:r,matrix:t,isInteger:n}=e,i=Gc({typed:r,matrix:t,isInteger:n});return r("concat",{"...any":function(s){var c=s.length-1,f=s[c];ar(f)?s[c]=f-1:je(f)&&(s[c]=f.minus(1));try{return i.apply(null,s)}catch(o){throw lt(o)}}})},{isTransformFunction:!0});var MO="diff",SV=["typed","matrix","subtract","number","bignumber"],_O=T(MO,SV,e=>{var{typed:r,matrix:t,subtract:n,number:i,bignumber:a}=e,s=Zc({typed:r,matrix:t,subtract:n,number:i,bignumber:a});return r(MO,{"...any":function(f){f=vn(f);try{return s.apply(null,f)}catch(o){throw lt(o)}}})},{isTransformFunction:!0});var NV="std",AV=["typed","map","sqrt","variance"],TO=T(NV,AV,e=>{var{typed:r,map:t,sqrt:n,variance:i}=e,a=zp({typed:r,map:t,sqrt:n,variance:i});return r("std",{"...any":function(c){c=vn(c);try{return a.apply(null,c)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var FO="sum",EV=["typed","config","add","numeric"],OO=T(FO,EV,e=>{var{typed:r,config:t,add:n,numeric:i}=e,a=Pp({typed:r,config:t,add:n,numeric:i});return r(FO,{"...any":function(c){c=vn(c);try{return a.apply(null,c)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var CV="quantileSeq",MV=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],BO=T(CV,MV,e=>{var{typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:c,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:h}=e,d=Up({typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:c,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:h});return r("quantileSeq",{"Array | Matrix, number | BigNumber":d,"Array | Matrix, number | BigNumber, number":(v,y,w)=>d(v,y,x(w)),"Array | Matrix, number | BigNumber, boolean":d,"Array | Matrix, number | BigNumber, boolean, number":(v,y,w,C)=>d(v,y,w,x(C)),"Array | Matrix, Array | Matrix":d,"Array | Matrix, Array | Matrix, number":(v,y,w)=>d(v,y,x(w)),"Array | Matrix, Array | Matrix, boolean":d,"Array | Matrix, Array | Matrix, boolean, number":(v,y,w,C)=>d(v,y,w,x(C))});function x(v){return vn([[],v])[1]}},{isTransformFunction:!0});var IO="cumsum",_V=["typed","add","unaryPlus"],PO=T(IO,_V,e=>{var{typed:r,add:t,unaryPlus:n}=e,i=Rp({typed:r,add:t,unaryPlus:n});return r(IO,{"...any":function(s){if(s.length===2&&bt(s[0])){var c=s[1];ar(c)?s[1]=c-1:je(c)&&(s[1]=c.minus(1))}try{return i.apply(null,s)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var kO="variance",TV=["typed","add","subtract","multiply","divide","apply","isNaN"],RO=T(kO,TV,e=>{var{typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:c}=e,f=qp({typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:c});return r(kO,{"...any":function(u){u=vn(u);try{return f.apply(null,u)}catch(p){throw lt(p)}}})},{isTransformFunction:!0});var LO="print",FV=["typed","matrix","zeros","add"],qO=T(LO,FV,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e,a=rp({typed:r,matrix:t,zeros:n,add:i});return r(LO,{"string, Object | Array":function(f,o){return a(s(f),o)},"string, Object | Array, number | Object":function(f,o,u){return a(s(f),o,u)}});function s(c){return c.replace(ep,f=>{var o=f.slice(1).split("."),u=o.map(function(p){return!isNaN(p)&&p.length>0?parseInt(p)-1:p});return"$"+u.join(".")})}},{isTransformFunction:!0});var OV="and",BV=["typed","matrix","zeros","add","equalScalar","not","concat"],UO=T(OV,BV,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,c=tp({typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s});function f(o,u,p){var h=o[0].compile().evaluate(p);if(!bt(h)&&!c(h,!0))return!1;var d=o[1].compile().evaluate(p);return c(h,d)}return f.rawArgs=!0,f},{isTransformFunction:!0});var IV="or",PV=["typed","matrix","equalScalar","DenseMatrix","concat"],zO=T(IV,PV,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=Hc({typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a});function c(f,o,u){var p=f[0].compile().evaluate(u);if(!bt(p)&&s(p,!1))return!0;var h=f[1].compile().evaluate(u);return s(p,h)}return c.rawArgs=!0,c},{isTransformFunction:!0});var kV="bitAnd",RV=["typed","matrix","zeros","add","equalScalar","not","concat"],WO=T(kV,RV,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,c=Vc({typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s});function f(o,u,p){var h=o[0].compile().evaluate(p);if(!bt(h)){if(isNaN(h))return NaN;if(h===0||h===!1)return 0}var d=o[1].compile().evaluate(p);return c(h,d)}return f.rawArgs=!0,f},{isTransformFunction:!0});var LV="bitOr",qV=["typed","matrix","equalScalar","DenseMatrix","concat"],VO=T(LV,qV,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=Yc({typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a});function c(f,o,u){var p=f[0].compile().evaluate(u);if(!bt(p)){if(isNaN(p))return NaN;if(p===-1)return-1;if(p===!0)return 1}var h=f[1].compile().evaluate(u);return s(p,h)}return c.rawArgs=!0,c},{isTransformFunction:!0});var _g=Mg;var ZO=li(vc(),1);var HO=li(YO(),1);function GO(e){var r=new HO.default;return e.on=r.on.bind(r),e.off=r.off.bind(r),e.once=r.once.bind(r),e.emit=r.emit.bind(r),e}function $O(e,r,t,n){function i(y,w){var C=arguments.length;if(C!==1&&C!==2)throw new jn("import",C,1,2);w||(w={});function b(O,F,M){if(Array.isArray(F))F.forEach(L=>b(O,L));else if(typeof F=="object")for(var _ in F)$e(F,_)&&b(O,F[_],_);else if(jo(F)||M!==void 0){var k=jo(F)?x(F)?F.fn+".transform":F.fn:M;if($e(O,k)&&O[k]!==F&&!w.silent)throw new Error('Cannot import "'+k+'" twice');O[k]=F}else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}var A={};b(A,y);for(var E in A)if($e(A,E)){var S=A[E];if(jo(S))o(S,w);else if(u(S))a(E,S,w);else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}}function a(y,w,C){if(C.wrap&&typeof w=="function"&&(w=f(w)),p(w)&&(w=e(y,{[w.signature]:w})),e.isTypedFunction(t[y])&&e.isTypedFunction(w)){C.override?w=e(y,w.signatures):w=e(t[y],w),t[y]=w,delete n[y],s(y,w),t.emit("import",y,function(){return w});return}if(t[y]===void 0||C.override){t[y]=w,delete n[y],s(y,w),t.emit("import",y,function(){return w});return}if(!C.silent)throw new Error('Cannot import "'+y+'": already exists')}function s(y,w){w&&typeof w.transform=="function"?(t.expression.transform[y]=w.transform,h(y)&&(t.expression.mathWithTransform[y]=w.transform)):(delete t.expression.transform[y],h(y)&&(t.expression.mathWithTransform[y]=w))}function c(y){delete t.expression.transform[y],h(y)?t.expression.mathWithTransform[y]=t[y]:delete t.expression.mathWithTransform[y]}function f(y){var w=function(){for(var b=[],A=0,E=arguments.length;A2&&arguments[2]!==void 0?arguments[2]:y.fn;if(Hd(C,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(C));var b=x(y)?t.expression.transform:t,A=C in t.expression.transform,E=$e(b,C)?b[C]:void 0,S=function(){var F={};y.dependencies.map(Zd).forEach(_=>{if(Hd(_,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(_));_==="math"?F.math=t:_==="mathWithTransform"?F.mathWithTransform=t.expression.mathWithTransform:_==="classes"?F.classes=t:F[_]=t[_]});var M=y(F);if(M&&typeof M.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(E===void 0||w.override)return M;if(e.isTypedFunction(E)&&e.isTypedFunction(M))return e(E,M);if(w.silent)return E;throw new Error('Cannot import "'+C+'": already exists')};!y.meta||y.meta.lazy!==!1?($s(b,C,S),E&&A?c(C):(x(y)||d(y))&&$s(t.expression.mathWithTransform,C,()=>b[C])):(b[C]=S(),E&&A?c(C):(x(y)||d(y))&&$s(t.expression.mathWithTransform,C,()=>b[C])),n[C]=y,t.emit("import",C,S)}function u(y){return typeof y=="function"||typeof y=="number"||typeof y=="string"||typeof y=="boolean"||y===null||qt(y)||Gt(y)||je(y)||Xn(y)||Ge(y)||Array.isArray(y)}function p(y){return typeof y=="function"&&typeof y.signature=="string"}function h(y){return!$e(v,y)}function d(y){return y.fn.indexOf(".")===-1&&!$e(v,y.fn)&&(!y.meta||!y.meta.isClass)}function x(y){return y!==void 0&&y.meta!==void 0&&y.meta.isTransformFunction===!0||!1}var v={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return i}function Yp(e,r){var t=Mt({},tc,r);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var n=GO({isNumber:ar,isComplex:Gt,isBigNumber:je,isFraction:Xn,isUnit:qt,isString:yt,isArray:Ar,isMatrix:Ge,isCollection:bt,isDenseMatrix:Ba,isSparseMatrix:Jn,isRange:po,isIndex:sa,isBoolean:nc,isResultSet:ic,isHelp:Ys,isFunction:ac,isDate:oc,isRegExp:sc,isObject:ua,isNull:uc,isUndefined:fc,isAccessorNode:Sn,isArrayNode:$t,isAssignmentNode:lc,isBlockNode:cc,isConditionalNode:pc,isConstantNode:yr,isFunctionAssignmentNode:pi,isFunctionNode:fn,isIndexNode:kn,isNode:Sr,isObjectNode:fa,isOperatorNode:ut,isParenthesisNode:Zt,isRangeNode:mc,isRelationalNode:hc,isSymbolNode:rt,isChain:Hs});n.config=ry(t,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var i=[],a=[];function s(u){if(jo(u))return u(n);var p=u[Object.keys(u)[0]];if(jo(p))return p(n);if(!Xx(u))throw console.warn("Factory object with properties \`type\`, \`name\`, and \`factory\` expected",u),new Error("Factory object with properties \`type\`, \`name\`, and \`factory\` expected");var h=i.indexOf(u),d;return h===-1?(u.math===!0?d=u.factory(n.type,t,s,n.typed,n):d=u.factory(n.type,t,s,n.typed),i.push(u),a.push(d)):d=a[h],d}var c={};function f(){for(var u=arguments.length,p=new Array(u),h=0;h{Pd(c).forEach(u=>{u&&u.meta&&u.meta.recreateOnConfigChange&&o(u,{override:!0})})}),n.create=Yp.bind(null,e),n.factory=T,n.import(Pd(Zx(e))),n.ArgumentsError=jn,n.DimensionError=pr,n.IndexError=Xt,n}var QO=(e,r,t)=>{if(e.length!==1)return"";let n=e.map(function(s){return s.compile().evaluate(t)}),i=t.get(n[0]),a=t.get("$properties")?.[n[0]]?.type;return(a=="file"||a=="link"||a=="context")&&(a.includes("multi")?i=qi(i).map(s=>t.get("$paths").get(s)):i=t.get("$paths").get(i)),i??""};QO.rawArgs=!0;var XO=(e,r,t)=>{if((e.length-1)%2!==0)return"";for(let n=0;n{if(e.length<1||e.length>2)return"";let n=e[0].compile().evaluate(t);n instanceof Date||(n=new Date(n));let i=e[1]?.compile().evaluate(t);return i?.length>0?Oa(n,i):Oa(n,t.get("$settings")?.dateFormat??"yyyy-MM-dd")};JO.rawArgs=!0;var KO={prop:QO,slice:(e,r,t)=>e.slice(r,t),if:(e,r,t)=>e===!0?r:t,ifs:XO,empty:e=>e.length!==1?"":e[0]===""?"true":"false",length:e=>e.length,substring:(e,r,t)=>t?e.substring(r,t):e.substring(r),contains:(e,r)=>e.includes(r),test:(e,r)=>new RegExp(r).test(e),match:(e,r)=>e.match(new RegExp(r)),replace:(e,r,t)=>e.replace(new RegExp(r),t),replaceAll:(e,r,t)=>e.replace(new RegExp(r,"g"),t),lower:e=>e.toLowerCase(),upper:e=>e.toUpperCase(),repeat:(e,r)=>e.repeat(r),format:e=>e instanceof Date?Oa(e,"yyyy-MM-dd"):typeof e=="number"?e.toFixed(2):e,toNumber:e=>e instanceof Date?e.getTime():typeof e=="string"?parseFloat(e):e,now:()=>new Date,minute:e=>e.getMinutes(),hour:e=>e.getHours(),day:e=>e.getDay(),date:e=>e.getDate(),week:e=>Oa(e,"w"),month:e=>e.getMonth()+1,year:e=>e.getFullYear(),dateAdd:(e,r,t)=>(t==="days"&&e.setDate(e.getDate()+r),t==="months"&&e.setMonth(e.getMonth()+r),t==="years"&&e.setFullYear(e.getFullYear()+r),t==="quarters"&&e.setMonth(e.getMonth()+r*3),t==="weeks"&&e.setDate(e.getDate()+r*7),t==="hours"&&e.setHours(e.getHours()+r),t==="minutes"&&e.setMinutes(e.getMinutes()+r),t==="seconds"&&e.setSeconds(e.getSeconds()+r),e),dateSubtract:(e,r,t)=>(t==="day"&&e.setDate(e.getDate()-r),t==="month"&&e.setMonth(e.getMonth()-r),t==="year"&&e.setFullYear(e.getFullYear()-r),t==="quarter"&&e.setMonth(e.getMonth()-r*3),t==="week"&&e.setDate(e.getDate()-r*7),t==="hour"&&e.setHours(e.getHours()-r),t==="minute"&&e.setMinutes(e.getMinutes()-r),t==="second"&&e.setSeconds(e.getSeconds()-r),e),dateBetween:(e,r,t)=>{let s=Math.abs(r.getTime()-e.getTime());switch(t){case"days":return Math.round(s/864e5);case"months":return Math.round(s/2592e6);case"years":return Math.round(s/31536e6);case"hours":return Math.round(s/(60*60*1e3));case"minutes":return Math.round(s/(60*1e3));case"seconds":return Math.round(s/1e3);case"weeks":return Math.round(s/(864e5*7));case"quarters":return Math.round(s/(2592e6*3));default:return Math.round(s/864e5)}},timeStamp:e=>e.getTime(),formatDate:JO,parseDate:e=>{if(e?.length>0)return new Date(e)??""}};var jO=(e,r,t,n)=>{if(!r)return"";let i=new Map;Object.keys(n).forEach(f=>i.set(f,n[f])),i.set("$properties",t),i.set("$paths",e);let a={..._g,createAdd:T("add",[],()=>function(o,u){return o+u})},s=Yp(a);s.import(KO,{override:!0});let c;try{c=s.evaluate(r,i),c=Jl("",c)}catch(f){console.log(r,f)}return c};var eB=(e,r,t)=>({...r,...t.filter(n=>n.type=="fileprop"||n.name=="tags").reduce((n,i)=>{let{value:a}=Bd(i.value,i.type);return{...n,[i.name]:jO(e,a,t.reduce((s,c)=>({...s,[c.name]:c}),{}),r)}},{})});var zV=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],oB=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],WV="\\u200C\\u200D\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0898-\\u089F\\u08CA-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EBC\\u0EC8-\\u0ECE\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u180F-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1ABF-\\u1ACE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\u30FB\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F\\uFF65",sB="\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC",Og={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Bg="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",VV={5:Bg,"5module":Bg+" export import",6:Bg+" const class extends export import super"},YV=/^in(stanceof)?$/,HV=new RegExp("["+sB+"]"),GV=new RegExp("["+sB+WV+"]");function Pg(e,r){for(var t=65536,n=0;ne)return!1;if(t+=r[n+1],t>=e)return!0}return!1}function Ua(e,r){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&HV.test(String.fromCharCode(e)):r===!1?!1:Pg(e,oB)}function vu(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&GV.test(String.fromCharCode(e)):r===!1?!1:Pg(e,oB)||Pg(e,zV)}var tt=function(r,t){t===void 0&&(t={}),this.label=r,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function yi(e,r){return new tt(e,{beforeExpr:!0,binop:r})}var bi={beforeExpr:!0},zn={startsExpr:!0},Lg={};function $r(e,r){return r===void 0&&(r={}),r.keyword=e,Lg[e]=new tt(e,r)}var X={num:new tt("num",zn),regexp:new tt("regexp",zn),string:new tt("string",zn),name:new tt("name",zn),privateId:new tt("privateId",zn),eof:new tt("eof"),bracketL:new tt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new tt("]"),braceL:new tt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new tt("}"),parenL:new tt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new tt(")"),comma:new tt(",",bi),semi:new tt(";",bi),colon:new tt(":",bi),dot:new tt("."),question:new tt("?",bi),questionDot:new tt("?."),arrow:new tt("=>",bi),template:new tt("template"),invalidTemplate:new tt("invalidTemplate"),ellipsis:new tt("...",bi),backQuote:new tt("\`",zn),dollarBraceL:new tt("\${",{beforeExpr:!0,startsExpr:!0}),eq:new tt("=",{beforeExpr:!0,isAssign:!0}),assign:new tt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new tt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new tt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:yi("||",1),logicalAND:yi("&&",2),bitwiseOR:yi("|",3),bitwiseXOR:yi("^",4),bitwiseAND:yi("&",5),equality:yi("==/!=/===/!==",6),relational:yi("/<=/>=",7),bitShift:yi("<>/>>>",8),plusMin:new tt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:yi("%",10),star:yi("*",10),slash:yi("/",10),starstar:new tt("**",{beforeExpr:!0}),coalesce:yi("??",1),_break:$r("break"),_case:$r("case",bi),_catch:$r("catch"),_continue:$r("continue"),_debugger:$r("debugger"),_default:$r("default",bi),_do:$r("do",{isLoop:!0,beforeExpr:!0}),_else:$r("else",bi),_finally:$r("finally"),_for:$r("for",{isLoop:!0}),_function:$r("function",zn),_if:$r("if"),_return:$r("return",bi),_switch:$r("switch"),_throw:$r("throw",bi),_try:$r("try"),_var:$r("var"),_const:$r("const"),_while:$r("while",{isLoop:!0}),_with:$r("with"),_new:$r("new",{beforeExpr:!0,startsExpr:!0}),_this:$r("this",zn),_super:$r("super",zn),_class:$r("class",zn),_extends:$r("extends",bi),_export:$r("export"),_import:$r("import",zn),_null:$r("null",zn),_true:$r("true",zn),_false:$r("false",zn),_in:$r("in",{beforeExpr:!0,binop:7}),_instanceof:$r("instanceof",{beforeExpr:!0,binop:7}),_typeof:$r("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:$r("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:$r("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Si=/\\r\\n?|\\n|\\u2028|\\u2029/,$V=new RegExp(Si.source,"g");function gu(e){return e===10||e===13||e===8232||e===8233}function uB(e,r,t){t===void 0&&(t=e.length);for(var n=r;n>10)+55296,(e&1023)+56320))}var XV=/(?:[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/,Tf=function(r,t){this.line=r,this.column=t};Tf.prototype.offset=function(r){return new Tf(this.line,this.column+r)};var Qp=function(r,t,n){this.start=t,this.end=n,r.sourceFile!==null&&(this.source=r.sourceFile)};function cB(e,r){for(var t=1,n=0;;){var i=uB(e,n,r);if(i<0)return new Tf(t,r-n);++t,n=i}}var kg={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},nB=!1;function JV(e){var r={};for(var t in kg)r[t]=e&&Of(e,t)?e[t]:kg[t];if(r.ecmaVersion==="latest"?r.ecmaVersion=1e8:r.ecmaVersion==null?(!nB&&typeof console=="object"&&console.warn&&(nB=!0,console.warn(\`Since Acorn 8.0.0, options.ecmaVersion is required. -Defaulting to 2020, but this will stop working in the future.\`)),r.ecmaVersion=11):r.ecmaVersion>=2015&&(r.ecmaVersion-=2009),r.allowReserved==null&&(r.allowReserved=r.ecmaVersion<5),(!e||e.allowHashBang==null)&&(r.allowHashBang=r.ecmaVersion>=14),rB(r.onToken)){var n=r.onToken;r.onToken=function(i){return n.push(i)}}return rB(r.onComment)&&(r.onComment=KV(r,r.onComment)),r}function KV(e,r){return function(t,n,i,a,s,c){var f={type:t?"Block":"Line",value:n,start:i,end:a};e.locations&&(f.loc=new Qp(this,s,c)),e.ranges&&(f.range=[i,a]),r.push(f)}}var Ff=1,xu=2,qg=4,pB=8,mB=16,hB=32,Ug=64,dB=128,Bf=256,zg=Ff|xu|Bf;function Wg(e,r){return xu|(e?qg:0)|(r?pB:0)}var Gp=0,Vg=1,Wa=2,vB=3,gB=4,xB=5,Kt=function(r,t,n){this.options=r=JV(r),this.sourceFile=r.sourceFile,this.keywords=No(VV[r.ecmaVersion>=6?6:r.sourceType==="module"?"5module":5]);var i="";r.allowReserved!==!0&&(i=Og[r.ecmaVersion>=6?6:r.ecmaVersion===5?5:3],r.sourceType==="module"&&(i+=" await")),this.reservedWords=No(i);var a=(i?i+" ":"")+Og.strict;this.reservedWordsStrict=No(a),this.reservedWordsStrictBind=No(a+" "+Og.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(\` -\`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Si).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=X.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=r.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&r.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Ff),this.regexpState=null,this.privateNameStack=[]},ha={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};Kt.prototype.parse=function(){var r=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(r)};ha.inFunction.get=function(){return(this.currentVarScope().flags&xu)>0};ha.inGenerator.get=function(){return(this.currentVarScope().flags&pB)>0&&!this.currentVarScope().inClassFieldInit};ha.inAsync.get=function(){return(this.currentVarScope().flags&qg)>0&&!this.currentVarScope().inClassFieldInit};ha.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var r=this.scopeStack[e];if(r.inClassFieldInit||r.flags&Bf)return!1;if(r.flags&xu)return(r.flags&qg)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};ha.allowSuper.get=function(){var e=this.currentThisScope(),r=e.flags,t=e.inClassFieldInit;return(r&Ug)>0||t||this.options.allowSuperOutsideMethod};ha.allowDirectSuper.get=function(){return(this.currentThisScope().flags&dB)>0};ha.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};ha.allowNewDotTarget.get=function(){var e=this.currentThisScope(),r=e.flags,t=e.inClassFieldInit;return(r&(xu|Bf))>0||t};ha.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Bf)>0};Kt.extend=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];for(var n=this,i=0;i=,?^&]/.test(i)||i==="!"&&this.input.charAt(n+1)==="=")}e+=r[0].length,wi.lastIndex=e,e+=wi.exec(this.input)[0].length,this.input[e]===";"&&e++}};Nn.eat=function(e){return this.type===e?(this.next(),!0):!1};Nn.isContextual=function(e){return this.type===X.name&&this.value===e&&!this.containsEsc};Nn.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};Nn.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};Nn.canInsertSemicolon=function(){return this.type===X.eof||this.type===X.braceR||Si.test(this.input.slice(this.lastTokEnd,this.start))};Nn.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};Nn.semicolon=function(){!this.eat(X.semi)&&!this.insertSemicolon()&&this.unexpected()};Nn.afterTrailingComma=function(e,r){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),r||this.next(),!0};Nn.expect=function(e){this.eat(e)||this.unexpected()};Nn.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Xp=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Nn.checkPatternErrors=function(e,r){if(!!e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var t=r?e.parenthesizedAssign:e.parenthesizedBind;t>-1&&this.raiseRecoverable(t,r?"Assigning to rvalue":"Parenthesized pattern")}};Nn.checkExpressionErrors=function(e,r){if(!e)return!1;var t=e.shorthandAssign,n=e.doubleProto;if(!r)return t>=0||n>=0;t>=0&&this.raise(t,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")};Nn.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&n<56320)return!0;if(Ua(n,!0)){for(var i=t+1;vu(n=this.input.charCodeAt(i),!0);)++i;if(n===92||n>55295&&n<56320)return!0;var a=this.input.slice(t,i);if(!YV.test(a))return!0}return!1};hr.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;wi.lastIndex=this.pos;var e=wi.exec(this.input),r=this.pos+e[0].length,t;return!Si.test(this.input.slice(this.pos,r))&&this.input.slice(r,r+8)==="function"&&(r+8===this.input.length||!(vu(t=this.input.charCodeAt(r+8))||t>55295&&t<56320))};hr.parseStatement=function(e,r,t){var n=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(n=X._var,a="let"),n){case X._break:case X._continue:return this.parseBreakContinueStatement(i,n.keyword);case X._debugger:return this.parseDebuggerStatement(i);case X._do:return this.parseDoStatement(i);case X._for:return this.parseForStatement(i);case X._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case X._class:return e&&this.unexpected(),this.parseClass(i,!0);case X._if:return this.parseIfStatement(i);case X._return:return this.parseReturnStatement(i);case X._switch:return this.parseSwitchStatement(i);case X._throw:return this.parseThrowStatement(i);case X._try:return this.parseTryStatement(i);case X._const:case X._var:return a=a||this.value,e&&a!=="var"&&this.unexpected(),this.parseVarStatement(i,a);case X._while:return this.parseWhileStatement(i);case X._with:return this.parseWithStatement(i);case X.braceL:return this.parseBlock(!0,i);case X.semi:return this.parseEmptyStatement(i);case X._export:case X._import:if(this.options.ecmaVersion>10&&n===X._import){wi.lastIndex=this.pos;var s=wi.exec(this.input),c=this.pos+s[0].length,f=this.input.charCodeAt(c);if(f===40||f===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(r||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===X._import?this.parseImport(i):this.parseExport(i,t);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var o=this.value,u=this.parseExpression();return n===X.name&&u.type==="Identifier"&&this.eat(X.colon)?this.parseLabeledStatement(i,o,u,e):this.parseExpressionStatement(i,u)}};hr.parseBreakContinueStatement=function(e,r){var t=r==="break";this.next(),this.eat(X.semi)||this.insertSemicolon()?e.label=null:this.type!==X.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(X.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};hr.parseForStatement=function(e){this.next();var r=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Yg),this.enterScope(0),this.expect(X.parenL),this.type===X.semi)return r>-1&&this.unexpected(r),this.parseFor(e,null);var t=this.isLet();if(this.type===X._var||this.type===X._const||t){var n=this.startNode(),i=t?"let":this.value;return this.next(),this.parseVar(n,!0,i),this.finishNode(n,"VariableDeclaration"),(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&n.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===X._in?r>-1&&this.unexpected(r):e.await=r>-1),this.parseForIn(e,n)):(r>-1&&this.unexpected(r),this.parseFor(e,n))}var a=this.isContextual("let"),s=!1,c=new Xp,f=this.parseExpression(r>-1?"await":!0,c);return this.type===X._in||(s=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===X._in?r>-1&&this.unexpected(r):e.await=r>-1),a&&s&&this.raise(f.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(f,!1,c),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(c,!0),r>-1&&this.unexpected(r),this.parseFor(e,f))};hr.parseFunctionStatement=function(e,r,t){return this.next(),this.parseFunction(e,_f|(t?0:Rg),!1,r)};hr.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(X._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};hr.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(X.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};hr.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(X.braceL),this.labels.push(eY),this.enterScope(0);for(var r,t=!1;this.type!==X.braceR;)if(this.type===X._case||this.type===X._default){var n=this.type===X._case;r&&this.finishNode(r,"SwitchCase"),e.cases.push(r=this.startNode()),r.consequent=[],this.next(),n?r.test=this.parseExpression():(t&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),t=!0,r.test=null),this.expect(X.colon)}else r||this.unexpected(),r.consequent.push(this.parseStatement(null));return this.exitScope(),r&&this.finishNode(r,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};hr.parseThrowStatement=function(e){return this.next(),Si.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var rY=[];hr.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),r=e.type==="Identifier";return this.enterScope(r?hB:0),this.checkLValPattern(e,r?gB:Wa),this.expect(X.parenR),e};hr.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===X._catch){var r=this.startNode();this.next(),this.eat(X.parenL)?r.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),r.param=null,this.enterScope(0)),r.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(r,"CatchClause")}return e.finalizer=this.eat(X._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};hr.parseVarStatement=function(e,r,t){return this.next(),this.parseVar(e,!1,r,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};hr.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Yg),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};hr.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};hr.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};hr.parseLabeledStatement=function(e,r,t,n){for(var i=0,a=this.labels;i=0;f--){var o=this.labels[f];if(o.statementStart===e.start)o.statementStart=this.start,o.kind=c;else break}return this.labels.push({name:r,kind:c,statementStart:this.start}),e.body=this.parseStatement(n?n.indexOf("label")===-1?n+"label":n:"label"),this.labels.pop(),e.label=t,this.finishNode(e,"LabeledStatement")};hr.parseExpressionStatement=function(e,r){return e.expression=r,this.semicolon(),this.finishNode(e,"ExpressionStatement")};hr.parseBlock=function(e,r,t){for(e===void 0&&(e=!0),r===void 0&&(r=this.startNode()),r.body=[],this.expect(X.braceL),e&&this.enterScope(0);this.type!==X.braceR;){var n=this.parseStatement(null);r.body.push(n)}return t&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(r,"BlockStatement")};hr.parseFor=function(e,r){return e.init=r,this.expect(X.semi),e.test=this.type===X.semi?null:this.parseExpression(),this.expect(X.semi),e.update=this.type===X.parenR?null:this.parseExpression(),this.expect(X.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};hr.parseForIn=function(e,r){var t=this.type===X._in;return this.next(),r.type==="VariableDeclaration"&&r.declarations[0].init!=null&&(!t||this.options.ecmaVersion<8||this.strict||r.kind!=="var"||r.declarations[0].id.type!=="Identifier")&&this.raise(r.start,(t?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=r,e.right=t?this.parseExpression():this.parseMaybeAssign(),this.expect(X.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,t?"ForInStatement":"ForOfStatement")};hr.parseVar=function(e,r,t,n){for(e.declarations=[],e.kind=t;;){var i=this.startNode();if(this.parseVarId(i,t),this.eat(X.eq)?i.init=this.parseMaybeAssign(r):!n&&t==="const"&&!(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!n&&i.id.type!=="Identifier"&&!(r&&(this.type===X._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):i.init=null,e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(X.comma))break}return e};hr.parseVarId=function(e,r){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,r==="var"?Vg:Wa,!1)};var _f=1,Rg=2,yB=4;hr.parseFunction=function(e,r,t,n,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===X.star&&r&Rg&&this.unexpected(),e.generator=this.eat(X.star)),this.options.ecmaVersion>=8&&(e.async=!!n),r&_f&&(e.id=r&yB&&this.type!==X.name?null:this.parseIdent(),e.id&&!(r&Rg)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Vg:Wa:vB));var a=this.yieldPos,s=this.awaitPos,c=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Wg(e.async,e.generator)),r&_f||(e.id=this.type===X.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,t,!1,i),this.yieldPos=a,this.awaitPos=s,this.awaitIdentPos=c,this.finishNode(e,r&_f?"FunctionDeclaration":"FunctionExpression")};hr.parseFunctionParams=function(e){this.expect(X.parenL),e.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};hr.parseClass=function(e,r){this.next();var t=this.strict;this.strict=!0,this.parseClassId(e,r),this.parseClassSuper(e);var n=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(X.braceL);this.type!==X.braceR;){var s=this.parseClassElement(e.superClass!==null);s&&(i.body.push(s),s.type==="MethodDefinition"&&s.kind==="constructor"?(a&&this.raiseRecoverable(s.start,"Duplicate constructor in the same class"),a=!0):s.key&&s.key.type==="PrivateIdentifier"&&tY(n,s)&&this.raiseRecoverable(s.key.start,"Identifier '#"+s.key.name+"' has already been declared"))}return this.strict=t,this.next(),e.body=this.finishNode(i,"ClassBody"),this.exitClassBody(),this.finishNode(e,r?"ClassDeclaration":"ClassExpression")};hr.parseClassElement=function(e){if(this.eat(X.semi))return null;var r=this.options.ecmaVersion,t=this.startNode(),n="",i=!1,a=!1,s="method",c=!1;if(this.eatContextual("static")){if(r>=13&&this.eat(X.braceL))return this.parseClassStaticBlock(t),t;this.isClassElementNameStart()||this.type===X.star?c=!0:n="static"}if(t.static=c,!n&&r>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===X.star)&&!this.canInsertSemicolon()?a=!0:n="async"),!n&&(r>=9||!a)&&this.eat(X.star)&&(i=!0),!n&&!a&&!i){var f=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?s=f:n=f)}if(n?(t.computed=!1,t.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),t.key.name=n,this.finishNode(t.key,"Identifier")):this.parseClassElementName(t),r<13||this.type===X.parenL||s!=="method"||i||a){var o=!t.static&&$p(t,"constructor"),u=o&&e;o&&s!=="method"&&this.raise(t.key.start,"Constructor can't have get/set modifier"),t.kind=o?"constructor":s,this.parseClassMethod(t,i,a,u)}else this.parseClassField(t);return t};hr.isClassElementNameStart=function(){return this.type===X.name||this.type===X.privateId||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword};hr.parseClassElementName=function(e){this.type===X.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};hr.parseClassMethod=function(e,r,t,n){var i=e.key;e.kind==="constructor"?(r&&this.raise(i.start,"Constructor can't be a generator"),t&&this.raise(i.start,"Constructor can't be an async method")):e.static&&$p(e,"prototype")&&this.raise(i.start,"Classes may not have a static property named prototype");var a=e.value=this.parseMethod(r,t,n);return e.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),e.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),e.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};hr.parseClassField=function(e){if($p(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&$p(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(X.eq)){var r=this.currentThisScope(),t=r.inClassFieldInit;r.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),r.inClassFieldInit=t}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};hr.parseClassStaticBlock=function(e){e.body=[];var r=this.labels;for(this.labels=[],this.enterScope(Bf|Ug);this.type!==X.braceR;){var t=this.parseStatement(null);e.body.push(t)}return this.next(),this.exitScope(),this.labels=r,this.finishNode(e,"StaticBlock")};hr.parseClassId=function(e,r){this.type===X.name?(e.id=this.parseIdent(),r&&this.checkLValSimple(e.id,Wa,!1)):(r===!0&&this.unexpected(),e.id=null)};hr.parseClassSuper=function(e){e.superClass=this.eat(X._extends)?this.parseExprSubscripts(null,!1):null};hr.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};hr.exitClassBody=function(){var e=this.privateNameStack.pop(),r=e.declared,t=e.used;if(!!this.options.checkPrivateFields)for(var n=this.privateNameStack.length,i=n===0?null:this.privateNameStack[n-1],a=0;a=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(r,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};hr.parseExport=function(e,r){if(this.next(),this.eat(X.star))return this.parseExportAllDeclaration(e,r);if(this.eat(X._default))return this.checkExport(r,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(r,e.declaration.declarations):this.checkExport(r,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(r),this.eatContextual("from"))this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var t=0,n=e.specifiers;t=13&&this.type===X.string){var e=this.parseLiteral(this.value);return XV.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};hr.adaptDirectivePrologue=function(e){for(var r=0;r=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var Ni=Kt.prototype;Ni.toAssignable=function(e,r,t){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",t&&this.checkPatternErrors(t,!0);for(var n=0,i=e.properties;n=8&&!c&&f.name==="async"&&!this.canInsertSemicolon()&&this.eat(X._function))return this.overrideContext(Nt.f_expr),this.parseFunction(this.startNodeAt(a,s),0,!1,!0,r);if(i&&!this.canInsertSemicolon()){if(this.eat(X.arrow))return this.parseArrowExpression(this.startNodeAt(a,s),[f],!1,r);if(this.options.ecmaVersion>=8&&f.name==="async"&&this.type===X.name&&!c&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return f=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(X.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,s),[f],!0,r)}return f;case X.regexp:var o=this.value;return n=this.parseLiteral(o.value),n.regex={pattern:o.pattern,flags:o.flags},n;case X.num:case X.string:return this.parseLiteral(this.value);case X._null:case X._true:case X._false:return n=this.startNode(),n.value=this.type===X._null?null:this.type===X._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case X.parenL:var u=this.start,p=this.parseParenAndDistinguishExpression(i,r);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),p;case X.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(X.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression");case X.braceL:return this.overrideContext(Nt.b_expr),this.parseObj(!1,e);case X._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case X._class:return this.parseClass(this.startNode(),!1);case X._new:return this.parseNew();case X.backQuote:return this.parseTemplate();case X._import:return this.options.ecmaVersion>=11?this.parseExprImport(t):this.unexpected();default:return this.parseExprAtomDefault()}};Mr.parseExprAtomDefault=function(){this.unexpected()};Mr.parseExprImport=function(e){var r=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===X.parenL&&!e)return this.parseDynamicImport(r);if(this.type===X.dot){var t=this.startNodeAt(r.start,r.loc&&r.loc.start);return t.name="import",r.meta=this.finishNode(t,"Identifier"),this.parseImportMeta(r)}else this.unexpected()};Mr.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(X.parenR)){var r=this.start;this.eat(X.comma)&&this.eat(X.parenR)?this.raiseRecoverable(r,"Trailing comma is not allowed in import()"):this.unexpected(r)}return this.finishNode(e,"ImportExpression")};Mr.parseImportMeta=function(e){this.next();var r=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),r&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};Mr.parseLiteral=function(e){var r=this.startNode();return r.value=e,r.raw=this.input.slice(this.start,this.end),r.raw.charCodeAt(r.raw.length-1)===110&&(r.bigint=r.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(r,"Literal")};Mr.parseParenExpression=function(){this.expect(X.parenL);var e=this.parseExpression();return this.expect(X.parenR),e};Mr.shouldParseArrow=function(e){return!this.canInsertSemicolon()};Mr.parseParenAndDistinguishExpression=function(e,r){var t=this.start,n=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s=this.start,c=this.startLoc,f=[],o=!0,u=!1,p=new Xp,h=this.yieldPos,d=this.awaitPos,x;for(this.yieldPos=0,this.awaitPos=0;this.type!==X.parenR;)if(o?o=!1:this.expect(X.comma),a&&this.afterTrailingComma(X.parenR,!0)){u=!0;break}else if(this.type===X.ellipsis){x=this.start,f.push(this.parseParenItem(this.parseRestBinding())),this.type===X.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else f.push(this.parseMaybeAssign(!1,p,this.parseParenItem));var v=this.lastTokEnd,y=this.lastTokEndLoc;if(this.expect(X.parenR),e&&this.shouldParseArrow(f)&&this.eat(X.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=h,this.awaitPos=d,this.parseParenArrowList(t,n,f,r);(!f.length||u)&&this.unexpected(this.lastTokStart),x&&this.unexpected(x),this.checkExpressionErrors(p,!0),this.yieldPos=h||this.yieldPos,this.awaitPos=d||this.awaitPos,f.length>1?(i=this.startNodeAt(s,c),i.expressions=f,this.finishNodeAt(i,"SequenceExpression",v,y)):i=f[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var w=this.startNodeAt(t,n);return w.expression=i,this.finishNode(w,"ParenthesizedExpression")}else return i};Mr.parseParenItem=function(e){return e};Mr.parseParenArrowList=function(e,r,t,n){return this.parseArrowExpression(this.startNodeAt(e,r),t,!1,n)};var nY=[];Mr.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===X.dot){var r=this.startNodeAt(e.start,e.loc&&e.loc.start);r.name="new",e.meta=this.finishNode(r,"Identifier"),this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),t&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var n=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,i,!0,!1),this.eat(X.parenL)?e.arguments=this.parseExprList(X.parenR,this.options.ecmaVersion>=8,!1):e.arguments=nY,this.finishNode(e,"NewExpression")};Mr.parseTemplateElement=function(e){var r=e.isTagged,t=this.startNode();return this.type===X.invalidTemplate?(r||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),t.value={raw:this.value,cooked:null}):t.value={raw:this.input.slice(this.start,this.end).replace(/\\r\\n?/g,\` -\`),cooked:this.value},this.next(),t.tail=this.type===X.backQuote,this.finishNode(t,"TemplateElement")};Mr.parseTemplate=function(e){e===void 0&&(e={});var r=e.isTagged;r===void 0&&(r=!1);var t=this.startNode();this.next(),t.expressions=[];var n=this.parseTemplateElement({isTagged:r});for(t.quasis=[n];!n.tail;)this.type===X.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(X.dollarBraceL),t.expressions.push(this.parseExpression()),this.expect(X.braceR),t.quasis.push(n=this.parseTemplateElement({isTagged:r}));return this.next(),this.finishNode(t,"TemplateLiteral")};Mr.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===X.name||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===X.star)&&!Si.test(this.input.slice(this.lastTokEnd,this.start))};Mr.parseObj=function(e,r){var t=this.startNode(),n=!0,i={};for(t.properties=[],this.next();!this.eat(X.braceR);){if(n)n=!1;else if(this.expect(X.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(X.braceR))break;var a=this.parseProperty(e,r);e||this.checkPropClash(a,i,r),t.properties.push(a)}return this.finishNode(t,e?"ObjectPattern":"ObjectExpression")};Mr.parseProperty=function(e,r){var t=this.startNode(),n,i,a,s;if(this.options.ecmaVersion>=9&&this.eat(X.ellipsis))return e?(t.argument=this.parseIdent(!1),this.type===X.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(t,"RestElement")):(t.argument=this.parseMaybeAssign(!1,r),this.type===X.comma&&r&&r.trailingComma<0&&(r.trailingComma=this.start),this.finishNode(t,"SpreadElement"));this.options.ecmaVersion>=6&&(t.method=!1,t.shorthand=!1,(e||r)&&(a=this.start,s=this.startLoc),e||(n=this.eat(X.star)));var c=this.containsEsc;return this.parsePropertyName(t),!e&&!c&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(t)?(i=!0,n=this.options.ecmaVersion>=9&&this.eat(X.star),this.parsePropertyName(t)):i=!1,this.parsePropertyValue(t,e,n,i,a,s,r,c),this.finishNode(t,"Property")};Mr.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var r=e.kind==="get"?0:1;if(e.value.params.length!==r){var t=e.value.start;e.kind==="get"?this.raiseRecoverable(t,"getter should have no params"):this.raiseRecoverable(t,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};Mr.parsePropertyValue=function(e,r,t,n,i,a,s,c){(t||n)&&this.type===X.colon&&this.unexpected(),this.eat(X.colon)?(e.value=r?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,s),e.kind="init"):this.options.ecmaVersion>=6&&this.type===X.parenL?(r&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(t,n)):!r&&!c&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==X.comma&&this.type!==X.braceR&&this.type!==X.eq?((t||n)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((t||n)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=i),e.kind="init",r?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===X.eq&&s?(s.shorthandAssign<0&&(s.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};Mr.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(X.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(X.bracketR),e.key;e.computed=!1}return e.key=this.type===X.num||this.type===X.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Mr.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};Mr.parseMethod=function(e,r,t){var n=this.startNode(),i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Wg(r,n.generator)|Ug|(t?dB:0)),this.expect(X.parenL),n.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(n,"FunctionExpression")};Mr.parseArrowExpression=function(e,r,t,n){var i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(Wg(t,!1)|mB),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(r,!0),this.parseFunctionBody(e,!0,!1,n),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")};Mr.parseFunctionBody=function(e,r,t,n){var i=r&&this.type!==X.braceL,a=this.strict,s=!1;if(i)e.body=this.parseMaybeAssign(n),e.expression=!0,this.checkParams(e,!1);else{var c=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||c)&&(s=this.strictDirective(this.end),s&&c&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var f=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!a&&!s&&!r&&!t&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,xB),e.body=this.parseBlock(!1,void 0,s&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=f}this.exitScope()};Mr.isSimpleParamList=function(e){for(var r=0,t=e;r-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Ff&&delete this.undefinedExports[e]}else if(r===gB){var a=this.currentScope();a.lexical.push(e)}else if(r===vB){var s=this.currentScope();this.treatFunctionsAsVar?n=s.lexical.indexOf(e)>-1:n=s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var c=this.scopeStack.length-1;c>=0;--c){var f=this.scopeStack[c];if(f.lexical.indexOf(e)>-1&&!(f.flags&hB&&f.lexical[0]===e)||!this.treatFunctionsAsVarInScope(f)&&f.functions.indexOf(e)>-1){n=!0;break}if(f.var.push(e),this.inModule&&f.flags&Ff&&delete this.undefinedExports[e],f.flags&zg)break}n&&this.raiseRecoverable(t,"Identifier '"+e+"' has already been declared")};Eo.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};Eo.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Eo.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&zg)return r}};Eo.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&zg&&!(r.flags&mB))return r}};var Jp=function(r,t,n){this.type="",this.start=t,this.end=0,r.options.locations&&(this.loc=new Qp(r,n)),r.options.directSourceFile&&(this.sourceFile=r.options.directSourceFile),r.options.ranges&&(this.range=[t,0])},If=Kt.prototype;If.startNode=function(){return new Jp(this,this.start,this.startLoc)};If.startNodeAt=function(e,r){return new Jp(this,e,r)};function wB(e,r,t,n){return e.type=r,e.end=t,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=t),e}If.finishNode=function(e,r){return wB.call(this,e,r,this.lastTokEnd,this.lastTokEndLoc)};If.finishNodeAt=function(e,r,t,n){return wB.call(this,e,r,t,n)};If.copyNode=function(e){var r=new Jp(this,e.start,this.startLoc);for(var t in e)r[t]=e[t];return r};var DB="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",SB=DB+" Extended_Pictographic",NB=SB,AB=NB+" EBase EComp EMod EPres ExtPict",EB=AB,aY=EB,oY={9:DB,10:SB,11:NB,12:AB,13:EB,14:aY},sY="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",uY={9:"",10:"",11:"",12:"",13:"",14:sY},iB="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",CB="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",MB=CB+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",_B=MB+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",TB=_B+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",FB=TB+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",fY=FB+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",lY={9:CB,10:MB,11:_B,12:TB,13:FB,14:fY},OB={};function cY(e){var r=OB[e]={binary:No(oY[e]+" "+iB),binaryOfStrings:No(uY[e]),nonBinary:{General_Category:No(iB),Script:No(lY[e])}};r.nonBinary.Script_Extensions=r.nonBinary.Script,r.nonBinary.gc=r.nonBinary.General_Category,r.nonBinary.sc=r.nonBinary.Script,r.nonBinary.scx=r.nonBinary.Script_Extensions}for(Hp=0,Ig=[9,10,11,12,13,14];Hp=6?"uy":"")+(r.options.ecmaVersion>=9?"s":"")+(r.options.ecmaVersion>=13?"d":"")+(r.options.ecmaVersion>=15?"v":""),this.unicodeProperties=OB[r.options.ecmaVersion>=14?14:r.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};da.prototype.reset=function(r,t,n){var i=n.indexOf("v")!==-1,a=n.indexOf("u")!==-1;this.start=r|0,this.source=t+"",this.flags=n,i&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=a&&this.parser.options.ecmaVersion>=9)};da.prototype.raise=function(r){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+r)};da.prototype.at=function(r,t){t===void 0&&(t=!1);var n=this.source,i=n.length;if(r>=i)return-1;var a=n.charCodeAt(r);if(!(t||this.switchU)||a<=55295||a>=57344||r+1>=i)return a;var s=n.charCodeAt(r+1);return s>=56320&&s<=57343?(a<<10)+s-56613888:a};da.prototype.nextIndex=function(r,t){t===void 0&&(t=!1);var n=this.source,i=n.length;if(r>=i)return i;var a=n.charCodeAt(r),s;return!(t||this.switchU)||a<=55295||a>=57344||r+1>=i||(s=n.charCodeAt(r+1))<56320||s>57343?r+1:r+2};da.prototype.current=function(r){return r===void 0&&(r=!1),this.at(this.pos,r)};da.prototype.lookahead=function(r){return r===void 0&&(r=!1),this.at(this.nextIndex(this.pos,r),r)};da.prototype.advance=function(r){r===void 0&&(r=!1),this.pos=this.nextIndex(this.pos,r)};da.prototype.eat=function(r,t){return t===void 0&&(t=!1),this.current(t)===r?(this.advance(t),!0):!1};da.prototype.eatChars=function(r,t){t===void 0&&(t=!1);for(var n=this.pos,i=0,a=r;i-1&&this.raise(e.start,"Duplicate regular expression flag"),s==="u"&&(n=!0),s==="v"&&(i=!0)}this.options.ecmaVersion>=15&&n&&i&&this.raise(e.start,"Invalid regular expression flag")};ur.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};ur.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var r=0,t=e.backReferenceNames;r=9&&(t=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!t,!0}return e.pos=r,!1};ur.regexp_eatQuantifier=function(e,r){return r===void 0&&(r=!1),this.regexp_eatQuantifierPrefix(e,r)?(e.eat(63),!0):!1};ur.regexp_eatQuantifierPrefix=function(e,r){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,r)};ur.regexp_eatBracedQuantifier=function(e,r){var t=e.pos;if(e.eat(123)){var n=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};ur.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};ur.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};ur.regexp_eatSyntaxCharacter=function(e){var r=e.current();return BB(r)?(e.lastIntValue=r,e.advance(),!0):!1};function BB(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}ur.regexp_eatPatternCharacters=function(e){for(var r=e.pos,t=0;(t=e.current())!==-1&&!BB(t);)e.advance();return e.pos!==r};ur.regexp_eatExtendedPatternCharacter=function(e){var r=e.current();return r!==-1&&r!==36&&!(r>=40&&r<=43)&&r!==46&&r!==63&&r!==91&&r!==94&&r!==124?(e.advance(),!0):!1};ur.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};ur.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};ur.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Ao(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Ao(e.lastIntValue);return!0}return!1};ur.regexp_eatRegExpIdentifierStart=function(e){var r=e.pos,t=this.options.ecmaVersion>=11,n=e.current(t);return e.advance(t),n===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(n=e.lastIntValue),pY(n)?(e.lastIntValue=n,!0):(e.pos=r,!1)};function pY(e){return Ua(e,!0)||e===36||e===95}ur.regexp_eatRegExpIdentifierPart=function(e){var r=e.pos,t=this.options.ecmaVersion>=11,n=e.current(t);return e.advance(t),n===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(n=e.lastIntValue),mY(n)?(e.lastIntValue=n,!0):(e.pos=r,!1)};function mY(e){return vu(e,!0)||e===36||e===95||e===8204||e===8205}ur.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};ur.regexp_eatBackReference=function(e){var r=e.pos;if(this.regexp_eatDecimalEscape(e)){var t=e.lastIntValue;if(e.switchU)return t>e.maxBackReference&&(e.maxBackReference=t),!0;if(t<=e.numCapturingParens)return!0;e.pos=r}return!1};ur.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};ur.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};ur.regexp_eatCControlLetter=function(e){var r=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=r}return!1};ur.regexp_eatZero=function(e){return e.current()===48&&!Kp(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};ur.regexp_eatControlEscape=function(e){var r=e.current();return r===116?(e.lastIntValue=9,e.advance(),!0):r===110?(e.lastIntValue=10,e.advance(),!0):r===118?(e.lastIntValue=11,e.advance(),!0):r===102?(e.lastIntValue=12,e.advance(),!0):r===114?(e.lastIntValue=13,e.advance(),!0):!1};ur.regexp_eatControlLetter=function(e){var r=e.current();return IB(r)?(e.lastIntValue=r%32,e.advance(),!0):!1};function IB(e){return e>=65&&e<=90||e>=97&&e<=122}ur.regexp_eatRegExpUnicodeEscapeSequence=function(e,r){r===void 0&&(r=!1);var t=e.pos,n=r||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(n&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=(i-55296)*1024+(s-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(n&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&hY(e.lastIntValue))return!0;n&&e.raise("Invalid unicode escape"),e.pos=t}return!1};function hY(e){return e>=0&&e<=1114111}ur.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var r=e.current();return r!==99&&(!e.switchN||r!==107)?(e.lastIntValue=r,e.advance(),!0):!1};ur.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var r=e.current();if(r>=49&&r<=57){do e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();while((r=e.current())>=48&&r<=57);return!0}return!1};var PB=0,za=1,Di=2;ur.regexp_eatCharacterClassEscape=function(e){var r=e.current();if(dY(r))return e.lastIntValue=-1,e.advance(),za;var t=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((t=r===80)||r===112)){e.lastIntValue=-1,e.advance();var n;if(e.eat(123)&&(n=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return t&&n===Di&&e.raise("Invalid property name"),n;e.raise("Invalid property name")}return PB};function dY(e){return e===100||e===68||e===115||e===83||e===119||e===87}ur.regexp_eatUnicodePropertyValueExpression=function(e){var r=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var t=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,t,n),za}}if(e.pos=r,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return PB};ur.regexp_validateUnicodePropertyNameAndValue=function(e,r,t){Of(e.unicodeProperties.nonBinary,r)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[r].test(t)||e.raise("Invalid property value")};ur.regexp_validateUnicodePropertyNameOrValue=function(e,r){if(e.unicodeProperties.binary.test(r))return za;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(r))return Di;e.raise("Invalid property name")};ur.regexp_eatUnicodePropertyName=function(e){var r=0;for(e.lastStringValue="";kB(r=e.current());)e.lastStringValue+=Ao(r),e.advance();return e.lastStringValue!==""};function kB(e){return IB(e)||e===95}ur.regexp_eatUnicodePropertyValue=function(e){var r=0;for(e.lastStringValue="";vY(r=e.current());)e.lastStringValue+=Ao(r),e.advance();return e.lastStringValue!==""};function vY(e){return kB(e)||Kp(e)}ur.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};ur.regexp_eatCharacterClass=function(e){if(e.eat(91)){var r=e.eat(94),t=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),r&&t===Di&&e.raise("Negated character class may contain strings"),!0}return!1};ur.regexp_classContents=function(e){return e.current()===93?za:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),za)};ur.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var r=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var t=e.lastIntValue;e.switchU&&(r===-1||t===-1)&&e.raise("Invalid character class"),r!==-1&&t!==-1&&r>t&&e.raise("Range out of order in character class")}}};ur.regexp_eatClassAtom=function(e){var r=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var t=e.current();(t===99||qB(t))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=r}var n=e.current();return n!==93?(e.lastIntValue=n,e.advance(),!0):!1};ur.regexp_eatClassEscape=function(e){var r=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=r}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};ur.regexp_classSetExpression=function(e){var r=za,t;if(!this.regexp_eatClassSetRange(e))if(t=this.regexp_eatClassSetOperand(e)){t===Di&&(r=Di);for(var n=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(t=this.regexp_eatClassSetOperand(e))){t!==Di&&(r=za);continue}e.raise("Invalid character in character class")}if(n!==e.pos)return r;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(n!==e.pos)return r}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(t=this.regexp_eatClassSetOperand(e),!t)return r;t===Di&&(r=Di)}};ur.regexp_eatClassSetRange=function(e){var r=e.pos;if(this.regexp_eatClassSetCharacter(e)){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;return t!==-1&&n!==-1&&t>n&&e.raise("Range out of order in character class"),!0}e.pos=r}return!1};ur.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?za:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};ur.regexp_eatNestedClass=function(e){var r=e.pos;if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);if(e.eat(93))return t&&n===Di&&e.raise("Negated character class may contain strings"),n;e.pos=r}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=r}return null};ur.regexp_eatClassStringDisjunction=function(e){var r=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var t=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return t}else e.raise("Invalid escape");e.pos=r}return null};ur.regexp_classStringDisjunctionContents=function(e){for(var r=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===Di&&(r=Di);return r};ur.regexp_classString=function(e){for(var r=0;this.regexp_eatClassSetCharacter(e);)r++;return r===1?za:Di};ur.regexp_eatClassSetCharacter=function(e){var r=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=r,!1);var t=e.current();return t<0||t===e.lookahead()&&gY(t)||xY(t)?!1:(e.advance(),e.lastIntValue=t,!0)};function gY(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function xY(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}ur.regexp_eatClassSetReservedPunctuator=function(e){var r=e.current();return yY(r)?(e.lastIntValue=r,e.advance(),!0):!1};function yY(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}ur.regexp_eatClassControlLetter=function(e){var r=e.current();return Kp(r)||r===95?(e.lastIntValue=r%32,e.advance(),!0):!1};ur.regexp_eatHexEscapeSequence=function(e){var r=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=r}return!1};ur.regexp_eatDecimalDigits=function(e){var r=e.pos,t=0;for(e.lastIntValue=0;Kp(t=e.current());)e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();return e.pos!==r};function Kp(e){return e>=48&&e<=57}ur.regexp_eatHexDigits=function(e){var r=e.pos,t=0;for(e.lastIntValue=0;RB(t=e.current());)e.lastIntValue=16*e.lastIntValue+LB(t),e.advance();return e.pos!==r};function RB(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function LB(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}ur.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;r<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=r*64+t*8+e.lastIntValue:e.lastIntValue=r*8+t}else e.lastIntValue=r;return!0}return!1};ur.regexp_eatOctalDigit=function(e){var r=e.current();return qB(r)?(e.lastIntValue=r-48,e.advance(),!0):(e.lastIntValue=0,!1)};function qB(e){return e>=48&&e<=55}ur.regexp_eatFixedHexDigits=function(e,r){var t=e.pos;e.lastIntValue=0;for(var n=0;n=this.input.length)return this.finishToken(X.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};Yr.readToken=function(e){return Ua(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};Yr.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var r=this.input.charCodeAt(this.pos+1);return r<=56319||r>=57344?e:(e<<10)+r-56613888};Yr.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),r=this.pos,t=this.input.indexOf("*/",this.pos+=2);if(t===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=t+2,this.options.locations)for(var n=void 0,i=r;(n=uB(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=n;this.options.onComment&&this.options.onComment(!0,this.input.slice(r+2,t),r,this.pos,e,this.curPosition())};Yr.skipLineComment=function(e){for(var r=this.pos,t=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&fB.test(String.fromCharCode(e)))++this.pos;else break e}}};Yr.finishToken=function(e,r){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var t=this.type;this.type=e,this.value=r,this.updateContext(t)};Yr.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var r=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&r===46?(this.pos+=3,this.finishToken(X.ellipsis)):(++this.pos,this.finishToken(X.dot))};Yr.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(X.assign,2):this.finishOp(X.slash,1)};Yr.readToken_mult_modulo_exp=function(e){var r=this.input.charCodeAt(this.pos+1),t=1,n=e===42?X.star:X.modulo;return this.options.ecmaVersion>=7&&e===42&&r===42&&(++t,n=X.starstar,r=this.input.charCodeAt(this.pos+2)),r===61?this.finishOp(X.assign,t+1):this.finishOp(n,t)};Yr.readToken_pipe_amp=function(e){var r=this.input.charCodeAt(this.pos+1);if(r===e){if(this.options.ecmaVersion>=12){var t=this.input.charCodeAt(this.pos+2);if(t===61)return this.finishOp(X.assign,3)}return this.finishOp(e===124?X.logicalOR:X.logicalAND,2)}return r===61?this.finishOp(X.assign,2):this.finishOp(e===124?X.bitwiseOR:X.bitwiseAND,1)};Yr.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(X.assign,2):this.finishOp(X.bitwiseXOR,1)};Yr.readToken_plus_min=function(e){var r=this.input.charCodeAt(this.pos+1);return r===e?r===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Si.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(X.incDec,2):r===61?this.finishOp(X.assign,2):this.finishOp(X.plusMin,1)};Yr.readToken_lt_gt=function(e){var r=this.input.charCodeAt(this.pos+1),t=1;return r===e?(t=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+t)===61?this.finishOp(X.assign,t+1):this.finishOp(X.bitShift,t)):r===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(r===61&&(t=2),this.finishOp(X.relational,t))};Yr.readToken_eq_excl=function(e){var r=this.input.charCodeAt(this.pos+1);return r===61?this.finishOp(X.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&r===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(X.arrow)):this.finishOp(e===61?X.eq:X.prefix,1)};Yr.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var r=this.input.charCodeAt(this.pos+1);if(r===46){var t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(X.questionDot,2)}if(r===63){if(e>=12){var n=this.input.charCodeAt(this.pos+2);if(n===61)return this.finishOp(X.assign,3)}return this.finishOp(X.coalesce,2)}}return this.finishOp(X.question,1)};Yr.readToken_numberSign=function(){var e=this.options.ecmaVersion,r=35;if(e>=13&&(++this.pos,r=this.fullCharCodeAtPos(),Ua(r,!0)||r===92))return this.finishToken(X.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Ao(r)+"'")};Yr.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(X.parenL);case 41:return++this.pos,this.finishToken(X.parenR);case 59:return++this.pos,this.finishToken(X.semi);case 44:return++this.pos,this.finishToken(X.comma);case 91:return++this.pos,this.finishToken(X.bracketL);case 93:return++this.pos,this.finishToken(X.bracketR);case 123:return++this.pos,this.finishToken(X.braceL);case 125:return++this.pos,this.finishToken(X.braceR);case 58:return++this.pos,this.finishToken(X.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(X.backQuote);case 48:var r=this.input.charCodeAt(this.pos+1);if(r===120||r===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(r===111||r===79)return this.readRadixNumber(8);if(r===98||r===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(X.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Ao(e)+"'")};Yr.finishOp=function(e,r){var t=this.input.slice(this.pos,this.pos+r);return this.pos+=r,this.finishToken(e,t)};Yr.readRegexp=function(){for(var e,r,t=this.pos;;){this.pos>=this.input.length&&this.raise(t,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(Si.test(n)&&this.raise(t,"Unterminated regular expression"),e)e=!1;else{if(n==="[")r=!0;else if(n==="]"&&r)r=!1;else if(n==="/"&&!r)break;e=n==="\\\\"}++this.pos}var i=this.input.slice(t,this.pos);++this.pos;var a=this.pos,s=this.readWord1();this.containsEsc&&this.unexpected(a);var c=this.regexpState||(this.regexpState=new da(this));c.reset(t,i,s),this.validateRegExpFlags(c),this.validateRegExpPattern(c);var f=null;try{f=new RegExp(i,s)}catch{}return this.finishToken(X.regexp,{pattern:i,flags:s,value:f})};Yr.readInt=function(e,r,t){for(var n=this.options.ecmaVersion>=12&&r===void 0,i=t&&this.input.charCodeAt(this.pos)===48,a=this.pos,s=0,c=0,f=0,o=r??1/0;f=97?p=u-97+10:u>=65?p=u-65+10:u>=48&&u<=57?p=u-48:p=1/0,p>=e)break;c=u,s=s*e+p}return n&&c===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||r!=null&&this.pos-a!==r?null:s};function bY(e,r){return r?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function UB(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}Yr.readRadixNumber=function(e){var r=this.pos;this.pos+=2;var t=this.readInt(e);return t==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(t=UB(this.input.slice(r,this.pos)),++this.pos):Ua(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(X.num,t)};Yr.readNumber=function(e){var r=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(r,"Invalid number");var t=this.pos-r>=2&&this.input.charCodeAt(r)===48;t&&this.strict&&this.raise(r,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!t&&!e&&this.options.ecmaVersion>=11&&n===110){var i=UB(this.input.slice(r,this.pos));return++this.pos,Ua(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(X.num,i)}t&&/[89]/.test(this.input.slice(r,this.pos))&&(t=!1),n===46&&!t&&(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),(n===69||n===101)&&!t&&(n=this.input.charCodeAt(++this.pos),(n===43||n===45)&&++this.pos,this.readInt(10)===null&&this.raise(r,"Invalid number")),Ua(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=bY(this.input.slice(r,this.pos),t);return this.finishToken(X.num,a)};Yr.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),r;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;r=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,r>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else r=this.readHexChar(4);return r};Yr.readString=function(e){for(var r="",t=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;n===92?(r+=this.input.slice(t,this.pos),r+=this.readEscapedChar(!1),t=this.pos):n===8232||n===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(gu(n)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return r+=this.input.slice(t,this.pos++),this.finishToken(X.string,r)};var zB={};Yr.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===zB)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};Yr.invalidStringToken=function(e,r){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw zB;this.raise(e,r)};Yr.readTmplToken=function(){for(var e="",r=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var t=this.input.charCodeAt(this.pos);if(t===96||t===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===X.template||this.type===X.invalidTemplate)?t===36?(this.pos+=2,this.finishToken(X.dollarBraceL)):(++this.pos,this.finishToken(X.backQuote)):(e+=this.input.slice(r,this.pos),this.finishToken(X.template,e));if(t===92)e+=this.input.slice(r,this.pos),e+=this.readEscapedChar(!0),r=this.pos;else if(gu(t)){switch(e+=this.input.slice(r,this.pos),++this.pos,t){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=\` +In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.\`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]};var n_={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]};var i_={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var a_={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var o_={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]};var s_={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]};var u_={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]};var f_={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as \`acosh(x) = ln(sqrt(x^2 - 1) + x)\`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]};var l_={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]};var c_={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as \`acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2\`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]};var p_={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]};var m_={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as \`acsch(x) = ln(1/x + sqrt(1/x^2 + 1))\`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]};var h_={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]};var d_={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};var v_={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]};var g_={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as \`asinh(x) = ln(x + sqrt(x^2 + 1))\`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]};var x_={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]};var y_={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]};var b_={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as \`atanh(x) = ln((1 + x)/(1 - x)) / 2\`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]};var w_={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]};var D_={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]};var S_={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]};var N_={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]};var A_={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]};var E_={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]};var C_={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]};var M_={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]};var __={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]};var T_={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};var F_={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]};var O_={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]};var B_={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]};var I_={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};var P_={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]};var k_={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]};var R_={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]};var L_={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};var q_={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var U_={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var z_={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]};var W_={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]};var V_={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var Y_={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var H_={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]};var G_={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]};var $_={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};var Z_={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]};var Q_={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]};var X_={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]};var J_={bignumber:zA,boolean:WA,complex:VA,createUnit:YA,fraction:HA,index:GA,matrix:$A,number:ZA,sparse:QA,splitUnit:XA,string:JA,unit:KA,e:gg,E:gg,false:EA,i:CA,Infinity:MA,LN2:TA,LN10:_A,LOG2E:OA,LOG10E:FA,NaN:BA,null:IA,pi:xg,PI:xg,phi:PA,SQRT1_2:kA,SQRT2:RA,tau:LA,true:qA,version:UA,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:tE,lsolve:iE,lsolveAll:aE,lup:oE,lusolve:sE,leafCount:nE,polynomialRoot:uE,resolve:cE,simplify:pE,simplifyConstant:mE,simplifyCore:hE,symbolicEqual:vE,rationalize:lE,slu:dE,usolve:gE,usolveAll:xE,qr:fE,abs:yE,add:bE,cbrt:wE,ceil:DE,cube:SE,divide:NE,dotDivide:AE,dotMultiply:EE,dotPow:CE,exp:ME,expm:_E,expm1:TE,fix:FE,floor:OE,gcd:BE,hypot:IE,lcm:kE,log:RE,log2:UE,log1p:qE,log10:LE,mod:zE,multiply:WE,norm:VE,nthRoot:YE,nthRoots:HE,pow:GE,round:$E,sign:ZE,sqrt:QE,sqrtm:XE,square:eC,subtract:rC,unaryMinus:tC,unaryPlus:nC,xgcd:iC,invmod:PE,bitAnd:aC,bitNot:oC,bitOr:sC,bitXor:uC,leftShift:fC,rightArithShift:lC,rightLogShift:cC,bellNumbers:pC,catalan:mC,composition:hC,stirlingS2:dC,config:jA,import:eE,typed:rE,arg:vC,conj:gC,re:yC,im:xC,evaluate:bC,help:wC,distance:DC,intersect:SC,and:NC,not:AC,or:EC,xor:CC,concat:_C,count:TC,cross:FC,column:MC,ctranspose:OC,det:BC,diag:IC,diff:PC,dot:kC,getMatrixDataType:zC,identity:WC,filter:LC,flatten:qC,forEach:UC,inv:VC,pinv:YC,eigs:RC,kron:HC,matrixFromFunction:ZC,matrixFromRows:QC,matrixFromColumns:$C,map:GC,ones:XC,partitionSelect:JC,range:KC,resize:eM,reshape:jC,rotate:rM,rotationMatrix:tM,row:nM,size:iM,sort:aM,squeeze:oM,subset:sM,trace:uM,transpose:fM,zeros:lM,fft:cM,ifft:pM,sylvester:JE,schur:KE,lyap:jE,solveODE:X_,combinations:mM,combinationsWithRep:hM,factorial:dM,gamma:vM,kldivergence:xM,lgamma:gM,multinomial:yM,permutations:bM,pickRandom:wM,random:DM,randomInt:SM,compare:NM,compareNatural:AM,compareText:EM,deepEqual:CM,equal:MM,equalText:_M,larger:TM,largerEq:FM,smaller:OM,smallerEq:BM,unequal:IM,setCartesian:PM,setDifference:kM,setDistinct:RM,setIntersect:LM,setIsSubset:qM,setMultiplicity:UM,setPowerset:zM,setSize:WM,setSymDifference:VM,setUnion:YM,zpk2tf:HM,freqz:GM,erf:$M,zeta:ZM,cumsum:i_,mad:QM,max:XM,mean:JM,median:KM,min:jM,mode:e_,prod:r_,quantileSeq:t_,std:n_,sum:a_,variance:o_,corr:s_,acos:u_,acosh:f_,acot:l_,acoth:c_,acsc:p_,acsch:m_,asec:h_,asech:d_,asin:v_,asinh:g_,atan:x_,atanh:b_,atan2:y_,cos:w_,cosh:D_,cot:S_,coth:N_,csc:A_,csch:E_,sec:C_,sech:M_,sin:__,sinh:T_,tan:F_,tanh:O_,to:B_,clone:P_,format:k_,bin:I_,oct:$_,hex:L_,isNaN:U_,isInteger:q_,isNegative:z_,isNumeric:W_,hasNumericValue:R_,isPositive:V_,isPrime:Y_,isZero:H_,print:Z_,typeOf:Q_,numeric:G_};var K_="help",Uz=["typed","mathWithTransform","Help"],j_=T(K_,Uz,e=>{var{typed:r,mathWithTransform:t,Help:n}=e;return r(K_,{any:function(a){var s,l=a;if(typeof a!="string"){for(s in t)if($e(t,s)&&a===t[s]){l=s;break}}var f=gt(J_,l);if(!f){var o=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+o+'"')}return new n(f)}})});var eT="chain",zz=["typed","Chain"],rT=T(eT,zz,e=>{var{typed:r,Chain:t}=e;return r(eT,{"":function(){return new t},any:function(i){return new t(i)}})});var tT="det",Wz=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],nT=T(tT,Wz,e=>{var{typed:r,matrix:t,subtractScalar:n,multiply:i,divideScalar:a,isZero:s,unaryMinus:l}=e;return r(tT,{any:function(u){return tr(u)},"Array | Matrix":function(u){var p;switch(Ge(u)?p=u.size():Array.isArray(u)?(u=t(u),p=u.size()):p=[],p.length){case 0:return tr(u);case 1:if(p[0]===1)return tr(u.valueOf()[0]);if(p[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(p)+")");case 2:{var h=p[0],d=p[1];if(h===d)return f(u.clone().valueOf(),h,d);if(d===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(p)+")")}}});function f(o,u,p){if(u===1)return tr(o[0][0]);if(u===2)return n(i(o[0][0],o[1][1]),i(o[1][0],o[0][1]));for(var h=!1,d=new Array(u).fill(0).map((O,F)=>F),x=0;x{var{typed:r,matrix:t,divideScalar:n,addScalar:i,multiply:a,unaryMinus:s,det:l,identity:f,abs:o}=e;return r(iT,{"Array | Matrix":function(h){var d=Ge(h)?h.size():or(h);switch(d.length){case 1:if(d[0]===1)return Ge(h)?t([n(1,h.valueOf()[0])]):[n(1,h[0])];throw new RangeError("Matrix must be square (size: "+lr(d)+")");case 2:{var x=d[0],v=d[1];if(x===v)return Ge(h)?t(u(h.valueOf(),x,v),h.storage()):u(h,x,v);throw new RangeError("Matrix must be square (size: "+lr(d)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(d)+")")}},any:function(h){return n(1,h)}});function u(p,h,d){var x,v,y,w,C;if(h===1){if(w=p[0][0],w===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,w)]]}else if(h===2){var b=l(p);if(b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(p[1][1],b),n(s(p[0][1]),b)],[n(s(p[1][0]),b),n(p[0][0],b)]]}else{var A=p.concat();for(x=0;xO&&(O=o(A[x][S]),F=x),x++;if(O===0)throw Error("Cannot calculate inverse, determinant is zero");x=F,x!==S&&(C=A[S],A[S]=A[x],A[x]=C,C=E[S],E[S]=E[x],E[x]=C);var M=A[S],_=E[S];for(x=0;x{var{typed:r,matrix:t,inv:n,deepEqual:i,equal:a,dotDivide:s,dot:l,ctranspose:f,divideScalar:o,multiply:u,add:p,Complex:h}=e;return r(oT,{"Array | Matrix":function(b){var A=Ge(b)?b.size():or(b);switch(A.length){case 1:return w(b)?f(b):A[0]===1?n(b):s(f(b),l(b,b));case 2:{if(w(b))return f(b);var E=A[0],S=A[1];if(E===S)try{return n(b)}catch(O){if(!(O instanceof Error&&O.message.match(/Cannot calculate inverse, determinant is zero/)))throw O}return Ge(b)?t(d(b.valueOf(),E,S),b.storage()):d(b,E,S)}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(A)+")")}},any:function(b){return a(b,0)?tr(b):o(1,b)}});function d(C,b,A){var{C:E,F:S}=v(C,b,A),O=u(n(u(f(E),E)),f(E)),F=u(f(S),n(u(S,f(S))));return u(F,O)}function x(C,b,A){for(var E=tr(C),S=0,O=0;OF.filter((_,k)=>k!y(l(E[M],E[M])));return{C:S,F:O}}function y(C){return a(p(C,h(1,1)),p(0,h(1,1)))}function w(C){return i(p(C,h(1,1)),p(u(C,0),h(1,1)))}});function uT(e){var{addScalar:r,subtract:t,flatten:n,multiply:i,multiplyScalar:a,divideScalar:s,sqrt:l,abs:f,bignumber:o,diag:u,size:p,reshape:h,inv:d,qr:x,usolve:v,usolveAll:y,equal:w,complex:C,larger:b,smaller:A,matrixFromColumns:E,dot:S}=e;function O(ie,H,ce,Me){var pe=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ge=F(ie,H,ce,Me,pe);M(ie,H,ce,Me,pe,ge);var{values:Se,C:xe}=_(ie,H,ce,Me,pe);if(pe){var be=k(ie,H,xe,ge,Se,ce,Me);return{values:Se,eigenvectors:be}}return{values:Se}}function F(ie,H,ce,Me,pe){var ge=Me==="BigNumber",Se=Me==="Complex",xe=ge?o(0):0,be=ge?o(1):Se?C(1):1,De=ge?o(1):1,Ae=ge?o(10):2,ze=a(Ae,Ae),Ze;pe&&(Ze=Array(H).fill(be));for(var K=!1;!K;){K=!0;for(var te=0;te1&&(K=u(Array(Ae-1).fill(xe)))),Ae-=1,be.pop();for(var Ce=0;Ce2&&(K=u(Array(Ae-2).fill(xe)))),Ae-=2,be.pop(),be.pop();for(var Ie=0;Ie+t(f(Xe),f(Or))),te>100){var sr=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+De.join(", "));throw sr.values=De,sr.vectors=[],sr}var ir=pe?i(Ze,V(ze,H)):void 0;return{values:De,C:ir}}function k(ie,H,ce,Me,pe,ge,Se){var xe=d(ce),be=i(xe,ie,ce),De=Se==="BigNumber",Ae=Se==="Complex",ze=De?o(0):Ae?C(0):0,Ze=De?o(1):Ae?C(1):1,K=[],te=[];for(var ye of pe){var ee=q(K,ye,w);ee===-1?(K.push(ye),te.push(1)):te[ee]+=1}for(var ne=[],ue=K.length,Ee=Array(H).fill(ze),Ce=u(Array(H).fill(Ze)),Le=function(){var ir=K[Ie],Xe=t(be,i(ir,Ce)),Or=y(Xe,Ee);for(Or.shift();Or.lengthi(le,we)),ne.push(...Or.map(we=>({value:ir,vector:n(we)})))},Ie=0;Ie=5)return null;for(xe=0;;){var be=v(ie,Se);if(A(oe(U(Se,[be])),Me))break;if(++xe>=10)return null;Se=me(be)}return Se}function j(ie,H,ce){var Me=ce==="BigNumber",pe=ce==="Complex",ge=Array(ie).fill(0).map(Se=>2*Math.random()-1);return Me&&(ge=ge.map(Se=>o(Se))),pe&&(ge=ge.map(Se=>C(Se))),ge=U(ge,H),me(ge,ce)}function U(ie,H){var ce=p(ie);for(var Me of H)Me=h(Me,ce),ie=t(ie,i(s(S(Me,ie),S(Me,Me)),Me));return ie}function oe(ie){return f(l(S(ie,ie)))}function me(ie,H){var ce=H==="BigNumber",Me=H==="Complex",pe=ce?o(1):Me?C(1):1;return i(s(pe,oe(ie)),ie)}return O}function fT(e){var{config:r,addScalar:t,subtract:n,abs:i,atan:a,cos:s,sin:l,multiplyScalar:f,inv:o,bignumber:u,multiply:p,add:h}=e;function d(M,_){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.epsilon,L=arguments.length>3?arguments[3]:void 0,Y=arguments.length>4?arguments[4]:void 0;if(L==="number")return x(M,k,Y);if(L==="BigNumber")return v(M,k,Y);throw TypeError("Unsupported data type: "+L)}function x(M,_,k){var L=M.length,Y=Math.abs(_/L),$,V;if(k){V=new Array(L);for(var q=0;q=Math.abs(Y);){var j=R[0][0],U=R[0][1];$=y(M[j][j],M[U][U],M[j][U]),M=E(M,$,j,U),k&&(V=C(V,$,j,U)),R=S(M)}for(var oe=Array(L).fill(0),me=0;me=i(Y);){var j=R[0][0],U=R[0][1];$=w(M[j][j],M[U][U],M[j][U]),M=A(M,$,j,U),k&&(V=b(V,$,j,U)),R=O(M)}for(var oe=Array(L).fill(0),me=0;me({value:Y[H],vector:ie}));return{values:Y,eigenvectors:me}}return d}var Hz="eigs",Gz=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],lT=T(Hz,Gz,e=>{var{config:r,typed:t,matrix:n,addScalar:i,subtract:a,equal:s,abs:l,atan:f,cos:o,sin:u,multiplyScalar:p,divideScalar:h,inv:d,bignumber:x,multiply:v,add:y,larger:w,column:C,flatten:b,number:A,complex:E,sqrt:S,diag:O,size:F,reshape:M,qr:_,usolve:k,usolveAll:L,im:Y,re:$,smaller:V,matrixFromColumns:q,dot:R}=e,j=fT({config:r,addScalar:i,subtract:a,column:C,flatten:b,equal:s,abs:l,atan:f,cos:o,sin:u,multiplyScalar:p,inv:d,bignumber:x,complex:E,multiply:v,add:y}),U=uT({config:r,addScalar:i,subtract:a,multiply:v,multiplyScalar:p,flatten:b,divideScalar:h,sqrt:S,abs:l,bignumber:x,diag:O,size:F,reshape:M,qr:_,inv:d,usolve:k,usolveAll:L,equal:s,complex:E,larger:w,smaller:V,matrixFromColumns:q,dot:R});return t("eigs",{Array:function(ge){return oe(n(ge))},"Array, number|BigNumber":function(ge,Se){return oe(n(ge),{precision:Se})},"Array, Object"(pe,ge){return oe(n(pe),ge)},Matrix:function(ge){return oe(ge,{matricize:!0})},"Matrix, number|BigNumber":function(ge,Se){return oe(ge,{precision:Se,matricize:!0})},"Matrix, Object":function(ge,Se){var xe={matricize:!0};return Mt(xe,Se),oe(ge,xe)}});function oe(pe){var ge,Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},xe="eigenvectors"in Se?Se.eigenvectors:!0,be=(ge=Se.precision)!==null&&ge!==void 0?ge:r.epsilon,De=me(pe,be,xe);return Se.matricize&&(De.values=n(De.values),xe&&(De.eigenvectors=De.eigenvectors.map(Ae=>{var{value:ze,vector:Ze}=Ae;return{value:ze,vector:n(Ze)}}))),xe&&Object.defineProperty(De,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),De}function me(pe,ge,Se){var xe=pe.toArray(),be=pe.size();if(be.length!==2||be[0]!==be[1])throw new RangeError("Matrix must be square (size: ".concat(lr(be),")"));var De=be[0];if(H(xe,De,ge)&&(ce(xe,De),ie(xe,De,ge))){var Ae=Me(pe,xe,De);return j(xe,De,ge,Ae,Se)}var ze=Me(pe,xe,De);return U(xe,De,ge,ze,Se)}function ie(pe,ge,Se){for(var xe=0;xe{var{typed:r,abs:t,add:n,identity:i,inv:a,multiply:s}=e;return r(cT,{Matrix:function(p){var h=p.size();if(h.length!==2||h[0]!==h[1])throw new RangeError("Matrix must be square (size: "+lr(h)+")");for(var d=h[0],x=1e-15,v=l(p),y=f(v,x),w=y.q,C=y.j,b=s(p,Math.pow(2,-C)),A=i(d),E=i(d),S=1,O=b,F=-1,M=1;M<=w;M++)M>1&&(O=s(O,b),F=-F),S=S*(w-M+1)/((2*w-M+1)*M),A=n(A,s(S,O)),E=n(E,s(S*F,O));for(var _=s(a(E),A),k=0;k{var{typed:r,abs:t,add:n,multiply:i,map:a,sqrt:s,subtract:l,inv:f,size:o,max:u,identity:p}=e,h=1e3,d=1e-6;function x(v){var y,w=0,C=v,b=p(o(v));do{var A=C;if(C=i(.5,n(A,f(b))),b=i(.5,n(b,f(A))),y=u(t(l(C,A))),y>d&&++w>h)throw new Error("computing square root of matrix: iterative method could not converge")}while(y>d);return C}return r(mT,{"Array | Matrix":function(y){var w=Ge(y)?y.size():or(y);switch(w.length){case 1:if(w[0]===1)return a(y,s);throw new RangeError("Matrix must be square (size: "+lr(w)+")");case 2:{var C=w[0],b=w[1];if(C===b)return x(y);throw new RangeError("Matrix must be square (size: "+lr(w)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+lr(w)+")")}}})});var dT="sylvester",Qz=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],vT=T(dT,Qz,e=>{var{typed:r,schur:t,matrixFromColumns:n,matrix:i,multiply:a,range:s,concat:l,transpose:f,index:o,subset:u,add:p,subtract:h,identity:d,lusolve:x,abs:v}=e;return r(dT,{"Matrix, Matrix, Matrix":y,"Array, Matrix, Matrix":function(C,b,A){return y(i(C),b,A)},"Array, Array, Matrix":function(C,b,A){return y(i(C),i(b),A)},"Array, Matrix, Array":function(C,b,A){return y(i(C),b,i(A))},"Matrix, Array, Matrix":function(C,b,A){return y(C,i(b),A)},"Matrix, Array, Array":function(C,b,A){return y(C,i(b),i(A))},"Matrix, Matrix, Array":function(C,b,A){return y(C,b,i(A))},"Array, Array, Array":function(C,b,A){return y(i(C),i(b),i(A)).toArray()}});function y(w,C,b){for(var A=C.size()[0],E=w.size()[0],S=t(w),O=S.T,F=S.U,M=t(a(-1,C)),_=M.T,k=M.U,L=a(a(f(F),b),k),Y=s(0,E),$=[],V=(Ae,ze)=>l(Ae,ze,1),q=(Ae,ze)=>l(Ae,ze,0),R=0;R1e-5){for(var j=q(u(L,o(Y,R)),u(L,o(Y,R+1))),U=0;U{var{typed:r,matrix:t,identity:n,multiply:i,qr:a,norm:s,subtract:l}=e;return r(gT,{Array:function(u){var p=f(t(u));return{U:p.U.valueOf(),T:p.T.valueOf()}},Matrix:function(u){return f(u)}});function f(o){var u=o.size()[0],p=o,h=n(u),d=0,x;do{x=p;var v=a(p),y=v.Q,w=v.R;if(p=i(w,y),h=i(h,y),d++>100)break}while(s(l(p,x))>1e-4);return{U:h,T:p}}});var yT="lyap",Jz=["typed","matrix","sylvester","multiply","transpose"],bT=T(yT,Jz,e=>{var{typed:r,matrix:t,sylvester:n,multiply:i,transpose:a}=e;return r(yT,{"Matrix, Matrix":function(l,f){return n(l,a(l),i(-1,f))},"Array, Matrix":function(l,f){return n(t(l),a(t(l)),i(-1,f))},"Matrix, Array":function(l,f){return n(l,a(t(l)),t(i(-1,f)))},"Array, Array":function(l,f){return n(t(l),a(t(l)),t(i(-1,f))).toArray()}})});var Kz="divide",jz=["typed","matrix","multiply","equalScalar","divideScalar","inv"],wT=T(Kz,jz,e=>{var{typed:r,matrix:t,multiply:n,equalScalar:i,divideScalar:a,inv:s}=e,l=Jr({typed:r,equalScalar:i}),f=Bt({typed:r});return r("divide",vc({"Array | Matrix, Array | Matrix":function(u,p){return n(u,s(p))},"DenseMatrix, any":function(u,p){return f(u,p,a,!1)},"SparseMatrix, any":function(u,p){return l(u,p,a,!1)},"Array, any":function(u,p){return f(t(u),p,a,!1).valueOf()},"any, Array | Matrix":function(u,p){return n(u,s(p))}},a.signatures))});var DT="distance",eW=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],ST=T(DT,eW,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:i,divideScalar:a,deepEqual:s,sqrt:l,abs:f}=e;return r(DT,{"Array, Array, Array":function(E,S,O){if(E.length===2&&S.length===2&&O.length===2){if(!u(E))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!u(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!u(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(s(S,O))throw new TypeError("LinePoint1 should not be same with LinePoint2");var F=n(O[1],S[1]),M=n(S[0],O[0]),_=n(i(O[0],S[1]),i(S[0],O[1]));return y(E[0],E[1],F,M,_)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(E,S,O){if(Object.keys(E).length===2&&Object.keys(S).length===2&&Object.keys(O).length===2){if(!u(E))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!u(S))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!u(O))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(s(x(S),x(O)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in E&&"pointY"in E&&"lineOnePtX"in S&&"lineOnePtY"in S&&"lineTwoPtX"in O&&"lineTwoPtY"in O){var F=n(O.lineTwoPtY,S.lineOnePtY),M=n(S.lineOnePtX,O.lineTwoPtX),_=n(i(O.lineTwoPtX,S.lineOnePtY),i(S.lineOnePtX,O.lineTwoPtY));return y(E.pointX,E.pointY,F,M,_)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(E,S){if(E.length===2&&S.length===3){if(!u(E))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return y(E[0],E[1],S[0],S[1],S[2])}else if(E.length===3&&S.length===6){if(!p(E))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!d(S))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return w(E[0],E[1],E[2],S[0],S[1],S[2],S[3],S[4],S[5])}else if(E.length===S.length&&E.length>0){if(!h(E))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!h(S))throw new TypeError("All values of an array should be numbers or BigNumbers");return C(E,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(E,S){if(Object.keys(E).length===2&&Object.keys(S).length===3){if(!u(E))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(S))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in E&&"pointY"in E&&"xCoeffLine"in S&&"yCoeffLine"in S&&"constant"in S)return y(E.pointX,E.pointY,S.xCoeffLine,S.yCoeffLine,S.constant);throw new TypeError("Key names do not match")}else if(Object.keys(E).length===3&&Object.keys(S).length===6){if(!p(E))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!d(S))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in E&&"pointY"in E&&"x0"in S&&"y0"in S&&"z0"in S&&"a"in S&&"b"in S&&"c"in S)return w(E.pointX,E.pointY,E.pointZ,S.x0,S.y0,S.z0,S.a,S.b,S.c);throw new TypeError("Key names do not match")}else if(Object.keys(E).length===2&&Object.keys(S).length===2){if(!u(E))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!u(S))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in E&&"pointOneY"in E&&"pointTwoX"in S&&"pointTwoY"in S)return C([E.pointOneX,E.pointOneY],[S.pointTwoX,S.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(E).length===3&&Object.keys(S).length===3){if(!p(E))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!p(S))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in E&&"pointOneY"in E&&"pointOneZ"in E&&"pointTwoX"in S&&"pointTwoY"in S&&"pointTwoZ"in S)return C([E.pointOneX,E.pointOneY,E.pointOneZ],[S.pointTwoX,S.pointTwoY,S.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(E){if(!v(E))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return b(E)}});function o(A){return typeof A=="number"||je(A)}function u(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])}function p(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])&&o(A[2])}function h(A){return Array.isArray(A)||(A=x(A)),A.every(o)}function d(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])&&o(A[2])&&o(A[3])&&o(A[4])&&o(A[5])}function x(A){for(var E=Object.keys(A),S=[],O=0;OE.length!==2||!o(E[0])||!o(E[1])))return!1}else if(A[0].length===3&&o(A[0][0])&&o(A[0][1])&&o(A[0][2])){if(A.some(E=>E.length!==3||!o(E[0])||!o(E[1])||!o(E[2])))return!1}else return!1;return!0}function y(A,E,S,O,F){var M=f(t(t(i(S,A),i(O,E)),F)),_=l(t(i(S,S),i(O,O)));return a(M,_)}function w(A,E,S,O,F,M,_,k,L){var Y=[n(i(n(F,E),L),i(n(M,S),k)),n(i(n(M,S),_),i(n(O,A),L)),n(i(n(O,A),k),i(n(F,E),_))];Y=l(t(t(i(Y[0],Y[0]),i(Y[1],Y[1])),i(Y[2],Y[2])));var $=l(t(t(i(_,_),i(k,k)),i(L,L)));return a(Y,$)}function C(A,E){for(var S=A.length,O=0,F=0,M=0;M{var{typed:r,config:t,abs:n,add:i,addScalar:a,matrix:s,multiply:l,multiplyScalar:f,divideScalar:o,subtract:u,smaller:p,equalScalar:h,flatten:d,isZero:x,isNumeric:v}=e;return r("intersect",{"Array, Array, Array":y,"Array, Array, Array, Array":w,"Matrix, Matrix, Matrix":function(k,L,Y){var $=y(k.valueOf(),L.valueOf(),Y.valueOf());return $===null?null:s($)},"Matrix, Matrix, Matrix, Matrix":function(k,L,Y,$){var V=w(k.valueOf(),L.valueOf(),Y.valueOf(),$.valueOf());return V===null?null:s(V)}});function y(_,k,L){if(_=C(_),k=C(k),L=C(L),!A(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!A(k))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!E(L))throw new TypeError("Array with 4 numbers expected as third argument");return M(_[0],_[1],_[2],k[0],k[1],k[2],L[0],L[1],L[2],L[3])}function w(_,k,L,Y){if(_=C(_),k=C(k),L=C(L),Y=C(Y),_.length===2){if(!b(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(k))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!b(L))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!b(Y))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return S(_,k,L,Y)}else if(_.length===3){if(!A(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!A(k))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!A(L))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!A(Y))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return F(_[0],_[1],_[2],k[0],k[1],k[2],L[0],L[1],L[2],Y[0],Y[1],Y[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function C(_){return _.length===1?_[0]:_.length>1&&Array.isArray(_[0])&&_.every(k=>Array.isArray(k)&&k.length===1)?d(_):_}function b(_){return _.length===2&&v(_[0])&&v(_[1])}function A(_){return _.length===3&&v(_[0])&&v(_[1])&&v(_[2])}function E(_){return _.length===4&&v(_[0])&&v(_[1])&&v(_[2])&&v(_[3])}function S(_,k,L,Y){var $=_,V=L,q=u($,k),R=u(V,Y),j=u(f(q[0],R[1]),f(R[0],q[1]));if(x(j)||p(n(j),t.epsilon))return null;var U=f(R[0],$[1]),oe=f(R[1],$[0]),me=f(R[0],V[1]),ie=f(R[1],V[0]),H=o(a(u(u(U,oe),me),ie),j);return i(l(q,H),$)}function O(_,k,L,Y,$,V,q,R,j,U,oe,me){var ie=f(u(_,k),u(L,Y)),H=f(u($,V),u(q,R)),ce=f(u(j,U),u(oe,me));return a(a(ie,H),ce)}function F(_,k,L,Y,$,V,q,R,j,U,oe,me){var ie=O(_,q,U,q,k,R,oe,R,L,j,me,j),H=O(U,q,Y,_,oe,R,$,k,me,j,V,L),ce=O(_,q,Y,_,k,R,$,k,L,j,V,L),Me=O(U,q,U,q,oe,R,oe,R,me,j,me,j),pe=O(Y,_,Y,_,$,k,$,k,V,L,V,L),ge=u(f(ie,H),f(ce,Me)),Se=u(f(pe,Me),f(H,H));if(x(Se))return null;var xe=o(ge,Se),be=o(a(ie,f(xe,H)),Me),De=a(_,f(xe,u(Y,_))),Ae=a(k,f(xe,u($,k))),ze=a(L,f(xe,u(V,L))),Ze=a(q,f(be,u(U,q))),K=a(R,f(be,u(oe,R))),te=a(j,f(be,u(me,j)));return h(De,Ze)&&h(Ae,K)&&h(ze,te)?[De,Ae,ze]:null}function M(_,k,L,Y,$,V,q,R,j,U){var oe=f(_,q),me=f(Y,q),ie=f(k,R),H=f($,R),ce=f(L,j),Me=f(V,j),pe=u(u(u(U,oe),ie),ce),ge=u(u(u(a(a(me,H),Me),oe),ie),ce),Se=o(pe,ge),xe=a(_,f(Se,u(Y,_))),be=a(k,f(Se,u($,k))),De=a(L,f(Se,u(V,L)));return[xe,be,De]}});var AT="sum",nW=["typed","config","add","numeric"],kp=T(AT,nW,e=>{var{typed:r,config:t,add:n,numeric:i}=e;return r(AT,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":s,"...":function(f){if(di(f))throw new TypeError("Scalar values expected in function sum");return a(f)}});function a(l){var f;return hn(l,function(o){try{f=f===void 0?o:n(f,o)}catch(u){throw St(u,"sum",o)}}),f===void 0&&(f=i(0,t.number)),typeof f=="string"&&(f=i(f,t.number)),f}function s(l,f){try{var o=Do(l,f,n);return o}catch(u){throw St(u,"sum")}}});var Rp="cumsum",iW=["typed","add","unaryPlus"],Lp=T(Rp,iW,e=>{var{typed:r,add:t,unaryPlus:n}=e;return r(Rp,{Array:i,Matrix:function(o){return o.create(i(o.valueOf()))},"Array, number | BigNumber":s,"Matrix, number | BigNumber":function(o,u){return o.create(s(o.valueOf(),u))},"...":function(o){if(di(o))throw new TypeError("All values expected to be scalar in function cumsum");return i(o)}});function i(f){try{return a(f)}catch(o){throw St(o,Rp)}}function a(f){if(f.length===0)return[];for(var o=[n(f[0])],u=1;u=u.length)throw new Xt(o,u.length);try{return l(f,o)}catch(p){throw St(p,Rp)}}function l(f,o){var u,p,h;if(o<=0){var d=f[0][0];if(Array.isArray(d)){for(h=Pc(f),p=[],u=0;u{var{typed:r,add:t,divide:n}=e;return r(ET,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(l){if(di(l))throw new TypeError("Scalar values expected in function mean");return a(l)}});function i(s,l){try{var f=Do(s,l,t),o=Array.isArray(s)?or(s):s.size();return n(f,o[l])}catch(u){throw St(u,"mean")}}function a(s){var l,f=0;if(hn(s,function(o){try{l=l===void 0?o:t(l,o),f++}catch(u){throw St(u,"mean",o)}}),f===0)throw new Error("Cannot calculate the mean of an empty array");return n(l,f)}});var CT="median",oW=["typed","add","divide","compare","partitionSelect"],MT=T(CT,oW,e=>{var{typed:r,add:t,divide:n,compare:i,partitionSelect:a}=e;function s(o){try{o=gr(o.valueOf());var u=o.length;if(u===0)throw new Error("Cannot calculate median of an empty array");if(u%2===0){for(var p=u/2-1,h=a(o,p+1),d=o[p],x=0;x0&&(d=o[x]);return f(d,h)}else{var v=a(o,(u-1)/2);return l(v)}}catch(y){throw St(y,"median")}}var l=r({"number | BigNumber | Complex | Unit":function(u){return u}}),f=r({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(u,p){return n(t(u,p),2)}});return r(CT,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,p){throw new Error("median(A, dim) is not yet supported")},"...":function(u){if(di(u))throw new TypeError("Scalar values expected in function median");return s(u)}})});var _T="mad",sW=["typed","abs","map","median","subtract"],TT=T(_T,sW,e=>{var{typed:r,abs:t,map:n,median:i,subtract:a}=e;return r(_T,{"Array | Matrix":s,"...":function(f){return s(f)}});function s(l){if(l=gr(l.valueOf()),l.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var f=i(l);return i(n(l,function(o){return t(a(o,f))}))}catch(o){throw o instanceof TypeError&&o.message.indexOf("median")!==-1?new TypeError(o.message.replace("median","mad")):St(o,"mad")}}});var yg="unbiased",FT="variance",uW=["typed","add","subtract","multiply","divide","apply","isNaN"],Up=T(FT,uW,e=>{var{typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:l}=e;return r(FT,{"Array | Matrix":function(p){return f(p,yg)},"Array | Matrix, string":f,"Array | Matrix, number | BigNumber":function(p,h){return o(p,h,yg)},"Array | Matrix, number | BigNumber, string":o,"...":function(p){return f(p,yg)}});function f(u,p){var h,d=0;if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(hn(u,function(y){try{h=h===void 0?y:t(h,y),d++}catch(w){throw St(w,"variance",y)}}),d===0)throw new Error("Cannot calculate variance of an empty array");var x=a(h,d);if(h=void 0,hn(u,function(y){var w=n(y,x);h=h===void 0?i(w,w):t(h,i(w,w))}),l(h))return h;switch(p){case"uncorrected":return a(h,d);case"biased":return a(h,d+1);case"unbiased":{var v=je(h)?h.mul(0):0;return d===1?v:a(h,d-1)}default:throw new Error('Unknown normalization "'+p+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function o(u,p,h){try{if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return s(u,p,d=>f(d,h))}catch(d){throw St(d,"variance")}}});var OT="quantileSeq",fW=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],zp=T(OT,fW,e=>{var{typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:l,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:h}=e,d=ou({typed:r,isInteger:o});return r(OT,{"Array | Matrix, number | BigNumber":(C,b)=>v(C,b,!1),"Array | Matrix, number | BigNumber, number":(C,b,A)=>x(C,b,!1,A,v),"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":(C,b,A,E)=>x(C,b,A,E,v),"Array | Matrix, Array | Matrix":(C,b)=>y(C,b,!1),"Array | Matrix, Array | Matrix, number":(C,b,A)=>x(C,b,!1,A,y),"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":(C,b,A,E)=>x(C,b,A,E,y)});function x(C,b,A,E,S){return d(C,E,O=>S(O,b,A))}function v(C,b,A){var E,S=C.valueOf();if(u(b,0))throw new Error("N/prob must be non-negative");if(p(b,1))return ar(b)?w(S,b,A):t(w(S,b,A));if(h(b,1)){if(!o(b))throw new Error("N must be a positive integer");if(h(b,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var O=n(b,1);E=[];for(var F=0;u(F,b);F++){var M=a(F+1,O);E.push(w(S,M,A))}return ar(b)?E:t(E)}}function y(C,b,A){for(var E=C.valueOf(),S=b.valueOf(),O=[],F=0;F0&&(_=E[L])}return n(s(_,i(1,M)),s(k,M))}});var BT="std",lW=["typed","map","sqrt","variance"],Wp=T(BT,lW,e=>{var{typed:r,map:t,sqrt:n,variance:i}=e;return r(BT,{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(l){return a(l)}});function a(s,l){if(s.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var f=i.apply(null,arguments);return bt(f)?t(f,n):n(f)}catch(o){throw o instanceof TypeError&&o.message.indexOf(" variance")!==-1?new TypeError(o.message.replace(" variance"," std")):o}}});var IT="corr",cW=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],PT=T(IT,cW,e=>{var{typed:r,matrix:t,sqrt:n,sum:i,add:a,subtract:s,multiply:l,pow:f,divide:o}=e;return r(IT,{"Array, Array":function(d,x){return u(d,x)},"Matrix, Matrix":function(d,x){var v=u(d.toArray(),x.toArray());return Array.isArray(v)?t(v):v}});function u(h,d){var x=[];if(Array.isArray(h[0])&&Array.isArray(d[0])){if(h.length!==d.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var v=0;va(S,l(O,d[F])),0),C=i(h.map(S=>f(S,2))),b=i(d.map(S=>f(S,2))),A=s(l(x,w),l(v,y)),E=n(l(s(l(x,C),f(v,2)),s(l(x,b),f(y,2))));return o(A,E)}});var kT="combinations",pW=["typed"],LT=T(kT,pW,e=>{var{typed:r}=e;return r(kT,{"number, number":Ov,"BigNumber, BigNumber":function(n,i){var a=n.constructor,s,l,f=n.minus(i),o=new a(1);if(!RT(n)||!RT(i))throw new TypeError("Positive integer value expected in function combinations");if(i.gt(n))throw new TypeError("k must be less than n in function combinations");if(s=o,i.lt(f))for(l=o;l.lte(f);l=l.plus(o))s=s.times(i.plus(l)).dividedBy(l);else for(l=o;l.lte(i);l=l.plus(o))s=s.times(f.plus(l)).dividedBy(l);return s}})});function RT(e){return e.isInteger()&&e.gte(0)}var qT="combinationsWithRep",mW=["typed"],zT=T(qT,mW,e=>{var{typed:r}=e;return r(qT,{"number, number":function(n,i){if(!He(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!He(i)||i<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(i{var{typed:r,config:t,multiplyScalar:n,pow:i,BigNumber:a,Complex:s}=e;function l(o){if(o.im===0)return Df(o.re);if(o.re<.5){var u=new s(1-o.re,-o.im),p=new s(Math.PI*o.re,Math.PI*o.im);return new s(Math.PI).div(p.sin()).div(l(u))}o=new s(o.re-1,o.im);for(var h=new s(is[0],0),d=1;d2;)h-=2,x+=h,d=d.times(x);return new a(d.toPrecision(a.precision))}});var YT="lgamma",dW=["Complex","typed"],HT=T(YT,dW,e=>{var{Complex:r,typed:t}=e,n=7,i=7,a=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(YT,{number:Sf,Complex:s,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function s(o){var u=6.283185307179586,p=1.1447298858494002,h=.1;if(o.isNaN())return new r(NaN,NaN);if(o.im===0)return new r(Sf(o.re),0);if(o.re>=n||Math.abs(o.im)>=i)return l(o);if(o.re<=h){var d=dy(u,o.im)*Math.floor(.5*o.re+.25),x=o.mul(Math.PI).sin().log(),v=s(new r(1-o.re,-o.im));return new r(p,d).sub(x).sub(v)}else return o.im>=0?f(o):f(o.conjugate()).conjugate()}function l(o){for(var u=o.sub(.5).mul(o.log()).sub(o).add(qv),p=new r(1,0).div(o),h=p.div(o),d=a[0],x=a[1],v=2*h.re,y=h.re*h.re+h.im*h.im,w=2;w<8;w++){var C=x;x=-y*d+a[w],d=v*d+C}var b=p.mul(h.mul(d).add(x));return u.add(b)}function f(o){var u=0,p=0,h=o;for(o=o.add(1);o.re<=n;){h=h.mul(o);var d=h.im<0?1:0;d!==0&&p===0&&u++,p=d,o=o.add(1)}return l(o).sub(h.log()).sub(new r(0,u*2*Math.PI*1))}});var GT="factorial",vW=["typed","gamma"],$T=T(GT,vW,e=>{var{typed:r,gamma:t}=e;return r(GT,{number:function(i){if(i<0)throw new Error("Value must be non-negative");return t(i+1)},BigNumber:function(i){if(i.isNegative())throw new Error("Value must be non-negative");return t(i.plus(1))},"Array | Matrix":r.referToSelf(n=>i=>Je(i,n))})});var ZT="kldivergence",gW=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],QT=T(ZT,gW,e=>{var{typed:r,matrix:t,divide:n,sum:i,multiply:a,map:s,dotDivide:l,log:f,isNumeric:o}=e;return r(ZT,{"Array, Array":function(h,d){return u(t(h),t(d))},"Matrix, Array":function(h,d){return u(h,t(d))},"Array, Matrix":function(h,d){return u(t(h),d)},"Matrix, Matrix":function(h,d){return u(h,d)}});function u(p,h){var d=h.size().length,x=p.size().length;if(d>1)throw new Error("first object must be one dimensional");if(x>1)throw new Error("second object must be one dimensional");if(d!==x)throw new Error("Length of two vectors must be equal");var v=i(p);if(v===0)throw new Error("Sum of elements in first object must be non zero");var y=i(h);if(y===0)throw new Error("Sum of elements in second object must be non zero");var w=n(p,i(p)),C=n(h,i(h)),b=i(a(w,s(l(w,C),A=>f(A))));return o(b)?b:Number.NaN}});var XT="multinomial",xW=["typed","add","divide","multiply","factorial","isInteger","isPositive"],JT=T(XT,xW,e=>{var{typed:r,add:t,divide:n,multiply:i,factorial:a,isInteger:s,isPositive:l}=e;return r(XT,{"Array | Matrix":function(o){var u=0,p=1;return hn(o,function(h){if(!s(h)||!l(h))throw new TypeError("Positive integer value expected in function multinomial");u=t(u,h),p=i(p,a(h))}),n(a(u),p)}})});var KT="permutations",yW=["typed","factorial"],eF=T(KT,yW,e=>{var{typed:r,factorial:t}=e;return r(KT,{"number | BigNumber":t,"number, number":function(i,a){if(!He(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(!He(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(a>i)throw new TypeError("second argument k must be less than or equal to first argument n");return Kn(i-a+1,i)},"BigNumber, BigNumber":function(i,a){var s,l;if(!jT(i)||!jT(a))throw new TypeError("Positive integer value expected in function permutations");if(a.gt(i))throw new TypeError("second argument k must be less than or equal to first argument n");var f=i.mul(0).add(1);for(s=f,l=i.minus(a).plus(1);l.lte(i);l=l.plus(1))s=s.times(l);return s}})});function jT(e){return e.isInteger()&&e.gte(0)}var Eg=ci(gF(),1),EW=(0,Eg.default)(Date.now());function Ua(e){var r;function t(i){r=i===null?EW:(0,Eg.default)(String(i))}t(e);function n(){return r()}return n}var xF="pickRandom",CW=["typed","config","?on"],yF=T(xF,CW,e=>{var{typed:r,config:t,on:n}=e,i=Ua(t.randomSeed);return n&&n("config",function(s,l){s.randomSeed!==l.randomSeed&&(i=Ua(s.randomSeed))}),r(xF,{"Array | Matrix":function(l){return a(l,{})},"Array | Matrix, Object":function(l,f){return a(l,f)},"Array | Matrix, number":function(l,f){return a(l,{number:f})},"Array | Matrix, Array | Matrix":function(l,f){return a(l,{weights:f})},"Array | Matrix, Array | Matrix, number":function(l,f,o){return a(l,{number:o,weights:f})},"Array | Matrix, number, Array | Matrix":function(l,f,o){return a(l,{number:f,weights:o})}});function a(s,l){var{number:f,weights:o,elementWise:u=!0}=l,p=typeof f>"u";p&&(f=1);var h=Ge(s)?s.create:Ge(o)?o.create:null;s=s.valueOf(),o&&(o=o.valueOf()),u===!0&&(s=gr(s),o=gr(o));var d=0;if(typeof o<"u"){if(o.length!==s.length)throw new Error("Weights must have the same length as possibles");for(var x=0,v=o.length;x"u")C=s[Math.floor(i()*y)];else for(var b=i()*d,A=0,E=s.length;A1)for(var n=0,i=e.shift();n{var{typed:r,config:t,on:n}=e,i=Ua(t.randomSeed);return n&&n("config",function(l,f){l.randomSeed!==f.randomSeed&&(i=Ua(l.randomSeed))}),r(bF,{"":()=>s(0,1),number:l=>s(0,l),"number, number":(l,f)=>s(l,f),"Array | Matrix":l=>a(l,0,1),"Array | Matrix, number":(l,f)=>a(l,0,f),"Array | Matrix, number, number":(l,f,o)=>a(l,f,o)});function a(l,f,o){var u=Mf(l.valueOf(),()=>s(f,o));return Ge(l)?l.create(u):u}function s(l,f){return l+i()*(f-l)}});var DF="randomInt",_W=["typed","config","?on"],SF=T(DF,_W,e=>{var{typed:r,config:t,on:n}=e,i=Ua(t.randomSeed);return n&&n("config",function(l,f){l.randomSeed!==f.randomSeed&&(i=Ua(l.randomSeed))}),r(DF,{"":()=>s(0,1),number:l=>s(0,l),"number, number":(l,f)=>s(l,f),"Array | Matrix":l=>a(l,0,1),"Array | Matrix, number":(l,f)=>a(l,0,f),"Array | Matrix, number, number":(l,f,o)=>a(l,f,o)});function a(l,f,o){var u=Mf(l.valueOf(),()=>s(f,o));return Ge(l)?l.create(u):u}function s(l,f){return Math.floor(l+i()*(f-l))}});var NF="stirlingS2",TW=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],AF=T(NF,TW,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:i,divideScalar:a,pow:s,factorial:l,combinations:f,isNegative:o,isInteger:u,number:p,bignumber:h,larger:d}=e,x=[],v=[];return r(NF,{"number | BigNumber, number | BigNumber":function(w,C){if(!u(w)||o(w)||!u(C)||o(C))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(d(C,w))throw new TypeError("k must be less than or equal to n in function stirlingS2");var b=!(ar(w)&&ar(C)),A=b?v:x,E=b?h:p,S=p(w),O=p(C);if(A[S]&&A[S].length>O)return A[S][O];for(var F=0;F<=S;++F)if(A[F]||(A[F]=[E(F===0?1:0)]),F!==0)for(var M=A[F],_=A[F-1],k=M.length;k<=F&&k<=O;++k)k===F?M[k]=1:M[k]=t(i(E(k),_[k]),_[k-1]);return A[S][O]}})});var EF="bellNumbers",FW=["typed","addScalar","isNegative","isInteger","stirlingS2"],CF=T(EF,FW,e=>{var{typed:r,addScalar:t,isNegative:n,isInteger:i,stirlingS2:a}=e;return r(EF,{"number | BigNumber":function(l){if(!i(l)||n(l))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var f=0,o=0;o<=l;o++)f=t(f,a(l,o));return f}})});var MF="catalan",OW=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],_F=T(MF,OW,e=>{var{typed:r,addScalar:t,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:s,isInteger:l}=e;return r(MF,{"number | BigNumber":function(o){if(!l(o)||s(o))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(o,2),o),t(o,1))}})});var TF="composition",BW=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],FF=T(TF,BW,e=>{var{typed:r,addScalar:t,combinations:n,isPositive:i,isNegative:a,isInteger:s,larger:l}=e;return r(TF,{"number | BigNumber, number | BigNumber":function(o,u){if(!s(o)||!i(o)||!s(u)||!i(u))throw new TypeError("Positive integer value expected in function composition");if(l(u,o))throw new TypeError("k must be less than or equal to n in function composition");return n(t(o,-1),t(u,-1))}})});var OF="leafCount",IW=["parse","typed"],BF=T(OF,IW,e=>{var{parse:r,typed:t}=e;function n(i){var a=0;return i.forEach(s=>{a+=n(s)}),a||1}return t(OF,{Node:function(a){return n(a)}})});function Cg(e){return yr(e)||ut(e)&&e.isUnary()&&yr(e.args[0])}function _f(e){return!!(yr(e)||(fn(e)||ut(e))&&e.args.every(_f)||Zt(e)&&_f(e.content))}function IF(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Mg(e){for(var r=1;r{var{FunctionNode:r,OperatorNode:t,SymbolNode:n}=e,i=!0,a=!1,s="defaultF",l={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:a,total:i,commutative:a,associative:a},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:a,total:i,commutative:a,associative:a},paren:{trivial:i,total:i,commutative:i,associative:a},defaultF:{trivial:a,total:i,commutative:a,associative:a}},f={divide:{total:a},log:{total:a}},o={subtract:{total:a},abs:{trivial:i},log:{total:i}};function u(b,A){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l,S=s;if(typeof b=="string"?S=b:ut(b)?S=b.fn.toString():fn(b)?S=b.name:Zt(b)&&(S="paren"),$e(E,S)){var O=E[S];if($e(O,A))return O[A];if($e(l,S))return l[S][A]}if($e(E,s)){var F=E[s];return $e(F,A)?F[A]:l[s][A]}if($e(l,S)){var M=l[S];if($e(M,A))return M[A]}return l[s][A]}function p(b){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u(b,"commutative",A)}function h(b){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u(b,"associative",A)}function d(b,A){var E=Mg({},b);for(var S in A)$e(b,S)?E[S]=Mg(Mg({},A[S]),b[S]):E[S]=A[S];return E}function x(b,A){if(!b.args||b.args.length===0)return b;b.args=v(b,A);for(var E=0;E2&&h(b,A)){for(var F=b.args.pop();b.args.length>0;)F=E([b.args.pop(),F]);b.args=F.args}}}function w(b,A){if(!(!b.args||b.args.length===0)){for(var E=C(b),S=b.args.length,O=0;O2&&h(b,A)){for(var F=b.args.shift();b.args.length>0;)F=E([F,b.args.shift()]);b.args=F.args}}}function C(b){return ut(b)?function(A){try{return new t(b.op,b.fn,A,b.implicit)}catch(E){return console.error(E),[]}}:function(A){return new r(new n(b.name),A)}}return{createMakeNodeFunction:C,hasProperty:u,isCommutative:p,isAssociative:h,mergeContext:d,flatten:x,allChildren:v,unflattenr:y,unflattenl:w,defaultContext:l,realContext:f,positiveContext:o}});var RW="simplify",LW=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],PF=T(RW,LW,e=>{var{config:r,typed:t,parse:n,add:i,subtract:a,multiply:s,divide:l,pow:f,isZero:o,equal:u,resolve:p,simplifyConstant:h,simplifyCore:d,fraction:x,bignumber:v,mathWithTransform:y,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:A,FunctionNode:E,IndexNode:S,ObjectNode:O,OperatorNode:F,ParenthesisNode:M,SymbolNode:_}=e,{hasProperty:k,isCommutative:L,isAssociative:Y,mergeContext:$,flatten:V,unflattenr:q,unflattenl:R,createMakeNodeFunction:j,defaultContext:U,realContext:oe,positiveContext:me}=du({FunctionNode:E,OperatorNode:F,SymbolNode:_});t.addConversion({from:"Object",to:"Map",convert:ka});var ie=t("simplify",{Node:xe,"Node, Map":(ee,ne)=>xe(ee,!1,ne),"Node, Map, Object":(ee,ne,ue)=>xe(ee,!1,ne,ue),"Node, Array":xe,"Node, Array, Map":xe,"Node, Array, Map, Object":xe});t.removeConversion({from:"Object",to:"Map",convert:ka}),ie.defaultContext=U,ie.realContext=oe,ie.positiveContext=me;function H(ee){return ee.transform(function(ne,ue,Ee){return Zt(ne)?H(ne.content):ne})}var ce={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};ie.rules=[d,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},h,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},h,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function Me(ee,ne){var ue={};if(ee.s){var Ee=ee.s.split("->");if(Ee.length===2)ue.l=Ee[0],ue.r=Ee[1];else throw SyntaxError("Could not parse rule: "+ee.s)}else ue.l=ee.l,ue.r=ee.r;ue.l=H(n(ue.l)),ue.r=H(n(ue.r));for(var Ce of["imposeContext","repeat","assuming"])Ce in ee&&(ue[Ce]=ee[Ce]);if(ee.evaluate&&(ue.evaluate=n(ee.evaluate)),Y(ue.l,ne)){var Le=!L(ue.l,ne),Ie;Le&&(Ie=Se());var sr=j(ue.l),ir=Se();ue.expanded={},ue.expanded.l=sr([ue.l,ir]),V(ue.expanded.l,ne),q(ue.expanded.l,ne),ue.expanded.r=sr([ue.r,ir]),Le&&(ue.expandedNC1={},ue.expandedNC1.l=sr([Ie,ue.l]),ue.expandedNC1.r=sr([Ie,ue.r]),ue.expandedNC2={},ue.expandedNC2.l=sr([Ie,ue.expanded.l]),ue.expandedNC2.r=sr([Ie,ue.expanded.r]))}return ue}function pe(ee,ne){for(var ue=[],Ee=0;Ee2&&arguments[2]!==void 0?arguments[2]:go(),Ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ce=Ee.consoleDebug;ne=pe(ne||ie.rules,Ee.context);var Le=p(ee,ue);Le=H(Le);for(var Ie={},sr=Le.toString({parenthesis:"all"});!Ie[sr];){Ie[sr]=!0,ge=0;var ir=sr;Ce&&console.log("Working on: ",sr);for(var Xe=0;Xe ").concat(ne[Xe].r.toString()))),Ce){var re=Le.toString({parenthesis:"all"});re!==ir&&(console.log("Applying",Or,"produced",re),ir=re)}R(Le,Ee.context)}sr=Le.toString({parenthesis:"all"})}return Le}function be(ee,ne,ue){var Ee=ee;if(ee)for(var Ce=0;Ce1&&(ir=Le(ee.args.slice(0,sr))),Ce=ee.args.slice(sr),Ee=Ce.length===1?Ce[0]:Le(Ce),ue.push(Le([ir,Ee]))}return ue}function ze(ee,ne){var ue={placeholders:{}};if(!ee.placeholders&&!ne.placeholders)return ue;if(ee.placeholders){if(!ne.placeholders)return ee}else return ne;for(var Ee in ee.placeholders)if($e(ee.placeholders,Ee)&&(ue.placeholders[Ee]=ee.placeholders[Ee],$e(ne.placeholders,Ee)&&!ye(ee.placeholders[Ee],ne.placeholders[Ee])))return null;for(var Ce in ne.placeholders)$e(ne.placeholders,Ce)&&(ue.placeholders[Ce]=ne.placeholders[Ce]);return ue}function Ze(ee,ne){var ue=[];if(ee.length===0||ne.length===0)return ue;for(var Ee,Ce=0;Ce2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var ir=te(ee.args[0],ne.args[1],ue);if(ir.length===0)return[];var Xe=te(ee.args[1],ne.args[0],ue);if(Xe.length===0)return[];Le=[ir,Xe]}Ce=K(Le)}else if(ne.args.length>=2&&ee.args.length===2){for(var Or=Ae(ne,ue),re=[],le=0;le2)throw Error("Unexpected non-binary associative function: "+ee.toString());return[]}}else if(ee instanceof _){if(ee.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(ce[ee.name]){if(ee.name!==ne.name)return[]}else switch(ee.name[1]>="a"&&ee.name[1]<="z"?ee.name.substring(0,2):ee.name[0]){case"n":case"_p":Ce[0].placeholders[ee.name]=ne;break;case"c":case"cl":if(yr(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"v":if(!yr(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"vl":if(rt(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"cd":if(Cg(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"vd":if(!Cg(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"ce":if(_f(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;case"ve":if(!_f(ne))Ce[0].placeholders[ee.name]=ne;else return[];break;default:throw new Error("Invalid symbol in rule: "+ee.name)}}else if(ee instanceof A){if(!u(ee.value,ne.value))return[]}else return[];return Ce}function ye(ee,ne){if(ee instanceof A&&ne instanceof A){if(!u(ee.value,ne.value))return!1}else if(ee instanceof _&&ne instanceof _){if(ee.name!==ne.name)return!1}else if(ee instanceof F&&ne instanceof F||ee instanceof E&&ne instanceof E){if(ee instanceof F){if(ee.op!==ne.op||ee.fn!==ne.fn)return!1}else if(ee instanceof E&&ee.name!==ne.name)return!1;if(ee.args.length!==ne.args.length)return!1;for(var ue=0;ue{var{typed:r,config:t,mathWithTransform:n,matrix:i,fraction:a,bignumber:s,AccessorNode:l,ArrayNode:f,ConstantNode:o,FunctionNode:u,IndexNode:p,ObjectNode:h,OperatorNode:d,SymbolNode:x}=e,{isCommutative:v,isAssociative:y,allChildren:w,createMakeNodeFunction:C}=du({FunctionNode:u,OperatorNode:d,SymbolNode:x}),b=r("simplifyConstant",{Node:V=>O($(V,{})),"Node, Object":function(q,R){return O($(q,R))}});function A(V){return Xn(V)?V.valueOf():V instanceof Array?V.map(A):Ge(V)?i(A(V.valueOf())):V}function E(V,q,R){try{return n[V].apply(null,q)}catch{return q=q.map(A),M(n[V].apply(null,q),R)}}var S=r({Fraction:k,number:function(q){return q<0?_(new o(-q)):new o(q)},BigNumber:function(q){return q<0?_(new o(-q)):new o(q)},Complex:function(q){throw new Error("Cannot convert Complex number to Node")},string:function(q){return new o(q)},Matrix:function(q){return new f(q.valueOf().map(R=>S(R)))}});function O(V){return Sr(V)?V:S(V)}function F(V,q){var R=q&&q.exactFractions!==!1;if(R&&isFinite(V)&&a){var j=a(V),U=q&&typeof q.fractionsLimit=="number"?q.fractionsLimit:1/0;if(j.valueOf()===V&&j.n0;)if(yr(j[0])&&typeof j[0].value!="string"){var U=M(j.shift().value,R);$t(V)?V=V.items[U-1]:(V=V.valueOf()[U-1],V instanceof Array&&(V=i(V)))}else if(j.length>1&&yr(j[1])&&typeof j[1].value!="string"){var oe=M(j[1].value,R),me=[],ie=$t(V)?V.items:V.valueOf();for(var H of ie)if($t(H))me.push(H.items[oe-1]);else if(Ge(V))me.push(H[oe-1]);else break;if(me.length===ie.length)$t(V)?V=new f(me):V=i(me),j.splice(1,1);else break}else break;return j.length===q.dimensions.length?new l(O(V),q):j.length>0?(q=new p(j),new l(O(V),q)):V}if(la(V)&&q.dimensions.length===1&&yr(q.dimensions[0])){var ce=q.dimensions[0].value;return ce in V.properties?V.properties[ce]:new o}return new l(O(V),q)}function Y(V,q,R,j){var U=q.shift(),oe=q.reduce((me,ie)=>{if(!Sr(ie)){var H=me.pop();if(Sr(H))return[H,ie];try{return me.push(E(V,[H,ie],j)),me}catch{me.push(H)}}me.push(O(me.pop()));var ce=me.length===1?me[0]:R(me);return[R([ce,O(ie)])]},[U]);return oe.length===1?oe[0]:R([oe[0],S(oe[1])])}function $(V,q){switch(V.type){case"SymbolNode":return V;case"ConstantNode":switch(typeof V.value){case"number":return M(V.value,q);case"string":return V.value;default:if(!isNaN(V.value))return M(V.value,q)}return V;case"FunctionNode":if(n[V.name]&&n[V.name].rawArgs)return V;{var R=["add","multiply"];if(R.indexOf(V.name)===-1){var j=V.args.map(De=>$(De,q));if(!j.some(Sr))try{return E(V.name,j,q)}catch{}if(V.name==="size"&&j.length===1&&$t(j[0])){for(var U=[],oe=j[0];$t(oe);)U.push(oe.items.length),oe=oe.items[0];return i(U)}return new u(V.name,j.map(O))}}case"OperatorNode":{var me=V.fn.toString(),ie,H,ce=C(V);if(ut(V)&&V.isUnary())ie=[$(V.args[0],q)],Sr(ie[0])?H=ce(ie):H=E(me,ie,q);else if(y(V,q.context))if(ie=w(V,q.context),ie=ie.map(De=>$(De,q)),v(me,q.context)){for(var Me=[],pe=[],ge=0;ge1?(H=Y(me,Me,ce,q),pe.unshift(H),H=Y(me,pe,ce,q)):H=Y(me,ie,ce,q)}else H=Y(me,ie,ce,q);else ie=V.args.map(De=>$(De,q)),H=Y(me,ie,ce,q);return H}case"ParenthesisNode":return $(V.content,q);case"AccessorNode":return L($(V.object,q),$(V.index,q),q);case"ArrayNode":{var Se=V.items.map(De=>$(De,q));return Se.some(Sr)?new f(Se.map(O)):i(Se)}case"IndexNode":return new p(V.dimensions.map(De=>b(De,q)));case"ObjectNode":{var xe={};for(var be in V.properties)xe[be]=b(V.properties[be],q);return new h(xe)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(V.type))}}return b});var RF="simplifyCore",zW=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],LF=T(RF,zW,e=>{var{typed:r,parse:t,equal:n,isZero:i,add:a,subtract:s,multiply:l,divide:f,pow:o,AccessorNode:u,ArrayNode:p,ConstantNode:h,FunctionNode:d,IndexNode:x,ObjectNode:v,OperatorNode:y,ParenthesisNode:w,SymbolNode:C}=e,b=new h(0),A=new h(1),E=new h(!0),S=new h(!1);function O(k){return ut(k)&&["and","not","or"].includes(k.op)}var{hasProperty:F,isCommutative:M}=du({FunctionNode:d,OperatorNode:y,SymbolNode:C});function _(k){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=L?L.context:void 0;if(F(k,"trivial",Y)){if(fn(k)&&k.args.length===1)return _(k.args[0],L);var $=!1,V=0;if(k.forEach(pe=>{++V,V===1&&($=_(pe,L))}),V===1)return $}var q=k;if(fn(q)){var R=M2(q.name);if(R){if(q.args.length>2&&F(q,"associative",Y))for(;q.args.length>2;){var j=q.args.pop(),U=q.args.pop();q.args.push(new y(R,q.name,[j,U]))}q=new y(R,q.name,q.args)}else return new d(_(q.fn),q.args.map(pe=>_(pe,L)))}if(ut(q)&&q.isUnary()){var oe=_(q.args[0],L);if(q.op==="~"&&ut(oe)&&oe.isUnary()&&oe.op==="~"||q.op==="not"&&ut(oe)&&oe.isUnary()&&oe.op==="not"&&O(oe.args[0]))return oe.args[0];var me=!0;if(q.op==="-"&&ut(oe)&&(oe.isBinary()&&oe.fn==="subtract"&&(q=new y("-","subtract",[oe.args[1],oe.args[0]]),me=!1),oe.isUnary()&&oe.op==="-"))return oe.args[0];if(me)return new y(q.op,q.fn,[oe])}if(ut(q)&&q.isBinary()){var ie=_(q.args[0],L),H=_(q.args[1],L);if(q.op==="+"){if(yr(ie)&&i(ie.value))return H;if(yr(H)&&i(H.value))return ie;ut(H)&&H.isUnary()&&H.op==="-"&&(H=H.args[0],q=new y("-","subtract",[ie,H]))}if(q.op==="-")return ut(H)&&H.isUnary()&&H.op==="-"?_(new y("+","add",[ie,H.args[0]]),L):yr(ie)&&i(ie.value)?_(new y("-","unaryMinus",[H])):yr(H)&&i(H.value)?ie:new y(q.op,q.fn,[ie,H]);if(q.op==="*"){if(yr(ie)){if(i(ie.value))return b;if(n(ie.value,1))return H}if(yr(H)){if(i(H.value))return b;if(n(H.value,1))return ie;if(M(q,Y))return new y(q.op,q.fn,[H,ie],q.implicit)}return new y(q.op,q.fn,[ie,H],q.implicit)}if(q.op==="/")return yr(ie)&&i(ie.value)?b:yr(H)&&n(H.value,1)?ie:new y(q.op,q.fn,[ie,H]);if(q.op==="^"&&yr(H)){if(i(H.value))return A;if(n(H.value,1))return ie}if(q.op==="and"){if(yr(ie))if(ie.value){if(O(H))return H;if(yr(H))return H.value?E:S}else return S;if(yr(H))if(H.value){if(O(ie))return ie}else return S}if(q.op==="or"){if(yr(ie)){if(ie.value)return E;if(O(H))return H}if(yr(H)){if(H.value)return E;if(O(ie))return ie}}return new y(q.op,q.fn,[ie,H])}if(ut(q))return new y(q.op,q.fn,q.args.map(pe=>_(pe,L)));if($t(q))return new p(q.items.map(pe=>_(pe,L)));if(Sn(q))return new u(_(q.object,L),_(q.index,L));if(kn(q))return new x(q.dimensions.map(pe=>_(pe,L)));if(la(q)){var ce={};for(var Me in q.properties)ce[Me]=_(q.properties[Me],L);return new v(ce)}return q}return r(RF,{Node:_,"Node,Object":_})});var WW="resolve",VW=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],qF=T(WW,VW,e=>{var{typed:r,parse:t,ConstantNode:n,FunctionNode:i,OperatorNode:a,ParenthesisNode:s}=e;function l(f,o){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!o)return f;if(rt(f)){if(u.has(f.name)){var p=Array.from(u).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(p,"}"))}var h=o.get(f.name);if(Sr(h)){var d=new Set(u);return d.add(f.name),l(h,o,d)}else return typeof h=="number"?t(String(h)):h!==void 0?new n(h):f}else if(ut(f)){var x=f.args.map(function(y){return l(y,o,u)});return new a(f.op,f.fn,x,f.implicit)}else{if(Zt(f))return new s(l(f.content,o,u));if(fn(f)){var v=f.args.map(function(y){return l(y,o,u)});return new i(f.name,v)}}return f.map(y=>l(y,o,u))}return r("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(f,o)=>l(f,ka(o)),"Array | Matrix":r.referToSelf(f=>o=>o.map(u=>f(u))),"Array | Matrix, null | undefined":r.referToSelf(f=>o=>o.map(u=>f(u))),"Array, Object":r.referTo("Array,Map",f=>(o,u)=>f(o,ka(u))),"Matrix, Object":r.referTo("Matrix,Map",f=>(o,u)=>f(o,ka(u))),"Array | Matrix, Map":r.referToSelf(f=>(o,u)=>o.map(p=>f(p,u)))})});var UF="symbolicEqual",YW=["parse","simplify","typed","OperatorNode"],zF=T(UF,YW,e=>{var{parse:r,simplify:t,typed:n,OperatorNode:i}=e;function a(s,l){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=new i("-","subtract",[s,l]),u=t(o,{},f);return yr(u)&&!u.value}return n(UF,{"Node, Node":a,"Node, Node, Object":a})});var WF="derivative",HW=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],VF=T(WF,HW,e=>{var{typed:r,config:t,parse:n,simplify:i,equal:a,isZero:s,numeric:l,ConstantNode:f,FunctionNode:o,OperatorNode:u,ParenthesisNode:p,SymbolNode:h}=e;function d(b,A){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},S={};y(S,b,A.name);var O=w(b,S);return E.simplify?i(O):O}r.addConversion({from:"identifier",to:"SymbolNode",convert:n});var x=r(WF,{"Node, SymbolNode":d,"Node, SymbolNode, Object":d});r.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),x._simplify=!0,x.toTex=function(b){return v.apply(null,b.args)};var v=r("_derivTex",{"Node, SymbolNode":function(A,E){return yr(A)&&_r(A.value)==="string"?v(n(A.value).toString(),E.toString(),1):v(A.toTex(),E.toString(),1)},"Node, ConstantNode":function(A,E){if(_r(E.value)==="string")return v(A,n(E.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(A,E,S){return v(A.toString(),E.name,S.value)},"string, string, number":function(A,E,S){var O;return S===1?O="{d\\\\over d"+E+"}":O="{d^{"+S+"}\\\\over d"+E+"^{"+S+"}}",O+"\\\\left[".concat(A,"\\\\right]")}}),y=r("constTag",{"Object, ConstantNode, string":function(A,E){return A[E]=!0,!0},"Object, SymbolNode, string":function(A,E,S){return E.name!==S?(A[E]=!0,!0):!1},"Object, ParenthesisNode, string":function(A,E,S){return y(A,E.content,S)},"Object, FunctionAssignmentNode, string":function(A,E,S){return E.params.indexOf(S)===-1?(A[E]=!0,!0):y(A,E.expr,S)},"Object, FunctionNode | OperatorNode, string":function(A,E,S){if(E.args.length>0){for(var O=y(A,E.args[0],S),F=1;F0){var O=A.args.filter(function(V){return E[V]===void 0}),F=O.length===1?O[0]:new u("*","multiply",O),M=S.concat(w(F,E));return new u("*","multiply",M)}return new u("+","add",A.args.map(function(V){return new u("*","multiply",A.args.map(function(q){return q===V?w(q,E):q.clone()}))}))}if(A.op==="/"&&A.isBinary()){var _=A.args[0],k=A.args[1];return E[k]!==void 0?new u("/","divide",[w(_,E),k]):E[_]!==void 0?new u("*","multiply",[new u("-","unaryMinus",[_]),new u("/","divide",[w(k,E),new u("^","pow",[k.clone(),C(2)])])]):new u("/","divide",[new u("-","subtract",[new u("*","multiply",[w(_,E),k.clone()]),new u("*","multiply",[_.clone(),w(k,E)])]),new u("^","pow",[k.clone(),C(2)])])}if(A.op==="^"&&A.isBinary()){var L=A.args[0],Y=A.args[1];if(E[L]!==void 0)return yr(L)&&(s(L.value)||a(L.value,1))?C(0):new u("*","multiply",[A,new u("*","multiply",[new o("log",[L.clone()]),w(Y.clone(),E)])]);if(E[Y]!==void 0){if(yr(Y)){if(s(Y.value))return C(0);if(a(Y.value,1))return w(L,E)}var $=new u("^","pow",[L.clone(),new u("-","subtract",[Y,C(1)])]);return new u("*","multiply",[Y.clone(),new u("*","multiply",[w(L,E),$])])}return new u("*","multiply",[new u("^","pow",[L.clone(),Y.clone()]),new u("+","add",[new u("*","multiply",[w(L,E),new u("/","divide",[Y.clone(),L.clone()])]),new u("*","multiply",[w(Y,E),new o("log",[L.clone()])])])])}throw new Error('Cannot process operator "'+A.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function C(b,A){return new f(l(b,A||t.number))}return x});var YF="rationalize",GW=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],HF=T(YF,GW,e=>{var{config:r,typed:t,equal:n,isZero:i,add:a,subtract:s,multiply:l,divide:f,pow:o,parse:u,simplifyConstant:p,simplifyCore:h,simplify:d,fraction:x,bignumber:v,mathWithTransform:y,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:A,FunctionNode:E,IndexNode:S,ObjectNode:O,OperatorNode:F,SymbolNode:M,ParenthesisNode:_}=e;function k(q){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,U=Y(),oe=L(q,R,!0,U.firstRules),me=oe.variables.length,ie={exactFractions:!1},H={exactFractions:!0};if(q=oe.expression,me>=1){q=$(q);var ce,Me,pe=!0,ge=!1;q=d(q,U.firstRules,{},ie);for(var Se;Me=pe?U.distrDivRules:U.sucDivRules,q=d(q,Me,{},H),pe=!pe,Se=q.toString(),Se!==ce;)ge=!0,ce=Se;ge&&(q=d(q,U.firstRulesAgain,{},ie)),q=d(q,U.finalRules,{},ie)}var xe=[],be={};return q.type==="OperatorNode"&&q.isBinary()&&q.op==="/"?(me===1&&(q.args[0]=V(q.args[0],xe),q.args[1]=V(q.args[1])),j&&(be.numerator=q.args[0],be.denominator=q.args[1])):(me===1&&(q=V(q,xe)),j&&(be.numerator=q,be.denominator=null)),j?(be.coefficients=xe,be.variables=oe.variables,be.expression=q,be):q}return t(YF,{Node:k,"Node, boolean":(q,R)=>k(q,{},R),"Node, Object":k,"Node, Object, boolean":k});function L(q,R,j,U){var oe=[],me=d(q,U,R,{exactFractions:!1});j=!!j;var ie="+-*"+(j?"/":"");ce(me);var H={};return H.expression=me,H.variables=oe,H;function ce(Me){var pe=Me.type;if(pe==="FunctionNode")throw new Error("There is an unsolved function call");if(pe==="OperatorNode")if(Me.op==="^"){if(Me.args[1].type!=="ConstantNode"||!He(parseFloat(Me.args[1].value)))throw new Error("There is a non-integer exponent");ce(Me.args[0])}else{if(ie.indexOf(Me.op)===-1)throw new Error("Operator "+Me.op+" invalid in polynomial expression");for(var ge=0;ge1;if(U==="OperatorNode"&&q.isBinary()){var me=!1,ie;if(q.op==="^"&&(q.args[0].type==="ParenthesisNode"||q.args[0].type==="OperatorNode")&&q.args[1].type==="ConstantNode"&&(ie=parseFloat(q.args[1].value),me=ie>=2&&He(ie)),me){if(ie>2){var H=q.args[0],ce=new F("^","pow",[q.args[0].cloneDeep(),new A(ie-1)]);q=new F("*","multiply",[H,ce])}else q=new F("*","multiply",[q.args[0],q.args[0].cloneDeep()]);oe&&(j==="content"?R.content=q:R.args[j]=q)}}if(U==="ParenthesisNode")$(q.content,q,"content");else if(U!=="ConstantNode"&&U!=="SymbolNode")for(var Me=0;Me=0;H--)if(R[H]!==0){var ce=new A(me?R[H]:Math.abs(R[H])),Me=R[H]<0?"-":"+";if(H>0){var pe=new M(oe);if(H>1){var ge=new A(H);pe=new F("^","pow",[pe,ge])}R[H]===-1&&me?ce=new F("-","unaryMinus",[pe]):Math.abs(R[H])===1?ce=pe:ce=new F("*","multiply",[ce,pe])}me?ie=ce:Me==="+"?ie=new F("+","add",[ie,ce]):ie=new F("-","subtract",[ie,ce]),me=!1}if(me)return new A(0);return ie;function Se(xe,be,De){var Ae=xe.type;if(Ae==="FunctionNode")throw new Error("There is an unsolved function call");if(Ae==="OperatorNode"){if("+-*^".indexOf(xe.op)===-1)throw new Error("Operator "+xe.op+" invalid");if(be!==null){if((xe.fn==="unaryMinus"||xe.fn==="pow")&&be.fn!=="add"&&be.fn!=="subtract"&&be.fn!=="multiply")throw new Error("Invalid "+xe.op+" placing");if((xe.fn==="subtract"||xe.fn==="add"||xe.fn==="multiply")&&be.fn!=="add"&&be.fn!=="subtract")throw new Error("Invalid "+xe.op+" placing");if((xe.fn==="subtract"||xe.fn==="add"||xe.fn==="unaryMinus")&&De.noFil!==0)throw new Error("Invalid "+xe.op+" placing")}(xe.op==="^"||xe.op==="*")&&(De.fire=xe.op);for(var ze=0;zeU&&(R[Ze]=0),R[Ze]+=De.cte*(De.oper==="+"?1:-1),U=Math.max(Ze,U);return}De.cte=Ze,De.fire===""&&(R[0]+=De.cte*(De.oper==="+"?1:-1))}else throw new Error("Type "+Ae+" is not allowed")}}});var GF="zpk2tf",$W=["typed","add","multiply","Complex","number"],$F=T(GF,$W,e=>{var{typed:r,add:t,multiply:n,Complex:i,number:a}=e;return r(GF,{"Array,Array,number":function(o,u,p){return s(o,u,p)},"Array,Array":function(o,u){return s(o,u,1)},"Matrix,Matrix,number":function(o,u,p){return s(o.valueOf(),u.valueOf(),p)},"Matrix,Matrix":function(o,u){return s(o.valueOf(),u.valueOf(),1)}});function s(f,o,u){f.some(C=>C.type==="BigNumber")&&(f=f.map(C=>a(C))),o.some(C=>C.type==="BigNumber")&&(o=o.map(C=>a(C)));for(var p=[i(1,0)],h=[i(1,0)],d=0;d=0&&p-h{var{typed:r,add:t,multiply:n,Complex:i,divide:a,matrix:s}=e;return r(ZF,{"Array, Array":function(u,p){var h=f(512);return l(u,p,h)},"Array, Array, Array":function(u,p,h){return l(u,p,h)},"Array, Array, number":function(u,p,h){if(h<0)throw new Error("w must be a positive number");var d=f(h);return l(u,p,d)},"Matrix, Matrix":function(u,p){var h=f(512),{w:d,h:x}=l(u.valueOf(),p.valueOf(),h);return{w:s(d),h:s(x)}},"Matrix, Matrix, Matrix":function(u,p,h){var{h:d}=l(u.valueOf(),p.valueOf(),h.valueOf());return{h:s(d),w:s(h)}},"Matrix, Matrix, number":function(u,p,h){if(h<0)throw new Error("w must be a positive number");var d=f(h),{h:x}=l(u.valueOf(),p.valueOf(),d);return{h:s(x),w:s(d)}}});function l(o,u,p){for(var h=[],d=[],x=0;x{var{classes:r}=e;return function(n,i){var a=r[i&&i.mathjs];return a&&typeof a.fromJSON=="function"?a.fromJSON(i):i}});var JW="replacer",KW=[],JF=T(JW,KW,()=>function(r,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t});var KF="12.4.1";var jF=T("true",[],()=>!0),e3=T("false",[],()=>!1),r3=T("null",[],()=>null),t3=ei("Infinity",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1/0):1/0}),n3=ei("NaN",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(NaN):NaN}),i3=ei("pi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?Ef(t):p1}),a3=ei("tau",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?HS(t):m1}),o3=ei("e",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?VS(t):h1}),s3=ei("phi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?YS(t):d1}),u3=ei("LN2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).ln():Math.LN2}),f3=ei("LN10",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(10).ln():Math.LN10}),l3=ei("LOG2E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),c3=ei("LOG10E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),p3=ei("SQRT1_2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),m3=ei("SQRT2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),h3=ei("i",["Complex"],e=>{var{Complex:r}=e;return r.I}),d3=T("PI",["pi"],e=>{var{pi:r}=e;return r}),v3=T("E",["e"],e=>{var{e:r}=e;return r}),g3=T("version",[],()=>KF);function ei(e,r,t){return T(e,r,t,{recreateOnConfigChange:!0})}var x3=Cr("speedOfLight","299792458","m s^-1"),y3=Cr("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),b3=Cr("planckConstant","6.62607015e-34","J s"),w3=Cr("reducedPlanckConstant","1.0545718176461565e-34","J s"),D3=Cr("magneticConstant","1.25663706212e-6","N A^-2"),S3=Cr("electricConstant","8.8541878128e-12","F m^-1"),N3=Cr("vacuumImpedance","376.730313667","ohm"),A3=Cr("coulomb","8.987551792261171e9","N m^2 C^-2"),E3=Cr("elementaryCharge","1.602176634e-19","C"),C3=Cr("bohrMagneton","9.2740100783e-24","J T^-1"),M3=Cr("conductanceQuantum","7.748091729863649e-5","S"),_3=Cr("inverseConductanceQuantum","12906.403729652257","ohm"),T3=Cr("magneticFluxQuantum","2.0678338484619295e-15","Wb"),F3=Cr("nuclearMagneton","5.0507837461e-27","J T^-1"),O3=Cr("klitzing","25812.807459304513","ohm");var B3=Cr("bohrRadius","5.29177210903e-11","m"),I3=Cr("classicalElectronRadius","2.8179403262e-15","m"),P3=Cr("electronMass","9.1093837015e-31","kg"),k3=Cr("fermiCoupling","1.1663787e-5","GeV^-2"),R3=Yp("fineStructure",.0072973525693),L3=Cr("hartreeEnergy","4.3597447222071e-18","J"),q3=Cr("protonMass","1.67262192369e-27","kg"),U3=Cr("deuteronMass","3.3435830926e-27","kg"),z3=Cr("neutronMass","1.6749271613e-27","kg"),W3=Cr("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),V3=Cr("rydberg","10973731.568160","m^-1"),Y3=Cr("thomsonCrossSection","6.6524587321e-29","m^2"),H3=Yp("weakMixingAngle",.2229),G3=Yp("efimovFactor",22.7),$3=Cr("atomicMass","1.66053906660e-27","kg"),Z3=Cr("avogadro","6.02214076e23","mol^-1"),Q3=Cr("boltzmann","1.380649e-23","J K^-1"),X3=Cr("faraday","96485.33212331001","C mol^-1"),J3=Cr("firstRadiation","3.7417718521927573e-16","W m^2"),K3=Cr("loschmidt","2.686780111798444e25","m^-3"),j3=Cr("gasConstant","8.31446261815324","J K^-1 mol^-1"),eO=Cr("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),rO=Cr("molarVolume","0.022413969545014137","m^3 mol^-1"),tO=Yp("sackurTetrode",-1.16487052358),nO=Cr("secondRadiation","0.014387768775039337","m K"),iO=Cr("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),aO=Cr("wienDisplacement","2.897771955e-3","m K"),oO=Cr("molarMass","0.99999999965e-3","kg mol^-1"),sO=Cr("molarMassC12","11.9999999958e-3","kg mol^-1"),uO=Cr("gravity","9.80665","m s^-2"),fO=Cr("planckLength","1.616255e-35","m"),lO=Cr("planckMass","2.176435e-8","kg"),cO=Cr("planckTime","5.391245e-44","s"),pO=Cr("planckCharge","1.87554603778e-18","C"),mO=Cr("planckTemperature","1.416785e+32","K");function Cr(e,r,t){var n=["config","Unit","BigNumber"];return T(e,n,i=>{var{config:a,Unit:s,BigNumber:l}=i,f=a.number==="BigNumber"?new l(r):parseFloat(r),o=new s(f,t);return o.fixPrefix=!0,o})}function Yp(e,r){var t=["config","BigNumber"];return T(e,t,n=>{var{config:i,BigNumber:a}=n;return i.number==="BigNumber"?new a(r):r})}var jW="apply",eV=["typed","isInteger"],hO=T(jW,eV,e=>{var{typed:r,isInteger:t}=e,n=ou({typed:r,isInteger:t});return r("apply",{"...any":function(a){var s=a[1];ar(s)?a[1]=s-1:je(s)&&(a[1]=s.minus(1));try{return n.apply(null,a)}catch(l){throw lt(l)}}})},{isTransformFunction:!0});var rV="column",tV=["typed","Index","matrix","range"],dO=T(rV,tV,e=>{var{typed:r,Index:t,matrix:n,range:i}=e,a=Zc({typed:r,Index:t,matrix:n,range:i});return r("column",{"...any":function(l){var f=l.length-1,o=l[f];ar(o)&&(l[f]=o-1);try{return a.apply(null,l)}catch(u){throw lt(u)}}})},{isTransformFunction:!0});function vu(e,r,t){var n=e.filter(function(f){return rt(f)&&!(f.name in r)&&!t.has(f.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=new Map,s=new eu(t,a,new Set([i])),l=e.compile();return function(o){return a.set(i,o),l.evaluate(s)}}var nV="filter",iV=["typed"],gO=T(nV,iV,e=>{var{typed:r}=e;function t(i,a,s){var l,f;return i[0]&&(l=i[0].compile().evaluate(s)),i[1]&&(rt(i[1])||mi(i[1])?f=i[1].compile().evaluate(s):f=vu(i[1],a,s)),n(l,f)}t.rawArgs=!0;var n=r("filter",{"Array, function":vO,"Matrix, function":function(a,s){return a.create(vO(a.toArray(),s))},"Array, RegExp":Ks,"Matrix, RegExp":function(a,s){return a.create(Ks(a.toArray(),s))}});return t},{isTransformFunction:!0});function vO(e,r){return Nc(e,function(t,n,i){return gi(r,t,[n+1],i,"filter")})}var aV="forEach",oV=["typed"],xO=T(aV,oV,e=>{var{typed:r}=e;function t(i,a,s){var l,f;return i[0]&&(l=i[0].compile().evaluate(s)),i[1]&&(rt(i[1])||mi(i[1])?f=i[1].compile().evaluate(s):f=vu(i[1],a,s)),n(l,f)}t.rawArgs=!0;var n=r("forEach",{"Array | Matrix, function":function(a,s){var l=function f(o,u){if(Array.isArray(o))ho(o,function(p,h){f(p,u.concat(h+1))});else return gi(s,o,u,a,"forEach")};l(a.valueOf(),[])}});return t},{isTransformFunction:!0});var sV="index",uV=["Index","getMatrixDataType"],yO=T(sV,uV,e=>{var{Index:r,getMatrixDataType:t}=e;return function(){for(var i=[],a=0,s=arguments.length;a0?0:2;else if(l&&l.isSet===!0)l=l.map(function(o){return o-1});else if(Ar(l)||Ge(l))t(l)!=="boolean"&&(l=l.map(function(o){return o-1}));else if(ar(l))l--;else if(je(l))l=l.toNumber()-1;else if(typeof l!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");i[a]=l}var f=new r;return r.apply(f,i),f}},{isTransformFunction:!0});var fV="map",lV=["typed"],wO=T(fV,lV,e=>{var{typed:r}=e;function t(i,a,s){var l,f;return i[0]&&(l=i[0].compile().evaluate(s)),i[1]&&(rt(i[1])||mi(i[1])?f=i[1].compile().evaluate(s):f=vu(i[1],a,s)),n(l,f)}t.rawArgs=!0;var n=r("map",{"Array, function":function(a,s){return bO(a,s,a)},"Matrix, function":function(a,s){return a.create(bO(a.valueOf(),s,a))}});return t},{isTransformFunction:!0});function bO(e,r,t){function n(i,a){return Array.isArray(i)?Rn(i,function(s,l){return n(s,a.concat(l+1))}):gi(r,i,a,t,"map")}return n(e,[])}function vn(e){if(e.length===2&&bt(e[0])){e=e.slice();var r=e[1];ar(r)?e[1]=r-1:je(r)&&(e[1]=r.minus(1))}return e}var cV="max",pV=["typed","config","numeric","larger"],DO=T(cV,pV,e=>{var{typed:r,config:t,numeric:n,larger:i}=e,a=cp({typed:r,config:t,numeric:n,larger:i});return r("max",{"...any":function(l){l=vn(l);try{return a.apply(null,l)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var mV="mean",hV=["typed","add","divide"],SO=T(mV,hV,e=>{var{typed:r,add:t,divide:n}=e,i=qp({typed:r,add:t,divide:n});return r("mean",{"...any":function(s){s=vn(s);try{return i.apply(null,s)}catch(l){throw lt(l)}}})},{isTransformFunction:!0});var dV="min",vV=["typed","config","numeric","smaller"],NO=T(dV,vV,e=>{var{typed:r,config:t,numeric:n,smaller:i}=e,a=pp({typed:r,config:t,numeric:n,smaller:i});return r("min",{"...any":function(l){l=vn(l);try{return a.apply(null,l)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var gV="range",xV=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],AO=T(gV,xV,e=>{var{typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:l,largerEq:f,add:o,isPositive:u}=e,p=Kc({typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:l,largerEq:f,add:o,isPositive:u});return r("range",{"...any":function(d){var x=d.length-1,v=d[x];return typeof v!="boolean"&&d.push(!0),p.apply(null,d)}})},{isTransformFunction:!0});var yV="row",bV=["typed","Index","matrix","range"],EO=T(yV,bV,e=>{var{typed:r,Index:t,matrix:n,range:i}=e,a=jc({typed:r,Index:t,matrix:n,range:i});return r("row",{"...any":function(l){var f=l.length-1,o=l[f];ar(o)&&(l[f]=o-1);try{return a.apply(null,l)}catch(u){throw lt(u)}}})},{isTransformFunction:!0});var wV="subset",DV=["typed","matrix","zeros","add"],CO=T(wV,DV,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e,a=ep({typed:r,matrix:t,zeros:n,add:i});return r("subset",{"...any":function(l){try{return a.apply(null,l)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var SV="concat",NV=["typed","matrix","isInteger"],MO=T(SV,NV,e=>{var{typed:r,matrix:t,isInteger:n}=e,i=$c({typed:r,matrix:t,isInteger:n});return r("concat",{"...any":function(s){var l=s.length-1,f=s[l];ar(f)?s[l]=f-1:je(f)&&(s[l]=f.minus(1));try{return i.apply(null,s)}catch(o){throw lt(o)}}})},{isTransformFunction:!0});var _O="diff",AV=["typed","matrix","subtract","number","bignumber"],TO=T(_O,AV,e=>{var{typed:r,matrix:t,subtract:n,number:i,bignumber:a}=e,s=Qc({typed:r,matrix:t,subtract:n,number:i,bignumber:a});return r(_O,{"...any":function(f){f=vn(f);try{return s.apply(null,f)}catch(o){throw lt(o)}}})},{isTransformFunction:!0});var EV="std",CV=["typed","map","sqrt","variance"],FO=T(EV,CV,e=>{var{typed:r,map:t,sqrt:n,variance:i}=e,a=Wp({typed:r,map:t,sqrt:n,variance:i});return r("std",{"...any":function(l){l=vn(l);try{return a.apply(null,l)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var OO="sum",MV=["typed","config","add","numeric"],BO=T(OO,MV,e=>{var{typed:r,config:t,add:n,numeric:i}=e,a=kp({typed:r,config:t,add:n,numeric:i});return r(OO,{"...any":function(l){l=vn(l);try{return a.apply(null,l)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var _V="quantileSeq",TV=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],IO=T(_V,TV,e=>{var{typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:l,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:h}=e,d=zp({typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:l,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:h});return r("quantileSeq",{"Array | Matrix, number | BigNumber":d,"Array | Matrix, number | BigNumber, number":(v,y,w)=>d(v,y,x(w)),"Array | Matrix, number | BigNumber, boolean":d,"Array | Matrix, number | BigNumber, boolean, number":(v,y,w,C)=>d(v,y,w,x(C)),"Array | Matrix, Array | Matrix":d,"Array | Matrix, Array | Matrix, number":(v,y,w)=>d(v,y,x(w)),"Array | Matrix, Array | Matrix, boolean":d,"Array | Matrix, Array | Matrix, boolean, number":(v,y,w,C)=>d(v,y,w,x(C))});function x(v){return vn([[],v])[1]}},{isTransformFunction:!0});var PO="cumsum",FV=["typed","add","unaryPlus"],kO=T(PO,FV,e=>{var{typed:r,add:t,unaryPlus:n}=e,i=Lp({typed:r,add:t,unaryPlus:n});return r(PO,{"...any":function(s){if(s.length===2&&bt(s[0])){var l=s[1];ar(l)?s[1]=l-1:je(l)&&(s[1]=l.minus(1))}try{return i.apply(null,s)}catch(f){throw lt(f)}}})},{isTransformFunction:!0});var RO="variance",OV=["typed","add","subtract","multiply","divide","apply","isNaN"],LO=T(RO,OV,e=>{var{typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:l}=e,f=Up({typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:l});return r(RO,{"...any":function(u){u=vn(u);try{return f.apply(null,u)}catch(p){throw lt(p)}}})},{isTransformFunction:!0});var qO="print",BV=["typed","matrix","zeros","add"],UO=T(qO,BV,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e,a=tp({typed:r,matrix:t,zeros:n,add:i});return r(qO,{"string, Object | Array":function(f,o){return a(s(f),o)},"string, Object | Array, number | Object":function(f,o,u){return a(s(f),o,u)}});function s(l){return l.replace(rp,f=>{var o=f.slice(1).split("."),u=o.map(function(p){return!isNaN(p)&&p.length>0?parseInt(p)-1:p});return"$"+u.join(".")})}},{isTransformFunction:!0});var IV="and",PV=["typed","matrix","zeros","add","equalScalar","not","concat"],zO=T(IV,PV,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,l=np({typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s});function f(o,u,p){var h=o[0].compile().evaluate(p);if(!bt(h)&&!l(h,!0))return!1;var d=o[1].compile().evaluate(p);return l(h,d)}return f.rawArgs=!0,f},{isTransformFunction:!0});var kV="or",RV=["typed","matrix","equalScalar","DenseMatrix","concat"],WO=T(kV,RV,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=Gc({typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a});function l(f,o,u){var p=f[0].compile().evaluate(u);if(!bt(p)&&s(p,!1))return!0;var h=f[1].compile().evaluate(u);return s(p,h)}return l.rawArgs=!0,l},{isTransformFunction:!0});var LV="bitAnd",qV=["typed","matrix","zeros","add","equalScalar","not","concat"],VO=T(LV,qV,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,l=Yc({typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s});function f(o,u,p){var h=o[0].compile().evaluate(p);if(!bt(h)){if(isNaN(h))return NaN;if(h===0||h===!1)return 0}var d=o[1].compile().evaluate(p);return l(h,d)}return f.rawArgs=!0,f},{isTransformFunction:!0});var UV="bitOr",zV=["typed","matrix","equalScalar","DenseMatrix","concat"],YO=T(UV,zV,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=Hc({typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a});function l(f,o,u){var p=f[0].compile().evaluate(u);if(!bt(p)){if(isNaN(p))return NaN;if(p===-1)return-1;if(p===!0)return 1}var h=f[1].compile().evaluate(u);return s(p,h)}return l.rawArgs=!0,l},{isTransformFunction:!0});var Tg=_g;var QO=ci(gc(),1);var GO=ci(HO(),1);function $O(e){var r=new GO.default;return e.on=r.on.bind(r),e.off=r.off.bind(r),e.once=r.once.bind(r),e.emit=r.emit.bind(r),e}function ZO(e,r,t,n){function i(y,w){var C=arguments.length;if(C!==1&&C!==2)throw new jn("import",C,1,2);w||(w={});function b(O,F,M){if(Array.isArray(F))F.forEach(L=>b(O,L));else if(typeof F=="object")for(var _ in F)$e(F,_)&&b(O,F[_],_);else if(es(F)||M!==void 0){var k=es(F)?x(F)?F.fn+".transform":F.fn:M;if($e(O,k)&&O[k]!==F&&!w.silent)throw new Error('Cannot import "'+k+'" twice');O[k]=F}else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}var A={};b(A,y);for(var E in A)if($e(A,E)){var S=A[E];if(es(S))o(S,w);else if(u(S))a(E,S,w);else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}}function a(y,w,C){if(C.wrap&&typeof w=="function"&&(w=f(w)),p(w)&&(w=e(y,{[w.signature]:w})),e.isTypedFunction(t[y])&&e.isTypedFunction(w)){C.override?w=e(y,w.signatures):w=e(t[y],w),t[y]=w,delete n[y],s(y,w),t.emit("import",y,function(){return w});return}if(t[y]===void 0||C.override){t[y]=w,delete n[y],s(y,w),t.emit("import",y,function(){return w});return}if(!C.silent)throw new Error('Cannot import "'+y+'": already exists')}function s(y,w){w&&typeof w.transform=="function"?(t.expression.transform[y]=w.transform,h(y)&&(t.expression.mathWithTransform[y]=w.transform)):(delete t.expression.transform[y],h(y)&&(t.expression.mathWithTransform[y]=w))}function l(y){delete t.expression.transform[y],h(y)?t.expression.mathWithTransform[y]=t[y]:delete t.expression.mathWithTransform[y]}function f(y){var w=function(){for(var b=[],A=0,E=arguments.length;A2&&arguments[2]!==void 0?arguments[2]:y.fn;if(Gd(C,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(C));var b=x(y)?t.expression.transform:t,A=C in t.expression.transform,E=$e(b,C)?b[C]:void 0,S=function(){var F={};y.dependencies.map(Qd).forEach(_=>{if(Gd(_,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(_));_==="math"?F.math=t:_==="mathWithTransform"?F.mathWithTransform=t.expression.mathWithTransform:_==="classes"?F.classes=t:F[_]=t[_]});var M=y(F);if(M&&typeof M.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(E===void 0||w.override)return M;if(e.isTypedFunction(E)&&e.isTypedFunction(M))return e(E,M);if(w.silent)return E;throw new Error('Cannot import "'+C+'": already exists')};!y.meta||y.meta.lazy!==!1?(Zs(b,C,S),E&&A?l(C):(x(y)||d(y))&&Zs(t.expression.mathWithTransform,C,()=>b[C])):(b[C]=S(),E&&A?l(C):(x(y)||d(y))&&Zs(t.expression.mathWithTransform,C,()=>b[C])),n[C]=y,t.emit("import",C,S)}function u(y){return typeof y=="function"||typeof y=="number"||typeof y=="string"||typeof y=="boolean"||y===null||qt(y)||Gt(y)||je(y)||Xn(y)||Ge(y)||Array.isArray(y)}function p(y){return typeof y=="function"&&typeof y.signature=="string"}function h(y){return!$e(v,y)}function d(y){return y.fn.indexOf(".")===-1&&!$e(v,y.fn)&&(!y.meta||!y.meta.isClass)}function x(y){return y!==void 0&&y.meta!==void 0&&y.meta.isTransformFunction===!0||!1}var v={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return i}function Hp(e,r){var t=Mt({},nc,r);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var n=$O({isNumber:ar,isComplex:Gt,isBigNumber:je,isFraction:Xn,isUnit:qt,isString:yt,isArray:Ar,isMatrix:Ge,isCollection:bt,isDenseMatrix:Ia,isSparseMatrix:Jn,isRange:mo,isIndex:ua,isBoolean:ic,isResultSet:ac,isHelp:Hs,isFunction:oc,isDate:sc,isRegExp:uc,isObject:fa,isNull:fc,isUndefined:lc,isAccessorNode:Sn,isArrayNode:$t,isAssignmentNode:cc,isBlockNode:pc,isConditionalNode:mc,isConstantNode:yr,isFunctionAssignmentNode:mi,isFunctionNode:fn,isIndexNode:kn,isNode:Sr,isObjectNode:la,isOperatorNode:ut,isParenthesisNode:Zt,isRangeNode:hc,isRelationalNode:dc,isSymbolNode:rt,isChain:Gs});n.config=ty(t,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var i=[],a=[];function s(u){if(es(u))return u(n);var p=u[Object.keys(u)[0]];if(es(p))return p(n);if(!Jx(u))throw console.warn("Factory object with properties \`type\`, \`name\`, and \`factory\` expected",u),new Error("Factory object with properties \`type\`, \`name\`, and \`factory\` expected");var h=i.indexOf(u),d;return h===-1?(u.math===!0?d=u.factory(n.type,t,s,n.typed,n):d=u.factory(n.type,t,s,n.typed),i.push(u),a.push(d)):d=a[h],d}var l={};function f(){for(var u=arguments.length,p=new Array(u),h=0;h{kd(l).forEach(u=>{u&&u.meta&&u.meta.recreateOnConfigChange&&o(u,{override:!0})})}),n.create=Hp.bind(null,e),n.factory=T,n.import(kd(Qx(e))),n.ArgumentsError=jn,n.DimensionError=pr,n.IndexError=Xt,n}var XO=(e,r,t)=>{if(e.length!==1)return"";let n=e.map(function(s){return s.compile().evaluate(t)}),i=t.get(n[0]),a=t.get("$properties")?.[n[0]]?.type;return(a=="file"||a=="link"||a=="context")&&(a.includes("multi")?i=Ui(i).map(s=>t.get("$paths").get(s)??s):i=t.get("$paths").get(i)??i),i??""};XO.rawArgs=!0;var JO=(e,r,t)=>{if((e.length-1)%2!==0)return"";for(let n=0;n{if(e.length<1||e.length>2)return"";let n=e[0].compile().evaluate(t);n instanceof Date||(n=new Date(n));let i=e[1]?.compile().evaluate(t);return i?.length>0?Ba(n,i):Ba(n,t.get("$settings")?.dateFormat??"yyyy-MM-dd")};KO.rawArgs=!0;var ri=e=>typeof e=="string"||e instanceof String?e:e instanceof Date?Ba(e,"yyyy-MM-dd"):typeof e=="number"?e.toFixed(2):e.path?e.path:"",jO={prop:XO,slice:(e,r,t)=>(e=ri(e),e.slice(r,t)),if:(e,r,t)=>e===!0?r:t,ifs:JO,empty:e=>e.length!==1?"":e[0]===""?"true":"false",length:e=>e.length,substring:(e,r,t)=>(e=ri(e),t?e.substring(r,t):e.substring(r)),contains:(e,r)=>(e=ri(e),r=ri(r),e.includes(r)),test:(e,r)=>(e=ri(e),new RegExp(r).test(e)),match:(e,r)=>(e=ri(e),e.match(new RegExp(r))),replace:(e,r,t)=>(e=ri(e),e.replace(new RegExp(r),t)),replaceAll:(e,r,t)=>(e=ri(e),r=ri(r),t=ri(t),e.replace(new RegExp(r,"g"),t)),lower:e=>(e=ri(e),e.toLowerCase()),upper:e=>(e=ri(e),e.toUpperCase()),repeat:(e,r)=>e.repeat(r),format:ri,toNumber:e=>e instanceof Date?e.getTime():typeof e=="string"?parseFloat(e):e,now:()=>new Date,minute:e=>e.getMinutes(),hour:e=>e.getHours(),day:e=>e.getDay(),date:e=>e.getDate(),week:e=>Ba(e,"w"),month:e=>e.getMonth()+1,year:e=>e.getFullYear(),dateAdd:(e,r,t)=>(t==="days"&&e.setDate(e.getDate()+r),t==="months"&&e.setMonth(e.getMonth()+r),t==="years"&&e.setFullYear(e.getFullYear()+r),t==="quarters"&&e.setMonth(e.getMonth()+r*3),t==="weeks"&&e.setDate(e.getDate()+r*7),t==="hours"&&e.setHours(e.getHours()+r),t==="minutes"&&e.setMinutes(e.getMinutes()+r),t==="seconds"&&e.setSeconds(e.getSeconds()+r),e),dateSubtract:(e,r,t)=>(t==="day"&&e.setDate(e.getDate()-r),t==="month"&&e.setMonth(e.getMonth()-r),t==="year"&&e.setFullYear(e.getFullYear()-r),t==="quarter"&&e.setMonth(e.getMonth()-r*3),t==="week"&&e.setDate(e.getDate()-r*7),t==="hour"&&e.setHours(e.getHours()-r),t==="minute"&&e.setMinutes(e.getMinutes()-r),t==="second"&&e.setSeconds(e.getSeconds()-r),e),dateBetween:(e,r,t)=>{let s=Math.abs(r.getTime()-e.getTime());switch(t){case"days":return Math.round(s/864e5);case"months":return Math.round(s/2592e6);case"years":return Math.round(s/31536e6);case"hours":return Math.round(s/(60*60*1e3));case"minutes":return Math.round(s/(60*1e3));case"seconds":return Math.round(s/1e3);case"weeks":return Math.round(s/(864e5*7));case"quarters":return Math.round(s/(2592e6*3));default:return Math.round(s/864e5)}},style:(e,r)=>e,timeStamp:e=>e.getTime(),formatDate:KO,parseDate:e=>{if(e?.length>0)return new Date(e)??""}};var eB=(e,r,t,n)=>{if(!r)return"";let i=new Map;Object.keys(n).forEach(f=>i.set(f,n[f])),i.set("$properties",t),i.set("$paths",e);let a={...Tg,createAdd:T("add",[],()=>function(o,u){return o+u})},s=Hp(a);s.import(jO,{override:!0});let l;try{l=s.evaluate(r,i),l=Kl("",l)}catch(f){console.log(r,f)}return l};var rB=(e,r,t)=>({...r,...t.filter(n=>n.type=="fileprop"||n.name=="tags").reduce((n,i)=>{let{value:a}=Id(i.value,i.type);return{...n,[i.name]:eB(e,a,t.reduce((s,l)=>({...s,[l.name]:l}),{}),r)}},{})});var VV=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],sB=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],YV="\\u200C\\u200D\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0898-\\u089F\\u08CA-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EBC\\u0EC8-\\u0ECE\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u180F-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1ABF-\\u1ACE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\u30FB\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F\\uFF65",uB="\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC",Bg={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Ig="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",HV={5:Ig,"5module":Ig+" export import",6:Ig+" const class extends export import super"},GV=/^in(stanceof)?$/,$V=new RegExp("["+uB+"]"),ZV=new RegExp("["+uB+YV+"]");function kg(e,r){for(var t=65536,n=0;ne)return!1;if(t+=r[n+1],t>=e)return!0}return!1}function za(e,r){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&$V.test(String.fromCharCode(e)):r===!1?!1:kg(e,sB)}function gu(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&ZV.test(String.fromCharCode(e)):r===!1?!1:kg(e,sB)||kg(e,VV)}var tt=function(r,t){t===void 0&&(t={}),this.label=r,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function bi(e,r){return new tt(e,{beforeExpr:!0,binop:r})}var wi={beforeExpr:!0},zn={startsExpr:!0},qg={};function $r(e,r){return r===void 0&&(r={}),r.keyword=e,qg[e]=new tt(e,r)}var X={num:new tt("num",zn),regexp:new tt("regexp",zn),string:new tt("string",zn),name:new tt("name",zn),privateId:new tt("privateId",zn),eof:new tt("eof"),bracketL:new tt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new tt("]"),braceL:new tt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new tt("}"),parenL:new tt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new tt(")"),comma:new tt(",",wi),semi:new tt(";",wi),colon:new tt(":",wi),dot:new tt("."),question:new tt("?",wi),questionDot:new tt("?."),arrow:new tt("=>",wi),template:new tt("template"),invalidTemplate:new tt("invalidTemplate"),ellipsis:new tt("...",wi),backQuote:new tt("\`",zn),dollarBraceL:new tt("\${",{beforeExpr:!0,startsExpr:!0}),eq:new tt("=",{beforeExpr:!0,isAssign:!0}),assign:new tt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new tt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new tt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:bi("||",1),logicalAND:bi("&&",2),bitwiseOR:bi("|",3),bitwiseXOR:bi("^",4),bitwiseAND:bi("&",5),equality:bi("==/!=/===/!==",6),relational:bi("/<=/>=",7),bitShift:bi("<>/>>>",8),plusMin:new tt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:bi("%",10),star:bi("*",10),slash:bi("/",10),starstar:new tt("**",{beforeExpr:!0}),coalesce:bi("??",1),_break:$r("break"),_case:$r("case",wi),_catch:$r("catch"),_continue:$r("continue"),_debugger:$r("debugger"),_default:$r("default",wi),_do:$r("do",{isLoop:!0,beforeExpr:!0}),_else:$r("else",wi),_finally:$r("finally"),_for:$r("for",{isLoop:!0}),_function:$r("function",zn),_if:$r("if"),_return:$r("return",wi),_switch:$r("switch"),_throw:$r("throw",wi),_try:$r("try"),_var:$r("var"),_const:$r("const"),_while:$r("while",{isLoop:!0}),_with:$r("with"),_new:$r("new",{beforeExpr:!0,startsExpr:!0}),_this:$r("this",zn),_super:$r("super",zn),_class:$r("class",zn),_extends:$r("extends",wi),_export:$r("export"),_import:$r("import",zn),_null:$r("null",zn),_true:$r("true",zn),_false:$r("false",zn),_in:$r("in",{beforeExpr:!0,binop:7}),_instanceof:$r("instanceof",{beforeExpr:!0,binop:7}),_typeof:$r("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:$r("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:$r("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Ni=/\\r\\n?|\\n|\\u2028|\\u2029/,QV=new RegExp(Ni.source,"g");function xu(e){return e===10||e===13||e===8232||e===8233}function fB(e,r,t){t===void 0&&(t=e.length);for(var n=r;n>10)+55296,(e&1023)+56320))}var KV=/(?:[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/,Ff=function(r,t){this.line=r,this.column=t};Ff.prototype.offset=function(r){return new Ff(this.line,this.column+r)};var Xp=function(r,t,n){this.start=t,this.end=n,r.sourceFile!==null&&(this.source=r.sourceFile)};function pB(e,r){for(var t=1,n=0;;){var i=fB(e,n,r);if(i<0)return new Ff(t,r-n);++t,n=i}}var Rg={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},iB=!1;function jV(e){var r={};for(var t in Rg)r[t]=e&&Bf(e,t)?e[t]:Rg[t];if(r.ecmaVersion==="latest"?r.ecmaVersion=1e8:r.ecmaVersion==null?(!iB&&typeof console=="object"&&console.warn&&(iB=!0,console.warn(\`Since Acorn 8.0.0, options.ecmaVersion is required. +Defaulting to 2020, but this will stop working in the future.\`)),r.ecmaVersion=11):r.ecmaVersion>=2015&&(r.ecmaVersion-=2009),r.allowReserved==null&&(r.allowReserved=r.ecmaVersion<5),(!e||e.allowHashBang==null)&&(r.allowHashBang=r.ecmaVersion>=14),tB(r.onToken)){var n=r.onToken;r.onToken=function(i){return n.push(i)}}return tB(r.onComment)&&(r.onComment=eY(r,r.onComment)),r}function eY(e,r){return function(t,n,i,a,s,l){var f={type:t?"Block":"Line",value:n,start:i,end:a};e.locations&&(f.loc=new Xp(this,s,l)),e.ranges&&(f.range=[i,a]),r.push(f)}}var Of=1,yu=2,Ug=4,mB=8,hB=16,dB=32,zg=64,vB=128,If=256,Wg=Of|yu|If;function Vg(e,r){return yu|(e?Ug:0)|(r?mB:0)}var $p=0,Yg=1,Va=2,gB=3,xB=4,yB=5,Kt=function(r,t,n){this.options=r=jV(r),this.sourceFile=r.sourceFile,this.keywords=Ao(HV[r.ecmaVersion>=6?6:r.sourceType==="module"?"5module":5]);var i="";r.allowReserved!==!0&&(i=Bg[r.ecmaVersion>=6?6:r.ecmaVersion===5?5:3],r.sourceType==="module"&&(i+=" await")),this.reservedWords=Ao(i);var a=(i?i+" ":"")+Bg.strict;this.reservedWordsStrict=Ao(a),this.reservedWordsStrictBind=Ao(a+" "+Bg.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(\` +\`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Ni).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=X.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=r.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&r.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Of),this.regexpState=null,this.privateNameStack=[]},da={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};Kt.prototype.parse=function(){var r=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(r)};da.inFunction.get=function(){return(this.currentVarScope().flags&yu)>0};da.inGenerator.get=function(){return(this.currentVarScope().flags&mB)>0&&!this.currentVarScope().inClassFieldInit};da.inAsync.get=function(){return(this.currentVarScope().flags&Ug)>0&&!this.currentVarScope().inClassFieldInit};da.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var r=this.scopeStack[e];if(r.inClassFieldInit||r.flags&If)return!1;if(r.flags&yu)return(r.flags&Ug)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};da.allowSuper.get=function(){var e=this.currentThisScope(),r=e.flags,t=e.inClassFieldInit;return(r&zg)>0||t||this.options.allowSuperOutsideMethod};da.allowDirectSuper.get=function(){return(this.currentThisScope().flags&vB)>0};da.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};da.allowNewDotTarget.get=function(){var e=this.currentThisScope(),r=e.flags,t=e.inClassFieldInit;return(r&(yu|If))>0||t};da.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&If)>0};Kt.extend=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];for(var n=this,i=0;i=,?^&]/.test(i)||i==="!"&&this.input.charAt(n+1)==="=")}e+=r[0].length,Di.lastIndex=e,e+=Di.exec(this.input)[0].length,this.input[e]===";"&&e++}};Nn.eat=function(e){return this.type===e?(this.next(),!0):!1};Nn.isContextual=function(e){return this.type===X.name&&this.value===e&&!this.containsEsc};Nn.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};Nn.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};Nn.canInsertSemicolon=function(){return this.type===X.eof||this.type===X.braceR||Ni.test(this.input.slice(this.lastTokEnd,this.start))};Nn.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};Nn.semicolon=function(){!this.eat(X.semi)&&!this.insertSemicolon()&&this.unexpected()};Nn.afterTrailingComma=function(e,r){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),r||this.next(),!0};Nn.expect=function(e){this.eat(e)||this.unexpected()};Nn.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Jp=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Nn.checkPatternErrors=function(e,r){if(!!e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var t=r?e.parenthesizedAssign:e.parenthesizedBind;t>-1&&this.raiseRecoverable(t,r?"Assigning to rvalue":"Parenthesized pattern")}};Nn.checkExpressionErrors=function(e,r){if(!e)return!1;var t=e.shorthandAssign,n=e.doubleProto;if(!r)return t>=0||n>=0;t>=0&&this.raise(t,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")};Nn.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&n<56320)return!0;if(za(n,!0)){for(var i=t+1;gu(n=this.input.charCodeAt(i),!0);)++i;if(n===92||n>55295&&n<56320)return!0;var a=this.input.slice(t,i);if(!GV.test(a))return!0}return!1};hr.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Di.lastIndex=this.pos;var e=Di.exec(this.input),r=this.pos+e[0].length,t;return!Ni.test(this.input.slice(this.pos,r))&&this.input.slice(r,r+8)==="function"&&(r+8===this.input.length||!(gu(t=this.input.charCodeAt(r+8))||t>55295&&t<56320))};hr.parseStatement=function(e,r,t){var n=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(n=X._var,a="let"),n){case X._break:case X._continue:return this.parseBreakContinueStatement(i,n.keyword);case X._debugger:return this.parseDebuggerStatement(i);case X._do:return this.parseDoStatement(i);case X._for:return this.parseForStatement(i);case X._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case X._class:return e&&this.unexpected(),this.parseClass(i,!0);case X._if:return this.parseIfStatement(i);case X._return:return this.parseReturnStatement(i);case X._switch:return this.parseSwitchStatement(i);case X._throw:return this.parseThrowStatement(i);case X._try:return this.parseTryStatement(i);case X._const:case X._var:return a=a||this.value,e&&a!=="var"&&this.unexpected(),this.parseVarStatement(i,a);case X._while:return this.parseWhileStatement(i);case X._with:return this.parseWithStatement(i);case X.braceL:return this.parseBlock(!0,i);case X.semi:return this.parseEmptyStatement(i);case X._export:case X._import:if(this.options.ecmaVersion>10&&n===X._import){Di.lastIndex=this.pos;var s=Di.exec(this.input),l=this.pos+s[0].length,f=this.input.charCodeAt(l);if(f===40||f===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(r||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===X._import?this.parseImport(i):this.parseExport(i,t);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var o=this.value,u=this.parseExpression();return n===X.name&&u.type==="Identifier"&&this.eat(X.colon)?this.parseLabeledStatement(i,o,u,e):this.parseExpressionStatement(i,u)}};hr.parseBreakContinueStatement=function(e,r){var t=r==="break";this.next(),this.eat(X.semi)||this.insertSemicolon()?e.label=null:this.type!==X.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(X.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};hr.parseForStatement=function(e){this.next();var r=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Hg),this.enterScope(0),this.expect(X.parenL),this.type===X.semi)return r>-1&&this.unexpected(r),this.parseFor(e,null);var t=this.isLet();if(this.type===X._var||this.type===X._const||t){var n=this.startNode(),i=t?"let":this.value;return this.next(),this.parseVar(n,!0,i),this.finishNode(n,"VariableDeclaration"),(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&n.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===X._in?r>-1&&this.unexpected(r):e.await=r>-1),this.parseForIn(e,n)):(r>-1&&this.unexpected(r),this.parseFor(e,n))}var a=this.isContextual("let"),s=!1,l=new Jp,f=this.parseExpression(r>-1?"await":!0,l);return this.type===X._in||(s=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===X._in?r>-1&&this.unexpected(r):e.await=r>-1),a&&s&&this.raise(f.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(f,!1,l),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(l,!0),r>-1&&this.unexpected(r),this.parseFor(e,f))};hr.parseFunctionStatement=function(e,r,t){return this.next(),this.parseFunction(e,Tf|(t?0:Lg),!1,r)};hr.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(X._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};hr.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(X.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};hr.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(X.braceL),this.labels.push(tY),this.enterScope(0);for(var r,t=!1;this.type!==X.braceR;)if(this.type===X._case||this.type===X._default){var n=this.type===X._case;r&&this.finishNode(r,"SwitchCase"),e.cases.push(r=this.startNode()),r.consequent=[],this.next(),n?r.test=this.parseExpression():(t&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),t=!0,r.test=null),this.expect(X.colon)}else r||this.unexpected(),r.consequent.push(this.parseStatement(null));return this.exitScope(),r&&this.finishNode(r,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};hr.parseThrowStatement=function(e){return this.next(),Ni.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var nY=[];hr.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),r=e.type==="Identifier";return this.enterScope(r?dB:0),this.checkLValPattern(e,r?xB:Va),this.expect(X.parenR),e};hr.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===X._catch){var r=this.startNode();this.next(),this.eat(X.parenL)?r.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),r.param=null,this.enterScope(0)),r.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(r,"CatchClause")}return e.finalizer=this.eat(X._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};hr.parseVarStatement=function(e,r,t){return this.next(),this.parseVar(e,!1,r,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};hr.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Hg),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};hr.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};hr.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};hr.parseLabeledStatement=function(e,r,t,n){for(var i=0,a=this.labels;i=0;f--){var o=this.labels[f];if(o.statementStart===e.start)o.statementStart=this.start,o.kind=l;else break}return this.labels.push({name:r,kind:l,statementStart:this.start}),e.body=this.parseStatement(n?n.indexOf("label")===-1?n+"label":n:"label"),this.labels.pop(),e.label=t,this.finishNode(e,"LabeledStatement")};hr.parseExpressionStatement=function(e,r){return e.expression=r,this.semicolon(),this.finishNode(e,"ExpressionStatement")};hr.parseBlock=function(e,r,t){for(e===void 0&&(e=!0),r===void 0&&(r=this.startNode()),r.body=[],this.expect(X.braceL),e&&this.enterScope(0);this.type!==X.braceR;){var n=this.parseStatement(null);r.body.push(n)}return t&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(r,"BlockStatement")};hr.parseFor=function(e,r){return e.init=r,this.expect(X.semi),e.test=this.type===X.semi?null:this.parseExpression(),this.expect(X.semi),e.update=this.type===X.parenR?null:this.parseExpression(),this.expect(X.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};hr.parseForIn=function(e,r){var t=this.type===X._in;return this.next(),r.type==="VariableDeclaration"&&r.declarations[0].init!=null&&(!t||this.options.ecmaVersion<8||this.strict||r.kind!=="var"||r.declarations[0].id.type!=="Identifier")&&this.raise(r.start,(t?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=r,e.right=t?this.parseExpression():this.parseMaybeAssign(),this.expect(X.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,t?"ForInStatement":"ForOfStatement")};hr.parseVar=function(e,r,t,n){for(e.declarations=[],e.kind=t;;){var i=this.startNode();if(this.parseVarId(i,t),this.eat(X.eq)?i.init=this.parseMaybeAssign(r):!n&&t==="const"&&!(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!n&&i.id.type!=="Identifier"&&!(r&&(this.type===X._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):i.init=null,e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(X.comma))break}return e};hr.parseVarId=function(e,r){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,r==="var"?Yg:Va,!1)};var Tf=1,Lg=2,bB=4;hr.parseFunction=function(e,r,t,n,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===X.star&&r&Lg&&this.unexpected(),e.generator=this.eat(X.star)),this.options.ecmaVersion>=8&&(e.async=!!n),r&Tf&&(e.id=r&bB&&this.type!==X.name?null:this.parseIdent(),e.id&&!(r&Lg)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Yg:Va:gB));var a=this.yieldPos,s=this.awaitPos,l=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Vg(e.async,e.generator)),r&Tf||(e.id=this.type===X.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,t,!1,i),this.yieldPos=a,this.awaitPos=s,this.awaitIdentPos=l,this.finishNode(e,r&Tf?"FunctionDeclaration":"FunctionExpression")};hr.parseFunctionParams=function(e){this.expect(X.parenL),e.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};hr.parseClass=function(e,r){this.next();var t=this.strict;this.strict=!0,this.parseClassId(e,r),this.parseClassSuper(e);var n=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(X.braceL);this.type!==X.braceR;){var s=this.parseClassElement(e.superClass!==null);s&&(i.body.push(s),s.type==="MethodDefinition"&&s.kind==="constructor"?(a&&this.raiseRecoverable(s.start,"Duplicate constructor in the same class"),a=!0):s.key&&s.key.type==="PrivateIdentifier"&&iY(n,s)&&this.raiseRecoverable(s.key.start,"Identifier '#"+s.key.name+"' has already been declared"))}return this.strict=t,this.next(),e.body=this.finishNode(i,"ClassBody"),this.exitClassBody(),this.finishNode(e,r?"ClassDeclaration":"ClassExpression")};hr.parseClassElement=function(e){if(this.eat(X.semi))return null;var r=this.options.ecmaVersion,t=this.startNode(),n="",i=!1,a=!1,s="method",l=!1;if(this.eatContextual("static")){if(r>=13&&this.eat(X.braceL))return this.parseClassStaticBlock(t),t;this.isClassElementNameStart()||this.type===X.star?l=!0:n="static"}if(t.static=l,!n&&r>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===X.star)&&!this.canInsertSemicolon()?a=!0:n="async"),!n&&(r>=9||!a)&&this.eat(X.star)&&(i=!0),!n&&!a&&!i){var f=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?s=f:n=f)}if(n?(t.computed=!1,t.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),t.key.name=n,this.finishNode(t.key,"Identifier")):this.parseClassElementName(t),r<13||this.type===X.parenL||s!=="method"||i||a){var o=!t.static&&Zp(t,"constructor"),u=o&&e;o&&s!=="method"&&this.raise(t.key.start,"Constructor can't have get/set modifier"),t.kind=o?"constructor":s,this.parseClassMethod(t,i,a,u)}else this.parseClassField(t);return t};hr.isClassElementNameStart=function(){return this.type===X.name||this.type===X.privateId||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword};hr.parseClassElementName=function(e){this.type===X.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};hr.parseClassMethod=function(e,r,t,n){var i=e.key;e.kind==="constructor"?(r&&this.raise(i.start,"Constructor can't be a generator"),t&&this.raise(i.start,"Constructor can't be an async method")):e.static&&Zp(e,"prototype")&&this.raise(i.start,"Classes may not have a static property named prototype");var a=e.value=this.parseMethod(r,t,n);return e.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),e.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),e.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};hr.parseClassField=function(e){if(Zp(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Zp(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(X.eq)){var r=this.currentThisScope(),t=r.inClassFieldInit;r.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),r.inClassFieldInit=t}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};hr.parseClassStaticBlock=function(e){e.body=[];var r=this.labels;for(this.labels=[],this.enterScope(If|zg);this.type!==X.braceR;){var t=this.parseStatement(null);e.body.push(t)}return this.next(),this.exitScope(),this.labels=r,this.finishNode(e,"StaticBlock")};hr.parseClassId=function(e,r){this.type===X.name?(e.id=this.parseIdent(),r&&this.checkLValSimple(e.id,Va,!1)):(r===!0&&this.unexpected(),e.id=null)};hr.parseClassSuper=function(e){e.superClass=this.eat(X._extends)?this.parseExprSubscripts(null,!1):null};hr.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};hr.exitClassBody=function(){var e=this.privateNameStack.pop(),r=e.declared,t=e.used;if(!!this.options.checkPrivateFields)for(var n=this.privateNameStack.length,i=n===0?null:this.privateNameStack[n-1],a=0;a=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(r,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};hr.parseExport=function(e,r){if(this.next(),this.eat(X.star))return this.parseExportAllDeclaration(e,r);if(this.eat(X._default))return this.checkExport(r,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(r,e.declaration.declarations):this.checkExport(r,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(r),this.eatContextual("from"))this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var t=0,n=e.specifiers;t=13&&this.type===X.string){var e=this.parseLiteral(this.value);return KV.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};hr.adaptDirectivePrologue=function(e){for(var r=0;r=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var Ai=Kt.prototype;Ai.toAssignable=function(e,r,t){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",t&&this.checkPatternErrors(t,!0);for(var n=0,i=e.properties;n=8&&!l&&f.name==="async"&&!this.canInsertSemicolon()&&this.eat(X._function))return this.overrideContext(Nt.f_expr),this.parseFunction(this.startNodeAt(a,s),0,!1,!0,r);if(i&&!this.canInsertSemicolon()){if(this.eat(X.arrow))return this.parseArrowExpression(this.startNodeAt(a,s),[f],!1,r);if(this.options.ecmaVersion>=8&&f.name==="async"&&this.type===X.name&&!l&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return f=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(X.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,s),[f],!0,r)}return f;case X.regexp:var o=this.value;return n=this.parseLiteral(o.value),n.regex={pattern:o.pattern,flags:o.flags},n;case X.num:case X.string:return this.parseLiteral(this.value);case X._null:case X._true:case X._false:return n=this.startNode(),n.value=this.type===X._null?null:this.type===X._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case X.parenL:var u=this.start,p=this.parseParenAndDistinguishExpression(i,r);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),p;case X.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(X.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression");case X.braceL:return this.overrideContext(Nt.b_expr),this.parseObj(!1,e);case X._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case X._class:return this.parseClass(this.startNode(),!1);case X._new:return this.parseNew();case X.backQuote:return this.parseTemplate();case X._import:return this.options.ecmaVersion>=11?this.parseExprImport(t):this.unexpected();default:return this.parseExprAtomDefault()}};Mr.parseExprAtomDefault=function(){this.unexpected()};Mr.parseExprImport=function(e){var r=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===X.parenL&&!e)return this.parseDynamicImport(r);if(this.type===X.dot){var t=this.startNodeAt(r.start,r.loc&&r.loc.start);return t.name="import",r.meta=this.finishNode(t,"Identifier"),this.parseImportMeta(r)}else this.unexpected()};Mr.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(X.parenR)){var r=this.start;this.eat(X.comma)&&this.eat(X.parenR)?this.raiseRecoverable(r,"Trailing comma is not allowed in import()"):this.unexpected(r)}return this.finishNode(e,"ImportExpression")};Mr.parseImportMeta=function(e){this.next();var r=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),r&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};Mr.parseLiteral=function(e){var r=this.startNode();return r.value=e,r.raw=this.input.slice(this.start,this.end),r.raw.charCodeAt(r.raw.length-1)===110&&(r.bigint=r.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(r,"Literal")};Mr.parseParenExpression=function(){this.expect(X.parenL);var e=this.parseExpression();return this.expect(X.parenR),e};Mr.shouldParseArrow=function(e){return!this.canInsertSemicolon()};Mr.parseParenAndDistinguishExpression=function(e,r){var t=this.start,n=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s=this.start,l=this.startLoc,f=[],o=!0,u=!1,p=new Jp,h=this.yieldPos,d=this.awaitPos,x;for(this.yieldPos=0,this.awaitPos=0;this.type!==X.parenR;)if(o?o=!1:this.expect(X.comma),a&&this.afterTrailingComma(X.parenR,!0)){u=!0;break}else if(this.type===X.ellipsis){x=this.start,f.push(this.parseParenItem(this.parseRestBinding())),this.type===X.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else f.push(this.parseMaybeAssign(!1,p,this.parseParenItem));var v=this.lastTokEnd,y=this.lastTokEndLoc;if(this.expect(X.parenR),e&&this.shouldParseArrow(f)&&this.eat(X.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=h,this.awaitPos=d,this.parseParenArrowList(t,n,f,r);(!f.length||u)&&this.unexpected(this.lastTokStart),x&&this.unexpected(x),this.checkExpressionErrors(p,!0),this.yieldPos=h||this.yieldPos,this.awaitPos=d||this.awaitPos,f.length>1?(i=this.startNodeAt(s,l),i.expressions=f,this.finishNodeAt(i,"SequenceExpression",v,y)):i=f[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var w=this.startNodeAt(t,n);return w.expression=i,this.finishNode(w,"ParenthesizedExpression")}else return i};Mr.parseParenItem=function(e){return e};Mr.parseParenArrowList=function(e,r,t,n){return this.parseArrowExpression(this.startNodeAt(e,r),t,!1,n)};var aY=[];Mr.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===X.dot){var r=this.startNodeAt(e.start,e.loc&&e.loc.start);r.name="new",e.meta=this.finishNode(r,"Identifier"),this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),t&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var n=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,i,!0,!1),this.eat(X.parenL)?e.arguments=this.parseExprList(X.parenR,this.options.ecmaVersion>=8,!1):e.arguments=aY,this.finishNode(e,"NewExpression")};Mr.parseTemplateElement=function(e){var r=e.isTagged,t=this.startNode();return this.type===X.invalidTemplate?(r||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),t.value={raw:this.value,cooked:null}):t.value={raw:this.input.slice(this.start,this.end).replace(/\\r\\n?/g,\` +\`),cooked:this.value},this.next(),t.tail=this.type===X.backQuote,this.finishNode(t,"TemplateElement")};Mr.parseTemplate=function(e){e===void 0&&(e={});var r=e.isTagged;r===void 0&&(r=!1);var t=this.startNode();this.next(),t.expressions=[];var n=this.parseTemplateElement({isTagged:r});for(t.quasis=[n];!n.tail;)this.type===X.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(X.dollarBraceL),t.expressions.push(this.parseExpression()),this.expect(X.braceR),t.quasis.push(n=this.parseTemplateElement({isTagged:r}));return this.next(),this.finishNode(t,"TemplateLiteral")};Mr.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===X.name||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===X.star)&&!Ni.test(this.input.slice(this.lastTokEnd,this.start))};Mr.parseObj=function(e,r){var t=this.startNode(),n=!0,i={};for(t.properties=[],this.next();!this.eat(X.braceR);){if(n)n=!1;else if(this.expect(X.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(X.braceR))break;var a=this.parseProperty(e,r);e||this.checkPropClash(a,i,r),t.properties.push(a)}return this.finishNode(t,e?"ObjectPattern":"ObjectExpression")};Mr.parseProperty=function(e,r){var t=this.startNode(),n,i,a,s;if(this.options.ecmaVersion>=9&&this.eat(X.ellipsis))return e?(t.argument=this.parseIdent(!1),this.type===X.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(t,"RestElement")):(t.argument=this.parseMaybeAssign(!1,r),this.type===X.comma&&r&&r.trailingComma<0&&(r.trailingComma=this.start),this.finishNode(t,"SpreadElement"));this.options.ecmaVersion>=6&&(t.method=!1,t.shorthand=!1,(e||r)&&(a=this.start,s=this.startLoc),e||(n=this.eat(X.star)));var l=this.containsEsc;return this.parsePropertyName(t),!e&&!l&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(t)?(i=!0,n=this.options.ecmaVersion>=9&&this.eat(X.star),this.parsePropertyName(t)):i=!1,this.parsePropertyValue(t,e,n,i,a,s,r,l),this.finishNode(t,"Property")};Mr.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var r=e.kind==="get"?0:1;if(e.value.params.length!==r){var t=e.value.start;e.kind==="get"?this.raiseRecoverable(t,"getter should have no params"):this.raiseRecoverable(t,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};Mr.parsePropertyValue=function(e,r,t,n,i,a,s,l){(t||n)&&this.type===X.colon&&this.unexpected(),this.eat(X.colon)?(e.value=r?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,s),e.kind="init"):this.options.ecmaVersion>=6&&this.type===X.parenL?(r&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(t,n)):!r&&!l&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==X.comma&&this.type!==X.braceR&&this.type!==X.eq?((t||n)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((t||n)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=i),e.kind="init",r?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===X.eq&&s?(s.shorthandAssign<0&&(s.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};Mr.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(X.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(X.bracketR),e.key;e.computed=!1}return e.key=this.type===X.num||this.type===X.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Mr.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};Mr.parseMethod=function(e,r,t){var n=this.startNode(),i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Vg(r,n.generator)|zg|(t?vB:0)),this.expect(X.parenL),n.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(n,"FunctionExpression")};Mr.parseArrowExpression=function(e,r,t,n){var i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(Vg(t,!1)|hB),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(r,!0),this.parseFunctionBody(e,!0,!1,n),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")};Mr.parseFunctionBody=function(e,r,t,n){var i=r&&this.type!==X.braceL,a=this.strict,s=!1;if(i)e.body=this.parseMaybeAssign(n),e.expression=!0,this.checkParams(e,!1);else{var l=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||l)&&(s=this.strictDirective(this.end),s&&l&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var f=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!a&&!s&&!r&&!t&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,yB),e.body=this.parseBlock(!1,void 0,s&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=f}this.exitScope()};Mr.isSimpleParamList=function(e){for(var r=0,t=e;r-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Of&&delete this.undefinedExports[e]}else if(r===xB){var a=this.currentScope();a.lexical.push(e)}else if(r===gB){var s=this.currentScope();this.treatFunctionsAsVar?n=s.lexical.indexOf(e)>-1:n=s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var l=this.scopeStack.length-1;l>=0;--l){var f=this.scopeStack[l];if(f.lexical.indexOf(e)>-1&&!(f.flags&dB&&f.lexical[0]===e)||!this.treatFunctionsAsVarInScope(f)&&f.functions.indexOf(e)>-1){n=!0;break}if(f.var.push(e),this.inModule&&f.flags&Of&&delete this.undefinedExports[e],f.flags&Wg)break}n&&this.raiseRecoverable(t,"Identifier '"+e+"' has already been declared")};Co.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};Co.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Co.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&Wg)return r}};Co.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&Wg&&!(r.flags&hB))return r}};var Kp=function(r,t,n){this.type="",this.start=t,this.end=0,r.options.locations&&(this.loc=new Xp(r,n)),r.options.directSourceFile&&(this.sourceFile=r.options.directSourceFile),r.options.ranges&&(this.range=[t,0])},Pf=Kt.prototype;Pf.startNode=function(){return new Kp(this,this.start,this.startLoc)};Pf.startNodeAt=function(e,r){return new Kp(this,e,r)};function DB(e,r,t,n){return e.type=r,e.end=t,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=t),e}Pf.finishNode=function(e,r){return DB.call(this,e,r,this.lastTokEnd,this.lastTokEndLoc)};Pf.finishNodeAt=function(e,r,t,n){return DB.call(this,e,r,t,n)};Pf.copyNode=function(e){var r=new Kp(this,e.start,this.startLoc);for(var t in e)r[t]=e[t];return r};var SB="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",NB=SB+" Extended_Pictographic",AB=NB,EB=AB+" EBase EComp EMod EPres ExtPict",CB=EB,sY=CB,uY={9:SB,10:NB,11:AB,12:EB,13:CB,14:sY},fY="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",lY={9:"",10:"",11:"",12:"",13:"",14:fY},aB="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",MB="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",_B=MB+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",TB=_B+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",FB=TB+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",OB=FB+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",cY=OB+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",pY={9:MB,10:_B,11:TB,12:FB,13:OB,14:cY},BB={};function mY(e){var r=BB[e]={binary:Ao(uY[e]+" "+aB),binaryOfStrings:Ao(lY[e]),nonBinary:{General_Category:Ao(aB),Script:Ao(pY[e])}};r.nonBinary.Script_Extensions=r.nonBinary.Script,r.nonBinary.gc=r.nonBinary.General_Category,r.nonBinary.sc=r.nonBinary.Script,r.nonBinary.scx=r.nonBinary.Script_Extensions}for(Gp=0,Pg=[9,10,11,12,13,14];Gp=6?"uy":"")+(r.options.ecmaVersion>=9?"s":"")+(r.options.ecmaVersion>=13?"d":"")+(r.options.ecmaVersion>=15?"v":""),this.unicodeProperties=BB[r.options.ecmaVersion>=14?14:r.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};va.prototype.reset=function(r,t,n){var i=n.indexOf("v")!==-1,a=n.indexOf("u")!==-1;this.start=r|0,this.source=t+"",this.flags=n,i&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=a&&this.parser.options.ecmaVersion>=9)};va.prototype.raise=function(r){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+r)};va.prototype.at=function(r,t){t===void 0&&(t=!1);var n=this.source,i=n.length;if(r>=i)return-1;var a=n.charCodeAt(r);if(!(t||this.switchU)||a<=55295||a>=57344||r+1>=i)return a;var s=n.charCodeAt(r+1);return s>=56320&&s<=57343?(a<<10)+s-56613888:a};va.prototype.nextIndex=function(r,t){t===void 0&&(t=!1);var n=this.source,i=n.length;if(r>=i)return i;var a=n.charCodeAt(r),s;return!(t||this.switchU)||a<=55295||a>=57344||r+1>=i||(s=n.charCodeAt(r+1))<56320||s>57343?r+1:r+2};va.prototype.current=function(r){return r===void 0&&(r=!1),this.at(this.pos,r)};va.prototype.lookahead=function(r){return r===void 0&&(r=!1),this.at(this.nextIndex(this.pos,r),r)};va.prototype.advance=function(r){r===void 0&&(r=!1),this.pos=this.nextIndex(this.pos,r)};va.prototype.eat=function(r,t){return t===void 0&&(t=!1),this.current(t)===r?(this.advance(t),!0):!1};va.prototype.eatChars=function(r,t){t===void 0&&(t=!1);for(var n=this.pos,i=0,a=r;i-1&&this.raise(e.start,"Duplicate regular expression flag"),s==="u"&&(n=!0),s==="v"&&(i=!0)}this.options.ecmaVersion>=15&&n&&i&&this.raise(e.start,"Invalid regular expression flag")};ur.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};ur.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var r=0,t=e.backReferenceNames;r=9&&(t=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!t,!0}return e.pos=r,!1};ur.regexp_eatQuantifier=function(e,r){return r===void 0&&(r=!1),this.regexp_eatQuantifierPrefix(e,r)?(e.eat(63),!0):!1};ur.regexp_eatQuantifierPrefix=function(e,r){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,r)};ur.regexp_eatBracedQuantifier=function(e,r){var t=e.pos;if(e.eat(123)){var n=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};ur.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};ur.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};ur.regexp_eatSyntaxCharacter=function(e){var r=e.current();return IB(r)?(e.lastIntValue=r,e.advance(),!0):!1};function IB(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}ur.regexp_eatPatternCharacters=function(e){for(var r=e.pos,t=0;(t=e.current())!==-1&&!IB(t);)e.advance();return e.pos!==r};ur.regexp_eatExtendedPatternCharacter=function(e){var r=e.current();return r!==-1&&r!==36&&!(r>=40&&r<=43)&&r!==46&&r!==63&&r!==91&&r!==94&&r!==124?(e.advance(),!0):!1};ur.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};ur.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};ur.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Eo(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Eo(e.lastIntValue);return!0}return!1};ur.regexp_eatRegExpIdentifierStart=function(e){var r=e.pos,t=this.options.ecmaVersion>=11,n=e.current(t);return e.advance(t),n===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(n=e.lastIntValue),hY(n)?(e.lastIntValue=n,!0):(e.pos=r,!1)};function hY(e){return za(e,!0)||e===36||e===95}ur.regexp_eatRegExpIdentifierPart=function(e){var r=e.pos,t=this.options.ecmaVersion>=11,n=e.current(t);return e.advance(t),n===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(n=e.lastIntValue),dY(n)?(e.lastIntValue=n,!0):(e.pos=r,!1)};function dY(e){return gu(e,!0)||e===36||e===95||e===8204||e===8205}ur.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};ur.regexp_eatBackReference=function(e){var r=e.pos;if(this.regexp_eatDecimalEscape(e)){var t=e.lastIntValue;if(e.switchU)return t>e.maxBackReference&&(e.maxBackReference=t),!0;if(t<=e.numCapturingParens)return!0;e.pos=r}return!1};ur.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};ur.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};ur.regexp_eatCControlLetter=function(e){var r=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=r}return!1};ur.regexp_eatZero=function(e){return e.current()===48&&!jp(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};ur.regexp_eatControlEscape=function(e){var r=e.current();return r===116?(e.lastIntValue=9,e.advance(),!0):r===110?(e.lastIntValue=10,e.advance(),!0):r===118?(e.lastIntValue=11,e.advance(),!0):r===102?(e.lastIntValue=12,e.advance(),!0):r===114?(e.lastIntValue=13,e.advance(),!0):!1};ur.regexp_eatControlLetter=function(e){var r=e.current();return PB(r)?(e.lastIntValue=r%32,e.advance(),!0):!1};function PB(e){return e>=65&&e<=90||e>=97&&e<=122}ur.regexp_eatRegExpUnicodeEscapeSequence=function(e,r){r===void 0&&(r=!1);var t=e.pos,n=r||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(n&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=(i-55296)*1024+(s-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(n&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&vY(e.lastIntValue))return!0;n&&e.raise("Invalid unicode escape"),e.pos=t}return!1};function vY(e){return e>=0&&e<=1114111}ur.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var r=e.current();return r!==99&&(!e.switchN||r!==107)?(e.lastIntValue=r,e.advance(),!0):!1};ur.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var r=e.current();if(r>=49&&r<=57){do e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();while((r=e.current())>=48&&r<=57);return!0}return!1};var kB=0,Wa=1,Si=2;ur.regexp_eatCharacterClassEscape=function(e){var r=e.current();if(gY(r))return e.lastIntValue=-1,e.advance(),Wa;var t=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((t=r===80)||r===112)){e.lastIntValue=-1,e.advance();var n;if(e.eat(123)&&(n=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return t&&n===Si&&e.raise("Invalid property name"),n;e.raise("Invalid property name")}return kB};function gY(e){return e===100||e===68||e===115||e===83||e===119||e===87}ur.regexp_eatUnicodePropertyValueExpression=function(e){var r=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var t=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,t,n),Wa}}if(e.pos=r,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return kB};ur.regexp_validateUnicodePropertyNameAndValue=function(e,r,t){Bf(e.unicodeProperties.nonBinary,r)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[r].test(t)||e.raise("Invalid property value")};ur.regexp_validateUnicodePropertyNameOrValue=function(e,r){if(e.unicodeProperties.binary.test(r))return Wa;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(r))return Si;e.raise("Invalid property name")};ur.regexp_eatUnicodePropertyName=function(e){var r=0;for(e.lastStringValue="";RB(r=e.current());)e.lastStringValue+=Eo(r),e.advance();return e.lastStringValue!==""};function RB(e){return PB(e)||e===95}ur.regexp_eatUnicodePropertyValue=function(e){var r=0;for(e.lastStringValue="";xY(r=e.current());)e.lastStringValue+=Eo(r),e.advance();return e.lastStringValue!==""};function xY(e){return RB(e)||jp(e)}ur.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};ur.regexp_eatCharacterClass=function(e){if(e.eat(91)){var r=e.eat(94),t=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),r&&t===Si&&e.raise("Negated character class may contain strings"),!0}return!1};ur.regexp_classContents=function(e){return e.current()===93?Wa:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),Wa)};ur.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var r=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var t=e.lastIntValue;e.switchU&&(r===-1||t===-1)&&e.raise("Invalid character class"),r!==-1&&t!==-1&&r>t&&e.raise("Range out of order in character class")}}};ur.regexp_eatClassAtom=function(e){var r=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var t=e.current();(t===99||UB(t))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=r}var n=e.current();return n!==93?(e.lastIntValue=n,e.advance(),!0):!1};ur.regexp_eatClassEscape=function(e){var r=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=r}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};ur.regexp_classSetExpression=function(e){var r=Wa,t;if(!this.regexp_eatClassSetRange(e))if(t=this.regexp_eatClassSetOperand(e)){t===Si&&(r=Si);for(var n=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(t=this.regexp_eatClassSetOperand(e))){t!==Si&&(r=Wa);continue}e.raise("Invalid character in character class")}if(n!==e.pos)return r;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(n!==e.pos)return r}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(t=this.regexp_eatClassSetOperand(e),!t)return r;t===Si&&(r=Si)}};ur.regexp_eatClassSetRange=function(e){var r=e.pos;if(this.regexp_eatClassSetCharacter(e)){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;return t!==-1&&n!==-1&&t>n&&e.raise("Range out of order in character class"),!0}e.pos=r}return!1};ur.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?Wa:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};ur.regexp_eatNestedClass=function(e){var r=e.pos;if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);if(e.eat(93))return t&&n===Si&&e.raise("Negated character class may contain strings"),n;e.pos=r}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=r}return null};ur.regexp_eatClassStringDisjunction=function(e){var r=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var t=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return t}else e.raise("Invalid escape");e.pos=r}return null};ur.regexp_classStringDisjunctionContents=function(e){for(var r=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===Si&&(r=Si);return r};ur.regexp_classString=function(e){for(var r=0;this.regexp_eatClassSetCharacter(e);)r++;return r===1?Wa:Si};ur.regexp_eatClassSetCharacter=function(e){var r=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=r,!1);var t=e.current();return t<0||t===e.lookahead()&&yY(t)||bY(t)?!1:(e.advance(),e.lastIntValue=t,!0)};function yY(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function bY(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}ur.regexp_eatClassSetReservedPunctuator=function(e){var r=e.current();return wY(r)?(e.lastIntValue=r,e.advance(),!0):!1};function wY(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}ur.regexp_eatClassControlLetter=function(e){var r=e.current();return jp(r)||r===95?(e.lastIntValue=r%32,e.advance(),!0):!1};ur.regexp_eatHexEscapeSequence=function(e){var r=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=r}return!1};ur.regexp_eatDecimalDigits=function(e){var r=e.pos,t=0;for(e.lastIntValue=0;jp(t=e.current());)e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();return e.pos!==r};function jp(e){return e>=48&&e<=57}ur.regexp_eatHexDigits=function(e){var r=e.pos,t=0;for(e.lastIntValue=0;LB(t=e.current());)e.lastIntValue=16*e.lastIntValue+qB(t),e.advance();return e.pos!==r};function LB(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function qB(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}ur.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;r<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=r*64+t*8+e.lastIntValue:e.lastIntValue=r*8+t}else e.lastIntValue=r;return!0}return!1};ur.regexp_eatOctalDigit=function(e){var r=e.current();return UB(r)?(e.lastIntValue=r-48,e.advance(),!0):(e.lastIntValue=0,!1)};function UB(e){return e>=48&&e<=55}ur.regexp_eatFixedHexDigits=function(e,r){var t=e.pos;e.lastIntValue=0;for(var n=0;n=this.input.length)return this.finishToken(X.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};Yr.readToken=function(e){return za(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};Yr.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var r=this.input.charCodeAt(this.pos+1);return r<=56319||r>=57344?e:(e<<10)+r-56613888};Yr.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),r=this.pos,t=this.input.indexOf("*/",this.pos+=2);if(t===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=t+2,this.options.locations)for(var n=void 0,i=r;(n=fB(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=n;this.options.onComment&&this.options.onComment(!0,this.input.slice(r+2,t),r,this.pos,e,this.curPosition())};Yr.skipLineComment=function(e){for(var r=this.pos,t=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&lB.test(String.fromCharCode(e)))++this.pos;else break e}}};Yr.finishToken=function(e,r){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var t=this.type;this.type=e,this.value=r,this.updateContext(t)};Yr.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var r=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&r===46?(this.pos+=3,this.finishToken(X.ellipsis)):(++this.pos,this.finishToken(X.dot))};Yr.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(X.assign,2):this.finishOp(X.slash,1)};Yr.readToken_mult_modulo_exp=function(e){var r=this.input.charCodeAt(this.pos+1),t=1,n=e===42?X.star:X.modulo;return this.options.ecmaVersion>=7&&e===42&&r===42&&(++t,n=X.starstar,r=this.input.charCodeAt(this.pos+2)),r===61?this.finishOp(X.assign,t+1):this.finishOp(n,t)};Yr.readToken_pipe_amp=function(e){var r=this.input.charCodeAt(this.pos+1);if(r===e){if(this.options.ecmaVersion>=12){var t=this.input.charCodeAt(this.pos+2);if(t===61)return this.finishOp(X.assign,3)}return this.finishOp(e===124?X.logicalOR:X.logicalAND,2)}return r===61?this.finishOp(X.assign,2):this.finishOp(e===124?X.bitwiseOR:X.bitwiseAND,1)};Yr.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(X.assign,2):this.finishOp(X.bitwiseXOR,1)};Yr.readToken_plus_min=function(e){var r=this.input.charCodeAt(this.pos+1);return r===e?r===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Ni.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(X.incDec,2):r===61?this.finishOp(X.assign,2):this.finishOp(X.plusMin,1)};Yr.readToken_lt_gt=function(e){var r=this.input.charCodeAt(this.pos+1),t=1;return r===e?(t=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+t)===61?this.finishOp(X.assign,t+1):this.finishOp(X.bitShift,t)):r===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(r===61&&(t=2),this.finishOp(X.relational,t))};Yr.readToken_eq_excl=function(e){var r=this.input.charCodeAt(this.pos+1);return r===61?this.finishOp(X.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&r===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(X.arrow)):this.finishOp(e===61?X.eq:X.prefix,1)};Yr.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var r=this.input.charCodeAt(this.pos+1);if(r===46){var t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(X.questionDot,2)}if(r===63){if(e>=12){var n=this.input.charCodeAt(this.pos+2);if(n===61)return this.finishOp(X.assign,3)}return this.finishOp(X.coalesce,2)}}return this.finishOp(X.question,1)};Yr.readToken_numberSign=function(){var e=this.options.ecmaVersion,r=35;if(e>=13&&(++this.pos,r=this.fullCharCodeAtPos(),za(r,!0)||r===92))return this.finishToken(X.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Eo(r)+"'")};Yr.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(X.parenL);case 41:return++this.pos,this.finishToken(X.parenR);case 59:return++this.pos,this.finishToken(X.semi);case 44:return++this.pos,this.finishToken(X.comma);case 91:return++this.pos,this.finishToken(X.bracketL);case 93:return++this.pos,this.finishToken(X.bracketR);case 123:return++this.pos,this.finishToken(X.braceL);case 125:return++this.pos,this.finishToken(X.braceR);case 58:return++this.pos,this.finishToken(X.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(X.backQuote);case 48:var r=this.input.charCodeAt(this.pos+1);if(r===120||r===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(r===111||r===79)return this.readRadixNumber(8);if(r===98||r===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(X.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Eo(e)+"'")};Yr.finishOp=function(e,r){var t=this.input.slice(this.pos,this.pos+r);return this.pos+=r,this.finishToken(e,t)};Yr.readRegexp=function(){for(var e,r,t=this.pos;;){this.pos>=this.input.length&&this.raise(t,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(Ni.test(n)&&this.raise(t,"Unterminated regular expression"),e)e=!1;else{if(n==="[")r=!0;else if(n==="]"&&r)r=!1;else if(n==="/"&&!r)break;e=n==="\\\\"}++this.pos}var i=this.input.slice(t,this.pos);++this.pos;var a=this.pos,s=this.readWord1();this.containsEsc&&this.unexpected(a);var l=this.regexpState||(this.regexpState=new va(this));l.reset(t,i,s),this.validateRegExpFlags(l),this.validateRegExpPattern(l);var f=null;try{f=new RegExp(i,s)}catch{}return this.finishToken(X.regexp,{pattern:i,flags:s,value:f})};Yr.readInt=function(e,r,t){for(var n=this.options.ecmaVersion>=12&&r===void 0,i=t&&this.input.charCodeAt(this.pos)===48,a=this.pos,s=0,l=0,f=0,o=r??1/0;f=97?p=u-97+10:u>=65?p=u-65+10:u>=48&&u<=57?p=u-48:p=1/0,p>=e)break;l=u,s=s*e+p}return n&&l===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||r!=null&&this.pos-a!==r?null:s};function DY(e,r){return r?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function zB(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}Yr.readRadixNumber=function(e){var r=this.pos;this.pos+=2;var t=this.readInt(e);return t==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(t=zB(this.input.slice(r,this.pos)),++this.pos):za(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(X.num,t)};Yr.readNumber=function(e){var r=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(r,"Invalid number");var t=this.pos-r>=2&&this.input.charCodeAt(r)===48;t&&this.strict&&this.raise(r,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!t&&!e&&this.options.ecmaVersion>=11&&n===110){var i=zB(this.input.slice(r,this.pos));return++this.pos,za(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(X.num,i)}t&&/[89]/.test(this.input.slice(r,this.pos))&&(t=!1),n===46&&!t&&(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),(n===69||n===101)&&!t&&(n=this.input.charCodeAt(++this.pos),(n===43||n===45)&&++this.pos,this.readInt(10)===null&&this.raise(r,"Invalid number")),za(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=DY(this.input.slice(r,this.pos),t);return this.finishToken(X.num,a)};Yr.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),r;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;r=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,r>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else r=this.readHexChar(4);return r};Yr.readString=function(e){for(var r="",t=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;n===92?(r+=this.input.slice(t,this.pos),r+=this.readEscapedChar(!1),t=this.pos):n===8232||n===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(xu(n)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return r+=this.input.slice(t,this.pos++),this.finishToken(X.string,r)};var WB={};Yr.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===WB)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};Yr.invalidStringToken=function(e,r){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw WB;this.raise(e,r)};Yr.readTmplToken=function(){for(var e="",r=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var t=this.input.charCodeAt(this.pos);if(t===96||t===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===X.template||this.type===X.invalidTemplate)?t===36?(this.pos+=2,this.finishToken(X.dollarBraceL)):(++this.pos,this.finishToken(X.backQuote)):(e+=this.input.slice(r,this.pos),this.finishToken(X.template,e));if(t===92)e+=this.input.slice(r,this.pos),e+=this.readEscapedChar(!0),r=this.pos;else if(xu(t)){switch(e+=this.input.slice(r,this.pos),++this.pos,t){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=\` \`;break;default:e+=String.fromCharCode(t);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),r=this.pos}else++this.pos}};Yr.readInvalidTemplateToken=function(){for(;this.pos=48&&r<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,r=this.input.charCodeAt(this.pos),(n!=="0"||r===56||r===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return gu(r)?"":String.fromCharCode(r)}};Yr.readHexChar=function(e){var r=this.pos,t=this.readInt(16,e);return t===null&&this.invalidStringToken(r,"Bad character escape sequence"),t};Yr.readWord1=function(){this.containsEsc=!1;for(var e="",r=!0,t=this.pos,n=this.options.ecmaVersion>=6;this.pos{let r=/^["'](?:[^"\\\\]|\\\\.)*["'](?:;)?$/.test(e),t=e?.replace(/;+$/,""),n=!isNaN(parseFloat(t))&&!isNaN(t);return r||n||t=="false"||t=="true"||e==null||e==""};var Gg=(e,r)=>{let t=r?\`($event, $value, $state, $saveState, $api) => { \${e} }\`:e,n=typeof t=="string"||t instanceof String?t.includes(\` -\`):!1,i;try{i=n&&!r&&!t.startsWith("(")?new Function(\`with(this) { \${t} }\`):new Function(\`with(this) { return \${t}; }\`)}catch(a){console.log(a,e)}return i},$g=e=>{let r={...e,execActions:{},execProps:{},execStyles:{},execPropsOptions:[]},{sortedKeys:t,dependencies:n}=NY(r.node.props,\`\${r.id}.props\`);return r.execPropsOptions=t.map(i=>({name:i,isConst:VB(r.node.props[i]),deps:n.get(i)||[]})),r.execProps=em(r.node.props,i=>Gg(i,!1)),r.execStyles=em(r.node.styles,i=>Gg(i,!1)),r.execActions=em(r.node.actions,i=>Gg(i,!0)),r.children=r.children.map(i=>$g(i)),r.node.type=="list"&&(r.template=r.children),r};function SY(e){let r=[];function t(i,a=[]){if(i.type==="Identifier")return a.push(i.name),a;if(i.type==="MemberExpression"){let s=t(i.object,a);if(s&&i.computed)return i.property.type==="Literal"?(s.push(String(i.property.value)),s):null;if(s)return t(i.property,s)}else if(i.type==="Literal")return a.push(String(i.value)),a;return null}function n(i){if(i.type==="MemberExpression"){let a=t(i);a&&r.push(a);return}for(let a in i)typeof i[a]=="object"&&i[a]!==null&&n(i[a])}try{let i=jp(e.replace("return ",""),{ecmaVersion:2020});n(i)}catch{return[]}return r}function NY(e,r){let t=new Map,n=new Map,i=new Map;for(let o in e){let u=e[o],p=SY(u),h=p.filter(d=>d.slice(0,-1).join(".")===r);n.set(o,h),i.set(o,p),t.has(o)||t.set(o,new Set);for(let d of h){let x=d[d.length-1];x!==o&&t.get(o).add(x)}}let a=new Set,s=[],c=new Set,f=o=>{if(c.has(o))throw new Error("Circular dependency detected");if(!a.has(o)){c.add(o);let u=t.get(o)||new Set;for(let p of u)f(p);a.add(o),c.delete(o),s.push(o)}};for(let o in e)a.has(o)||f(o);return{sortedKeys:s,dependencies:i}}function YB(e,r,t,n,i){var a=[];t||(t=Qe),function s(c,f,o){var u=o||c.type,p=c!==a[a.length-1];p&&a.push(c),t[u](c,f,s),r[u]&&r[u](c,f||a,a),p&&a.pop()}(e,n,i)}function Zg(e,r,t){t(e,r)}function ss(e,r,t){}var Qe={};Qe.Program=Qe.BlockStatement=Qe.StaticBlock=function(e,r,t){for(var n=0,i=e.body;n":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},$i=17,EY={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:$i,ClassExpression:$i,FunctionExpression:$i,ObjectExpression:$i,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function bu(e,r){let{generator:t}=e;if(e.write("("),r!=null&&r.length>0){t[r[0].type](r[0],e);let{length:n}=r;for(let i=1;i=48&&r<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,r=this.input.charCodeAt(this.pos),(n!=="0"||r===56||r===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return xu(r)?"":String.fromCharCode(r)}};Yr.readHexChar=function(e){var r=this.pos,t=this.readInt(16,e);return t===null&&this.invalidStringToken(r,"Bad character escape sequence"),t};Yr.readWord1=function(){this.containsEsc=!1;for(var e="",r=!0,t=this.pos,n=this.options.ecmaVersion>=6;this.pos{let r=/^["'](?:[^"\\\\]|\\\\.)*["'](?:;)?$/.test(e),t=e?.replace(/;+$/,""),n=!isNaN(parseFloat(t))&&!isNaN(t);return r||n||t=="false"||t=="true"||e==null||e==""};var $g=(e,r)=>{let t=r?\`($event, $value, $state, $saveState, $api) => { \${e} }\`:e,n=typeof t=="string"||t instanceof String?t.includes(\` +\`):!1,i;try{i=n&&!r&&!t.startsWith("(")?new Function(\`with(this) { \${t} }\`):new Function(\`with(this) { return \${t}; }\`)}catch(a){console.log(a,e)}return i},Zg=e=>{let r={...e,execActions:{},execProps:{},execStyles:{},execPropsOptions:{}},{sortedKeys:t,dependencies:n}=HB(r.node.props,\`\${r.id}.props\`),{sortedKeys:i,dependencies:a}=HB(r.node.styles,\`\${r.id}.styles\`);r.execPropsOptions.props=t.map(l=>({name:l,isConst:YB(r.node.props[l]),deps:n.get(l)||[]})),r.execProps=rm(r.node.props,l=>$g(l,!1)),r.execStyles=rm(r.node.styles,l=>$g(l,!1)),r.execActions=rm(r.node.actions,l=>$g(l,!0)),r.children=r.children.map(l=>Zg(l)),r.execPropsOptions.children=[...r.children.flatMap(l=>l.execPropsOptions.children),...r.children.map(l=>l.id)];let s=[...r.children.flatMap(l=>l.execPropsOptions.deps),...r.execPropsOptions.props.flatMap(l=>l.deps),...[...a.values()].flat()];return r.execPropsOptions.deps=s.filter(l=>l[0]!=r.id),r.node.type=="list"&&(r.execPropsOptions.template=r.children),r};function AY(e){let r=[];function t(i,a=[]){if(i.type==="Identifier")return a.push(i.name),a;if(i.type==="MemberExpression"){let s=t(i.object,a);if(s&&i.computed)return i.property.type==="Literal"?(s.push(String(i.property.value)),s):null;if(s)return t(i.property,s)}else if(i.type==="Literal")return a.push(String(i.value)),a;return null}function n(i){if(i.type==="MemberExpression"){let a=t(i);a&&r.push(a);return}for(let a in i)typeof i[a]=="object"&&i[a]!==null&&n(i[a])}try{let i=em(e.replace("return ",""),{ecmaVersion:2020});n(i)}catch{return[]}return r}function HB(e,r){let t=new Map,n=new Map,i=new Map;for(let o in e){let u=e[o],p=AY(u),h=p.filter(d=>d.slice(0,-1).join(".")===r);n.set(o,h),i.set(o,p),t.has(o)||t.set(o,new Set);for(let d of h){let x=d[d.length-1];x!==o&&t.get(o).add(x)}}let a=new Set,s=[],l=new Set,f=o=>{if(l.has(o))throw new Error("Circular dependency detected");if(!a.has(o)){l.add(o);let u=t.get(o)||new Set;for(let p of u)f(p);a.add(o),l.delete(o),s.push(o)}};for(let o in e)a.has(o)||f(o);return{sortedKeys:s,dependencies:i}}function GB(e,r,t,n,i){var a=[];t||(t=Qe),function s(l,f,o){var u=o||l.type,p=l!==a[a.length-1];p&&a.push(l),t[u](l,f,s),r[u]&&r[u](l,f||a,a),p&&a.pop()}(e,n,i)}function Qg(e,r,t){t(e,r)}function us(e,r,t){}var Qe={};Qe.Program=Qe.BlockStatement=Qe.StaticBlock=function(e,r,t){for(var n=0,i=e.body;n":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},Zi=17,CY={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:Zi,ClassExpression:Zi,FunctionExpression:Zi,ObjectExpression:Zi,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function wu(e,r){let{generator:t}=e;if(e.write("("),r!=null&&r.length>0){t[r[0].type](r[0],e);let{length:n}=r;for(let i=1;i0){e.write(n);for(let s=1;s0){t.VariableDeclarator(n[0],e);for(let a=1;a0){r.write(n),i&&e.comments!=null&&An(r,e.comments,a,n);let{length:c}=s;for(let f=0;f0){for(;i0&&r.write(", ");let a=t[i],s=a.type[6];if(s==="D")r.write(a.local.name,a),i++;else if(s==="N")r.write("* as "+a.local.name,a),i++;else break}if(i0)for(let i=0;;){let a=t[i],{name:s}=a.local;if(r.write(s,a),s!==a.exported.name&&r.write(" as "+a.exported.name),++i "),e.body.type[0]==="O"?(r.write("("),this.ObjectExpression(e.body,r),r.write(")")):this[e.body.type](e.body,r)},ThisExpression(e,r){r.write("this",e)},Super(e,r){r.write("super",e)},RestElement:$B=function(e,r){r.write("..."),this[e.argument.type](e.argument,r)},SpreadElement:$B,YieldExpression(e,r){r.write(e.delegate?"yield*":"yield"),e.argument&&(r.write(" "),this[e.argument.type](e.argument,r))},AwaitExpression(e,r){r.write("await ",e),tm(r,e.argument,e)},TemplateLiteral(e,r){let{quasis:t,expressions:n}=e;r.write("\`");let{length:i}=n;for(let s=0;s0){let{elements:t}=e,{length:n}=t;for(let i=0;;){let a=t[i];if(a!=null&&this[a.type](a,r),++i0){r.write(n),i&&e.comments!=null&&An(r,e.comments,a,n);let s=","+n,{properties:c}=e,{length:f}=c;for(let o=0;;){let u=c[o];if(i&&u.comments!=null&&An(r,u.comments,a,n),r.write(a),this[u.type](u,r),++o0){let{properties:t}=e,{length:n}=t;for(let i=0;this[t[i].type](t[i],r),++i1||i[0]==="U"&&(i[1]==="n"||i[1]==="p")&&n.prefix&&n.operator[0]===t&&(t==="+"||t==="-"))&&r.write(" "),a?(r.write(t.length>1?" (":"("),this[i](n,r),r.write(")")):this[i](n,r)}else this[e.argument.type](e.argument,r),r.write(e.operator)},UpdateExpression(e,r){e.prefix?(r.write(e.operator),this[e.argument.type](e.argument,r)):(this[e.argument.type](e.argument,r),r.write(e.operator))},AssignmentExpression(e,r){this[e.left.type](e.left,r),r.write(" "+e.operator+" "),this[e.right.type](e.right,r)},AssignmentPattern(e,r){this[e.left.type](e.left,r),r.write(" = "),this[e.right.type](e.right,r)},BinaryExpression:ZB=function(e,r){let t=e.operator==="in";t&&r.write("("),tm(r,e.left,e,!1),r.write(" "+e.operator+" "),tm(r,e.right,e,!0),t&&r.write(")")},LogicalExpression:ZB,ConditionalExpression(e,r){let{test:t}=e,n=r.expressionsPrecedence[t.type];n===$i||n<=r.expressionsPrecedence.ConditionalExpression?(r.write("("),this[t.type](t,r),r.write(")")):this[t.type](t,r),r.write(" ? "),this[e.consequent.type](e.consequent,r),r.write(" : "),this[e.alternate.type](e.alternate,r)},NewExpression(e,r){r.write("new ");let t=r.expressionsPrecedence[e.callee.type];t===$i||t0){t.VariableDeclarator(n[0],e);for(let a=1;a0){r.write(n),i&&e.comments!=null&&An(r,e.comments,a,n);let{length:l}=s;for(let f=0;f0){for(;i0&&r.write(", ");let a=t[i],s=a.type[6];if(s==="D")r.write(a.local.name,a),i++;else if(s==="N")r.write("* as "+a.local.name,a),i++;else break}if(i0)for(let i=0;;){let a=t[i],{name:s}=a.local;if(r.write(s,a),s!==a.exported.name&&r.write(" as "+a.exported.name),++i "),e.body.type[0]==="O"?(r.write("("),this.ObjectExpression(e.body,r),r.write(")")):this[e.body.type](e.body,r)},ThisExpression(e,r){r.write("this",e)},Super(e,r){r.write("super",e)},RestElement:QB=function(e,r){r.write("..."),this[e.argument.type](e.argument,r)},SpreadElement:QB,YieldExpression(e,r){r.write(e.delegate?"yield*":"yield"),e.argument&&(r.write(" "),this[e.argument.type](e.argument,r))},AwaitExpression(e,r){r.write("await ",e),nm(r,e.argument,e)},TemplateLiteral(e,r){let{quasis:t,expressions:n}=e;r.write("\`");let{length:i}=n;for(let s=0;s0){let{elements:t}=e,{length:n}=t;for(let i=0;;){let a=t[i];if(a!=null&&this[a.type](a,r),++i0){r.write(n),i&&e.comments!=null&&An(r,e.comments,a,n);let s=","+n,{properties:l}=e,{length:f}=l;for(let o=0;;){let u=l[o];if(i&&u.comments!=null&&An(r,u.comments,a,n),r.write(a),this[u.type](u,r),++o0){let{properties:t}=e,{length:n}=t;for(let i=0;this[t[i].type](t[i],r),++i1||i[0]==="U"&&(i[1]==="n"||i[1]==="p")&&n.prefix&&n.operator[0]===t&&(t==="+"||t==="-"))&&r.write(" "),a?(r.write(t.length>1?" (":"("),this[i](n,r),r.write(")")):this[i](n,r)}else this[e.argument.type](e.argument,r),r.write(e.operator)},UpdateExpression(e,r){e.prefix?(r.write(e.operator),this[e.argument.type](e.argument,r)):(this[e.argument.type](e.argument,r),r.write(e.operator))},AssignmentExpression(e,r){this[e.left.type](e.left,r),r.write(" "+e.operator+" "),this[e.right.type](e.right,r)},AssignmentPattern(e,r){this[e.left.type](e.left,r),r.write(" = "),this[e.right.type](e.right,r)},BinaryExpression:XB=function(e,r){let t=e.operator==="in";t&&r.write("("),nm(r,e.left,e,!1),r.write(" "+e.operator+" "),nm(r,e.right,e,!0),t&&r.write(")")},LogicalExpression:XB,ConditionalExpression(e,r){let{test:t}=e,n=r.expressionsPrecedence[t.type];n===Zi||n<=r.expressionsPrecedence.ConditionalExpression?(r.write("("),this[t.type](t,r),r.write(")")):this[t.type](t,r),r.write(" ? "),this[e.consequent.type](e.consequent,r),r.write(" : "),this[e.alternate.type](e.alternate,r)},NewExpression(e,r){r.write("new ");let t=r.expressionsPrecedence[e.callee.type];t===Zi||t0&&(this.lineEndSize>0&&(i.length===1?r[n-1]===i:r.endsWith(i))?(this.line+=this.lineEndSize,this.column=0):this.column+=n)}toString(){return this.output}};function KB(e,r){let t=new Xg(r);return t.generator[e.type](e,t),t.output}var Jg=(e,r,t)=>{let n,i=gx(e),a=i.includes(\` -\`),s=!1;if(a){let c=i.split(\` -\`).filter(f=>f.trim()!=="");c[c.length-1].includes("return")&&(s=!0),c[c.length-1]=\`\${c[c.length-1].replace("return ","")}\`,i=c.join(\` -\`)}try{let c=jp(i,{ecmaVersion:2020,locations:!0});YB(c,{Identifier(f,o){let u=o[o.length-2];(u.type!=="MemberExpression"||u.object===f)&&f.name==r&&(f.name=t)},Property(f){f.key.type==="Identifier"&&f.key.name===r&&(f.key.name=t)},ObjectExpression(f){f.properties.forEach(o=>{o.key.type==="Identifier"&&o.key.name===r&&(o.key.name=t)})}}),n=KB(c).trimEnd()}catch(c){console.log(c,e,name),n='"error"'}if(a&&s){let c=n.split(\` -\`).filter(f=>f.trim()!=="");c[c.length-1]=\`return \${c[c.length-1]}\`,n=c.join(\` -\`)}return n};var jB=(e,r)=>{let t=(i,a,s)=>{let c,f=s.node;return s.children&&(c=s.children.map(o=>t(i,a,o))),{...s,children:c,node:{...s.node,parentId:f.parentId==i?a:f.parentId,props:Object.keys(f?.props??{}).reduce((o,u)=>({...o,[u]:Jg(f.props[u],i,a)}),f.props),actions:Object.keys(f?.actions??{}).reduce((o,u)=>({...o,[u]:Jg(f.actions[u],i,a)}),f.actions),styles:Object.keys(f?.styles??{}).reduce((o,u)=>({...o,[u]:Jg(f.styles[u],i,a)}),f.styles)}}};return((i,a,s)=>{let c=(f,o,u)=>{let p=o.node.parentId?o.id+u:f.id,h={...o,node:{...o.node,id:p},id:p};if(h=t(o.id,p,h),h.children){let[d,x]=h.children.reduce((v,y,w)=>{let[C,b]=c(h,y,u+w+1);return v[0].push(C),[v[0],b]},[[],u]);h.children=d,u=x}return[h,u+1]};return c(i,a,s)})(e,e,r)};var Kg=async(e,r,t)=>{let n=e,i=await FY(n,r,t.contexts,t.api);if(n.node.type=="list"){let a=0;n.children=ud(i.state[n.id].props.value).flatMap((s,c)=>n.template.map(f=>{let[o,u]=jB({...f,node:{...f.node,props:{...f.node.props,value:\`\${n.id}.props.value[\${c}]\`}}},a);return a=u,$g(o)}))}typeof i.state[n.id]?.actions?.onRun=="function"&&i.state[n.id].actions?.onRun(null,null,i,a=>{t.saveState(a,{state:i.state,slides:i.slides,root:t.root,id:t.runID})},t.api),n.children=[...n.children.filter(a=>a.node.type=="slides"),...n.children.filter(a=>a.node.type!="slides")];for(let a=0;a[{state:f.state,newState:f.newState,slides:f.slides},f.root]);if(i=s,n.children[a]=c,c.node.type=="slides"){let f=s.state[c.id].props.value,o=s.state[c.node.parentId]?.props[f],u;t.selectedSlide&&(u=c.children.find(p=>p.id==t.selectedSlide)),o!==null&&!u&&(u=c.children.find(p=>s.state[p.id].props.value==o)),u&&u.children.forEach(p=>{i.slides[p.node.ref]||(i.slides[p.node.ref]={props:{},styles:{},actions:{}}),i.slides[p.node.ref].props={...i.slides[p.node.ref].props,...i.state[p.node.id].props},i.slides[p.node.ref].styles={...i.slides[p.node.ref].styles,...i.state[p.node.id].styles},i.slides[p.node.ref].actions={...i.slides[p.node.ref].actions,...i.state[p.node.id].actions}})}}return i.slides[n.id]&&(i.state[n.id].props={...i.state[n.id].props,...i.slides[n.id]?.props??{}},i.state[n.id].styles={...i.state[n.id].styles,...i.slides[n.id]?.styles??{}},i.state[n.id].actions={...i.state[n.id].actions,...i.slides[n.id]?.actions??{}},delete i.slides[n.id]),{id:t.runID,root:n,state:i.state,slides:i.slides,newState:i.newState}},FY=async(e,r,t,n)=>{let i=await OY(e,r,t,n),a=eI(e.node,"styles",e.execStyles,i);return eI(e.node,"actions",e.execActions,a)};var OY=async(e,r,t,n)=>{let{id:i}=e.node,a=e.execProps??{},s=r.state;s[i]={props:r.state[i]?.props??{},actions:r.state[i]?.actions??{},styles:r.state[i]?.styles??{}},s.$contexts=t,s.$api=n;for(let{name:c,isConst:f}of e.execPropsOptions)try{let o;c in(r.newState?.[i]?.props||{})&&f?o=r.newState[i].props[c]:o=a[c]?.call(s),o!==null?(s[i].props[c]=o,r.state[i].props[c]=o,r.newState&&(r.newState[i]=r.newState[i]??{props:{},styles:{},actions:{}},r.newState[i].props[c]=o)):(delete s[i].props[c],delete r.state[i].props[c],r.newState?.[i]&&delete r.newState[i].props[c])}catch(o){console.log(c,o,a[c])}return r};function eI(e,r,t,n){for(let i of Object.keys(t))try{let a=t[i].call(n.state);a?n.state[e.id][r][i]=a:delete n.state[e.id][r][i]}catch(a){console.log(a)}return n}function rI(e){return e.table.rows.map(r=>eB(e.paths,r,e.table.cols))}function tI(e){let{queries:r,pathsIndex:t,count:n}=e,i=[];for(let[a,s]of t)!s.hidden&&_d(r,s)&&i.push(s);return i.slice(0,n)}function nI(e){let{root:r,store:t,context:n}=e;return Kg(r,t,n)}var BY=self;BY.onmessage=async e=>{let{payload:r,job:t}=e.data,n;t.type=="search"?n=tI(r):t.type=="table"?n=rI(r):t.type=="instance"&&(n=nI(r));try{postMessage({job:t,result:n})}catch(i){console.log(i),postMessage({job:t,result:{$error:\`Failed to run \${t.type} \${t.path}: \${i}\`}})}}; +\`).length-1,this.mapping={original:null,generated:this,name:void 0,source:t.sourceMap.file||t.sourceMap._file})}write(r){this.output+=r}writeToStream(r){this.output.write(r)}writeAndMap(r,t){this.output+=r,this.map(r,t)}writeToStreamAndMap(r,t){this.output.write(r),this.map(r,t)}map(r,t){if(t!=null){let{type:a}=t;if(a[0]==="L"&&a[2]==="n"){this.column=0,this.line++;return}if(t.loc!=null){let{mapping:s}=this;s.original=t.loc.start,s.name=t.name,this.sourceMap.addMapping(s)}if(a[0]==="T"&&a[8]==="E"||a[0]==="L"&&a[1]==="i"&&typeof t.value=="string"){let{length:s}=r,{column:l,line:f}=this;for(let o=0;o0&&(this.lineEndSize>0&&(i.length===1?r[n-1]===i:r.endsWith(i))?(this.line+=this.lineEndSize,this.column=0):this.column+=n)}toString(){return this.output}};function eI(e,r){let t=new Jg(r);return t.generator[e.type](e,t),t.output}var Kg=(e,r,t)=>{let n,i=xx(e),a=i.includes(\` +\`),s=!1;if(a){let l=i.split(\` +\`).filter(f=>f.trim()!=="");l[l.length-1].includes("return")&&(s=!0),l[l.length-1]=\`\${l[l.length-1].replace("return ","")}\`,i=l.join(\` +\`)}try{let l=em(i,{ecmaVersion:2020,locations:!0});GB(l,{Identifier(f,o){let u=o[o.length-2];(u.type!=="MemberExpression"||u.object===f)&&f.name==r&&(f.name=t)},Property(f){f.key.type==="Identifier"&&f.key.name===r&&(f.key.name=t)},ObjectExpression(f){f.properties.forEach(o=>{o.key.type==="Identifier"&&o.key.name===r&&(o.key.name=t)})}}),n=eI(l).trimEnd()}catch(l){console.log(l,e,name),n='"error"'}if(a&&s){let l=n.split(\` +\`).filter(f=>f.trim()!=="");l[l.length-1]=\`return \${l[l.length-1]}\`,n=l.join(\` +\`)}return n};var rI=(e,r)=>{let t=(i,a,s)=>{let l,f=s.node;return s.children&&(l=s.children.map(o=>t(i,a,o))),{...s,children:l,node:{...s.node,parentId:f.parentId==i?a:f.parentId,props:Object.keys(f?.props??{}).reduce((o,u)=>({...o,[u]:Kg(f.props[u],i,a)}),f.props),actions:Object.keys(f?.actions??{}).reduce((o,u)=>({...o,[u]:Kg(f.actions[u],i,a)}),f.actions),styles:Object.keys(f?.styles??{}).reduce((o,u)=>({...o,[u]:Kg(f.styles[u],i,a)}),f.styles)}}};return((i,a,s)=>{let l=(f,o,u)=>{let p=o.node.parentId?o.id+u:f.id,h={...o,node:{...o.node,id:p},id:p};if(h=t(o.id,p,h),h.children){let[d,x]=h.children.reduce((v,y,w)=>{let[C,b]=l(h,y,u+w+1);return v[0].push(C),[v[0],b]},[[],u]);h.children=d,u=x}return[h,u+1]};return l(i,a,s)})(e,e,r)};var jg=async(e,r,t)=>{let n=e;if(r.prevState[n.id]&&n.node.type!="content"){let a=!1;if(n.node.type=="slides"||n.node.type=="slide"||n.node.type=="delta")a=!1;else{let s=(n.execPropsOptions.children??[]).some(u=>Object.keys(r.newState).includes(u)),l=Object.keys(r.newState[n.id]?.props??{}).every(u=>r.newState[n.id]?.props[u]==r.prevState[n.id]?.props[u]),f=Object.keys(r.newState[n.id]?.styles??{}).every(u=>r.newState[n.id]?.styles[u]==r.prevState[n.id]?.styles[u]),o=n.execPropsOptions.deps.every(u=>u[0]=="$api"||r.newState[u[0]]?.[u[1]]?.[u[2]]===void 0?!0:r.newState[u[0]]?.[u[1]]?.[u[2]]===r.prevState[u[0]]?.[u[1]]?.[u[2]]);l&&f&&o&&!s&&(a=!0)}if(a)return{id:t.runID,root:t.root,exec:n,state:r.state,slides:r.slides,newState:r.newState,prevState:r.prevState}}let i=await OY(n,r,t.contexts,t.api);if(n.node.type=="list"){let a=0;n.children=fd(i.state[n.id].props.value).flatMap((s,l)=>n.execPropsOptions.template.map(f=>{let[o,u]=rI({...f,node:{...f.node,props:{...f.node.props,value:\`\${n.id}.props.value[\${l}]\`}}},a);return a=u,Zg(o)}))}typeof i.state[n.id]?.actions?.onRun=="function"&&i.state[n.id].actions?.onRun(null,null,i,a=>{t.saveState(a,{state:i.state,slides:i.slides,root:t.root,exec:t.exec,id:t.runID})},t.api),n.children=[...n.children.filter(a=>a.node.type=="slides"),...n.children.filter(a=>a.node.type!="slides")];for(let a=0;a[{state:f.state,newState:f.newState,slides:f.slides,prevState:f.prevState},f.exec]);if(i=s,n.children[a]=l,l.node.type=="slides"){let f=s.state[l.id].props.value,o=s.state[l.node.parentId]?.props[f],u;t.selectedSlide&&(u=l.children.find(p=>p.id==t.selectedSlide)),o!==null&&!u&&(u=l.children.find(p=>s.state[p.id].props.value==o)),u&&u.children.forEach(p=>{i.newState[p.node.ref]||(i.newState[p.node.ref]={props:{},styles:{},actions:{}}),p.node.ref==n.id?(i.state[p.node.ref].props={...i.state[p.node.ref].props,...i.state[p.node.id].props},i.state[p.node.ref].styles={...i.state[p.node.ref].styles,...i.state[p.node.id].styles},i.state[p.node.ref].actions={...i.state[p.node.ref].actions,...i.state[p.node.id].actions}):(i.newState[p.node.ref].props={...i.newState[p.node.ref].props,...i.state[p.node.id].props},i.newState[p.node.ref].styles={...i.newState[p.node.ref].styles,...i.state[p.node.id].styles},i.newState[p.node.ref].actions={...i.newState[p.node.ref].actions,...i.state[p.node.id].actions})})}}return{id:t.runID,root:t.root,exec:n,state:i.state,slides:i.slides,newState:i.newState,prevState:i.prevState}},OY=async(e,r,t,n)=>{let i=await BY(e,r,t,n),a=tI(e.node,"styles",e.execStyles,i);return tI(e.node,"actions",e.execActions,a)};var BY=async(e,r,t,n)=>{let{id:i}=e.node,a=e.execProps??{},s=r.state;s[i]={props:r.state[i]?.props??{},actions:r.state[i]?.actions??{},styles:r.state[i]?.styles??{}},s.$contexts=t,s.$api=n;for(let{name:l,isConst:f}of e.execPropsOptions.props)try{let o;l in(r.newState?.[i]?.props||{})&&f?o=r.newState[i].props[l]:o=a[l]?.call(s),o!==null?(s[i].props[l]=o,r.state[i].props[l]=o,r.newState&&(r.newState[i]=r.newState[i]??{props:{},styles:{},actions:{}},r.newState[i].props[l]=o)):(delete s[i].props[l],delete r.state[i].props[l],r.newState?.[i]&&delete r.newState[i].props[l])}catch(o){console.log(l,o,a[l])}return r};function tI(e,r,t,n){let{id:i}=e;for(let a of Object.keys(t)){let s;try{a in(n.newState?.[i]?.[r]||{})?s=n.newState[i][r][a]:s=t[a]?.call(n.state),s!==null?n.state[e.id][r][a]=s:delete n.state[e.id][r][a]}catch(l){console.log(l,a)}}return n}function nI(e){return e.table.rows.map(r=>rB(e.paths,r,e.table.cols))}function iI(e){let{queries:r,pathsIndex:t,count:n}=e,i=[];for(let[a,s]of t)!s.hidden&&Td(r,s)&&i.push(s);return i.slice(0,n)}function aI(e){let{root:r,store:t,context:n}=e;return jg(r,t,n)}var IY=self;IY.onmessage=async e=>{let{payload:r,job:t}=e.data,n;t.type=="search"?n=iI(r):t.type=="table"?n=nI(r):t.type=="instance"&&(n=aI(r));try{postMessage({job:t,result:n})}catch(i){console.log(i),postMessage({job:t,result:{$error:\`Failed to run \${t.type} \${t.path}: \${i}\`}})}}; /*! * decimal.js v10.4.3 * An arbitrary-precision Decimal type for JavaScript. @@ -88446,6 +88674,7 @@ var Superstate = class { progressNode, callout, toggleNode, + eventItem, circularProgressNode, previewNode, linkNode, @@ -88495,6 +88724,7 @@ var Superstate = class { this.linksMap = new IndexMap(); this.tagsMap = new IndexMap(); this.iconsCache = /* @__PURE__ */ new Map(); + this.imagesCache = /* @__PURE__ */ new Map(); this.contextStateQueue = Promise.resolve(); this.vaultDBCache = []; this.indexer = new Indexer(2, this); @@ -88931,14 +89161,16 @@ var Superstate = class { return false; } this.contextsIndex.set(space2.path, cache2); - const contextPaths = cache2.tables?.[defaultContextSchemaID]?.rows.map((f2) => f2[PathPropertyName]) ?? []; - const missingPaths = cache2.paths.filter((f2) => !contextPaths.includes(f2)); - const removedPaths = contextPaths.filter((f2) => !cache2.paths.includes(f2)); - if (missingPaths.length > 0) { - this.addToContextStateQueue(() => insertContextItems(this.spaceManager, missingPaths, space2.path)); - } - if (removedPaths.length > 0) { - this.addToContextStateQueue(() => removePathsInContext(this.spaceManager, removedPaths, space2)); + if (cache2.dbExists) { + const contextPaths = cache2.tables?.[defaultContextSchemaID]?.rows.map((f2) => f2[PathPropertyName]) ?? []; + const missingPaths = cache2.paths.filter((f2) => !contextPaths.includes(f2)); + const removedPaths = contextPaths.filter((f2) => !cache2.paths.includes(f2)); + if (missingPaths.length > 0) { + this.addToContextStateQueue(() => insertContextItems(this.spaceManager, missingPaths, space2.path)); + } + if (removedPaths.length > 0) { + this.addToContextStateQueue(() => removePathsInContext(this.spaceManager, removedPaths, space2)); + } } this.persister.store(space2.path, JSON.stringify(cache2), "context"); this.dispatchEvent("contextStateUpdated", { path: space2.path }); @@ -88994,12 +89226,14 @@ var Superstate = class { const parentTags = getAllParentTags(space2.name); contexts.push(...parentTags); } + const templates = await this.spaceManager.readTemplates(space2.path); const cache2 = { name: space2.name, space: space2, path: space2.path, defPath: space2.defPath, type, + templates, contexts: contexts.map((f2) => ensureTag(f2)), metadata, sortable @@ -89019,6 +89253,9 @@ var Superstate = class { async pathReloaded(path, cache2, changed, force) { this.pathsIndex.set(path, cache2); await this.onPathReloaded(path); + if (cache2.subtype == "image" || cache2.metadata?.file?.extension == "svg") { + this.imagesCache.set(cache2.metadata.file.filename, path); + } if (!changed && !force) { return false; } @@ -89210,8 +89447,8 @@ var FilesystemMiddleware = class { async getRoot() { return this.adapterForPath().getRoot(); } - async copyFile(folder, path) { - return this.adapterForPath(path).copyFile(folder, path); + async copyFile(path, folder) { + return this.adapterForPath(path).copyFile(path, folder); } async writeTextToFile(path, content3) { return this.adapterForPath(path).writeTextToFile(path, content3); @@ -89300,6 +89537,15 @@ var FilesystemSpaceAdapter = class { initiateAdapter(manager) { this.spaceManager = manager; } + async readTemplates(path) { + return (await this.childrenForPath(`${path}/.space/templates`)).filter((f2) => !f2.startsWith(".")).map((f2) => f2.split("/").pop()); + } + async saveTemplate(path, space2) { + return this.copyPath(path, `${space2}/.space/templates`); + } + deleteTemplate(path, space2) { + return this.deletePath(`${space2}/.space/templates/${path}`); + } async readWaypoints() { if (!await this.fileSystem.fileExists(defaultSpaceFolder)) { await this.fileSystem.createFolder(defaultSpaceFolder); @@ -89521,6 +89767,13 @@ var FilesystemSpaceAdapter = class { } return this.fileSystem.readFileFragments(mdbFile, "mdbTable", schema); } + async spaceInitiated(path) { + const spaceInfo = this.spaceInfoForPath(path); + const mdbFile = await this.fileSystem.getFile(spaceInfo.dbPath); + if (mdbFile) + return true; + return false; + } async tablesForSpace(path) { const spaceInfo = this.spaceInfoForPath(path); const mdbFile = await this.fileSystem.getFile(spaceInfo.dbPath); @@ -91318,6 +91571,7 @@ var SelectMenuSuggestionsComponent = (props) => { __html: markIt(props.item.name, props.query) } }), props.item.description && /* @__PURE__ */ import_react15.default.createElement("span", { + "aria-label": props.item.description, className: "mk-menu-options-description", dangerouslySetInnerHTML: { __html: markIt(props.item.description, props.query) @@ -91327,17 +91581,17 @@ var SelectMenuSuggestionsComponent = (props) => { dangerouslySetInnerHTML: { __html: props.ui.getSticker("ui//check") } - }), props.onMoreOption && props.item.removeable && /* @__PURE__ */ import_react15.default.createElement("div", { + }), props.item.onMoreOptions || props.onMoreOption && props.item.removeable ? /* @__PURE__ */ import_react15.default.createElement("div", { onClick: (e4) => { e4.stopPropagation(); e4.preventDefault(); - props.onMoreOption(e4, props.item.value); + props.item.onMoreOptions ? props.item.onMoreOptions(e4) : props.onMoreOption(e4, props.item.value); }, className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.ui.getSticker("ui//options") } - }), props.item.removeable && props.onDeleteOption && /* @__PURE__ */ import_react15.default.createElement("div", { + }) : null, props.item.removeable && props.onDeleteOption && /* @__PURE__ */ import_react15.default.createElement("div", { onClick: (e4) => { e4.stopPropagation(); e4.preventDefault(); @@ -92111,6 +92365,8 @@ var CollapseToggle = (props) => { return /* @__PURE__ */ import_react20.default.createElement("button", { className: `mk-collapse ${props.collapsed ? "mk-collapsed" : ""}`, onClick: (e4) => { + if (!props.onToggle) + return; e4.stopPropagation(); props.onToggle(!props.collapsed, e4); }, @@ -92245,7 +92501,7 @@ var validatePredicate = (prevPredicate) => { groupBy: Array.isArray(prevPredicate.groupBy) ? prevPredicate.groupBy : [], colsOrder: Array.isArray(prevPredicate.colsOrder) ? prevPredicate.colsOrder : [], colsHidden: Array.isArray(prevPredicate.colsHidden) ? prevPredicate.colsHidden : [], - colsSize: prevPredicate.colsSize + colsSize: prevPredicate.colsSize ?? {} }; }; var defaultPredicate = { @@ -92522,8 +92778,10 @@ var ContextMDBProvider = (props) => { }); }; const setActiveSchema = (schema) => { - setDBSchema(schema); - retrieveCachedTable(schema); + if (schema) { + setDBSchema(schema); + retrieveCachedTable(schema); + } }; const cols = (0, import_react22.useMemo)( () => tableData ? [ @@ -92544,13 +92802,22 @@ var ContextMDBProvider = (props) => { type: "table", path: spaceInfo.path + "/#^" + dbSchema.id, payload: { table: newTable } - }).then((g) => setData(g)); + }).then((g) => { + if (g) + setData(g); + }); }; const [data2, setData] = (0, import_react22.useState)([]); (0, import_react22.useEffect)(() => { const rows = tableData?.rows.map((r2, index) => ({ _index: index.toString(), ...r2, + ...r2[PathPropertyName] ? { + [PathPropertyName]: props.superstate.spaceManager.resolvePath( + r2[PathPropertyName], + spaceCache.path + ) + } : {}, ...contexts.reduce((p, c3) => { const contextRowIndexByPath = contextTable[c3]?.rows.findIndex( (f2) => f2[PathPropertyName] == r2[PathPropertyName] @@ -92933,7 +93200,7 @@ var ContextEditorProvider = (props) => { (f2) => f2.type == "view" && f2.def.db == dbSchema?.id ); return _views.length > 0 ? _views : frameSchema ? [frameSchema] : []; - }, [frameSchemas, frameSchema]); + }, [frameSchemas, frameSchema, dbSchema]); const sortedColumns = (0, import_react24.useMemo)(() => { return cols.filter( (f2) => f2.hidden != "true" && !predicate.colsHidden.some((c3) => c3 == f2.name + f2.table) @@ -93068,7 +93335,7 @@ var ContextEditorProvider = (props) => { const getPathProperties2 = async (paths2, fmKeys) => { let rows = { uniques: [], cols: fmKeys, rows: [] }; for (const c3 of paths2) { - const properties3 = props.superstate.pathsIndex.get(c3).metadata.property; + const properties3 = props.superstate.pathsIndex.get(c3)?.metadata.property; rows = { uniques: [], cols: fmKeys, @@ -93251,8 +93518,8 @@ var ContextEditorProvider = (props) => { (f2) => f2 == oldColumn.name + oldColumn.table ? column.name + column.table : f2 ), colsSize: { - ...predicate.colsSize, - [column.name + column.table]: predicate.colsSize[oldColumn.name + oldColumn.table], + ...predicate.colsSize ?? {}, + [column.name + column.table]: predicate.colsSize?.[oldColumn.name + oldColumn.table], [oldColumn.name + oldColumn.table]: void 0 } }); @@ -96176,9 +96443,14 @@ var PathStickerView = (props) => { selectedSticker: (emoji) => savePathSticker(props.superstate, pathState.path, emoji) })); }; + const [stickerType, stickerPath] = parseStickerString(sticker); return /* @__PURE__ */ import_react26.default.createElement("div", { className: `mk-path-icon ${sticker ? "" : "mk-path-icon-placeholder"}` - }, /* @__PURE__ */ import_react26.default.createElement("button", { + }, stickerType == "image" ? /* @__PURE__ */ import_react26.default.createElement("img", { + src: props.superstate.ui.getUIPath( + props.superstate.imagesCache.get(stickerPath) + ) + }) : /* @__PURE__ */ import_react26.default.createElement("button", { "aria-label": i18n_default.buttons.changeIcon, onContextMenu: triggerStickerContextMenu, style: color2?.length > 0 ? { @@ -96225,14 +96497,18 @@ var PathStickerContainer = (props) => { // src/core/react/components/UI/Crumbs/PathCrumb.tsx var PathCrumb = (props) => { + const path = (0, import_react27.useMemo)( + () => props.source && props.path ? props.superstate.spaceManager.resolvePath(props.path, props.source) : props.path, + [props.source, props.path] + ); const [cache2, setCache] = (0, import_react27.useState)( - props.superstate.pathsIndex.get(props.path) + props.superstate.pathsIndex.get(path) ); const reloadCache = () => { - setCache(props.superstate.pathsIndex.get(props.path)); + setCache(props.superstate.pathsIndex.get(path)); }; const reloadIcon = (payload) => { - if (payload.path == props.path) { + if (payload.path == path) { reloadCache(); } }; @@ -96248,29 +96524,21 @@ var PathCrumb = (props) => { reloadIcon ); }; - }, [props.path]); - return cache2 ? /* @__PURE__ */ import_react27.default.createElement("div", { + }, [path]); + return /* @__PURE__ */ import_react27.default.createElement("div", { className: "mk-path", - onClick: () => props.superstate.ui.openPath(cache2.path, false), - onContextMenu: (e4) => showPathContextMenu(props.superstate, cache2.path, null, { + "aria-label": path, + onClick: () => props.superstate.ui.openPath(cache2?.path ?? path, false), + onContextMenu: (e4) => cache2 && showPathContextMenu(props.superstate, cache2.path, null, { x: e4.clientX, y: e4.clientY, width: 0, height: 0 }) - }, /* @__PURE__ */ import_react27.default.createElement(PathStickerView, { + }, cache2 && /* @__PURE__ */ import_react27.default.createElement(PathStickerView, { superstate: props.superstate, pathState: cache2 - }), !props.hideName && cache2?.displayName) : /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, null); -}; - -// src/core/utils/parser.tsx -var parseSortStrat = (str) => { - const [a4, b2] = str.split("_"); - return { field: a4, asc: b2 == "asc", group: true }; -}; -var parseLinkDisplayString = (string3) => { - return pathToString(parseLinkString(string3)); + }), (!props.hideName && cache2?.displayName) ?? path); }; // src/core/react/components/SpaceView/Contexts/DataTypeView/ContextCell.tsx @@ -96488,100 +96756,75 @@ var OptionCellBase = (props) => { // src/core/react/components/SpaceView/Contexts/DataTypeView/ContextCell.tsx var ContextCell = (props) => { + const { spaceState } = (0, import_react29.useContext)(SpaceContext); const fieldValue = (0, import_react29.useMemo)( () => parseFieldValue(props.propertyValue, "context", props.superstate), - [props.initialValue] + [props.propertyValue] ); - const stringValueToLink = (strings) => strings.map((f2) => { - return { - label: parseLinkDisplayString(f2), - path: parseLinkString(f2), - ref: false - }; - }); - const initialValue = stringValueToLink( - props.multi ? parseMultiString(props.initialValue) ?? [] : [props.initialValue] + const spacePath = (0, import_react29.useMemo)( + () => fieldValue ? props.superstate.spaceManager.resolvePath( + fieldValue.space, + spaceState?.path + ) : null, + [fieldValue.space, spaceState] ); + const initialValue = props.multi ? parseMultiString(props.initialValue) ?? [] : [props.initialValue]; const [propValues, setPropValues] = (0, import_react29.useState)( - props.superstate.contextsIndex.get(fieldValue.space)?.spaceMap[fieldValue.spaceField]?.[props.path] + props.superstate.contextsIndex.get(spacePath)?.spaceMap[fieldValue.spaceField]?.[props.path] ?? [] ); (0, import_react29.useEffect)(() => { setPropValues( - props.superstate.contextsIndex.get(fieldValue.space)?.spaceMap[fieldValue.spaceField]?.[props.path] + props.superstate.contextsIndex.get(spacePath)?.spaceMap[fieldValue.spaceField]?.[props.path] ?? [] ); - }, [fieldValue]); - const options = stringValueToLink([ - ...props.superstate.spacesMap.getInverse(fieldValue.space) - ]).map((f2) => ({ - name: f2.label, + }, [spacePath, fieldValue]); + const options = [...props.superstate.spacesMap.getInverse(spacePath)].map((f2) => props.superstate.pathsIndex.get(f2)).filter((f2) => f2).map((f2) => ({ + name: f2.name, + icon: f2.label.sticker, + description: f2.path, value: f2.path })); const [value, setValue] = (0, import_react29.useState)(initialValue); const allValues = (0, import_react29.useMemo)( - () => [ - ...value, - ...(propValues ?? []).map((f2) => ({ - label: parseLinkDisplayString(f2), - path: parseLinkString(f2), - ref: true - })) - ], + () => uniq([...value, ...propValues]), [value, propValues] ); const removeValue = (v2) => { - if (v2.ref) { - const newPropValues = propValues.filter((f2) => f2 != v2.path); + if (propValues.includes(v2)) { + const newPropValues = propValues.filter((f2) => f2 != v2); setPropValues(newPropValues); updateContextValue( props.superstate.spaceManager, - props.superstate.spacesIndex.get(fieldValue.space).space, - v2.path, + props.superstate.spacesIndex.get(spacePath).space, + v2, fieldValue.spaceField, props.path, deletePropertyMultiValue ); } else { - const newValues = value.filter((f2) => f2.path != v2.path); + const newValues = value.filter((f2) => f2 != v2); setValue(newValues); - props.saveValue(serializeMultiString(newValues.map((f2) => f2.path))); + props.saveValue(serializeMultiString(newValues.map((f2) => f2))); } }; (0, import_react29.useEffect)(() => { setValue( - stringValueToLink( - props.multi ? parseMultiString(props.initialValue) ?? [] : [props.initialValue] - ) + props.multi ? parseMultiString(props.initialValue) ?? [] : [props.initialValue] ); }, [props.initialValue]); const saveOptions = (_options, _value) => { - insertContextItems(props.superstate.spaceManager, _value, fieldValue.space); + insertContextItems(props.superstate.spaceManager, _value, spacePath); if (!props.multi) { - setValue( - _value.map((f2) => ({ - path: f2, - label: pathNameToString(folderPathToString(f2)), - ref: false - })) - ); + setValue(_value); props.saveValue(serializeMultiString(_value)); } else { const newValue = _value[0]; if (newValue) { - const newValues = [...value.map((f2) => f2.path), newValue]; - setValue( - newValues.map((f2) => ({ - label: pathNameToString(folderPathToString(f2)), - path: f2, - ref: false - })) - ); + const newValues = [...value, newValue]; + setValue(newValues); props.saveValue(serializeMultiString(newValues)); } } }; - const openLink = async (o2) => { - props.superstate.ui.openPath(o2.path, false); - }; const menuProps = () => { const _options = !props.multi ? [{ name: i18n_default.menu.none, value: "" }, ...options] : options; return { @@ -96606,7 +96849,8 @@ var ContextCell = (props) => { className: "mk-cell-context-label" }, /* @__PURE__ */ import_react29.default.createElement(PathCrumb, { superstate: props.superstate, - path: _props.value.path + path: _props.value, + source: spaceState?.path }), props.editMode && props.multi ? /* @__PURE__ */ import_react29.default.createElement("div", { className: "mk-icon-xsmall", onClick: () => removeValue(_props.value), @@ -104763,7 +105007,11 @@ var PathCell = (props) => { return { path: "" }; - const pathState = props.superstate.pathsIndex.get(f2); + const resolvedPath = props.superstate.spaceManager.resolvePath( + f2, + props.folder + ); + const pathState = props.superstate.pathsIndex.get(resolvedPath); return pathState ? { path: f2, pathState } : { path: f2 }; }; const value = (0, import_react39.useMemo)( @@ -104857,19 +105105,14 @@ var PathCell = (props) => { e4.stopPropagation(); }, key: i3 - }, /* @__PURE__ */ import_react39.default.createElement(PathStickerView, { + }, /* @__PURE__ */ import_react39.default.createElement(PathCrumb, { superstate: props.superstate, - pathState: v2.pathState - }), /* @__PURE__ */ import_react39.default.createElement("div", { - className: "mk-cell-file-name", - onClick: (e4) => props.superstate.ui.openPath( - v2.pathState.path, - e4.ctrlKey || e4.metaKey ? e4.altKey ? "split" : "tab" : false - ) - }, v2 && v2.pathState ? v2.pathState.name : "")); + path: v2.pathState.path + })); } - return /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, /* @__PURE__ */ import_react39.default.createElement("div", { - className: "mk-cell-file-item" + return /* @__PURE__ */ import_react39.default.createElement("div", { + className: "mk-cell-file-item", + key: i3 }, /* @__PURE__ */ import_react39.default.createElement("div", { className: "mk-path-icon" }, /* @__PURE__ */ import_react39.default.createElement("button", { @@ -104887,7 +105130,7 @@ var PathCell = (props) => { onBlur }) : /* @__PURE__ */ import_react39.default.createElement("div", { className: "mk-cell-file-name" - }, v2.path))); + }, v2.path)); })); }; @@ -105007,7 +105250,7 @@ var PropertyValueComponent = (props) => { showOptions( e4, parsedValue.space, - props.superstate.allSpaces().filter((f2) => f2.type != "default").map((m4) => ({ name: m4.name, value: m4.path })), + props.superstate.allSpaces().filter((f2) => f2.type != "default").map((m4) => ({ name: m4.name, value: m4.path, description: m4.path })), "space" ); }; @@ -105794,50 +106037,25 @@ var ImageCell = (props) => { // src/core/react/components/SpaceView/Contexts/DataTypeView/LinkCell.tsx var import_react48 = __toESM(require_react()); var LinkCell = (props) => { - const initialValue = (props.multi ? parseMultiString(props.initialValue) ?? [] : [props.initialValue]).filter((f2) => f2); - const stringValueToLink = (strings) => strings.filter((f2) => f2?.length > 0).map((f2) => { - const resolvedLink = props.superstate.spaceManager.resolvePath( - f2, - props.source - ); - const pathState = props.superstate.pathsIndex.get(resolvedLink); - if (pathState) { - return { - label: pathState.name, - sticker: pathState.label?.sticker, - value: resolvedLink, - state: pathState - }; - } - return { - label: parseLinkDisplayString(f2), - value: parseLinkString(f2) - }; - }); + const parseValue = (v2) => props.multi ? parseMultiString(v2) ?? [] : [v2].filter((f2) => f2); (0, import_react48.useEffect)(() => { - setValue( - stringValueToLink( - props.multi ? parseMultiString(props.initialValue) ?? [] : [props.initialValue] - ) - ); + setValue(parseValue(props.initialValue)); }, [props.initialValue]); - const [value, setValue] = (0, import_react48.useState)( - stringValueToLink(initialValue) - ); + const [value, setValue] = (0, import_react48.useState)(parseValue(props.initialValue)); const removeValue = (v2) => { - const newValues = value.filter((f2) => f2.value != v2.value); + const newValues = value.filter((f2) => f2 != v2); setValue(newValues); - props.saveValue(serializeMultiString(newValues.map((f2) => f2.value))); + props.saveValue(serializeMultiString(newValues)); }; const saveOptions = (_17, _value) => { if (!props.multi) { - setValue(stringValueToLink(_value)); + setValue(_value); props.saveValue(serializeMultiString(_value)); } else { const newValue = _value[0]; if (newValue) { - const newValues = uniq([...value.map((f2) => f2.value), newValue]); - setValue(stringValueToLink(newValues)); + const newValues = uniq([...value, newValue]); + setValue(newValues); props.saveValue(serializeMultiString(newValues)); } } @@ -105853,7 +106071,7 @@ var LinkCell = (props) => { ui: props.superstate.ui, multi: false, editable: true, - value: value.map((f2) => f2.value), + value: value.map((f2) => f2), options: _options, saveOptions, placeholder: i18n_default.labels.linkItemSelectPlaceholder, @@ -105862,12 +106080,12 @@ var LinkCell = (props) => { }; }; const openLink = async (o2) => { - const pathExists = await props.superstate.spaceManager.pathExists(o2.value); + const pathExists = await props.superstate.spaceManager.pathExists(o2); if (pathExists) { - props.superstate.ui.openPath(o2.value, false); + props.superstate.ui.openPath(o2, false); } else { - await props.superstate.spaceManager.createItemAtPath("/", "md", o2.value); - props.superstate.ui.openPath(o2.value, false); + await props.superstate.spaceManager.createItemAtPath("/", "md", o2); + props.superstate.ui.openPath(o2, false); } }; return /* @__PURE__ */ import_react48.default.createElement(OptionCellBase, { @@ -105875,10 +106093,10 @@ var LinkCell = (props) => { baseClass: "mk-cell-link", selectLabel: props.compactMode ? props.property.name : i18n_default.labels.select, menuProps, - labelElement: (_props) => /* @__PURE__ */ import_react48.default.createElement("div", null, _props.value.state ? /* @__PURE__ */ import_react48.default.createElement(PathCrumb, { + labelElement: (_props) => /* @__PURE__ */ import_react48.default.createElement("div", null, /* @__PURE__ */ import_react48.default.createElement(PathCrumb, { superstate: props.superstate, - path: _props.value.value - }) : _props.value.label, props.editMode && props.multi ? /* @__PURE__ */ import_react48.default.createElement("div", { + path: _props.value + }), props.editMode && props.multi ? /* @__PURE__ */ import_react48.default.createElement("div", { className: "mk-icon-xsmall", onClick: () => removeValue(_props.value), dangerouslySetInnerHTML: { @@ -108275,7 +108493,7 @@ var ExplorerContextRow = (props) => { }; // src/core/react/components/MDBView/MDBViewer.tsx -var import_react148 = __toESM(require_react()); +var import_react150 = __toESM(require_react()); // src/core/react/context/FrameSelectionContext.tsx var import_react69 = __toESM(require_react()); @@ -108742,6 +108960,7 @@ var FrameInstanceProvider = (props) => { state: {}, id: null, root: null, + exec: null, slides: {} }); const [rootProps, setRootProps] = (0, import_react68.useState)(props.props); @@ -108762,19 +108981,22 @@ var FrameInstanceProvider = (props) => { [props.editable, editableRoot, nonEditableRoot] ); const activeRunID = (0, import_react68.useRef)(null); + const currentRoot = (0, import_react68.useRef)(null); const linkedProps = (0, import_react68.useMemo)(() => { return Object.keys(props.propSetters || {}); }, [props.propSetters]); const saveState = (newState, instance2) => { - const { root: _root, id: runID, state } = instance2; - renameKey(newState, "$root", _root.id); + const { root: _root, exec: _exec, id: runID, state } = instance2; + renameKey(newState, "$root", _exec.id); if (activeRunID.current != runID) return; + const { $api, ...prevState } = state; executeTreeNode( - _root, + _exec, { state, - newState: applyPropsToState(newState, rootProps, _root.id), + newState: applyPropsToState(newState, rootProps, _exec.id), + prevState: import_lodash14.default.cloneDeep(prevState), slides: {} }, { @@ -108783,7 +109005,8 @@ var FrameInstanceProvider = (props) => { root: _root, contexts: props.contexts, runID, - selectedSlide + selectedSlide, + exec: _exec } ).then((s4) => { setInstance((p) => { @@ -108822,6 +109045,7 @@ var FrameInstanceProvider = (props) => { executeTreeNode( newRoot, { + prevState: {}, state: {}, newState: applyPropsToState({}, rootProps, newRoot.id), slides: {} @@ -108830,7 +109054,8 @@ var FrameInstanceProvider = (props) => { api: props.superstate.api, contexts: props.contexts, saveState, - root: newRoot, + root, + exec: newRoot, runID, selectedSlide } @@ -108974,11 +109199,11 @@ var FrameSelectionProvider = (props) => { // src/core/react/components/SpaceView/Contexts/ContextListContainer.tsx var import_lodash19 = __toESM(require_lodash()); -var import_react147 = __toESM(require_react()); +var import_react149 = __toESM(require_react()); // src/core/react/components/SpaceView/Contexts/ContextBuilder/ContextListInstance.tsx var import_lodash18 = __toESM(require_lodash()); -var import_react144 = __toESM(require_react()); +var import_react146 = __toESM(require_react()); // src/core/utils/contexts/embed.ts var framePathForSpace = (space2, schema) => { @@ -109134,7 +109359,7 @@ var dropFrame = (_activeNode, overNode, root, nodes, direction) => { }; // src/core/react/components/SpaceView/Frames/ViewNodes/FrameEditorInstance.tsx -var import_react143 = __toESM(require_react()); +var import_react145 = __toESM(require_react()); // src/core/react/components/SpaceView/Frames/EditorNodes/FrameEditorNodeView.tsx var import_classnames8 = __toESM(require_classnames()); @@ -109164,7 +109389,7 @@ var parseStylesToClass = (styles2) => { }; // src/core/react/components/SpaceView/Frames/EditorNodes/FrameEditorNodeView.tsx -var import_react142 = __toESM(require_react()); +var import_react144 = __toESM(require_react()); var import_react_dom10 = __toESM(require_react_dom()); // src/core/react/components/SpaceView/Frames/FrameNodeEditor/FrameMultiNodeEditor.tsx @@ -110766,10 +110991,10 @@ var ContentNodeView = (props) => { }; // src/core/react/components/PathView/PathView.tsx -var import_react114 = __toESM(require_react()); +var import_react115 = __toESM(require_react()); // src/core/react/components/SpaceView/Contexts/SpaceView.tsx -var import_react111 = __toESM(require_react()); +var import_react112 = __toESM(require_react()); // node_modules/react-error-boundary/dist/react-error-boundary.cjs.mjs var import_react_error_boundary_cjs = __toESM(require_react_error_boundary_cjs(), 1); @@ -111011,13 +111236,13 @@ function getProjection(activeItem, items, paths, overItemIndex, dragDepth, yOffs var normalizedAltName = () => window.navigator.platform.startsWith("Mac") ? "\u2325" : "Alt"; // src/core/react/components/Navigator/SpaceTree/SpaceTreeView.tsx -var import_react106 = __toESM(require_react()); +var import_react107 = __toESM(require_react()); // src/core/react/components/Navigator/SpaceTree/SpaceTreeItem.tsx var import_classnames = __toESM(require_classnames()); // src/core/react/components/UI/Menus/navigator/spaceContextMenu.tsx -var import_react102 = __toESM(require_react()); +var import_react103 = __toESM(require_react()); // src/core/react/components/SpaceView/Contexts/ContextBuilder/SpacePropertyEditor.tsx var import_react89 = __toESM(require_react()); @@ -111293,7 +111518,7 @@ function SortableItem(props) { } // src/core/react/components/UI/Modals/ContextEditor.tsx -var import_react101 = __toESM(require_react()); +var import_react102 = __toESM(require_react()); // src/core/react/components/UI/Menus/properties/linkMenu.tsx var showLinkMenu = (e4, superstate, saveLink, options) => { @@ -111454,7 +111679,7 @@ var allMetadata = (superstate) => ({ }); // src/core/react/components/Navigator/SpaceEditor.tsx -var import_react100 = __toESM(require_react()); +var import_react101 = __toESM(require_react()); // src/core/react/components/SpaceView/Contexts/Header/ActionsList.tsx var import_react90 = __toESM(require_react()); @@ -111547,11 +111772,80 @@ var ActionsList = (props) => { })))); }; -// src/core/react/components/UI/Crumbs/ContextTableCrumb.tsx +// src/core/react/components/SpaceView/Contexts/Header/SpaceTemplates.tsx var import_react91 = __toESM(require_react()); +var TemplatesList = (props) => { + const { pathState } = (0, import_react91.useContext)(PathContext); + const { spaceState } = (0, import_react91.useContext)(SpaceContext); + const [templates, setTemplates] = import_react91.default.useState([]); + (0, import_react91.useEffect)(() => { + refreshData({ path: pathState.path }); + }, []); + const refreshData = (payload) => { + if (payload.path == pathState?.path) + setTemplates( + props.superstate.spacesIndex.get(spaceState.path)?.templates + ); + }; + (0, import_react91.useEffect)(() => { + props.superstate.eventsDispatcher.addListener( + "spaceStateUpdated", + refreshData + ); + return () => { + props.superstate.eventsDispatcher.removeListener( + "spaceStateUpdated", + refreshData + ); + }; + }, [pathState]); + const newAction = (e4) => { + showLinkMenu(e4, props.superstate, (space2) => { + saveSpaceTemplate(props.superstate, pathState.path, space2); + }); + }; + return /* @__PURE__ */ import_react91.default.createElement("div", { + className: "mk-actions-list" + }, /* @__PURE__ */ import_react91.default.createElement("div", { + className: "mk-space-editor-title" + }, /* @__PURE__ */ import_react91.default.createElement("div", { + className: "mk-icon-small", + dangerouslySetInnerHTML: { + __html: props.superstate.ui.getSticker("ui//file-stack") + } + }), i18n_default.subViews.spaceTemplates, /* @__PURE__ */ import_react91.default.createElement("span", null), /* @__PURE__ */ import_react91.default.createElement("button", { + className: "mk-button-new", + "aria-label": i18n_default.labels.newAction, + onClick: (e4) => newAction(e4), + dangerouslySetInnerHTML: { + __html: props.superstate.ui.getSticker("ui//plus") + } + })), /* @__PURE__ */ import_react91.default.createElement("div", { + className: "mk-space-editor-description" + }, i18n_default.descriptions.spaceActions), templates.map((f2, i3) => /* @__PURE__ */ import_react91.default.createElement("div", { + key: i3, + className: "mk-action" + }, /* @__PURE__ */ import_react91.default.createElement("div", { + className: "mk-path" + }, /* @__PURE__ */ import_react91.default.createElement("div", { + className: "mk-path-icon", + dangerouslySetInnerHTML: { + __html: props.superstate.ui.getSticker("ui//clipboard-pen") + } + }), /* @__PURE__ */ import_react91.default.createElement("div", null, f2)), /* @__PURE__ */ import_react91.default.createElement("span", null), /* @__PURE__ */ import_react91.default.createElement("div", { + className: "mk-path-icon", + onClick: () => props.superstate.spaceManager.deleteTemplate(f2, spaceState.path), + dangerouslySetInnerHTML: { + __html: props.superstate.ui.getSticker("ui//trash") + } + })))); +}; + +// src/core/react/components/UI/Crumbs/ContextTableCrumb.tsx +var import_react92 = __toESM(require_react()); var ContextTableCrumb = (props) => { - const { setDragNode } = (0, import_react91.useContext)(WindowContext); - const { spaceInfo } = (0, import_react91.useContext)(SpaceContext); + const { setDragNode } = (0, import_react92.useContext)(WindowContext); + const { spaceInfo } = (0, import_react92.useContext)(SpaceContext); const dragId = spaceInfo.path + props.schema.id; const { attributes, @@ -111567,19 +111861,19 @@ var ContextTableCrumb = (props) => { schema: props.schema.id } }); - const ref2 = (0, import_react91.useRef)(null); + const ref2 = (0, import_react92.useRef)(null); useDndMonitor({ onDragStart: (e4) => { if (e4.active.data.current.id == dragId) { setDragNode( - /* @__PURE__ */ import_react91.default.createElement("div", { + /* @__PURE__ */ import_react92.default.createElement("div", { dangerouslySetInnerHTML: { __html: ref2.current.innerHTML } }) ); } } }); - return /* @__PURE__ */ import_react91.default.createElement("div", { + return /* @__PURE__ */ import_react92.default.createElement("div", { className: "mk-path", onClick: (e4) => props.onClick(e4), ref: (el) => { @@ -111589,7 +111883,7 @@ var ContextTableCrumb = (props) => { onContextMenu: (e4) => props.onContextMenu(e4), ...attributes, ...listeners - }, /* @__PURE__ */ import_react91.default.createElement("div", { + }, /* @__PURE__ */ import_react92.default.createElement("div", { className: "mk-path-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( @@ -111600,12 +111894,12 @@ var ContextTableCrumb = (props) => { }; // src/core/react/components/SpaceView/Contexts/Header/TableList.tsx -var import_react92 = __toESM(require_react()); +var import_react93 = __toESM(require_react()); var TableList = (props) => { - const { pathState } = (0, import_react92.useContext)(PathContext); - const { spaceState } = (0, import_react92.useContext)(SpaceContext); - const [tables, setTables] = (0, import_react92.useState)([]); - (0, import_react92.useEffect)(() => { + const { pathState } = (0, import_react93.useContext)(PathContext); + const { spaceState } = (0, import_react93.useContext)(SpaceContext); + const [tables, setTables] = (0, import_react93.useState)([]); + (0, import_react93.useEffect)(() => { refreshData({ path: pathState.path }); }, []); const refreshData = (payload) => { @@ -111614,7 +111908,7 @@ var TableList = (props) => { (props.superstate.contextsIndex.get(pathState?.path)?.schemas ?? []).filter((f2) => f2.primary != "true") ); }; - (0, import_react92.useEffect)(() => { + (0, import_react93.useEffect)(() => { props.superstate.eventsDispatcher.addListener( "contextStateUpdated", refreshData @@ -111629,7 +111923,7 @@ var TableList = (props) => { const newTable = (e4) => { props.superstate.ui.openModal( i18n_default.labels.newTable, - (_props) => /* @__PURE__ */ import_react92.default.createElement(InputModal, { + (_props) => /* @__PURE__ */ import_react93.default.createElement(InputModal, { value: "", saveLabel: i18n_default.buttons.save, hide: _props.hide, @@ -111671,7 +111965,7 @@ var TableList = (props) => { onClick: (e5) => { props.superstate.ui.openModal( i18n_default.labels.renameView, - (_props) => /* @__PURE__ */ import_react92.default.createElement(InputModal, { + (_props) => /* @__PURE__ */ import_react93.default.createElement(InputModal, { value: _schema.name, saveLabel: i18n_default.labels.renameView, hide: _props.hide, @@ -111701,23 +111995,23 @@ var TableList = (props) => { defaultMenu(props.superstate.ui, menuOptions) ); }; - return /* @__PURE__ */ import_react92.default.createElement("div", null, /* @__PURE__ */ import_react92.default.createElement("div", { + return /* @__PURE__ */ import_react93.default.createElement("div", null, /* @__PURE__ */ import_react93.default.createElement("div", { className: "mk-space-editor-title" - }, /* @__PURE__ */ import_react92.default.createElement("div", { + }, /* @__PURE__ */ import_react93.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//file-stack") } - }), i18n_default.subViews.spaceLists, /* @__PURE__ */ import_react92.default.createElement("span", null), /* @__PURE__ */ import_react92.default.createElement("button", { + }), i18n_default.subViews.spaceLists, /* @__PURE__ */ import_react93.default.createElement("span", null), /* @__PURE__ */ import_react93.default.createElement("button", { className: "mk-button-new", "aria-label": i18n_default.labels.newTable, onClick: (e4) => newTable(e4), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - })), /* @__PURE__ */ import_react92.default.createElement("div", { + })), /* @__PURE__ */ import_react93.default.createElement("div", { className: "mk-space-editor-description" - }, i18n_default.descriptions.spaceLists), tables.map((f2, i3) => /* @__PURE__ */ import_react92.default.createElement(ContextTableCrumb, { + }, i18n_default.descriptions.spaceLists), tables.map((f2, i3) => /* @__PURE__ */ import_react93.default.createElement(ContextTableCrumb, { key: i3, superstate: props.superstate, schema: f2, @@ -111758,16 +112052,16 @@ var filterFnLabels = { }; // src/core/react/components/Navigator/SpaceQuery.tsx -var import_react99 = __toESM(require_react()); +var import_react100 = __toESM(require_react()); // src/core/react/components/UI/Menus/navigator/showSpaceAddMenu.tsx -var import_react93 = __toESM(require_react()); -var showSpaceAddMenu = (superstate, e4, space2, dontOpen) => { +var import_react94 = __toESM(require_react()); +var showSpaceAddMenu = (superstate, offset2, space2, dontOpen) => { const menuOptions = []; menuOptions.push({ name: i18n_default.labels.createNote, icon: "ui//edit", - onClick: (e5) => { + onClick: (e4) => { newPathInSpace( superstate, space2, @@ -111780,17 +112074,17 @@ var showSpaceAddMenu = (superstate, e4, space2, dontOpen) => { menuOptions.push({ name: i18n_default.buttons.createCanvas, icon: "ui//layout-dashboard", - onClick: (e5) => { + onClick: (e4) => { newPathInSpace(superstate, space2, "canvas", null, dontOpen); } }); menuOptions.push({ name: i18n_default.labels.createSection, icon: "ui//folder-plus", - onClick: (e5) => { + onClick: (e4) => { superstate.ui.openModal( i18n_default.labels.createSection, - (props) => /* @__PURE__ */ import_react93.default.createElement(InputModal, { + (props) => /* @__PURE__ */ import_react94.default.createElement(InputModal, { saveLabel: i18n_default.buttons.createFolder, value: "", hide: props.hide, @@ -111816,45 +112110,56 @@ var showSpaceAddMenu = (superstate, e4, space2, dontOpen) => { ); } }); + if (space2.templates.length > 0) { + menuOptions.push(menuSeparator); + for (const template2 of space2.templates) { + menuOptions.push({ + name: template2, + icon: "ui//clipboard-pen", + onClick: (e4) => { + newTemplateInSpace(superstate, space2, template2); + } + }); + } + } menuOptions.push(menuSeparator); menuOptions.push({ name: i18n_default.buttons.addIntoSpace, icon: "ui//pin", - onClick: (e5) => { - showLinkMenu(e5, superstate, (link) => { + onClick: (e4) => { + showLinkMenu(e4, superstate, (link) => { pinPathToSpaceAtIndex(superstate, space2, link); }); } }); - superstate.ui.openMenu( - e4.target.getBoundingClientRect(), + return superstate.ui.openMenu( + offset2, defaultMenu(superstate.ui, menuOptions) ); - return false; }; // src/core/react/components/SpaceView/Contexts/FilterBar/FilterBar.tsx -var import_react98 = __toESM(require_react()); +var import_react99 = __toESM(require_react()); // src/core/react/components/SpaceView/Contexts/FilterBar/CustomVIewOption.tsx -var import_react94 = __toESM(require_react()); +var import_react95 = __toESM(require_react()); var CustomViewOption = (props) => { - return /* @__PURE__ */ import_react94.default.createElement("div", { + return /* @__PURE__ */ import_react95.default.createElement("div", { className: "mk-menu-option", onClick: () => { props.onSelect(); props.hide(); } - }, /* @__PURE__ */ import_react94.default.createElement(Sticker, { + }, /* @__PURE__ */ import_react95.default.createElement(Sticker, { ui: props.ui, sticker: props.icon - }), /* @__PURE__ */ import_react94.default.createElement("div", { + }), /* @__PURE__ */ import_react95.default.createElement("div", { className: "mk-menu-options-inner" - }, /* @__PURE__ */ import_react94.default.createElement("span", null, props.type)), props.selected && /* @__PURE__ */ import_react94.default.createElement("div", { + }, /* @__PURE__ */ import_react95.default.createElement("span", null, props.type)), props.selected && /* @__PURE__ */ import_react95.default.createElement("div", { dangerouslySetInnerHTML: { __html: props.ui.getSticker("ui//check") } - }), /* @__PURE__ */ import_react94.default.createElement("button", { + }), /* @__PURE__ */ import_react95.default.createElement("button", { onClick: (e4) => { e4.preventDefault(); props.hide(); @@ -111869,33 +112174,33 @@ var CustomViewOption = (props) => { }; // src/core/react/components/UI/Crumbs/ContextViewCrumb.tsx -var import_react95 = __toESM(require_react()); +var import_react96 = __toESM(require_react()); var ContextViewCrumb = (props) => { - return /* @__PURE__ */ import_react95.default.createElement("div", { + return /* @__PURE__ */ import_react96.default.createElement("div", { onClick: (e4) => props.onSelect(e4), onContextMenu: (e4) => props.onContextMenu(e4, props.schema), className: "mk-context" - }, /* @__PURE__ */ import_react95.default.createElement("div", { + }, /* @__PURE__ */ import_react96.default.createElement("div", { className: "mk-path-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( stickerForSchema(props.schema) ) } - }), props.schema.name, props.children); + }), defaultString(props.schema.name, "Untitled"), props.children); }; // src/core/react/components/SpaceView/Contexts/FilterBar/ListSelector.tsx -var import_react96 = __toESM(require_react()); +var import_react97 = __toESM(require_react()); var ListSelector = (props) => { - const { views, setEditMode } = (0, import_react96.useContext)(ContextEditorContext); - const { spaceState } = (0, import_react96.useContext)(SpaceContext); + const { views, setEditMode } = (0, import_react97.useContext)(ContextEditorContext); + const { spaceState } = (0, import_react97.useContext)(SpaceContext); const { frameSchema: schema, setFrameSchema: setSchema, saveSchema, deleteSchema - } = (0, import_react96.useContext)(FramesMDBContext); + } = (0, import_react97.useContext)(FramesMDBContext); const viewContextMenu = (e4, _schema) => { const menuOptions = []; menuOptions.push({ @@ -111913,7 +112218,7 @@ var ListSelector = (props) => { onClick: (e5) => { props.superstate.ui.openModal( i18n_default.labels.renameView, - (props2) => /* @__PURE__ */ import_react96.default.createElement(InputModal, { + (props2) => /* @__PURE__ */ import_react97.default.createElement(InputModal, { value: _schema.name, saveLabel: i18n_default.labels.renameView, hide: props2.hide, @@ -111942,11 +112247,11 @@ var ListSelector = (props) => { if (props.setView) props.setView(value); }; - const ref2 = (0, import_react96.useRef)(null); + const ref2 = (0, import_react97.useRef)(null); const showSaveViewModal = () => { props.superstate.ui.openModal( i18n_default.labels.saveView, - (props2) => /* @__PURE__ */ import_react96.default.createElement(InputModal, { + (props2) => /* @__PURE__ */ import_react97.default.createElement(InputModal, { value: "", saveLabel: i18n_default.labels.saveView, hide: props2.hide, @@ -111963,9 +112268,11 @@ var ListSelector = (props) => { }; const selectViewMenu = (e4) => { const options = views.map((f2) => ({ - name: f2.name, + name: defaultString(f2.name, "Untitled"), value: f2.id, - onClick: () => selectView(f2.id) + icon: stickerForSchema(f2), + onClick: () => selectView(f2.id), + onMoreOptions: (e5) => viewContextMenu(e5, f2) })); options.push(menuSeparator); options.push({ @@ -111979,44 +112286,44 @@ var ListSelector = (props) => { "bottom" ); }; - return schema && /* @__PURE__ */ import_react96.default.createElement(import_react96.default.Fragment, null, /* @__PURE__ */ import_react96.default.createElement("div", { + return schema && /* @__PURE__ */ import_react97.default.createElement(import_react97.default.Fragment, null, /* @__PURE__ */ import_react97.default.createElement("div", { className: "mk-view-selector", ref: ref2 - }, props.expanded ? /* @__PURE__ */ import_react96.default.createElement(import_react96.default.Fragment, null, views.map((f2, i3) => /* @__PURE__ */ import_react96.default.createElement(ContextViewCrumb, { + }, props.expanded ? /* @__PURE__ */ import_react97.default.createElement(import_react97.default.Fragment, null, views.map((f2, i3) => /* @__PURE__ */ import_react97.default.createElement(ContextViewCrumb, { key: i3, superstate: props.superstate, schema: f2, onSelect: () => setSchema(views.find((g) => g.id == f2.id)), onContextMenu: viewContextMenu - })), /* @__PURE__ */ import_react96.default.createElement("button", { + })), /* @__PURE__ */ import_react97.default.createElement("button", { onClick: (e4) => showSaveViewModal() - }, "+")) : /* @__PURE__ */ import_react96.default.createElement(ContextViewCrumb, { + }, "+")) : /* @__PURE__ */ import_react97.default.createElement(ContextViewCrumb, { superstate: props.superstate, schema, onSelect: (e4) => selectViewMenu(e4), onContextMenu: viewContextMenu - }, /* @__PURE__ */ import_react96.default.createElement(CollapseToggle, { + }, /* @__PURE__ */ import_react97.default.createElement(CollapseToggle, { collapsed: false, - onToggle: () => null, + onToggle: null, superstate: props.superstate })))); }; // src/core/react/components/SpaceView/Contexts/FilterBar/SearchBar.tsx -var import_react97 = __toESM(require_react()); +var import_react98 = __toESM(require_react()); var SearchBar = (props) => { - const [searchActive, setSearchActive] = import_react97.default.useState(false); + const [searchActive, setSearchActive] = import_react98.default.useState(false); const clearSearch = () => { setSearchActive(false); props.setSearchString(""); }; - const ref2 = import_react97.default.useRef(null); - (0, import_react97.useEffect)(() => { + const ref2 = import_react98.default.useRef(null); + (0, import_react98.useEffect)(() => { if (searchActive) { ref2.current?.focus(); } }, [searchActive]); - return !searchActive ? /* @__PURE__ */ import_react97.default.createElement("button", { + return !searchActive ? /* @__PURE__ */ import_react98.default.createElement("button", { onClick: (e4) => { e4.stopPropagation(); setSearchActive(true); @@ -112024,18 +112331,18 @@ var SearchBar = (props) => { dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//search") } - }) : /* @__PURE__ */ import_react97.default.createElement("div", { + }) : /* @__PURE__ */ import_react98.default.createElement("div", { className: "mk-view-search" - }, /* @__PURE__ */ import_react97.default.createElement("button", { + }, /* @__PURE__ */ import_react98.default.createElement("button", { dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//search") } - }), /* @__PURE__ */ import_react97.default.createElement(import_react97.default.Fragment, null, /* @__PURE__ */ import_react97.default.createElement("input", { + }), /* @__PURE__ */ import_react98.default.createElement(import_react98.default.Fragment, null, /* @__PURE__ */ import_react98.default.createElement("input", { onChange: (e4) => props.setSearchString(e4.target.value), placeholder: i18n_default.labels.searchPlaceholder, className: "mk-search-bar", ref: ref2 - }), /* @__PURE__ */ import_react97.default.createElement("button", { + }), /* @__PURE__ */ import_react98.default.createElement("button", { dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//clear") }, @@ -112048,8 +112355,8 @@ var SearchBar = (props) => { // src/core/react/components/SpaceView/Contexts/FilterBar/FilterBar.tsx var FilterBar = (props) => { - const { spaceInfo, spaceState: spaceCache } = (0, import_react98.useContext)(SpaceContext); - const { setDBSchema, saveSchema, dbSchema, contextTable, cols, tableData } = (0, import_react98.useContext)(ContextMDBContext); + const { spaceInfo, spaceState: spaceCache } = (0, import_react99.useContext)(SpaceContext); + const { setDBSchema, saveSchema, dbSchema, contextTable, cols, tableData } = (0, import_react99.useContext)(ContextMDBContext); const { setSearchString, setEditMode, @@ -112059,9 +112366,9 @@ var FilterBar = (props) => { saveColumn, sortColumn, delColumn - } = (0, import_react98.useContext)(ContextEditorContext); + } = (0, import_react99.useContext)(ContextEditorContext); const filteredCols = cols.filter((f2) => f2.hidden != "true"); - const [expanded, setExpanded] = (0, import_react98.useState)(false); + const [expanded, setExpanded] = (0, import_react99.useState)(false); const saveViewType = (type) => { if (type == "table") { savePredicate({ @@ -112173,7 +112480,7 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.customView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react98.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react99.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//toy-brick", type: i18n_default.menu.customView, @@ -112189,7 +112496,7 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.listView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react98.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react99.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//list", type: i18n_default.menu.listView, @@ -112205,7 +112512,7 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.cardView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react98.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react99.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//layout-grid", type: i18n_default.menu.cardView, @@ -112221,7 +112528,7 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.detailsView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react98.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react99.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//layout-list", type: i18n_default.menu.detailsView, @@ -112245,7 +112552,7 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.boardView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react98.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react99.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//square-kanban", type: i18n_default.menu.boardView, @@ -112262,7 +112569,7 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.catalogView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react98.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react99.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//gallery-horizontal-end", type: i18n_default.menu.catalogView, @@ -112278,7 +112585,7 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.galleryView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react98.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react99.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//layout-dashboard", type: i18n_default.menu.galleryView, @@ -112295,7 +112602,7 @@ var FilterBar = (props) => { menuOptions.push({ name: i18n_default.menu.flowView, type: 5 /* Custom */, - fragment: (_props) => /* @__PURE__ */ import_react98.default.createElement(CustomViewOption, { + fragment: (_props) => /* @__PURE__ */ import_react99.default.createElement(CustomViewOption, { ui: props.superstate.ui, icon: "ui//infinity", type: i18n_default.menu.flowView, @@ -112696,115 +113003,111 @@ var FilterBar = (props) => { e4.preventDefault(); } }; - return /* @__PURE__ */ import_react98.default.createElement(import_react98.default.Fragment, null, /* @__PURE__ */ import_react98.default.createElement("div", { + return /* @__PURE__ */ import_react99.default.createElement(import_react99.default.Fragment, null, /* @__PURE__ */ import_react99.default.createElement("div", { className: "mk-view-config" - }, /* @__PURE__ */ import_react98.default.createElement("div", { - className: "mk-context-title", - contentEditable: true, - onBlur, - onDrop: (e4) => e4.preventDefault(), - onKeyDown, - onKeyPress, - onKeyUp, - dangerouslySetInnerHTML: { __html: dbSchema?.name } - }), /* @__PURE__ */ import_react98.default.createElement("div", { - className: "mk-view-options" - }, !expanded && dbSchema?.primary == "true" && /* @__PURE__ */ import_react98.default.createElement(ListSelector, { + }, !expanded && dbSchema?.primary == "true" && /* @__PURE__ */ import_react99.default.createElement(ListSelector, { superstate: props.superstate, expanded: false, setView: props.setView - }), /* @__PURE__ */ import_react98.default.createElement("span", null), /* @__PURE__ */ import_react98.default.createElement(SearchBar, { + }), /* @__PURE__ */ import_react99.default.createElement("div", { + className: "mk-view-options" + }, /* @__PURE__ */ import_react99.default.createElement("span", null), /* @__PURE__ */ import_react99.default.createElement(SearchBar, { superstate: props.superstate, setSearchString - }), /* @__PURE__ */ import_react98.default.createElement("button", { + }), /* @__PURE__ */ import_react99.default.createElement("button", { onClick: (e4) => showViewsMenu(e4), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//layout-panel-left") } - }), /* @__PURE__ */ import_react98.default.createElement("button", { + }), /* @__PURE__ */ import_react99.default.createElement("button", { onClick: (e4) => showFilterMenu(e4), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//view-options") } - }), props.superstate.settings.experimental && /* @__PURE__ */ import_react98.default.createElement("button", { + }), props.superstate.settings.experimental && /* @__PURE__ */ import_react99.default.createElement("button", { onClick: (e4) => setEditMode((p) => p == 0 ? 3 /* Group */ : 0), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//build") } - }), dbSchema?.id == defaultContextSchemaID && /* @__PURE__ */ import_react98.default.createElement(import_react98.default.Fragment, null, /* @__PURE__ */ import_react98.default.createElement("button", { + }), dbSchema?.id == defaultContextSchemaID && /* @__PURE__ */ import_react99.default.createElement(import_react99.default.Fragment, null, /* @__PURE__ */ import_react99.default.createElement("button", { onClick: (e4) => showColsMenu(e4), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//list") } - }), /* @__PURE__ */ import_react98.default.createElement("button", { + }), /* @__PURE__ */ import_react99.default.createElement("button", { className: "mk-button-new", - onClick: (e4) => showSpaceAddMenu(props.superstate, e4, spaceCache, true), + onClick: (e4) => showSpaceAddMenu( + props.superstate, + e4.target.getBoundingClientRect(), + spaceCache, + true + ), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - })))), (predicate.filters.length > 0 || predicate.sort.length > 0 || predicate.groupBy.length > 0) && /* @__PURE__ */ import_react98.default.createElement("div", { + })))), (predicate.filters.length > 0 || predicate.sort.length > 0 || predicate.groupBy.length > 0) && /* @__PURE__ */ import_react99.default.createElement("div", { className: "mk-filter-bar" - }, predicate.groupBy.length > 0 && /* @__PURE__ */ import_react98.default.createElement("div", { + }, predicate.groupBy.length > 0 && /* @__PURE__ */ import_react99.default.createElement("div", { className: "mk-filter" - }, /* @__PURE__ */ import_react98.default.createElement("span", null, i18n_default.menu.groupBy), /* @__PURE__ */ import_react98.default.createElement("span", { + }, /* @__PURE__ */ import_react99.default.createElement("span", null, i18n_default.menu.groupBy), /* @__PURE__ */ import_react99.default.createElement("span", { onClick: (e4) => showGroupByMenu( e4.target.getBoundingClientRect() ) - }, predicate.groupBy[0]), /* @__PURE__ */ import_react98.default.createElement("div", { + }, predicate.groupBy[0]), /* @__PURE__ */ import_react99.default.createElement("div", { onClick: () => saveGroupBy(null, []), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//close") } - })), predicate.sort.map((f2, i3) => /* @__PURE__ */ import_react98.default.createElement("div", { + })), predicate.sort.map((f2, i3) => /* @__PURE__ */ import_react99.default.createElement("div", { key: i3, className: "mk-filter" - }, /* @__PURE__ */ import_react98.default.createElement("span", null, f2.field), /* @__PURE__ */ import_react98.default.createElement("span", { + }, /* @__PURE__ */ import_react99.default.createElement("span", null, f2.field), /* @__PURE__ */ import_react99.default.createElement("span", { onClick: (e4) => changeSortMenu(e4, f2) - }, sortFnTypes[f2.fn].label), /* @__PURE__ */ import_react98.default.createElement("div", { + }, sortFnTypes[f2.fn].label), /* @__PURE__ */ import_react99.default.createElement("div", { onClick: () => removeSort(f2), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//close") } - }))), predicate.filters.map((f2, i3) => /* @__PURE__ */ import_react98.default.createElement("div", { + }))), predicate.filters.map((f2, i3) => /* @__PURE__ */ import_react99.default.createElement("div", { key: i3, className: "mk-filter" - }, /* @__PURE__ */ import_react98.default.createElement("span", null, f2.field), /* @__PURE__ */ import_react98.default.createElement("span", { + }, /* @__PURE__ */ import_react99.default.createElement("span", null, f2.field), /* @__PURE__ */ import_react99.default.createElement("span", { onClick: (e4) => changeFilterMenu(e4, f2) - }, filterFnLabels[f2.fn]), /* @__PURE__ */ import_react98.default.createElement(FilterValueSpan, { + }, filterFnLabels[f2.fn]), /* @__PURE__ */ import_react99.default.createElement(FilterValueSpan, { fieldType: cols.find((c3) => c3.name + c3.table == f2.field)?.type, filter: f2, selectFilterValue - }), /* @__PURE__ */ import_react98.default.createElement("div", { + }), /* @__PURE__ */ import_react99.default.createElement("div", { onClick: () => removeFilter(f2), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//close") } - }))), /* @__PURE__ */ import_react98.default.createElement("span", null))); + }))), /* @__PURE__ */ import_react99.default.createElement("span", null))); }; var FilterValueSpan = (props) => { const { filter: filter2, selectFilterValue, fieldType } = props; const fnType = filterFnTypes[filter2.fn]; if (!fieldType || !fnType || fnType.valueType == "none") { - return /* @__PURE__ */ import_react98.default.createElement(import_react98.default.Fragment, null); + return /* @__PURE__ */ import_react99.default.createElement(import_react99.default.Fragment, null); } else if (fieldType.startsWith("option") || fieldType.startsWith("context")) { const options = parseMultiString(filter2.value); - return /* @__PURE__ */ import_react98.default.createElement("span", { + return /* @__PURE__ */ import_react99.default.createElement("span", { onClick: (e4) => selectFilterValue(e4, filter2) - }, options.map((f2, i3) => /* @__PURE__ */ import_react98.default.createElement("span", { + }, options.map((f2, i3) => /* @__PURE__ */ import_react99.default.createElement("span", { key: i3 }, f2))); } else if (fnType.valueType == "text") { - return /* @__PURE__ */ import_react98.default.createElement("input", { + return /* @__PURE__ */ import_react99.default.createElement("input", { type: "text", onInput: (e4) => selectFilterValue(null, { ...filter2, value: e4.currentTarget.value }), value: filter2.value }); } else if (!filter2.value || filter2.value.length == 0) { - return /* @__PURE__ */ import_react98.default.createElement("span", { + return /* @__PURE__ */ import_react99.default.createElement("span", { onClick: (e4) => selectFilterValue(e4, filter2) }, i18n_default.labels.select); } - return /* @__PURE__ */ import_react98.default.createElement("span", { + return /* @__PURE__ */ import_react99.default.createElement("span", { onClick: (e4) => selectFilterValue(e4, filter2) }, filter2.value); }; @@ -113065,9 +113368,9 @@ var SpaceQuery = (props) => { showSections: true }); }; - return /* @__PURE__ */ import_react99.default.createElement("div", { + return /* @__PURE__ */ import_react100.default.createElement("div", { className: "mk-query" - }, filters.length == 0 ? /* @__PURE__ */ import_react99.default.createElement(DefFilterGroup, { + }, filters.length == 0 ? /* @__PURE__ */ import_react100.default.createElement(DefFilterGroup, { superstate: props.superstate, selectGroupType, group: null, @@ -113076,7 +113379,7 @@ var SpaceQuery = (props) => { i: 0, removeable: props.removeable, removeDefGroup - }) : filters.map((f2, i3) => /* @__PURE__ */ import_react99.default.createElement(DefFilterGroup, { + }) : filters.map((f2, i3) => /* @__PURE__ */ import_react100.default.createElement(DefFilterGroup, { superstate: props.superstate, key: i3, group: f2, @@ -113086,9 +113389,9 @@ var SpaceQuery = (props) => { removeable: props.removeable, i: i3, removeDefGroup - }, f2.filters.map((filter2, k2, arr) => /* @__PURE__ */ import_react99.default.createElement(import_react99.default.Fragment, { + }, f2.filters.map((filter2, k2, arr) => /* @__PURE__ */ import_react100.default.createElement(import_react100.default.Fragment, { key: k2 - }, /* @__PURE__ */ import_react99.default.createElement(DefFilter, { + }, /* @__PURE__ */ import_react100.default.createElement(DefFilter, { superstate: props.superstate, key: k2, filter: filter2, @@ -113098,10 +113401,10 @@ var SpaceQuery = (props) => { selectFilter, selectFilterValue, removeDefFilter - }), k2 != arr.length - 1 && /* @__PURE__ */ import_react99.default.createElement("div", { + }), k2 != arr.length - 1 && /* @__PURE__ */ import_react100.default.createElement("div", { className: "mk-filter", onClick: (e4) => selectGroupType(e4, i3) - }, /* @__PURE__ */ import_react99.default.createElement("span", null, f2.type == "any" ? "or" : "and"))))))); + }, /* @__PURE__ */ import_react100.default.createElement("span", null, f2.type == "any" ? "or" : "and"))))))); }; var DefFilter = (props) => { const { @@ -113113,22 +113416,22 @@ var DefFilter = (props) => { i: i3, k: k2 } = props; - return /* @__PURE__ */ import_react99.default.createElement("div", { + return /* @__PURE__ */ import_react100.default.createElement("div", { className: "mk-filter" - }, /* @__PURE__ */ import_react99.default.createElement("span", { + }, /* @__PURE__ */ import_react100.default.createElement("span", { onClick: (e4) => selectField(e4, i3, k2) - }, filter2.field.length == 0 ? i18n_default.labels.select : filter2.field), filter2.field.length > 0 && /* @__PURE__ */ import_react99.default.createElement("span", { + }, filter2.field.length == 0 ? i18n_default.labels.select : filter2.field), filter2.field.length > 0 && /* @__PURE__ */ import_react100.default.createElement("span", { onClick: (e4) => selectFilter(e4, i3, k2) - }, !filterFnLabels[filter2.fn] ? i18n_default.labels.select : filterFnLabels[filter2.fn]), filter2.field.length > 0 && filterFnLabels[filter2.fn] && filterFnTypes[filter2.fn]?.valueType != "none" && /* @__PURE__ */ import_react99.default.createElement("span", null, /* @__PURE__ */ import_react99.default.createElement(FilterValueSpan, { + }, !filterFnLabels[filter2.fn] ? i18n_default.labels.select : filterFnLabels[filter2.fn]), filter2.field.length > 0 && filterFnLabels[filter2.fn] && filterFnTypes[filter2.fn]?.valueType != "none" && /* @__PURE__ */ import_react100.default.createElement("span", null, /* @__PURE__ */ import_react100.default.createElement(FilterValueSpan, { fieldType: filter2.fType, filter: filter2, selectFilterValue: (e4, h3) => selectFilterValue(e4, h3, i3, k2) - })), /* @__PURE__ */ import_react99.default.createElement("span", { + })), /* @__PURE__ */ import_react100.default.createElement("span", { onClick: (e4) => { removeDefFilter(k2, i3); e4.stopPropagation(); } - }, /* @__PURE__ */ import_react99.default.createElement("div", { + }, /* @__PURE__ */ import_react100.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//close") @@ -113144,19 +113447,19 @@ var DefFilterGroup = (props) => { i: i3, removeDefGroup } = props; - return /* @__PURE__ */ import_react99.default.createElement("div", { + return /* @__PURE__ */ import_react100.default.createElement("div", { className: "mk-query-group" - }, /* @__PURE__ */ import_react99.default.createElement("div", { + }, /* @__PURE__ */ import_react100.default.createElement("div", { className: "mk-filter-bar mk-query-filters" - }, props.children, /* @__PURE__ */ import_react99.default.createElement("div", { + }, props.children, /* @__PURE__ */ import_react100.default.createElement("div", { className: "mk-filter-add", onClick: (e4) => selectField(e4, i3, group?.filters.length ?? 0) - }, /* @__PURE__ */ import_react99.default.createElement("span", null, /* @__PURE__ */ import_react99.default.createElement("span", { + }, /* @__PURE__ */ import_react100.default.createElement("span", null, /* @__PURE__ */ import_react100.default.createElement("span", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - }), i18n_default.buttons.addFilter))), props.removeable && /* @__PURE__ */ import_react99.default.createElement("div", { + }), i18n_default.buttons.addFilter))), props.removeable && /* @__PURE__ */ import_react100.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//close") @@ -113170,48 +113473,54 @@ var DefFilterGroup = (props) => { // src/core/react/components/Navigator/SpaceEditor.tsx var SpaceEditor = (props) => { - const [tab, setTab] = (0, import_react100.useState)(props.tab); - return /* @__PURE__ */ import_react100.default.createElement("div", null, /* @__PURE__ */ import_react100.default.createElement("div", { + const [tab, setTab] = (0, import_react101.useState)(props.tab); + return /* @__PURE__ */ import_react101.default.createElement("div", null, /* @__PURE__ */ import_react101.default.createElement("div", { className: "mk-tab-group" - }, /* @__PURE__ */ import_react100.default.createElement("div", { + }, /* @__PURE__ */ import_react101.default.createElement("div", { onClick: () => setTab(0), className: `mk-tab ${tab == 0 ? "mk-active" : ""}` - }, i18n_default.subViews.spaceItems), /* @__PURE__ */ import_react100.default.createElement("div", { + }, i18n_default.subViews.spaceItems), /* @__PURE__ */ import_react101.default.createElement("div", { onClick: () => setTab(1), className: `mk-tab ${tab == 1 ? "mk-active" : ""}` - }, i18n_default.subViews.spaceContext), /* @__PURE__ */ import_react100.default.createElement("div", { + }, i18n_default.subViews.spaceContext), /* @__PURE__ */ import_react101.default.createElement("div", { onClick: () => setTab(2), className: `mk-tab ${tab == 2 ? "mk-active" : ""}` - }, i18n_default.subViews.spaceLists), /* @__PURE__ */ import_react100.default.createElement("div", { + }, i18n_default.subViews.spaceLists), /* @__PURE__ */ import_react101.default.createElement("div", { onClick: () => setTab(3), className: `mk-tab ${tab == 3 ? "mk-active" : ""}` - }, i18n_default.subViews.spaceActions)), /* @__PURE__ */ import_react100.default.createElement(PathProvider, { + }, i18n_default.subViews.spaceActions), /* @__PURE__ */ import_react101.default.createElement("div", { + onClick: () => setTab(4), + className: `mk-tab ${tab == 4 ? "mk-active" : ""}` + }, i18n_default.subViews.spaceTemplates)), /* @__PURE__ */ import_react101.default.createElement(PathProvider, { superstate: props.superstate, path: props.space.path, readMode: false - }, /* @__PURE__ */ import_react100.default.createElement(SpaceProvider, { + }, /* @__PURE__ */ import_react101.default.createElement(SpaceProvider, { superstate: props.superstate - }, tab == 0 ? /* @__PURE__ */ import_react100.default.createElement(SpaceItems, { + }, tab == 0 ? /* @__PURE__ */ import_react101.default.createElement(SpaceItems, { superstate: props.superstate, space: props.space - }) : tab == 1 ? /* @__PURE__ */ import_react100.default.createElement(ContextMDBProvider, { + }) : tab == 1 ? /* @__PURE__ */ import_react101.default.createElement(ContextMDBProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react100.default.createElement(FramesMDBProvider, { + }, /* @__PURE__ */ import_react101.default.createElement(FramesMDBProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react100.default.createElement(ContextEditorProvider, { + }, /* @__PURE__ */ import_react101.default.createElement(ContextEditorProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react100.default.createElement(SpacePropertyEditorContext, { + }, /* @__PURE__ */ import_react101.default.createElement(SpacePropertyEditorContext, { superstate: props.superstate - })))) : tab == 2 ? /* @__PURE__ */ import_react100.default.createElement(TableList, { + })))) : tab == 2 ? /* @__PURE__ */ import_react101.default.createElement(TableList, { superstate: props.superstate, hide: props.close - }) : tab == 3 ? /* @__PURE__ */ import_react100.default.createElement(ActionsList, { + }) : tab == 3 ? /* @__PURE__ */ import_react101.default.createElement(ActionsList, { superstate: props.superstate, close: props.close - }) : /* @__PURE__ */ import_react100.default.createElement(import_react100.default.Fragment, null)))); + }) : tab == 4 ? /* @__PURE__ */ import_react101.default.createElement(TemplatesList, { + superstate: props.superstate, + close: props.close + }) : /* @__PURE__ */ import_react101.default.createElement(import_react101.default.Fragment, null)))); }; var SpaceItems = (props) => { - const [metadata, setMetadata] = (0, import_react100.useState)( + const [metadata, setMetadata] = (0, import_react101.useState)( props.space.metadata ?? {} ); const saveMetadata = (metadata2) => { @@ -113224,11 +113533,11 @@ var SpaceItems = (props) => { filters: q2 }); }; - const linkCaches = (0, import_react100.useMemo)( + const linkCaches = (0, import_react101.useMemo)( () => (metadata?.links ?? []).map((f2) => props.superstate.pathsIndex.get(f2)).filter((f2) => f2), [metadata] ); - const directChildren = (0, import_react100.useMemo)(() => { + const directChildren = (0, import_react101.useMemo)(() => { return [...props.superstate.spacesMap.getInverse(props.space.path)].map((f2) => props.superstate.pathsIndex.get(f2)).filter((f2) => f2.parent == props.space.path); }, [props.space]); const metadataProperties = allMetadata(props.superstate); @@ -113244,30 +113553,30 @@ var SpaceItems = (props) => { value: f2 }; }); - return /* @__PURE__ */ import_react100.default.createElement(import_react100.default.Fragment, null, /* @__PURE__ */ import_react100.default.createElement("div", { + return /* @__PURE__ */ import_react101.default.createElement(import_react101.default.Fragment, null, /* @__PURE__ */ import_react101.default.createElement("div", { className: "mk-space-editor" - }, /* @__PURE__ */ import_react100.default.createElement("div", { + }, /* @__PURE__ */ import_react101.default.createElement("div", { className: "mk-space-editor-section" - }, /* @__PURE__ */ import_react100.default.createElement("div", { + }, /* @__PURE__ */ import_react101.default.createElement("div", { className: "mk-space-editor-title" - }, /* @__PURE__ */ import_react100.default.createElement("div", { + }, /* @__PURE__ */ import_react101.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//file-stack") } - }), i18n_default.subViews.spaceItems), /* @__PURE__ */ import_react100.default.createElement("div", { + }), i18n_default.subViews.spaceItems), /* @__PURE__ */ import_react101.default.createElement("div", { className: "mk-space-editor-description" - }, i18n_default.descriptions.spaceItems), /* @__PURE__ */ import_react100.default.createElement("div", { + }, i18n_default.descriptions.spaceItems), /* @__PURE__ */ import_react101.default.createElement("div", { className: "mk-space-editor-contents" - }, linkCaches.map((f2, i3) => /* @__PURE__ */ import_react100.default.createElement(PathCrumb, { + }, linkCaches.map((f2, i3) => /* @__PURE__ */ import_react101.default.createElement(PathCrumb, { key: i3, superstate: props.superstate, path: f2.path - })), directChildren.map((f2, i3) => /* @__PURE__ */ import_react100.default.createElement(PathCrumb, { + })), directChildren.map((f2, i3) => /* @__PURE__ */ import_react101.default.createElement(PathCrumb, { key: i3, superstate: props.superstate, path: f2.path - }))), /* @__PURE__ */ import_react100.default.createElement("button", { + }))), /* @__PURE__ */ import_react101.default.createElement("button", { className: "mk-inline-button", onClick: (e4) => showLinkMenu( e4, @@ -113277,30 +113586,30 @@ var SpaceItems = (props) => { links: [...metadata.links ?? [], link] }) ) - }, /* @__PURE__ */ import_react100.default.createElement("div", { + }, /* @__PURE__ */ import_react101.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - }), i18n_default.buttons.addItem)), /* @__PURE__ */ import_react100.default.createElement("div", { + }), i18n_default.buttons.addItem)), /* @__PURE__ */ import_react101.default.createElement("div", { className: "mk-space-editor-section" - }, /* @__PURE__ */ import_react100.default.createElement("div", { + }, /* @__PURE__ */ import_react101.default.createElement("div", { className: "mk-space-editor-title" - }, /* @__PURE__ */ import_react100.default.createElement("div", { + }, /* @__PURE__ */ import_react101.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//file-search") } - }), i18n_default.subViews.smartSearch), /* @__PURE__ */ import_react100.default.createElement("div", { + }), i18n_default.subViews.smartSearch), /* @__PURE__ */ import_react101.default.createElement("div", { className: "mk-space-editor-description" - }, i18n_default.descriptions.smartSearch), metadata?.filters?.length > 0 && /* @__PURE__ */ import_react100.default.createElement(SpaceQuery, { + }, i18n_default.descriptions.smartSearch), metadata?.filters?.length > 0 && /* @__PURE__ */ import_react101.default.createElement(SpaceQuery, { superstate: props.superstate, filters: metadata.filters ?? [], setFilters: saveQuery, removeable: true, fields: allOptions, sections - }), /* @__PURE__ */ import_react100.default.createElement("button", { + }), /* @__PURE__ */ import_react101.default.createElement("button", { className: "mk-inline-button", "aria-label": i18n_default.buttons.addSmartSearch, onClick: (e4) => saveMetadata({ @@ -113314,7 +113623,7 @@ var SpaceItems = (props) => { } ] }) - }, /* @__PURE__ */ import_react100.default.createElement("div", { + }, /* @__PURE__ */ import_react101.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") @@ -113325,7 +113634,7 @@ var SpaceEditor_default = SpaceEditor; // src/core/react/components/UI/Modals/ContextEditor.tsx var openSpaceEditorModal = (superstate, space2, tab) => { - superstate.ui.openModal(space2.name, (props) => /* @__PURE__ */ import_react101.default.createElement(SpaceEditor_default, { + superstate.ui.openModal(space2.name, (props) => /* @__PURE__ */ import_react102.default.createElement(SpaceEditor_default, { superstate, space: space2, tab, @@ -113335,7 +113644,7 @@ var openSpaceEditorModal = (superstate, space2, tab) => { })); }; var SpacePropertyEditorContext = (props) => { - const { spaceState: spaceCache } = (0, import_react101.useContext)(SpaceContext); + const { spaceState: spaceCache } = (0, import_react102.useContext)(SpaceContext); const { predicate, savePredicate, @@ -113343,9 +113652,9 @@ var SpacePropertyEditorContext = (props) => { hideColumn, delColumn, saveColumn - } = (0, import_react101.useContext)(ContextEditorContext); - const { tableData } = (0, import_react101.useContext)(ContextMDBContext); - const columns = (0, import_react101.useMemo)(() => { + } = (0, import_react102.useContext)(ContextEditorContext); + const { tableData } = (0, import_react102.useContext)(ContextMDBContext); + const columns = (0, import_react102.useMemo)(() => { return (tableData?.cols ?? []).sort( (a4, b2) => predicate.colsOrder.findIndex((x2) => x2 == a4.name) - predicate.colsOrder.findIndex((x2) => x2 == b2.name) ); @@ -113358,7 +113667,7 @@ var SpacePropertyEditorContext = (props) => { contexts ); }; - return /* @__PURE__ */ import_react101.default.createElement(SpacePropertyEditor, { + return /* @__PURE__ */ import_react102.default.createElement(SpacePropertyEditor, { superstate: props.superstate, colsOrder: predicate.colsOrder, setColumnOrder: (cols) => savePredicate({ ...predicate, colsOrder: cols }), @@ -113391,43 +113700,12 @@ var triggerSpaceMenu = (superstate, path, e4, activePath, parentSpace, triggerRe } }); menuOptions.push({ - name: i18n_default.buttons.createCanvas, - icon: "ui//layout-dashboard", - onClick: (e5) => { - newPathInSpace(superstate, space2, "canvas", null); - } - }); - menuOptions.push({ - name: i18n_default.buttons.createFolder, - icon: "ui//folder-plus", - onClick: (e5) => { - superstate.ui.openModal( - i18n_default.labels.createSection, - (props) => /* @__PURE__ */ import_react102.default.createElement(InputModal, { - saveLabel: i18n_default.buttons.rename, - value: "", - hide: props.hide, - saveValue: (v2) => { - let pathState = superstate.pathsIndex.get(space2?.path); - if (!pathState) { - pathState = superstate.pathsIndex.get("/"); - } - const newName = v2.replace(/\//g, ""); - const parentPath = pathState?.subtype == "folder" ? pathState.path : pathState.parent ? pathState.parent : "/"; - const newPath = !parentPath || parentPath == "/" ? newName : parentPath + "/" + newName; - if (newName.length == 0) { - superstate.ui.notify(i18n_default.notice.newSpaceName); - return; - } - if (superstate.spacesIndex.has(newPath)) { - superstate.ui.notify(i18n_default.notice.duplicateSpaceName); - return; - } - createSpace(superstate, newPath, {}); - } - }) - ); - } + name: "New", + type: 6 /* Submenu */, + onSubmenu: (offset2) => { + return showSpaceAddMenu(superstate, offset2, space2); + }, + icon: "ui//plus" }); menuOptions.push(menuSeparator); menuOptions.push({ @@ -113476,6 +113754,13 @@ var triggerSpaceMenu = (superstate, path, e4, activePath, parentSpace, triggerRe ); } }); + menuOptions.push({ + name: "Save as Template", + icon: "ui//clipboard-add", + onClick: (e5) => { + saveSpaceTemplate(superstate, space2.path, parentSpace); + } + }); if (parentSpace && parentSpace != path.parent) { const spaceCache = superstate.spacesIndex.get(parentSpace); if (spaceCache) { @@ -113516,7 +113801,7 @@ var triggerSpaceMenu = (superstate, path, e4, activePath, parentSpace, triggerRe name: i18n_default.buttons.changeIcon, icon: "ui//sticker", onClick: (e5) => { - superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react102.default.createElement(StickerModal_default, { + superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react103.default.createElement(StickerModal_default, { ui: superstate.ui, hide: _props.hide, selectedSticker: (emoji) => savePathSticker(superstate, space2.path, emoji) @@ -113667,7 +113952,7 @@ var triggerSpaceMenu = (superstate, path, e4, activePath, parentSpace, triggerRe onClick: (e5) => { superstate.ui.openModal( i18n_default.labels.rename, - (_props) => /* @__PURE__ */ import_react102.default.createElement(InputModal, { + (_props) => /* @__PURE__ */ import_react103.default.createElement(InputModal, { saveLabel: i18n_default.buttons.rename, value: space2.type == "tag" ? stringFromTag(space2.name) : space2.name, hide: _props.hide, @@ -113704,7 +113989,7 @@ var triggerSpaceMenu = (superstate, path, e4, activePath, parentSpace, triggerRe onClick: (e5) => { superstate.ui.openModal( i18n_default.labels.deleteSpace, - (_props) => /* @__PURE__ */ import_react102.default.createElement(ConfirmationModal, { + (_props) => /* @__PURE__ */ import_react103.default.createElement(ConfirmationModal, { hide: _props.hide, confirmAction: () => removeSpace(superstate, space2.path), confirmLabel: i18n_default.buttons.delete, @@ -113721,10 +114006,10 @@ var triggerSpaceMenu = (superstate, path, e4, activePath, parentSpace, triggerRe }; // src/core/react/components/Navigator/SpaceTree/SpaceTreeItem.tsx -var import_react104 = __toESM(require_react()); +var import_react105 = __toESM(require_react()); // node_modules/react-dropzone/dist/es/index.js -var import_react103 = __toESM(require_react()); +var import_react104 = __toESM(require_react()); var import_prop_types = __toESM(require_prop_types()); // node_modules/tslib/tslib.es6.mjs @@ -114564,15 +114849,15 @@ function _objectWithoutPropertiesLoose2(source, excluded) { } return target; } -var Dropzone = /* @__PURE__ */ (0, import_react103.forwardRef)(function(_ref, ref2) { +var Dropzone = /* @__PURE__ */ (0, import_react104.forwardRef)(function(_ref, ref2) { var children = _ref.children, params = _objectWithoutProperties(_ref, _excluded2); var _useDropzone = useDropzone(params), open = _useDropzone.open, props = _objectWithoutProperties(_useDropzone, _excluded22); - (0, import_react103.useImperativeHandle)(ref2, function() { + (0, import_react104.useImperativeHandle)(ref2, function() { return { open }; }, [open]); - return /* @__PURE__ */ import_react103.default.createElement(import_react103.Fragment, null, children(_objectSpread5(_objectSpread5({}, props), {}, { + return /* @__PURE__ */ import_react104.default.createElement(import_react104.Fragment, null, children(_objectSpread5(_objectSpread5({}, props), {}, { open }))); }); @@ -114633,23 +114918,23 @@ var initialState = { function useDropzone() { var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; var _defaultProps$props = _objectSpread5(_objectSpread5({}, defaultProps2), props), accept = _defaultProps$props.accept, disabled = _defaultProps$props.disabled, getFilesFromEvent = _defaultProps$props.getFilesFromEvent, maxSize = _defaultProps$props.maxSize, minSize = _defaultProps$props.minSize, multiple = _defaultProps$props.multiple, maxFiles = _defaultProps$props.maxFiles, onDragEnter = _defaultProps$props.onDragEnter, onDragLeave = _defaultProps$props.onDragLeave, onDragOver = _defaultProps$props.onDragOver, onDrop = _defaultProps$props.onDrop, onDropAccepted = _defaultProps$props.onDropAccepted, onDropRejected = _defaultProps$props.onDropRejected, onFileDialogCancel = _defaultProps$props.onFileDialogCancel, onFileDialogOpen = _defaultProps$props.onFileDialogOpen, useFsAccessApi = _defaultProps$props.useFsAccessApi, autoFocus = _defaultProps$props.autoFocus, preventDropOnDocument = _defaultProps$props.preventDropOnDocument, noClick = _defaultProps$props.noClick, noKeyboard = _defaultProps$props.noKeyboard, noDrag = _defaultProps$props.noDrag, noDragEventsBubbling = _defaultProps$props.noDragEventsBubbling, onError = _defaultProps$props.onError, validator = _defaultProps$props.validator; - var acceptAttr = (0, import_react103.useMemo)(function() { + var acceptAttr = (0, import_react104.useMemo)(function() { return acceptPropAsAcceptAttr(accept); }, [accept]); - var pickerTypes = (0, import_react103.useMemo)(function() { + var pickerTypes = (0, import_react104.useMemo)(function() { return pickerOptionsFromAccept(accept); }, [accept]); - var onFileDialogOpenCb = (0, import_react103.useMemo)(function() { + var onFileDialogOpenCb = (0, import_react104.useMemo)(function() { return typeof onFileDialogOpen === "function" ? onFileDialogOpen : noop2; }, [onFileDialogOpen]); - var onFileDialogCancelCb = (0, import_react103.useMemo)(function() { + var onFileDialogCancelCb = (0, import_react104.useMemo)(function() { return typeof onFileDialogCancel === "function" ? onFileDialogCancel : noop2; }, [onFileDialogCancel]); - var rootRef = (0, import_react103.useRef)(null); - var inputRef = (0, import_react103.useRef)(null); - var _useReducer = (0, import_react103.useReducer)(reducer2, initialState), _useReducer2 = _slicedToArray2(_useReducer, 2), state = _useReducer2[0], dispatch = _useReducer2[1]; + var rootRef = (0, import_react104.useRef)(null); + var inputRef = (0, import_react104.useRef)(null); + var _useReducer = (0, import_react104.useReducer)(reducer2, initialState), _useReducer2 = _slicedToArray2(_useReducer, 2), state = _useReducer2[0], dispatch = _useReducer2[1]; var isFocused = state.isFocused, isFileDialogActive = state.isFileDialogActive; - var fsAccessApiWorksRef = (0, import_react103.useRef)(typeof window !== "undefined" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI()); + var fsAccessApiWorksRef = (0, import_react104.useRef)(typeof window !== "undefined" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI()); var onWindowFocus = function onWindowFocus2() { if (!fsAccessApiWorksRef.current && isFileDialogActive) { setTimeout(function() { @@ -114665,13 +114950,13 @@ function useDropzone() { }, 300); } }; - (0, import_react103.useEffect)(function() { + (0, import_react104.useEffect)(function() { window.addEventListener("focus", onWindowFocus, false); return function() { window.removeEventListener("focus", onWindowFocus, false); }; }, [inputRef, isFileDialogActive, onFileDialogCancelCb, fsAccessApiWorksRef]); - var dragTargetsRef = (0, import_react103.useRef)([]); + var dragTargetsRef = (0, import_react104.useRef)([]); var onDocumentDrop = function onDocumentDrop2(event) { if (rootRef.current && rootRef.current.contains(event.target)) { return; @@ -114679,7 +114964,7 @@ function useDropzone() { event.preventDefault(); dragTargetsRef.current = []; }; - (0, import_react103.useEffect)(function() { + (0, import_react104.useEffect)(function() { if (preventDropOnDocument) { document.addEventListener("dragover", onDocumentDragOver, false); document.addEventListener("drop", onDocumentDrop, false); @@ -114691,21 +114976,21 @@ function useDropzone() { } }; }, [rootRef, preventDropOnDocument]); - (0, import_react103.useEffect)(function() { + (0, import_react104.useEffect)(function() { if (!disabled && autoFocus && rootRef.current) { rootRef.current.focus(); } return function() { }; }, [rootRef, autoFocus, disabled]); - var onErrCb = (0, import_react103.useCallback)(function(e4) { + var onErrCb = (0, import_react104.useCallback)(function(e4) { if (onError) { onError(e4); } else { console.error(e4); } }, [onError]); - var onDragEnterCb = (0, import_react103.useCallback)(function(event) { + var onDragEnterCb = (0, import_react104.useCallback)(function(event) { event.preventDefault(); event.persist(); stopPropagation2(event); @@ -114740,7 +115025,7 @@ function useDropzone() { }); } }, [getFilesFromEvent, onDragEnter, onErrCb, noDragEventsBubbling, acceptAttr, minSize, maxSize, multiple, maxFiles, validator]); - var onDragOverCb = (0, import_react103.useCallback)(function(event) { + var onDragOverCb = (0, import_react104.useCallback)(function(event) { event.preventDefault(); event.persist(); stopPropagation2(event); @@ -114756,7 +115041,7 @@ function useDropzone() { } return false; }, [onDragOver, noDragEventsBubbling]); - var onDragLeaveCb = (0, import_react103.useCallback)(function(event) { + var onDragLeaveCb = (0, import_react104.useCallback)(function(event) { event.preventDefault(); event.persist(); stopPropagation2(event); @@ -114781,7 +115066,7 @@ function useDropzone() { onDragLeave(event); } }, [rootRef, onDragLeave, noDragEventsBubbling]); - var setFiles = (0, import_react103.useCallback)(function(files, event) { + var setFiles = (0, import_react104.useCallback)(function(files, event) { var acceptedFiles = []; var fileRejections = []; files.forEach(function(file) { @@ -114827,7 +115112,7 @@ function useDropzone() { onDropAccepted(acceptedFiles, event); } }, [dispatch, multiple, acceptAttr, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]); - var onDropCb = (0, import_react103.useCallback)(function(event) { + var onDropCb = (0, import_react104.useCallback)(function(event) { event.preventDefault(); event.persist(); stopPropagation2(event); @@ -114846,7 +115131,7 @@ function useDropzone() { type: "reset" }); }, [getFilesFromEvent, setFiles, onErrCb, noDragEventsBubbling]); - var openFileDialog = (0, import_react103.useCallback)(function() { + var openFileDialog = (0, import_react104.useCallback)(function() { if (fsAccessApiWorksRef.current) { dispatch({ type: "openDialog" @@ -114892,7 +115177,7 @@ function useDropzone() { inputRef.current.click(); } }, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, onErrCb, pickerTypes, multiple]); - var onKeyDownCb = (0, import_react103.useCallback)(function(event) { + var onKeyDownCb = (0, import_react104.useCallback)(function(event) { if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) { return; } @@ -114901,17 +115186,17 @@ function useDropzone() { openFileDialog(); } }, [rootRef, openFileDialog]); - var onFocusCb = (0, import_react103.useCallback)(function() { + var onFocusCb = (0, import_react104.useCallback)(function() { dispatch({ type: "focus" }); }, []); - var onBlurCb = (0, import_react103.useCallback)(function() { + var onBlurCb = (0, import_react104.useCallback)(function() { dispatch({ type: "blur" }); }, []); - var onClickCb = (0, import_react103.useCallback)(function() { + var onClickCb = (0, import_react104.useCallback)(function() { if (noClick) { return; } @@ -114935,7 +115220,7 @@ function useDropzone() { event.stopPropagation(); } }; - var getRootProps = (0, import_react103.useMemo)(function() { + var getRootProps = (0, import_react104.useMemo)(function() { return function() { var _ref2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref2$refKey = _ref2.refKey, refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey, role = _ref2.role, onKeyDown = _ref2.onKeyDown, onFocus = _ref2.onFocus, onBlur = _ref2.onBlur, onClick = _ref2.onClick, onDragEnter2 = _ref2.onDragEnter, onDragOver2 = _ref2.onDragOver, onDragLeave2 = _ref2.onDragLeave, onDrop2 = _ref2.onDrop, rest = _objectWithoutProperties(_ref2, _excluded3); return _objectSpread5(_objectSpread5(_defineProperty3({ @@ -114953,10 +115238,10 @@ function useDropzone() { } : {}), rest); }; }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]); - var onInputElementClick = (0, import_react103.useCallback)(function(event) { + var onInputElementClick = (0, import_react104.useCallback)(function(event) { event.stopPropagation(); }, []); - var getInputProps = (0, import_react103.useMemo)(function() { + var getInputProps = (0, import_react104.useMemo)(function() { return function() { var _ref3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, onChange = _ref3.onChange, onClick = _ref3.onClick, rest = _objectWithoutProperties(_ref3, _excluded4); var inputProps = _defineProperty3({ @@ -115053,14 +115338,14 @@ var TreeItem = (props) => { setSelectedPaths, setDragPaths, closeActiveSpace - } = (0, import_react104.useContext)(NavigatorContext); - const [hoverTarget, setHoverTarget] = (0, import_react104.useState)(null); - const innerRef = (0, import_react104.useRef)(null); - const [dropHighlighted, setDropHighlighted] = (0, import_react104.useState)(false); - const [pathState, setPathState] = (0, import_react104.useState)( + } = (0, import_react105.useContext)(NavigatorContext); + const [hoverTarget, setHoverTarget] = (0, import_react105.useState)(null); + const innerRef = (0, import_react105.useRef)(null); + const [dropHighlighted, setDropHighlighted] = (0, import_react105.useState)(false); + const [pathState, setPathState] = (0, import_react105.useState)( superstate.pathsIndex.get(data2.item.path) ); - (0, import_react104.useEffect)( + (0, import_react105.useEffect)( () => setPathState(superstate.pathsIndex.get(data2.item.path)), [data2.item.path] ); @@ -115117,7 +115402,7 @@ var TreeItem = (props) => { superstate.ui.openPath(pathState.path, "hover", el); } }; - const onDrop = (0, import_react104.useCallback)((files) => { + const onDrop = (0, import_react105.useCallback)((files) => { if (isFolder) { files.map(async (file) => { file.arrayBuffer().then((arrayBuffer) => { @@ -115130,7 +115415,7 @@ var TreeItem = (props) => { }); } }, []); - const onDragEnter = (0, import_react104.useCallback)(() => { + const onDragEnter = (0, import_react105.useCallback)(() => { if (isFolder) setDropHighlighted(true); }, []); @@ -115171,6 +115456,7 @@ var TreeItem = (props) => { const handleRightClick = (e4) => { selectedPaths.length > 1 && selectedPaths.some((f2) => f2.id == data2.id) ? triggerMultiPathMenu(superstate, selectedPaths, e4) : contextMenu(e4); }; + const color2 = pathState?.label?.color; const contextMenu = (e4) => { if (superstate.spacesIndex.has(pathState.path)) { triggerSpaceMenu(superstate, pathState, e4, activePath, data2.space); @@ -115191,7 +115477,7 @@ var TreeItem = (props) => { setPathState(_pathState); } }; - (0, import_react104.useEffect)(() => { + (0, import_react105.useEffect)(() => { superstate.eventsDispatcher.addListener( "pathStateUpdated", pathStateUpdated @@ -115211,7 +115497,7 @@ var TreeItem = (props) => { } } }; - (0, import_react104.useEffect)(() => { + (0, import_react105.useEffect)(() => { if (hoverTarget && superstate.settings.filePreviewOnHover) { window.addEventListener("keydown", onKeyDown); return () => { @@ -115232,7 +115518,7 @@ var TreeItem = (props) => { const extension = pathState?.metadata?.file?.extension; const isLink = pathState?.parent != data2.space; const spacing = data2.type == "group" ? 0 : indentationWidth * (depth - 1) + (data2.item?.type == "space" ? 0 : isTouchScreen(props.superstate.ui) ? 30 : 20); - return /* @__PURE__ */ import_react104.default.createElement(import_react104.default.Fragment, null, /* @__PURE__ */ import_react104.default.createElement("div", { + return /* @__PURE__ */ import_react105.default.createElement(import_react105.default.Fragment, null, /* @__PURE__ */ import_react105.default.createElement("div", { className: (0, import_classnames.default)( "mk-tree-wrapper", data2.type == "group" ? "mk-tree-section" : "", @@ -115240,7 +115526,14 @@ var TreeItem = (props) => { ghost && "mk-ghost", highlighted ? "is-highlighted" : "" ), - style: { position: "relative" }, + style: color2?.length > 0 ? { + "--label-color": `${color2}`, + "--icon-color": `#ffffff`, + position: "relative" + } : { + "--icon-color": `var(--mk-ui-text-secondary)`, + position: "relative" + }, ref: innerRef, onMouseLeave: mouseOut, onMouseEnter: hoverItem, @@ -115249,16 +115542,16 @@ var TreeItem = (props) => { onContextMenu: (e4) => handleRightClick(e4), ...dropProps, ...innerProps - }, /* @__PURE__ */ import_react104.default.createElement("div", { + }, /* @__PURE__ */ import_react105.default.createElement("div", { className: (0, import_classnames.default)(isFolder ? "nav-folder" : "nav-file"), style: { ...style, ...dragActive ? { pointerEvents: "none" } : {} }, ...!isTouchScreen(props.superstate.ui) ? getRootProps({ className: "dropzone" }) : {} - }, /* @__PURE__ */ import_react104.default.createElement("input", { + }, /* @__PURE__ */ import_react105.default.createElement("input", { ...getInputProps() - }), /* @__PURE__ */ import_react104.default.createElement("div", { + }), /* @__PURE__ */ import_react105.default.createElement("div", { className: (0, import_classnames.default)( "mk-tree-item", "tree-item-self", @@ -115272,33 +115565,33 @@ var TreeItem = (props) => { "--childrenCount": `${childCount * spaceRowHeight(superstate, data2.type == "group") - 13}px` }, "data-path": pathState?.path - }, data2.type == "space" && /* @__PURE__ */ import_react104.default.createElement(CollapseToggle, { + }, data2.type == "space" && /* @__PURE__ */ import_react105.default.createElement(CollapseToggle, { superstate: props.superstate, collapsed, onToggle: (c3, e4) => { onCollapse(data2, false); e4.stopPropagation(); } - }), superstate.settings.spacesStickers && pathState && /* @__PURE__ */ import_react104.default.createElement(PathStickerView, { + }), superstate.settings.spacesStickers && pathState && /* @__PURE__ */ import_react105.default.createElement(PathStickerView, { superstate, pathState, editable: true - }), /* @__PURE__ */ import_react104.default.createElement("div", { + }), /* @__PURE__ */ import_react105.default.createElement("div", { className: `mk-tree-text ${isFolder ? "nav-folder-title-content" : "nav-file-title-content"}` - }, pathState?.displayName ?? pathState?.name ?? data2.path), data2.type == "group" && /* @__PURE__ */ import_react104.default.createElement(CollapseToggle, { + }, pathState?.displayName ?? pathState?.name ?? data2.path), data2.type == "group" && /* @__PURE__ */ import_react105.default.createElement(CollapseToggle, { superstate: props.superstate, collapsed, onToggle: (c3, e4) => { onCollapse(data2, false); e4.stopPropagation(); } - }), /* @__PURE__ */ import_react104.default.createElement("div", { + }), /* @__PURE__ */ import_react105.default.createElement("div", { className: "mk-tree-span" - }), !isSpace && extension != "md" && /* @__PURE__ */ import_react104.default.createElement("span", { + }), !isSpace && extension != "md" && /* @__PURE__ */ import_react105.default.createElement("span", { className: "nav-file-tag" - }, extension), !clone4 ? /* @__PURE__ */ import_react104.default.createElement("div", { + }, extension), !clone4 ? /* @__PURE__ */ import_react105.default.createElement("div", { className: "mk-folder-buttons" - }, data2.type == "group" && /* @__PURE__ */ import_react104.default.createElement("button", { + }, data2.type == "group" && /* @__PURE__ */ import_react105.default.createElement("button", { "aria-label": "Close Space", onClick: (e4) => { closeActiveSpace(data2.path); @@ -115307,7 +115600,7 @@ var TreeItem = (props) => { dangerouslySetInnerHTML: { __html: superstate.ui.getSticker("ui//close") } - }), /* @__PURE__ */ import_react104.default.createElement("button", { + }), /* @__PURE__ */ import_react105.default.createElement("button", { "aria-label": i18n_default.buttons.moreOptions, onClick: (e4) => { contextMenu(e4); @@ -115316,7 +115609,7 @@ var TreeItem = (props) => { dangerouslySetInnerHTML: { __html: superstate.ui.getSticker("ui//options") } - }), isSpace && /* @__PURE__ */ import_react104.default.createElement("button", { + }), isSpace && /* @__PURE__ */ import_react105.default.createElement("button", { "aria-label": i18n_default.buttons.newNote, onClick: (e4) => { newAction(e4); @@ -115325,12 +115618,12 @@ var TreeItem = (props) => { dangerouslySetInnerHTML: { __html: superstate.ui.getSticker("ui//plus") } - })) : /* @__PURE__ */ import_react104.default.createElement(import_react104.default.Fragment, null))))); + })) : /* @__PURE__ */ import_react105.default.createElement(import_react105.default.Fragment, null))))); }; TreeItem.displayName = "TreeItem"; // node_modules/@tanstack/react-virtual/dist/esm/index.js -var React102 = __toESM(require_react(), 1); +var React103 = __toESM(require_react(), 1); var import_react_dom5 = __toESM(require_react_dom(), 1); // node_modules/@tanstack/virtual-core/dist/esm/utils.js @@ -115981,9 +116274,9 @@ function calculateRange({ } // node_modules/@tanstack/react-virtual/dist/esm/index.js -var useIsomorphicLayoutEffect3 = typeof document !== "undefined" ? React102.useLayoutEffect : React102.useEffect; +var useIsomorphicLayoutEffect3 = typeof document !== "undefined" ? React103.useLayoutEffect : React103.useEffect; function useVirtualizerBase(options) { - const rerender = React102.useReducer(() => ({}), {})[1]; + const rerender = React103.useReducer(() => ({}), {})[1]; const resolvedOptions = { ...options, onChange: (instance2, sync) => { @@ -115996,11 +116289,11 @@ function useVirtualizerBase(options) { (_a = options.onChange) == null ? void 0 : _a.call(options, instance2, sync); } }; - const [instance] = React102.useState( + const [instance] = React103.useState( () => new Virtualizer(resolvedOptions) ); instance.setOptions(resolvedOptions); - React102.useEffect(() => { + React103.useEffect(() => { return instance._didMount(); }, []); useIsomorphicLayoutEffect3(() => { @@ -116018,8 +116311,8 @@ function useVirtualizer(options) { } // src/core/react/components/Navigator/SpaceTree/SpaceTreeVirtualized.tsx -var import_react105 = __toESM(require_react()); -var VirtualizedList = import_react105.default.memo(function VirtualizedList2(props) { +var import_react106 = __toESM(require_react()); +var VirtualizedList = import_react106.default.memo(function VirtualizedList2(props) { const { flattenedTree, rowHeights, @@ -116034,16 +116327,16 @@ var VirtualizedList = import_react105.default.memo(function VirtualizedList2(pro activeIndex, indentationWidth } = props; - const parentRef = import_react105.default.useRef(null); + const parentRef = import_react106.default.useRef(null); const rowVirtualizer = useVirtualizer({ count: flattenedTree.length, paddingEnd: 24, getScrollElement: () => parentRef.current, - estimateSize: import_react105.default.useCallback((index) => rowHeights[index], [rowHeights]), + estimateSize: import_react106.default.useCallback((index) => rowHeights[index], [rowHeights]), overscan: 0 }); vRef.current = rowVirtualizer; - const { saveActiveSpace } = (0, import_react105.useContext)(NavigatorContext); + const { saveActiveSpace } = (0, import_react106.useContext)(NavigatorContext); const dropIndicator = (index) => { return overIndex == index && projected && projected.insert; }; @@ -116092,7 +116385,7 @@ var VirtualizedList = import_react105.default.memo(function VirtualizedList2(pro } } }; - return /* @__PURE__ */ import_react105.default.createElement("div", { + return /* @__PURE__ */ import_react106.default.createElement("div", { ref: parentRef, style: { width: `100%`, @@ -116100,13 +116393,13 @@ var VirtualizedList = import_react105.default.memo(function VirtualizedList2(pro overflow: "auto", "--spaceRowHeight": spaceRowHeight(superstate, false) + "px" } - }, /* @__PURE__ */ import_react105.default.createElement("div", { + }, /* @__PURE__ */ import_react106.default.createElement("div", { style: { height: `${rowVirtualizer.getTotalSize()}px`, width: "100%", position: "relative" } - }, rowVirtualizer.getVirtualItems().map((virtualRow) => /* @__PURE__ */ import_react105.default.createElement("div", { + }, rowVirtualizer.getVirtualItems().map((virtualRow) => /* @__PURE__ */ import_react106.default.createElement("div", { key: virtualRow.index, style: { position: "absolute", @@ -116116,7 +116409,7 @@ var VirtualizedList = import_react105.default.memo(function VirtualizedList2(pro height: `${rowHeights[virtualRow.index]}px`, transform: `translateY(${virtualRow.start}px)` } - }, flattenedTree[virtualRow.index].type == "new" ? /* @__PURE__ */ import_react105.default.createElement("div", { + }, flattenedTree[virtualRow.index].type == "new" ? /* @__PURE__ */ import_react106.default.createElement("div", { className: "mk-tree-wrapper mk-tree-section", onClick: (e4) => showSpacesMenu( e4, @@ -116134,16 +116427,16 @@ var VirtualizedList = import_react105.default.memo(function VirtualizedList2(pro true, true ) - }, /* @__PURE__ */ import_react105.default.createElement("div", { + }, /* @__PURE__ */ import_react106.default.createElement("div", { className: "mk-tree-item tree-item-self nav-folder-title mk-tree-new" - }, /* @__PURE__ */ import_react105.default.createElement("div", { + }, /* @__PURE__ */ import_react106.default.createElement("div", { className: `mk-path-icon mk-path-icon-placeholder`, dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - }), /* @__PURE__ */ import_react105.default.createElement("div", { + }), /* @__PURE__ */ import_react106.default.createElement("div", { className: "mk-tree-text nav-folder-title-content" - }, i18n_default.menu.openSpace))) : /* @__PURE__ */ import_react105.default.createElement(TreeItem, { + }, i18n_default.menu.openSpace))) : /* @__PURE__ */ import_react106.default.createElement(TreeItem, { key: flattenedTree[virtualRow.index].id, id: flattenedTree[virtualRow.index].id, data: flattenedTree[virtualRow.index], @@ -116182,7 +116475,7 @@ var VirtualizedList = import_react105.default.memo(function VirtualizedList2(pro var SpaceTreeComponent = (props) => { const { superstate } = props; const indentationWidth = isTouchScreen(props.superstate.ui) ? 20 : 16; - const [expandedSpaces, setExpandedSpaces] = (0, import_react106.useState)( + const [expandedSpaces, setExpandedSpaces] = (0, import_react107.useState)( superstate.settings.expandedSpaces ); const { @@ -116195,12 +116488,12 @@ var SpaceTreeComponent = (props) => { setDragPaths, modifier, setModifier - } = (0, import_react106.useContext)(NavigatorContext); - const [activeId, setActiveId] = (0, import_react106.useState)(null); - const [overId, setOverId] = (0, import_react106.useState)(null); - const nextTreeScrollPath = (0, import_react106.useRef)(null); - const [offset2, setOffset] = (0, import_react106.useState)({ x: 0, y: 0 }); - const listRef = (0, import_react106.useRef)(null); + } = (0, import_react107.useContext)(NavigatorContext); + const [activeId, setActiveId] = (0, import_react107.useState)(null); + const [overId, setOverId] = (0, import_react107.useState)(null); + const nextTreeScrollPath = (0, import_react107.useRef)(null); + const [offset2, setOffset] = (0, import_react107.useState)({ x: 0, y: 0 }); + const listRef = (0, import_react107.useRef)(null); const treeForRoot = (space2, activeId2) => { const tree = []; const activeParent = flattenedTree.find((f2) => f2.id == activeId2)?.parentId; @@ -116330,8 +116623,8 @@ var SpaceTreeComponent = (props) => { ); return tree; }; - const [flattenedTree, setFlattenedTree] = (0, import_react106.useState)([]); - const refreshableSpaces = (0, import_react106.useMemo)( + const [flattenedTree, setFlattenedTree] = (0, import_react107.useState)([]); + const refreshableSpaces = (0, import_react107.useMemo)( () => [ ...activeViewSpaces.filter((f2) => f2).map((f2) => f2.path), ...flattenedTree.filter((f2) => f2.type == "space").map((f2) => f2.path) @@ -116366,7 +116659,7 @@ var SpaceTreeComponent = (props) => { }); setFlattenedTree(tree); }; - (0, import_react106.useEffect)(() => { + (0, import_react107.useEffect)(() => { if (selectedPaths.length <= 1) { if (!selectedPaths[0] || selectedPaths[0].item.path != activePath) setSelectedPaths([]); @@ -116384,13 +116677,13 @@ var SpaceTreeComponent = (props) => { ); }; }, [activePath]); - (0, import_react106.useEffect)(() => { + (0, import_react107.useEffect)(() => { window.addEventListener("dragend", resetState); return () => { window.removeEventListener("dragend", resetState); }; }); - (0, import_react106.useEffect)(() => { + (0, import_react107.useEffect)(() => { superstate.eventsDispatcher.addListener("settingsChanged", settingsChanged); return () => { superstate.eventsDispatcher.removeListener( @@ -116399,7 +116692,7 @@ var SpaceTreeComponent = (props) => { ); }; }, [activeViewSpaces]); - (0, import_react106.useEffect)(() => { + (0, import_react107.useEffect)(() => { window.addEventListener(eventTypes.revealPath, handleRevealPathEvent); return () => { window.removeEventListener(eventTypes.revealPath, handleRevealPathEvent); @@ -116425,7 +116718,7 @@ var SpaceTreeComponent = (props) => { if (evt.detail) revealPath(evt.detail.path); }; - (0, import_react106.useEffect)(() => { + (0, import_react107.useEffect)(() => { retrieveData(); props.superstate.eventsDispatcher.addListener( "superstateUpdated", @@ -116438,7 +116731,7 @@ var SpaceTreeComponent = (props) => { ); }; }, [expandedSpaces, activeViewSpaces, activeId]); - (0, import_react106.useEffect)(() => { + (0, import_react107.useEffect)(() => { const spaceUpdated = (payload) => { if (refreshableSpaces.some((f2) => f2 == payload.path)) { retrieveData(); @@ -116461,19 +116754,19 @@ var SpaceTreeComponent = (props) => { const settingsChanged = () => { setExpandedSpaces(superstate.settings.expandedSpaces); }; - const overIndex = (0, import_react106.useMemo)( + const overIndex = (0, import_react107.useMemo)( () => flattenedTree.findIndex((f2) => f2.id == overId), [overId, flattenedTree] ); - const activeIndex = (0, import_react106.useMemo)( + const activeIndex = (0, import_react107.useMemo)( () => flattenedTree.findIndex((f2) => f2.id == activeId), [activeId, flattenedTree] ); - const sortedIds = (0, import_react106.useMemo)( + const sortedIds = (0, import_react107.useMemo)( () => flattenedTree.map(({ id: id3 }) => id3), [flattenedTree] ); - const selectRange2 = (0, import_react106.useCallback)( + const selectRange2 = (0, import_react107.useCallback)( (fromId) => { const startIndex = sortedIds.findIndex((f2) => f2 == fromId); const selectedPathsStartIndex = sortedIds.findIndex( @@ -116494,8 +116787,8 @@ var SpaceTreeComponent = (props) => { }, [sortedIds, selectedPaths, setSelectedPaths, flattenedTree] ); - const [projected, setProjected] = (0, import_react106.useState)(null); - (0, import_react106.useEffect)(() => { + const [projected, setProjected] = (0, import_react107.useState)(null); + (0, import_react107.useEffect)(() => { const dragDepth = getDragDepth(offset2.x, indentationWidth); const activeItem = flattenedTree.find(({ id: id3 }) => id3 === activeId); const _projected = overId ? getProjection( @@ -116534,11 +116827,11 @@ var SpaceTreeComponent = (props) => { } document.body.style.setProperty("cursor", "grabbing"); }; - const parentName = (0, import_react106.useMemo)( + const parentName = (0, import_react107.useMemo)( () => projected ? flattenedTree.find((f2) => f2.id == projected.parentId)?.item?.name : null, [flattenedTree, projected] ); - const overName = (0, import_react106.useMemo)( + const overName = (0, import_react107.useMemo)( () => projected && flattenedTree.find((f2) => f2.id == projected.overId)?.item?.name, [flattenedTree, projected] ); @@ -116569,7 +116862,7 @@ var SpaceTreeComponent = (props) => { }); } }; - (0, import_react106.useEffect)(() => { + (0, import_react107.useEffect)(() => { if (dragPaths.length == 0) { setOverId(null); setActiveId(null); @@ -116595,7 +116888,7 @@ var SpaceTreeComponent = (props) => { ); resetState(); }; - const handleCollapse = (0, import_react106.useCallback)( + const handleCollapse = (0, import_react107.useCallback)( (folder, open) => { const folderOpen = expandedSpaces?.includes(folder.id); const newOpenFolders = !folderOpen || open ? [...expandedSpaces, folder.id] : expandedSpaces.filter( @@ -116616,7 +116909,7 @@ var SpaceTreeComponent = (props) => { dragCounter.current = 0; document.body.style.setProperty("cursor", ""); } - const dragCounter = (0, import_react106.useRef)(0); + const dragCounter = (0, import_react107.useRef)(0); const dragEnter = () => { dragCounter.current++; }; @@ -116629,11 +116922,11 @@ var SpaceTreeComponent = (props) => { dragCounter.current = 0; } }; - const rowHeights = (0, import_react106.useMemo)( + const rowHeights = (0, import_react107.useMemo)( () => flattenedTree.map((f2) => spaceRowHeight(superstate, f2.type == "group")), [flattenedTree] ); - return /* @__PURE__ */ import_react106.default.createElement("div", { + return /* @__PURE__ */ import_react107.default.createElement("div", { className: `mk-path-tree`, onDragEnter: () => dragEnter(), onDragLeave: () => dragLeave(), @@ -116645,7 +116938,7 @@ var SpaceTreeComponent = (props) => { resetState(); } } - }, /* @__PURE__ */ import_react106.default.createElement(VirtualizedList, { + }, /* @__PURE__ */ import_react107.default.createElement(VirtualizedList, { vRef: listRef, rowHeights, flattenedTree, @@ -116661,7 +116954,7 @@ var SpaceTreeComponent = (props) => { dragEnded, overIndex, activeIndex - }), modifier && !isTouchScreen(props.superstate.ui) && /* @__PURE__ */ import_react106.default.createElement("div", { + }), modifier && !isTouchScreen(props.superstate.ui) && /* @__PURE__ */ import_react107.default.createElement("div", { className: "mk-hint-dnd", style: { position: "absolute", @@ -116674,23 +116967,23 @@ var SpaceTreeComponent = (props) => { color: "var(--text-on-accent)", fontSize: "12px" } - }, /* @__PURE__ */ import_react106.default.createElement("div", null, i18n_default.hintText.dragDropModifierKeys.replace("${1}", "shift").replace("${2}", normalizedAltName())))); + }, /* @__PURE__ */ import_react107.default.createElement("div", null, i18n_default.hintText.dragDropModifierKeys.replace("${1}", "shift").replace("${2}", normalizedAltName())))); }; // src/core/react/components/Navigator/MainList.tsx -var import_react110 = __toESM(require_react()); +var import_react111 = __toESM(require_react()); // src/core/react/components/Navigator/MainMenu.tsx var import_classnames2 = __toESM(require_classnames()); -var import_react107 = __toESM(require_react()); +var import_react108 = __toESM(require_react()); var MainMenu = (props) => { const { superstate } = props; - const { setActivePath, setDragPaths } = (0, import_react107.useContext)(NavigatorContext); - const ref2 = (0, import_react107.useRef)(); + const { setActivePath, setDragPaths } = (0, import_react108.useContext)(NavigatorContext); + const ref2 = (0, import_react108.useRef)(); const defaultAddAction = (superstate2, space2, path) => { if (space2?.path == "spaces://$tags") { superstate2.ui.openModal("New Tag", (props2) => { - return /* @__PURE__ */ import_react107.default.createElement(InputModal, { + return /* @__PURE__ */ import_react108.default.createElement(InputModal, { value: "", saveLabel: i18n_default.labels.saveView, hide: props2.hide, @@ -116707,40 +117000,44 @@ var MainMenu = (props) => { }); } }; - return /* @__PURE__ */ import_react107.default.createElement("div", { + return /* @__PURE__ */ import_react108.default.createElement("div", { className: "mk-main-menu-container" - }, /* @__PURE__ */ import_react107.default.createElement("div", { + }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "mk-main-menu-inner" - }, /* @__PURE__ */ import_react107.default.createElement("div", { + }, /* @__PURE__ */ import_react108.default.createElement("div", { className: (0, import_classnames2.default)("mk-main-menu") - }, /* @__PURE__ */ import_react107.default.createElement("div", { + }, /* @__PURE__ */ import_react108.default.createElement("div", { className: `mk-main-menu-button mk-main-menu-button-primary`, ref: ref2, onClick: (e4) => { props.superstate.ui.mainMenu(ref2.current, superstate); } - }, props.superstate.settings.systemName, /* @__PURE__ */ import_react107.default.createElement("div", { + }, props.superstate.settings.systemName, /* @__PURE__ */ import_react108.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//chevrons-up-down") } - })), /* @__PURE__ */ import_react107.default.createElement("div", { + })), /* @__PURE__ */ import_react108.default.createElement("div", { className: "mk-main-menu-button", onClick: (e4) => props.superstate.ui.quickOpen(superstate) - }, /* @__PURE__ */ import_react107.default.createElement("div", { + }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//search") } - }))), /* @__PURE__ */ import_react107.default.createElement("button", { + }))), /* @__PURE__ */ import_react108.default.createElement("button", { "aria-label": i18n_default.buttons.newNote, className: "mk-main-menu-button", - onClick: (e4) => e4.metaKey ? showSpaceAddMenu(props.superstate, e4, null) : defaultAddAction( + onClick: (e4) => e4.metaKey ? showSpaceAddMenu( + props.superstate, + e4.target.getBoundingClientRect(), + null + ) : defaultAddAction( superstate, null, superstate.settings.newNotePlaceholder ) - }, /* @__PURE__ */ import_react107.default.createElement("div", { + }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//new-note") @@ -116749,23 +117046,23 @@ var MainMenu = (props) => { }; // src/core/react/components/Navigator/Waypoints/Waypoints.tsx -var import_react109 = __toESM(require_react()); +var import_react110 = __toESM(require_react()); var import_react_dom6 = __toESM(require_react_dom()); // src/core/react/components/Navigator/Waypoints/Waypoint.tsx var import_classnames3 = __toESM(require_classnames()); -var import_react108 = __toESM(require_react()); +var import_react109 = __toESM(require_react()); var SortablePinnedSpaceItem = ({ id: id3, index, ...props }) => { - return /* @__PURE__ */ import_react108.default.createElement(PinnedSpace, { + return /* @__PURE__ */ import_react109.default.createElement(PinnedSpace, { index, ...props }); }; -var PinnedSpace = (0, import_react108.forwardRef)( +var PinnedSpace = (0, import_react109.forwardRef)( ({ pin, indicator, @@ -116779,13 +117076,13 @@ var PinnedSpace = (0, import_react108.forwardRef)( dragEnded, index }, ref2) => { - const innerRef = (0, import_react108.useRef)(null); + const innerRef = (0, import_react109.useRef)(null); const { activePath, waypoints, setWaypoints, setModifier - } = (0, import_react108.useContext)(NavigatorContext); + } = (0, import_react109.useContext)(NavigatorContext); const onDragStarted = (e4) => { if (dragStart && pin) { dragStart(index); @@ -116802,7 +117099,7 @@ var PinnedSpace = (0, import_react108.forwardRef)( onDragEnd: onDragEnded, onDrop: onDragEnded }; - return pin ? /* @__PURE__ */ import_react108.default.createElement("div", { + return pin ? /* @__PURE__ */ import_react109.default.createElement("div", { onContextMenu: (e4) => { const menuOptions = [ { @@ -116810,7 +117107,7 @@ var PinnedSpace = (0, import_react108.forwardRef)( icon: "ui//edit", value: "change-sticker", onClick: () => { - superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react108.default.createElement(StickerModal_default, { + superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react109.default.createElement(StickerModal_default, { ui: superstate.ui, hide: _props.hide, selectedSticker: (emoji) => { @@ -116855,7 +117152,7 @@ var PinnedSpace = (0, import_react108.forwardRef)( dragOver(index, x2); }, ...innerProps - }, /* @__PURE__ */ import_react108.default.createElement("div", { + }, /* @__PURE__ */ import_react109.default.createElement("div", { ref: ref2, className: (0, import_classnames3.default)( "mk-waypoints-item", @@ -116869,10 +117166,10 @@ var PinnedSpace = (0, import_react108.forwardRef)( dangerouslySetInnerHTML: { __html: superstate.ui.getSticker(pin.sticker) } - })) : /* @__PURE__ */ import_react108.default.createElement("div", { + })) : /* @__PURE__ */ import_react109.default.createElement("div", { ref: innerRef, className: "mk-waypoint" - }, /* @__PURE__ */ import_react108.default.createElement("div", { + }, /* @__PURE__ */ import_react109.default.createElement("div", { ref: ref2, onClick: (e4) => { setWaypoints([ @@ -116906,16 +117203,16 @@ var SpaceSwitcher = (props) => { modifier, setModifier, setWaypoints - } = (0, import_react109.useContext)(NavigatorContext); + } = (0, import_react110.useContext)(NavigatorContext); const { superstate } = props; - const { dragPaths, setDragPaths } = (0, import_react109.useContext)(NavigatorContext); - const [activeId, setActiveId] = (0, import_react109.useState)(null); - const [overId, setOverId] = (0, import_react109.useState)(null); - const dragCounter = (0, import_react109.useRef)(0); - const [offset2, setOffset] = (0, import_react109.useState)(0); - const [projected, setProjected] = (0, import_react109.useState)(null); - const [dropPlaceholder, setDragPlaceholder] = (0, import_react109.useState)(null); - (0, import_react109.useEffect)(() => { + const { dragPaths, setDragPaths } = (0, import_react110.useContext)(NavigatorContext); + const [activeId, setActiveId] = (0, import_react110.useState)(null); + const [overId, setOverId] = (0, import_react110.useState)(null); + const dragCounter = (0, import_react110.useRef)(0); + const [offset2, setOffset] = (0, import_react110.useState)(0); + const [projected, setProjected] = (0, import_react110.useState)(null); + const [dropPlaceholder, setDragPlaceholder] = (0, import_react110.useState)(null); + (0, import_react110.useEffect)(() => { if (overId === null || dragPaths.length == 0) { setProjected(null); return; @@ -117039,7 +117336,7 @@ var SpaceSwitcher = (props) => { function handleDragEnd({ active, over }) { dragEnded(); } - (0, import_react109.useEffect)(() => { + (0, import_react110.useEffect)(() => { window.addEventListener("dragend", resetState); return () => { window.removeEventListener("dragend", resetState); @@ -117066,14 +117363,14 @@ var SpaceSwitcher = (props) => { return 0; } }; - return /* @__PURE__ */ import_react109.default.createElement(import_react109.default.Fragment, null, /* @__PURE__ */ import_react109.default.createElement("div", { + return /* @__PURE__ */ import_react110.default.createElement(import_react110.default.Fragment, null, /* @__PURE__ */ import_react110.default.createElement("div", { className: "mk-waypoints nav-header", onDragEnter: () => dragEnter(), onDragLeave: () => dragLeave(), onDragOver: (e4) => e4.preventDefault() - }, /* @__PURE__ */ import_react109.default.createElement("div", { + }, /* @__PURE__ */ import_react110.default.createElement("div", { className: "mk-waypoints-inner nav-buttons-container" - }, waypoints.map((pin, i3) => /* @__PURE__ */ import_react109.default.createElement(SortablePinnedSpaceItem, { + }, waypoints.map((pin, i3) => /* @__PURE__ */ import_react110.default.createElement(SortablePinnedSpaceItem, { id: i3, superstate: props.superstate, highlighted: overId == i3 && projected && projected.insert && projected.droppable, @@ -117093,7 +117390,7 @@ var SpaceSwitcher = (props) => { dragEnded, dragActive: activeId !== null, ghost: activeId === i3 - })), /* @__PURE__ */ import_react109.default.createElement("div", { + })), /* @__PURE__ */ import_react110.default.createElement("div", { className: "mk-waypoint-new", onClick: (e4) => { const newWaypoints = [ @@ -117106,18 +117403,18 @@ var SpaceSwitcher = (props) => { dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - }), overId != null && activeId === null && /* @__PURE__ */ import_react109.default.createElement(SortablePinnedSpaceItem, { + }), overId != null && activeId === null && /* @__PURE__ */ import_react110.default.createElement(SortablePinnedSpaceItem, { id: waypoints.length, superstate: props.superstate, highlighted: false, index: waypoints.length, pin: null })), (0, import_react_dom6.createPortal)( - /* @__PURE__ */ import_react109.default.createElement(DragOverlay, { + /* @__PURE__ */ import_react110.default.createElement(DragOverlay, { dropAnimation: null, modifiers: [adjustTranslate], zIndex: 1600 - }, activeId !== null ? /* @__PURE__ */ import_react109.default.createElement(SortablePinnedSpaceItem, { + }, activeId !== null ? /* @__PURE__ */ import_react110.default.createElement(SortablePinnedSpaceItem, { id: -1, superstate: props.superstate, highlighted: false, @@ -117132,8 +117429,8 @@ var SpaceSwitcher = (props) => { // src/core/react/components/Navigator/MainList.tsx var MainList = (props) => { - const [indexing, setIndexing] = import_react110.default.useState(false); - (0, import_react110.useEffect)(() => { + const [indexing, setIndexing] = import_react111.default.useState(false); + (0, import_react111.useEffect)(() => { const reindex = async () => { setIndexing(true); }; @@ -117156,17 +117453,17 @@ var MainList = (props) => { ); }; }, []); - return /* @__PURE__ */ import_react110.default.createElement(import_react110.default.Fragment, null, /* @__PURE__ */ import_react110.default.createElement(import_react_error_boundary_cjs.ErrorBoundary, { + return /* @__PURE__ */ import_react111.default.createElement(import_react111.default.Fragment, null, /* @__PURE__ */ import_react111.default.createElement(import_react_error_boundary_cjs.ErrorBoundary, { FallbackComponent: ErrorFallback - }, /* @__PURE__ */ import_react110.default.createElement("div", { + }, /* @__PURE__ */ import_react111.default.createElement("div", { className: "mk-progress-bar" - }, indexing && /* @__PURE__ */ import_react110.default.createElement("div", { + }, indexing && /* @__PURE__ */ import_react111.default.createElement("div", { className: "mk-progress-bar-value" - })), !isTouchScreen(props.superstate.ui) && /* @__PURE__ */ import_react110.default.createElement(MainMenu, { + })), !isTouchScreen(props.superstate.ui) && /* @__PURE__ */ import_react111.default.createElement(MainMenu, { superstate: props.superstate - }), /* @__PURE__ */ import_react110.default.createElement(SpaceSwitcher, { + }), /* @__PURE__ */ import_react111.default.createElement(SpaceSwitcher, { superstate: props.superstate - }), /* @__PURE__ */ import_react110.default.createElement(SpaceTreeComponent, { + }), /* @__PURE__ */ import_react111.default.createElement(SpaceTreeComponent, { superstate: props.superstate }))); }; @@ -117175,48 +117472,48 @@ function ErrorFallback({ error }) { const copyError = () => { navigator.clipboard.writeText(error.message); }; - return /* @__PURE__ */ import_react110.default.createElement("div", { + return /* @__PURE__ */ import_react111.default.createElement("div", { role: "alert" - }, /* @__PURE__ */ import_react110.default.createElement("p", null, "Something went wrong:"), /* @__PURE__ */ import_react110.default.createElement("p", { + }, /* @__PURE__ */ import_react111.default.createElement("p", null, "Something went wrong:"), /* @__PURE__ */ import_react111.default.createElement("p", { style: { color: "red" } - }, error.message), /* @__PURE__ */ import_react110.default.createElement("button", { + }, error.message), /* @__PURE__ */ import_react111.default.createElement("button", { onClick: copyError - }, "Copy Error"), /* @__PURE__ */ import_react110.default.createElement("button", { + }, "Copy Error"), /* @__PURE__ */ import_react111.default.createElement("button", { onClick: resetBoundary }, "Reload")); } // src/core/react/components/SpaceView/Contexts/SpaceView.tsx var SpaceView = (props) => { - return /* @__PURE__ */ import_react111.default.createElement(import_react_error_boundary_cjs.ErrorBoundary, { + return /* @__PURE__ */ import_react112.default.createElement(import_react_error_boundary_cjs.ErrorBoundary, { FallbackComponent: ErrorFallback - }, /* @__PURE__ */ import_react111.default.createElement(PathProvider, { + }, /* @__PURE__ */ import_react112.default.createElement(PathProvider, { superstate: props.superstate, path: props.path, readMode: false - }, /* @__PURE__ */ import_react111.default.createElement(SpaceProvider, { + }, /* @__PURE__ */ import_react112.default.createElement(SpaceProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react111.default.createElement(FramesMDBProvider, { + }, /* @__PURE__ */ import_react112.default.createElement(FramesMDBProvider, { superstate: props.superstate, schema: "main" - }, /* @__PURE__ */ import_react111.default.createElement(FrameSelectionProvider, { + }, /* @__PURE__ */ import_react112.default.createElement(FrameSelectionProvider, { id: "main", superstate: props.superstate, editMode: 1 /* Page */ - }, /* @__PURE__ */ import_react111.default.createElement(SpaceRoot, { + }, /* @__PURE__ */ import_react112.default.createElement(SpaceRoot, { superstate: props.superstate }, props.children)))))); }; var SpaceRoot = (props) => { - const { pathState } = (0, import_react111.useContext)(PathContext); - const { tableData } = (0, import_react111.useContext)(FramesMDBContext); + const { pathState } = (0, import_react112.useContext)(PathContext); + const { tableData } = (0, import_react112.useContext)(FramesMDBContext); const cols = [ ...[...props.superstate.spacesMap.get(pathState.path) ?? []].flatMap( (f2) => props.superstate.contextsIndex.get(f2)?.cols.map((g) => ({ ...g, table: f2 })) ), ...tableData?.cols.map((f2) => ({ ...f2, table: "" })) ?? [] ]; - return /* @__PURE__ */ import_react111.default.createElement(FrameEditorProvider, { + return /* @__PURE__ */ import_react112.default.createElement(FrameEditorProvider, { superstate: props.superstate, editMode: 1 /* Page */, cols @@ -117224,7 +117521,7 @@ var SpaceRoot = (props) => { }; // node_modules/@air/react-drag-to-select/dist/index.modern.js -var import_react112 = __toESM(require_react(), 1); +var import_react113 = __toESM(require_react(), 1); var import_react_dom7 = __toESM(require_react_dom(), 1); var import_react_style_object_to_css = __toESM(require_react_style_object_to_css(), 1); function a3() { @@ -117238,7 +117535,7 @@ function a3() { }, a3.apply(this, arguments); } var s3 = ["style"]; -var d3 = (0, import_react112.forwardRef)((t5, u3) => { +var d3 = (0, import_react113.forwardRef)((t5, u3) => { let { style: d4 = {} } = t5, m4 = function(e4, t6) { if (null == e4) return {}; @@ -117247,8 +117544,8 @@ var d3 = (0, import_react112.forwardRef)((t5, u3) => { t6.indexOf(n3 = l2[r2]) >= 0 || (o2[n3] = e4[n3]); return o2; }(t5, s3); - const v2 = (0, import_react112.useRef)(null), f2 = (0, import_react112.useRef)(null), [, p] = (0, import_react112.useState)(0); - return (0, import_react112.useImperativeHandle)(u3, () => ({ getBoundingClientRect: () => { + const v2 = (0, import_react113.useRef)(null), f2 = (0, import_react113.useRef)(null), [, p] = (0, import_react113.useState)(0); + return (0, import_react113.useImperativeHandle)(u3, () => ({ getBoundingClientRect: () => { var e4; return null == (e4 = v2.current) ? void 0 : e4.getBoundingClientRect(); }, getParentBoundingClientRect: () => { @@ -117265,26 +117562,26 @@ var d3 = (0, import_react112.forwardRef)((t5, u3) => { requestAnimationFrame(() => { f2.current && (f2.current.style.cssText = (0, import_react_style_object_to_css.default)({ top: 0, left: 0, width: 0, height: 0 })); }); - } })), (0, import_react112.useEffect)(() => { + } })), (0, import_react113.useEffect)(() => { p((e4) => e4 + 1); - }, []), import_react112.default.createElement("div", { ref: v2 }, v2.current ? import_react_dom7.default.createPortal(import_react112.default.createElement("div", a3({ ref: f2 }, m4)), v2.current) : null); + }, []), import_react113.default.createElement("div", { ref: v2 }, v2.current ? import_react_dom7.default.createPortal(import_react113.default.createElement("div", a3({ ref: f2 }, m4)), v2.current) : null); }); var m3 = (e4, t5) => e4.left <= t5.left + t5.width && e4.left + e4.width >= t5.left && e4.top <= t5.top + t5.height && e4.top + e4.height >= t5.top; function v(t5) { - const { onSelectionChange: r2, onSelectionEnd: o2, onSelectionStart: c3, isEnabled: i3 = true, selectionProps: s4 = {}, eventsElement: m4, shouldStartSelecting: v2 } = t5 || {}, f2 = (0, import_react112.useRef)(null), { cancelCurrentSelection: p } = function({ containerRef: e4, onSelectionChange: t6, onSelectionStart: r3, onSelectionEnd: o3, isEnabled: c4 = true, eventsElement: i4, shouldStartSelecting: s5 }) { - const d4 = (0, import_react112.useRef)(null), m5 = (0, import_react112.useRef)(null), v3 = (0, import_react112.useRef)(false), f3 = (0, import_react112.useRef)(t6), p2 = (0, import_react112.useRef)(r3), h3 = (0, import_react112.useRef)(o3), g = (0, import_react112.useRef)(), y3 = (0, import_react112.useRef)(c4); - f3.current = (0, import_react112.useCallback)((e5) => { + const { onSelectionChange: r2, onSelectionEnd: o2, onSelectionStart: c3, isEnabled: i3 = true, selectionProps: s4 = {}, eventsElement: m4, shouldStartSelecting: v2 } = t5 || {}, f2 = (0, import_react113.useRef)(null), { cancelCurrentSelection: p } = function({ containerRef: e4, onSelectionChange: t6, onSelectionStart: r3, onSelectionEnd: o3, isEnabled: c4 = true, eventsElement: i4, shouldStartSelecting: s5 }) { + const d4 = (0, import_react113.useRef)(null), m5 = (0, import_react113.useRef)(null), v3 = (0, import_react113.useRef)(false), f3 = (0, import_react113.useRef)(t6), p2 = (0, import_react113.useRef)(r3), h3 = (0, import_react113.useRef)(o3), g = (0, import_react113.useRef)(), y3 = (0, import_react113.useRef)(c4); + f3.current = (0, import_react113.useCallback)((e5) => { g.current = t6 ? requestAnimationFrame(() => { t6(e5); }) : void 0; }, [t6]), p2.current = r3, h3.current = o3, y3.current = c4; - const b2 = (0, import_react112.useCallback)(() => { + const b2 = (0, import_react113.useCallback)(() => { var t7; d4.current = null, m5.current = null, v3.current = false, null == (t7 = e4.current) || t7.clearSelectionBox(), "number" == typeof g.current && cancelAnimationFrame(g.current); - }, [e4]), S3 = (0, import_react112.useCallback)((t7, n3) => { + }, [e4]), S3 = (0, import_react113.useCallback)((t7, n3) => { var r4, o4, l2; return n3 || (n3 = null == (l2 = e4.current) ? void 0 : l2.getParentBoundingClientRect()), { x: t7.clientX - ("number" == typeof (null == (r4 = n3) ? void 0 : r4.left) ? n3.left : 0), y: t7.clientY - ("number" == typeof (null == (o4 = n3) ? void 0 : o4.top) ? n3.top : 0) }; - }, [e4]), E2 = (0, import_react112.useCallback)((t7, n3) => { + }, [e4]), E2 = (0, import_react113.useCallback)((t7, n3) => { if (d4.current && m5.current) { if (!n3) return; @@ -117294,16 +117591,16 @@ function v(t5) { } else b2(); var o4; - }, [b2, e4]), w2 = (0, import_react112.useCallback)((t7) => { + }, [b2, e4]), w2 = (0, import_react113.useCallback)((t7) => { var n3; if (!d4.current) return; const r4 = null == (n3 = e4.current) ? void 0 : n3.getParentBoundingClientRect(); m5.current = S3(t7, r4), E2(t7, r4); - }, [E2, S3, e4]), x2 = (0, import_react112.useCallback)((e5) => { + }, [E2, S3, e4]), x2 = (0, import_react113.useCallback)((e5) => { var t7; 0 === e5.button && (m5.current && (null == h3.current || h3.current(e5)), b2(), document.body.style.removeProperty("user-select"), document.body.style.removeProperty("-webkit-user-select"), (i4 || document.body).removeEventListener("mousemove", w2), null == (t7 = window) || t7.removeEventListener("mouseup", x2)); - }, [i4, b2, w2]), C = (0, import_react112.useCallback)((e5) => { + }, [i4, b2, w2]), C = (0, import_react113.useCallback)((e5) => { if (0 === e5.button && y3.current) { var t7; if ("function" == typeof s5 && !s5(e5.target)) @@ -117311,30 +117608,30 @@ function v(t5) { document.body.style.userSelect = "none", document.body.style.webkitUserSelect = "none", d4.current = S3(e5), (i4 || document.body).addEventListener("mousemove", w2), null == (t7 = window) || t7.addEventListener("mouseup", x2); } }, [i4, S3, w2, x2]); - return (0, import_react112.useEffect)(() => ((i4 || document.body).addEventListener("mousedown", C), () => { + return (0, import_react113.useEffect)(() => ((i4 || document.body).addEventListener("mousedown", C), () => { (i4 || document.body).removeEventListener("mousedown", C), (i4 || document.body).removeEventListener("mousemove", w2), window.removeEventListener("mouseup", x2); }), [i4, C, w2, x2]), { cancelCurrentSelection: b2 }; }({ containerRef: f2, onSelectionEnd: o2, onSelectionStart: c3, onSelectionChange: r2, isEnabled: i3, eventsElement: m4, shouldStartSelecting: v2 }); - return { cancelCurrentSelection: p, DragSelection: (0, import_react112.useCallback)(() => import_react112.default.createElement(d3, a3({ ref: f2 }, s4)), []) }; + return { cancelCurrentSelection: p, DragSelection: (0, import_react113.useCallback)(() => import_react113.default.createElement(d3, a3({ ref: f2 }, s4)), []) }; } // src/core/react/components/SpaceView/SpaceOuter.tsx -var import_react113 = __toESM(require_react()); -var SpaceOuter = (0, import_react113.forwardRef)( +var import_react114 = __toESM(require_react()); +var SpaceOuter = (0, import_react114.forwardRef)( (props, ref2) => { - const [selectionBox, setSelectionBox] = (0, import_react113.useState)(); - const selectableItems = (0, import_react113.useRef)([]); - const { frameProperties } = (0, import_react113.useContext)(FramesEditorRootContext); - const { selectableNodeBounds, id: id3 } = (0, import_react113.useContext)(FrameInstanceContext); - const { selectMulti } = (0, import_react113.useContext)(FrameSelectionContext); - const { tableData } = (0, import_react113.useContext)(FramesMDBContext); - const [dragging, setDragging] = (0, import_react113.useState)(false); - const localRef = (0, import_react113.useRef)(null); - const [contexts, setContexts] = (0, import_react113.useState)({}); - const [frameProps, setFrameProps] = (0, import_react113.useState)({}); - const { pathState } = (0, import_react113.useContext)(PathContext); - const { spaceInfo } = (0, import_react113.useContext)(SpaceContext); - (0, import_react113.useEffect)(() => { + const [selectionBox, setSelectionBox] = (0, import_react114.useState)(); + const selectableItems = (0, import_react114.useRef)([]); + const { frameProperties } = (0, import_react114.useContext)(FramesEditorRootContext); + const { selectableNodeBounds, id: id3 } = (0, import_react114.useContext)(FrameInstanceContext); + const { selectMulti } = (0, import_react114.useContext)(FrameSelectionContext); + const { tableData } = (0, import_react114.useContext)(FramesMDBContext); + const [dragging, setDragging] = (0, import_react114.useState)(false); + const localRef = (0, import_react114.useRef)(null); + const [contexts, setContexts] = (0, import_react114.useState)({}); + const [frameProps, setFrameProps] = (0, import_react114.useState)({}); + const { pathState } = (0, import_react114.useContext)(PathContext); + const { spaceInfo } = (0, import_react114.useContext)(SpaceContext); + (0, import_react114.useEffect)(() => { if (!spaceInfo) { return; } @@ -117400,7 +117697,7 @@ var SpaceOuter = (0, import_react113.forwardRef)( props.superstate.ui.resetSelection(null); } }; - (0, import_react113.useEffect)(() => { + (0, import_react114.useEffect)(() => { window.addEventListener("keydown", onKeyDown); return () => { window.removeEventListener("keydown", onKeyDown); @@ -117447,7 +117744,7 @@ var SpaceOuter = (0, import_react113.forwardRef)( return false; } }); - return /* @__PURE__ */ import_react113.default.createElement("div", { + return /* @__PURE__ */ import_react114.default.createElement("div", { className: "mk-space-body cm-line", ref: (el) => { localRef.current = el; @@ -117456,7 +117753,7 @@ var SpaceOuter = (0, import_react113.forwardRef)( else if (ref2 !== null) ref2.current = el; } - }, /* @__PURE__ */ import_react113.default.createElement(DragSelection, null), /* @__PURE__ */ import_react113.default.createElement(FrameInstanceProvider, { + }, /* @__PURE__ */ import_react114.default.createElement(DragSelection, null), /* @__PURE__ */ import_react114.default.createElement(FrameInstanceProvider, { id: id3 ?? "root", superstate: props.superstate, props: frameProps, @@ -117471,11 +117768,11 @@ var SpaceOuter_default = SpaceOuter; // src/core/react/components/PathView/PathView.tsx var PathView = (props) => { - const [pathState, setPathState] = (0, import_react114.useState)( + const [pathState, setPathState] = (0, import_react115.useState)( props.superstate.pathsIndex.get(props.path) ); - const ref2 = (0, import_react114.useRef)(null); - (0, import_react114.useEffect)(() => { + const ref2 = (0, import_react115.useRef)(null); + (0, import_react115.useEffect)(() => { const uri = props.superstate.spaceManager.uriByString(props.path); if (uri?.scheme == "https" || uri?.scheme == "http") { setPathState({ @@ -117495,44 +117792,44 @@ var PathView = (props) => { const pathState2 = props.superstate.pathsIndex.get(props.path); setPathState(pathState2); }, [props.path]); - return /* @__PURE__ */ import_react114.default.createElement("div", { + return /* @__PURE__ */ import_react115.default.createElement("div", { className: "mk-path-view", style: { ...props.styles ?? {} } - }, pathState?.type == "remote" ? /* @__PURE__ */ import_react114.default.createElement("iframe", { + }, pathState?.type == "remote" ? /* @__PURE__ */ import_react115.default.createElement("iframe", { src: props.path - }) : pathState?.type == "space" ? /* @__PURE__ */ import_react114.default.createElement(SpaceView, { + }) : pathState?.type == "space" ? /* @__PURE__ */ import_react115.default.createElement(SpaceView, { superstate: props.superstate, path: props.path - }, /* @__PURE__ */ import_react114.default.createElement(SpaceOuter_default, { + }, /* @__PURE__ */ import_react115.default.createElement(SpaceOuter_default, { superstate: props.superstate, ref: ref2 - }, /* @__PURE__ */ import_react114.default.createElement(FrameEditorInstance, { + }, /* @__PURE__ */ import_react115.default.createElement(FrameEditorInstance, { containerRef: props.containerRef, superstate: props.superstate - }))) : props.superstate.ui.availableViews().some((f2) => f2 == props.path?.split(".").pop()) ? /* @__PURE__ */ import_react114.default.createElement(NoteView, { + }))) : props.superstate.ui.availableViews().some((f2) => f2 == props.path?.split(".").pop()) ? /* @__PURE__ */ import_react115.default.createElement(NoteView, { superstate: props.superstate, path: props.path, load: true, classname: "mk-flow-node" - }) : /* @__PURE__ */ import_react114.default.createElement(import_react114.default.Fragment, null)); + }) : /* @__PURE__ */ import_react115.default.createElement(import_react115.default.Fragment, null)); }; // src/core/react/components/SpaceView/Frames/EditorNodes/FlowNodeView.tsx -var import_react116 = __toESM(require_react()); +var import_react117 = __toESM(require_react()); // src/core/react/components/SpaceView/Frames/SpaceCommand/Suggester.tsx -var import_react115 = __toESM(require_react()); +var import_react116 = __toESM(require_react()); var import_react_dom8 = __toESM(require_react_dom()); -var Suggester = (0, import_react115.forwardRef)( +var Suggester = (0, import_react116.forwardRef)( (props, outerRef) => { - const ref2 = (0, import_react115.useRef)(null); - const [index, setIndex] = (0, import_react115.useState)(0); - const [isReady, setIsReady] = (0, import_react115.useState)(false); - const menuRef = (0, import_react115.useRef)(null); - const [pos, setPos] = (0, import_react115.useState)({ x: 0, y: 0 }); - const [active, setActive] = (0, import_react115.useState)(false); - const [section, setSection] = (0, import_react115.useState)(""); - (0, import_react115.useEffect)(() => { + const ref2 = (0, import_react116.useRef)(null); + const [index, setIndex] = (0, import_react116.useState)(0); + const [isReady, setIsReady] = (0, import_react116.useState)(false); + const menuRef = (0, import_react116.useRef)(null); + const [pos, setPos] = (0, import_react116.useState)({ x: 0, y: 0 }); + const [active, setActive] = (0, import_react116.useState)(false); + const [section, setSection] = (0, import_react116.useState)(""); + (0, import_react116.useEffect)(() => { const resizeObserver = new ResizeObserver((entries) => { if (menuRef.current) { const rect = menuRef.current.getBoundingClientRect(); @@ -117620,7 +117917,7 @@ var Suggester = (0, import_react115.forwardRef)( suggestionActive: "mk-active", suggestionDisabled: "mk-disabled" }; - return /* @__PURE__ */ import_react115.default.createElement(import_react115.default.Fragment, null, /* @__PURE__ */ import_react115.default.createElement("div", { + return /* @__PURE__ */ import_react116.default.createElement(import_react116.default.Fragment, null, /* @__PURE__ */ import_react116.default.createElement("div", { ref: (node) => { ref2.current = node; if (outerRef) { @@ -117648,7 +117945,7 @@ var Suggester = (0, import_react115.forwardRef)( className: "mk-suggester", contentEditable: true }), active && (0, import_react_dom8.createPortal)( - /* @__PURE__ */ import_react115.default.createElement("div", { + /* @__PURE__ */ import_react116.default.createElement("div", { ref: menuRef, className: `mk-menu mk-menu-suggester ${isReady ? "mk-ready" : ""}`, style: { @@ -117660,13 +117957,13 @@ var Suggester = (0, import_react115.forwardRef)( "--mk-menu-max-height": "300px", visibility: active ? "visible" : "hidden" } - }, props.sections ? /* @__PURE__ */ import_react115.default.createElement("div", { + }, props.sections ? /* @__PURE__ */ import_react116.default.createElement("div", { className: "mk-menu-sections" - }, props.sections.map((f2, i3) => /* @__PURE__ */ import_react115.default.createElement("div", { + }, props.sections.map((f2, i3) => /* @__PURE__ */ import_react116.default.createElement("div", { key: i3, onClick: () => setSection(f2.value), className: `${section == f2.value ? "is-active" : ""} mk-menu-section` - }, f2.name == "" ? i18n_default.labels.all : f2.name))) : /* @__PURE__ */ import_react115.default.createElement(import_react115.default.Fragment, null), /* @__PURE__ */ import_react115.default.createElement(SelectMenuSuggestions_default, { + }, f2.name == "" ? i18n_default.labels.all : f2.name))) : /* @__PURE__ */ import_react116.default.createElement(import_react116.default.Fragment, null), /* @__PURE__ */ import_react116.default.createElement(SelectMenuSuggestions_default, { expanded: false, addKeyword: "Add", options: props.suggestions, @@ -117697,7 +117994,7 @@ function parseContent(input) { return match1 ? match1[1] : match2 ? match2[1] : input; } var FlowNodeView = (props) => { - const pathState = (0, import_react116.useMemo)(() => { + const pathState = (0, import_react117.useMemo)(() => { const fullPath = props.state?.props?.value; const path = fullPath ? props.superstate.spaceManager.resolvePath( parseContent(fullPath), @@ -117720,14 +118017,15 @@ var FlowNodeView = (props) => { } return props.superstate.pathsIndex.get(path); }, [props.state, props.source]); - const { updateNode } = (0, import_react116.useContext)(FramesEditorRootContext); - const { selectionMode } = (0, import_react116.useContext)(FrameSelectionContext); - const [expanded, setExpanded] = (0, import_react116.useState)( + const { updateNode } = (0, import_react117.useContext)(FramesEditorRootContext); + const { selectionMode } = (0, import_react117.useContext)(FrameSelectionContext); + const [expanded, setExpanded] = (0, import_react117.useState)( props.state?.styles?.["--mk-expanded"] ); - const { id: id3 } = (0, import_react116.useContext)(FrameInstanceContext); - const [pathString, setPathString] = (0, import_react116.useState)(""); - const options = (0, import_react116.useMemo)(() => { + const hideToggle = props.state?.styles?.["--mk-link"]; + const { id: id3 } = (0, import_react117.useContext)(FrameInstanceContext); + const [pathString, setPathString] = (0, import_react117.useState)(""); + const options = (0, import_react117.useMemo)(() => { const fuseOptions = { keys: ["name", "value"] }; @@ -117750,21 +118048,21 @@ var FlowNodeView = (props) => { } }); }; - const [isTransition, startTransition] = (0, import_react116.useTransition)(); - return /* @__PURE__ */ import_react116.default.createElement("div", { + const [isTransition, startTransition] = (0, import_react117.useTransition)(); + return /* @__PURE__ */ import_react117.default.createElement("div", { className: "mk-node-flow" - }, !props.state?.styles?.["--mk-min-mode"] && /* @__PURE__ */ import_react116.default.createElement(import_react116.default.Fragment, null, pathState ? /* @__PURE__ */ import_react116.default.createElement("div", { + }, !props.state?.styles?.["--mk-min-mode"] && /* @__PURE__ */ import_react117.default.createElement(import_react117.default.Fragment, null, pathState ? /* @__PURE__ */ import_react117.default.createElement("div", { className: "mk-node-link" - }, /* @__PURE__ */ import_react116.default.createElement(PathCrumb, { + }, /* @__PURE__ */ import_react117.default.createElement(PathCrumb, { superstate: props.superstate, path: pathState.path - }), /* @__PURE__ */ import_react116.default.createElement(CollapseToggle, { + }), !hideToggle && /* @__PURE__ */ import_react117.default.createElement(CollapseToggle, { superstate: props.superstate, collapsed: !expanded, onToggle: toggleCollapse - })) : selectionMode > 0 /* Read */ && /* @__PURE__ */ import_react116.default.createElement("div", { + })) : selectionMode > 0 /* Read */ && /* @__PURE__ */ import_react117.default.createElement("div", { className: "mk-node-text-placeholder" - }, /* @__PURE__ */ import_react116.default.createElement(Suggester, { + }, /* @__PURE__ */ import_react117.default.createElement(Suggester, { placeholder: i18n_default.hintText.selectNote, onChange: (e4) => { setPathString(e4); @@ -117779,7 +118077,7 @@ var FlowNodeView = (props) => { } }); } - }))), props.state && expanded && /* @__PURE__ */ import_react116.default.createElement(PathView, { + }))), props.state && expanded && /* @__PURE__ */ import_react117.default.createElement(PathView, { id: id3, superstate: props.superstate, path: pathState?.path ?? props.state?.props?.value, @@ -117789,21 +118087,21 @@ var FlowNodeView = (props) => { }; // src/core/react/components/SpaceView/Frames/FrameNodeEditor/FrameHoverMenu.tsx -var import_react117 = __toESM(require_react()); +var import_react118 = __toESM(require_react()); var FrameHoverMenu = (props) => { - const { spaceInfo } = (0, import_react117.useContext)(SpaceContext); - const { addNode, moveUp, moveDown, setLastCreatedId } = (0, import_react117.useContext)( + const { spaceInfo } = (0, import_react118.useContext)(SpaceContext); + const { addNode, moveUp, moveDown, setLastCreatedId } = (0, import_react118.useContext)( FramesEditorRootContext ); - const { select, selection: selection2 } = (0, import_react117.useContext)(FrameSelectionContext); + const { select, selection: selection2 } = (0, import_react118.useContext)(FrameSelectionContext); const selected = selection2.includes(props.node.id); - return /* @__PURE__ */ import_react117.default.createElement(import_react117.default.Fragment, null, /* @__PURE__ */ import_react117.default.createElement("div", { + return /* @__PURE__ */ import_react118.default.createElement(import_react118.default.Fragment, null, /* @__PURE__ */ import_react118.default.createElement("div", { className: `${"mk-editor-frame-hover-horizontal"}`, style: { pointerEvents: "auto", opacity: props.visible ? "1" : "0" } - }, props.dragRef && /* @__PURE__ */ import_react117.default.createElement("div", { + }, props.dragRef && /* @__PURE__ */ import_react118.default.createElement("div", { className: "mk-icon-small mk-editor-frame-hover-button", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//handle") @@ -117824,7 +118122,7 @@ var FrameHoverMenu = (props) => { }, ...props.listeners ?? {}, ...props.attributes ?? {} - }), !isTouchScreen(props.superstate.ui) && /* @__PURE__ */ import_react117.default.createElement("div", { + }), !isTouchScreen(props.superstate.ui) && /* @__PURE__ */ import_react118.default.createElement("div", { onClick: (e4) => { addNode(newNode.node, props.node).then( (f2) => setLastCreatedId(f2.id) @@ -117839,10 +118137,10 @@ var FrameHoverMenu = (props) => { }; // src/core/react/components/SpaceView/Frames/FrameNodeEditor/FrameNodeEditorContainer.tsx -var import_react118 = __toESM(require_react()); +var import_react119 = __toESM(require_react()); var FrameNodeEditorContainer = (props) => { - const menuRef = (0, import_react118.useRef)(null); - const [pos, setPos] = (0, import_react118.useState)(0); + const menuRef = (0, import_react119.useRef)(null); + const [pos, setPos] = (0, import_react119.useState)(0); const calculateXBasedOnBounds = (targetRect, rect, containerRect) => { const x2 = targetRect.x - props.containerRect.x; const overflowX = x2 + rect.width - containerRect.width; @@ -117856,8 +118154,8 @@ var FrameNodeEditorContainer = (props) => { } return newX; }; - const [ready, setReady] = (0, import_react118.useState)(false); - (0, import_react118.useEffect)(() => { + const [ready, setReady] = (0, import_react119.useState)(false); + (0, import_react119.useEffect)(() => { const resizeObserver = new ResizeObserver((entries) => { const rect = entries[0].target.getBoundingClientRect(); setReady(true); @@ -117871,7 +118169,7 @@ var FrameNodeEditorContainer = (props) => { resizeObserver.disconnect(); }; }, [menuRef]); - return /* @__PURE__ */ import_react118.default.createElement("div", { + return /* @__PURE__ */ import_react119.default.createElement("div", { className: "mk-editor-frame-node-container", ref: menuRef, style: { @@ -117890,17 +118188,17 @@ var FrameNodeEditorContainer = (props) => { // src/core/react/components/SpaceView/Frames/FrameNodeEditor/Overlays/FrameCorners.tsx var import_classnames4 = __toESM(require_classnames()); -var import_react120 = __toESM(require_react()); +var import_react121 = __toESM(require_react()); // src/core/react/components/SpaceView/Frames/FrameNodeEditor/Overlays/FrameDraggableHandle.tsx -var import_react119 = __toESM(require_react()); +var import_react120 = __toESM(require_react()); var FrameDraggableHandle = (props) => { - const [modifier, setModifier] = (0, import_react119.useState)(null); - const startValue = (0, import_react119.useRef)(props.value); - const currentValue = (0, import_react119.useRef)(props.value); - const [, setStartPos] = (0, import_react119.useState)([0, 0]); + const [modifier, setModifier] = (0, import_react120.useState)(null); + const startValue = (0, import_react120.useRef)(props.value); + const currentValue = (0, import_react120.useRef)(props.value); + const [, setStartPos] = (0, import_react120.useState)([0, 0]); const step = props.step ?? 1; - const handleMove = (0, import_react119.useCallback)( + const handleMove = (0, import_react120.useCallback)( (e4) => { setStartPos((pos) => { const { clientX: x2, clientY: y22 } = e4; @@ -117932,7 +118230,7 @@ var FrameDraggableHandle = (props) => { }, [modifier, props.max, props.min, step, props.onDragMove, props.mod] ); - const handleMoveEnd = (0, import_react119.useCallback)( + const handleMoveEnd = (0, import_react120.useCallback)( (e4) => { const captureClick = (e5) => { e5.stopPropagation(); @@ -117956,7 +118254,7 @@ var FrameDraggableHandle = (props) => { }, [handleMove, props.onDragEnd] ); - const handleDown = (0, import_react119.useCallback)( + const handleDown = (0, import_react120.useCallback)( (e4) => { startValue.current = props.value; setStartPos([e4.clientX, e4.clientY]); @@ -117980,7 +118278,7 @@ var FrameDraggableHandle = (props) => { const handleKeyUp = () => { setModifier(null); }; - (0, import_react119.useEffect)(() => { + (0, import_react120.useEffect)(() => { document.addEventListener("keydown", handleKeyDown); document.addEventListener("keyup", handleKeyUp); return () => { @@ -117990,7 +118288,7 @@ var FrameDraggableHandle = (props) => { document.removeEventListener("keyup", handleKeyUp); }; }, []); - return /* @__PURE__ */ import_react119.default.createElement("div", { + return /* @__PURE__ */ import_react120.default.createElement("div", { className: "mk-frame-draggable-handle", onMouseDown: handleDown, "data-placeholder": currentValue.current.toString(), @@ -118000,7 +118298,7 @@ var FrameDraggableHandle = (props) => { height: "100%", pointerEvents: "auto" } - }, /* @__PURE__ */ import_react119.default.createElement("span", null)); + }, /* @__PURE__ */ import_react120.default.createElement("span", null)); }; // src/core/react/components/SpaceView/Frames/FrameNodeEditor/Overlays/FrameCorners.tsx @@ -118008,8 +118306,8 @@ var FrameCorners = (props) => { const match2 = props.styles.borderRadius ? props.styles.borderRadius.match(/^(\d+(?:\.\d+)?)\s?([a-zA-Z%]+)$/) : null; const numericValue = match2 ? parseInt(match2[1]) : 0; const unit = match2 && match2[2] ? match2[2] : "px"; - const [offset2, setOffset] = import_react120.default.useState(Math.max(8, numericValue)); - (0, import_react120.useEffect)(() => { + const [offset2, setOffset] = import_react121.default.useState(Math.max(8, numericValue)); + (0, import_react121.useEffect)(() => { setOffset(numericValue); }, [numericValue]); const handleProps = { @@ -118024,7 +118322,7 @@ var FrameCorners = (props) => { } }; const minOffset = Math.max(8, offset2); - return /* @__PURE__ */ import_react120.default.createElement("div", { + return /* @__PURE__ */ import_react121.default.createElement("div", { style: { position: "absolute", top: 0, @@ -118036,49 +118334,49 @@ var FrameCorners = (props) => { borderRadius: offset2, border: "1px solid var(--mk-ui-border-accent)" } - }, /* @__PURE__ */ import_react120.default.createElement("div", { + }, /* @__PURE__ */ import_react121.default.createElement("div", { className: (0, import_classnames4.default)("mk-frame-corners") - }, /* @__PURE__ */ import_react120.default.createElement("div", { + }, /* @__PURE__ */ import_react121.default.createElement("div", { className: "mk-frame-corner", style: { position: "absolute", transform: `translate(${minOffset}px, ${minOffset}px)`, zIndex: "var(--mk-layer-editor-overlay)" } - }, /* @__PURE__ */ import_react120.default.createElement(FrameDraggableHandle, { + }, /* @__PURE__ */ import_react121.default.createElement(FrameDraggableHandle, { ...handleProps, cursor: "nwse-resize", reverseY: true - })), /* @__PURE__ */ import_react120.default.createElement("div", { + })), /* @__PURE__ */ import_react121.default.createElement("div", { className: "mk-frame-corner", style: { position: "absolute", transform: `translate(${props.clientSize.width - minOffset}px, ${minOffset}px)`, zIndex: "var(--mk-layer-editor-overlay)" } - }, /* @__PURE__ */ import_react120.default.createElement(FrameDraggableHandle, { + }, /* @__PURE__ */ import_react121.default.createElement(FrameDraggableHandle, { ...handleProps, cursor: "nesw-resize", reverseX: true, reverseY: true - })), /* @__PURE__ */ import_react120.default.createElement("div", { + })), /* @__PURE__ */ import_react121.default.createElement("div", { className: "mk-frame-corner", style: { position: "absolute", transform: `translate(${minOffset}px, ${props.clientSize.height - minOffset}px)`, zIndex: "var(--mk-layer-editor-overlay)" } - }, /* @__PURE__ */ import_react120.default.createElement(FrameDraggableHandle, { + }, /* @__PURE__ */ import_react121.default.createElement(FrameDraggableHandle, { ...handleProps, cursor: "nesw-resize" - })), /* @__PURE__ */ import_react120.default.createElement("div", { + })), /* @__PURE__ */ import_react121.default.createElement("div", { className: "mk-frame-corner", style: { position: "absolute", transform: `translate(${props.clientSize.width - minOffset}px, ${props.clientSize.height - minOffset}px)`, zIndex: "var(--mk-layer-editor-overlay)" } - }, /* @__PURE__ */ import_react120.default.createElement(FrameDraggableHandle, { + }, /* @__PURE__ */ import_react121.default.createElement(FrameDraggableHandle, { ...handleProps, reverseX: true, cursor: "nwse-resize" @@ -118087,10 +118385,10 @@ var FrameCorners = (props) => { // src/core/react/components/SpaceView/Frames/FrameNodeEditor/Overlays/FrameDropZone.tsx var import_classnames5 = __toESM(require_classnames()); -var import_react121 = __toESM(require_react()); +var import_react122 = __toESM(require_react()); var FrameDropZone = (props) => { - const { instance, id: id3 } = (0, import_react121.useContext)(FrameInstanceContext); - const { spaceInfo } = (0, import_react121.useContext)(SpaceContext); + const { instance, id: id3 } = (0, import_react122.useContext)(FrameInstanceContext); + const { spaceInfo } = (0, import_react122.useContext)(SpaceContext); const { setNodeRef } = useDroppable({ id: props.id + props.direction, data: { @@ -118110,7 +118408,7 @@ var FrameDropZone = (props) => { const width = props.direction == "left" || props.direction == "right" ? offset2 : props.width; const height = props.direction == "top" || props.direction == "bottom" ? props.insertMode != 0 ? offset2 : props.height / 2 : props.height; const indicator = props.insertMode != 0 ? props.direction == "top" ? "bottom" : props.direction == "bottom" ? "top" : props.direction : props.direction; - return /* @__PURE__ */ import_react121.default.createElement("div", { + return /* @__PURE__ */ import_react122.default.createElement("div", { ref: setNodeRef, className: (0, import_classnames5.default)( props.active ? `mk-indicator-${indicator}` : "", @@ -118125,19 +118423,19 @@ var FrameDropZone = (props) => { }); }; var FrameEditorDropZone = (props) => { - const { frameSchema } = (0, import_react121.useContext)(FramesMDBContext); - const { hoverNode } = (0, import_react121.useContext)(FrameInstanceContext); + const { frameSchema } = (0, import_react122.useContext)(FramesMDBContext); + const { hoverNode } = (0, import_react122.useContext)(FrameInstanceContext); const directions2 = [ ...props.mode == 1 /* DropModeRowColumn */ ? ["top", "bottom", "left", "right"] : props.mode == 2 /* DropModeRowOnly */ ? ["top", "bottom"] : props.mode == 3 /* DropModeColumnOnly */ ? ["left", "right"] : [], ...props.insertMode == 1 ? ["inside"] : [] ]; - return /* @__PURE__ */ import_react121.default.createElement("div", { + return /* @__PURE__ */ import_react122.default.createElement("div", { className: `mk-frame-drop-zone-container`, style: { width: props.width, height: props.height } - }, directions2.map((d4) => /* @__PURE__ */ import_react121.default.createElement(FrameDropZone, { + }, directions2.map((d4) => /* @__PURE__ */ import_react122.default.createElement(FrameDropZone, { ...props, key: d4, active: hoverNode?.node == props.node && hoverNode?.direction == d4, @@ -118148,7 +118446,7 @@ var FrameEditorDropZone = (props) => { }; // src/core/react/components/SpaceView/Frames/FrameNodeEditor/Overlays/FrameGapHandle.tsx -var import_react122 = __toESM(require_react()); +var import_react123 = __toESM(require_react()); var reduceFlexItems = (items, container, xAxis, axisGap) => { const rows = {}; let row = 0; @@ -118203,11 +118501,11 @@ var FrameGapHandle = (props) => { const numericValue = match2 ? parseInt(match2[1]) : 0; return numericValue; }; - const [offset2, setOffset] = import_react122.default.useState({ + const [offset2, setOffset] = import_react123.default.useState({ row: calculateOffset(props.styles["rowGap"]), column: calculateOffset(props.styles["columnGap"]) }); - (0, import_react122.useEffect)(() => { + (0, import_react123.useEffect)(() => { setOffset({ row: calculateOffset(props.styles["rowGap"]), column: calculateOffset(props.styles["columnGap"]) @@ -118249,7 +118547,7 @@ var FrameGapHandle = (props) => { ); } }; - const rows = (0, import_react122.useMemo)( + const rows = (0, import_react123.useMemo)( () => reduceFlexItems( props.childSizes, { @@ -118261,14 +118559,14 @@ var FrameGapHandle = (props) => { ), [props.childSizes, props.clientSize, props.direction, offset2] ); - const items = (0, import_react122.useMemo)(() => { + const items = (0, import_react123.useMemo)(() => { const items2 = []; Object.keys(rows).forEach((f2) => { items2.push(...rows[f2].items); }); return items2; }, [rows]); - return /* @__PURE__ */ import_react122.default.createElement("div", { + return /* @__PURE__ */ import_react123.default.createElement("div", { className: `mk-frame-gaps ${parseStylesToClass(props.styles)}`, style: { position: "absolute", @@ -118282,9 +118580,9 @@ var FrameGapHandle = (props) => { paddingRight: props.clientSize.paddingRight, flexWrap: props.styles.flexWrap } - }, props.direction === "row" ? items.map((f2, i3, array) => /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, /* @__PURE__ */ import_react122.default.createElement("div", { + }, props.direction === "row" ? items.map((f2, i3, array) => /* @__PURE__ */ import_react123.default.createElement(import_react123.default.Fragment, null, /* @__PURE__ */ import_react123.default.createElement("div", { style: { width: f2.width, height: f2.height } - }), i3 == array.length - 1 ? /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null) : rows[f2.row].end == i3 ? /* @__PURE__ */ import_react122.default.createElement("div", { + }), i3 == array.length - 1 ? /* @__PURE__ */ import_react123.default.createElement(import_react123.default.Fragment, null) : rows[f2.row].end == i3 ? /* @__PURE__ */ import_react123.default.createElement("div", { key: i3, className: "mk-frame-gap-handle-h", style: { @@ -118292,12 +118590,12 @@ var FrameGapHandle = (props) => { height: Math.max(8, Math.abs(offset2["row"])), zIndex: "var(--mk-layer-editor-overlay)" } - }, /* @__PURE__ */ import_react122.default.createElement(FrameDraggableHandle, { + }, /* @__PURE__ */ import_react123.default.createElement(FrameDraggableHandle, { ...offAxisHandleProps, cursor: "col-resize", disableX: true, reverseY: true - })) : /* @__PURE__ */ import_react122.default.createElement("div", { + })) : /* @__PURE__ */ import_react123.default.createElement("div", { key: i3, className: "mk-frame-gap-handle-v", style: { @@ -118305,13 +118603,13 @@ var FrameGapHandle = (props) => { height: rows[f2.row].maxValue, zIndex: "var(--mk-layer-editor-overlay)" } - }, /* @__PURE__ */ import_react122.default.createElement(FrameDraggableHandle, { + }, /* @__PURE__ */ import_react123.default.createElement(FrameDraggableHandle, { ...handleProps, cursor: "col-resize", disableY: true - })))) : items.map((f2, i3, array) => /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, /* @__PURE__ */ import_react122.default.createElement("div", { + })))) : items.map((f2, i3, array) => /* @__PURE__ */ import_react123.default.createElement(import_react123.default.Fragment, null, /* @__PURE__ */ import_react123.default.createElement("div", { style: { width: f2.width, height: f2.height } - }), i3 == array.length - 1 ? /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null) : rows[f2.row].end == i3 ? /* @__PURE__ */ import_react122.default.createElement("div", { + }), i3 == array.length - 1 ? /* @__PURE__ */ import_react123.default.createElement(import_react123.default.Fragment, null) : rows[f2.row].end == i3 ? /* @__PURE__ */ import_react123.default.createElement("div", { key: i3, className: "mk-frame-gap-handle-v", style: { @@ -118319,12 +118617,12 @@ var FrameGapHandle = (props) => { width: Math.max(8, Math.abs(offset2["column"])), zIndex: "var(--mk-layer-editor-overlay)" } - }, /* @__PURE__ */ import_react122.default.createElement(FrameDraggableHandle, { + }, /* @__PURE__ */ import_react123.default.createElement(FrameDraggableHandle, { ...offAxisHandleProps, cursor: "col-resize", disableX: true, reverseY: true - })) : /* @__PURE__ */ import_react122.default.createElement("div", { + })) : /* @__PURE__ */ import_react123.default.createElement("div", { key: i3, className: "mk-frame-gap-handle-h", style: { @@ -118332,7 +118630,7 @@ var FrameGapHandle = (props) => { width: rows[f2.row].maxValue, zIndex: "var(--mk-layer-editor-overlay)" } - }, /* @__PURE__ */ import_react122.default.createElement(FrameDraggableHandle, { + }, /* @__PURE__ */ import_react123.default.createElement(FrameDraggableHandle, { ...handleProps, cursor: "row-resize", disableX: true, @@ -118342,7 +118640,7 @@ var FrameGapHandle = (props) => { // src/core/react/components/SpaceView/Frames/FrameNodeEditor/Overlays/FramePaddingHandle.tsx var import_classnames6 = __toESM(require_classnames()); -var import_react123 = __toESM(require_react()); +var import_react124 = __toESM(require_react()); var FramePadding = (props) => { const paddingTypes = [ "padding", @@ -118351,7 +118649,7 @@ var FramePadding = (props) => { "paddingLeft", "paddingRight" ]; - const [offset2, setOffset] = import_react123.default.useState({ + const [offset2, setOffset] = import_react124.default.useState({ padding: 0, paddingTop: null, paddingBottom: null, @@ -118359,7 +118657,7 @@ var FramePadding = (props) => { paddingRight: null }); const unit = "px"; - (0, import_react123.useEffect)(() => { + (0, import_react124.useEffect)(() => { const getNumericValue = (type) => { if (!props.styles[type]) return null; @@ -118376,7 +118674,7 @@ var FramePadding = (props) => { }, p); }); }, [props.styles]); - const [shiftModifier, setShiftModifier] = import_react123.default.useState(false); + const [shiftModifier, setShiftModifier] = import_react124.default.useState(false); const handleProps = { min: 0, mod: 2 @@ -118404,7 +118702,7 @@ var FramePadding = (props) => { } : { [type]: `'${value}${unit}'` } ); }; - (0, import_react123.useEffect)(() => { + (0, import_react124.useEffect)(() => { const handleKeyDown = (e4) => { if (e4.key === "Shift") { setShiftModifier(true); @@ -118422,7 +118720,7 @@ var FramePadding = (props) => { window.removeEventListener("keyup", handleKeyUp); }; }, []); - return /* @__PURE__ */ import_react123.default.createElement("div", { + return /* @__PURE__ */ import_react124.default.createElement("div", { style: { position: "absolute", top: 0, @@ -118433,12 +118731,12 @@ var FramePadding = (props) => { zIndex: 200, border: "1px solid var(--mk-ui-color-border-accent)" } - }, /* @__PURE__ */ import_react123.default.createElement("div", { + }, /* @__PURE__ */ import_react124.default.createElement("div", { className: (0, import_classnames6.default)( "mk-frame-paddings", shiftModifier && "mk-modifier-shift" ) - }, /* @__PURE__ */ import_react123.default.createElement("div", { + }, /* @__PURE__ */ import_react124.default.createElement("div", { className: "mk-frame-padding-handle-h", style: { position: "absolute", @@ -118446,7 +118744,7 @@ var FramePadding = (props) => { height: inset("paddingTop"), zIndex: "var(--mk-layer-editor-overlay)" } - }, /* @__PURE__ */ import_react123.default.createElement(FrameDraggableHandle, { + }, /* @__PURE__ */ import_react124.default.createElement(FrameDraggableHandle, { ...handleProps, value: offset2["paddingTop"] ?? offset2.padding, cursor: "s-resize", @@ -118459,7 +118757,7 @@ var FramePadding = (props) => { }, reverseY: true, disableX: true - })), /* @__PURE__ */ import_react123.default.createElement("div", { + })), /* @__PURE__ */ import_react124.default.createElement("div", { className: "mk-frame-padding-handle-v", style: { position: "absolute", @@ -118467,7 +118765,7 @@ var FramePadding = (props) => { width: inset("paddingRight"), zIndex: "var(--mk-layer-editor-overlay)" } - }, /* @__PURE__ */ import_react123.default.createElement(FrameDraggableHandle, { + }, /* @__PURE__ */ import_react124.default.createElement(FrameDraggableHandle, { ...handleProps, value: offset2["paddingRight"] ?? offset2.padding, cursor: "w-resize", @@ -118481,7 +118779,7 @@ var FramePadding = (props) => { reverseX: true, reverseY: true, disableY: true - })), /* @__PURE__ */ import_react123.default.createElement("div", { + })), /* @__PURE__ */ import_react124.default.createElement("div", { className: "mk-frame-padding-handle-v", style: { position: "absolute", @@ -118489,7 +118787,7 @@ var FramePadding = (props) => { width: inset("paddingLeft"), zIndex: "var(--mk-layer-editor-overlay)" } - }, /* @__PURE__ */ import_react123.default.createElement(FrameDraggableHandle, { + }, /* @__PURE__ */ import_react124.default.createElement(FrameDraggableHandle, { ...handleProps, value: offset2["paddingLeft"] ?? offset2.padding, cursor: "e-resize", @@ -118501,7 +118799,7 @@ var FramePadding = (props) => { saveValue("paddingLeft", value, modifiers); }, disableY: true - })), /* @__PURE__ */ import_react123.default.createElement("div", { + })), /* @__PURE__ */ import_react124.default.createElement("div", { className: "mk-frame-padding-handle-h", style: { position: "absolute", @@ -118509,7 +118807,7 @@ var FramePadding = (props) => { height: inset("paddingBottom"), zIndex: "var(--mk-layer-editor-overlay)" } - }, /* @__PURE__ */ import_react123.default.createElement(FrameDraggableHandle, { + }, /* @__PURE__ */ import_react124.default.createElement(FrameDraggableHandle, { ...handleProps, value: offset2["paddingBottom"] ?? offset2.padding, cursor: "n-resize", @@ -118529,11 +118827,11 @@ var FramePadding = (props) => { var import_classnames7 = __toESM(require_classnames()); // node_modules/re-resizable/lib/index.js -var React122 = __toESM(require_react()); +var React123 = __toESM(require_react()); var import_react_dom9 = __toESM(require_react_dom()); // node_modules/re-resizable/lib/resizer.js -var React121 = __toESM(require_react()); +var React122 = __toESM(require_react()); var __extends = function() { var extendStatics = function(d4, b2) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b3) { @@ -118607,10 +118905,10 @@ var Resizer = function(_super) { return _this; } Resizer2.prototype.render = function() { - return React121.createElement("div", { className: this.props.className || "", style: __assign2(__assign2({ position: "absolute", userSelect: "none" }, styles[this.props.direction]), this.props.replaceStyles || {}), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children); + return React122.createElement("div", { className: this.props.className || "", style: __assign2(__assign2({ position: "absolute", userSelect: "none" }, styles[this.props.direction]), this.props.replaceStyles || {}), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children); }; return Resizer2; -}(React121.PureComponent); +}(React122.PureComponent); // node_modules/re-resizable/lib/index.js var __extends2 = function() { @@ -119273,11 +119571,11 @@ var Resizable = function(_super) { } var resizers = Object.keys(enable).map(function(dir) { if (enable[dir] !== false) { - return React122.createElement(Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null); + return React123.createElement(Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null); } return null; }); - return React122.createElement("div", { className: handleWrapperClass, style: handleWrapperStyle }, resizers); + return React123.createElement("div", { className: handleWrapperClass, style: handleWrapperStyle }, resizers); }; Resizable2.prototype.render = function() { var _this = this; @@ -119293,10 +119591,10 @@ var Resizable = function(_super) { style.flexBasis = this.state.flexBasis; } var Wrapper = this.props.as || "div"; - return React122.createElement( + return React123.createElement( Wrapper, __assign3({ ref: this.ref, style, className: this.props.className }, extendsProps), - this.state.isResizing && React122.createElement("div", { style: this.state.backgroundStyle }), + this.state.isResizing && React123.createElement("div", { style: this.state.backgroundStyle }), this.props.children, this.renderResizer() ); @@ -119329,10 +119627,10 @@ var Resizable = function(_super) { snapGap: 0 }; return Resizable2; -}(React122.PureComponent); +}(React123.PureComponent); // src/core/react/components/SpaceView/Frames/FrameNodeEditor/Overlays/FrameResizer.tsx -var import_react124 = __toESM(require_react()); +var import_react125 = __toESM(require_react()); var FrameResizer = (props) => { const labelForValue = (value) => { if (!value) @@ -119343,18 +119641,18 @@ var FrameResizer = (props) => { return "Fill"; return value; }; - const [modifiers, setModifiers] = import_react124.default.useState(null); - const [size, setSize] = import_react124.default.useState({ + const [modifiers, setModifiers] = import_react125.default.useState(null); + const [size, setSize] = import_react125.default.useState({ width: props.resizeMode != 2 /* ResizeColumn */ ? props.size.width : props.size.maxWidth, height: props.size.height }); - import_react124.default.useEffect(() => { + import_react125.default.useEffect(() => { setSize({ width: props.resizeMode != 2 /* ResizeColumn */ ? props.size.width : props.size.maxWidth, height: props.size.height }); }, [props.size, props.resizeMode]); - (0, import_react124.useEffect)(() => { + (0, import_react125.useEffect)(() => { const captureShift = (e4) => { setModifiers({ shiftKey: e4.shiftKey }); }; @@ -119365,7 +119663,7 @@ var FrameResizer = (props) => { props.superstate.ui.inputManager.off("keyup", captureShift); }; }, [setModifiers]); - return /* @__PURE__ */ import_react124.default.createElement("div", { + return /* @__PURE__ */ import_react125.default.createElement("div", { style: { position: "absolute", top: 0, @@ -119373,7 +119671,7 @@ var FrameResizer = (props) => { width: props.clientSize.width, height: props.clientSize.height } - }, /* @__PURE__ */ import_react124.default.createElement(Resizable, { + }, /* @__PURE__ */ import_react125.default.createElement(Resizable, { lockAspectRatio: modifiers?.shiftKey, className: (0, import_classnames7.default)( props.resizeMode == 2 /* ResizeColumn */ ? "mk-frame-column" : "mk-frame-bounds" @@ -119421,9 +119719,9 @@ var FrameResizer = (props) => { height: size.height && size.height != "auto" ? size.height : "100%" }, ...props.listeners - }), props.clientSize?.width > 50 && props.resizeMode == 1 /* ResizeSelected */ && /* @__PURE__ */ import_react124.default.createElement("div", { + }), props.clientSize?.width > 50 && props.resizeMode == 1 /* ResizeSelected */ && /* @__PURE__ */ import_react125.default.createElement("div", { className: "mk-frame-resize-label-width" - }, /* @__PURE__ */ import_react124.default.createElement("div", null, /* @__PURE__ */ import_react124.default.createElement("span", null, labelForValue(size.width) ?? i18n_default.editor.fit), size.width && size.width != "auto" ? /* @__PURE__ */ import_react124.default.createElement("div", { + }, /* @__PURE__ */ import_react125.default.createElement("div", null, /* @__PURE__ */ import_react125.default.createElement("span", null, labelForValue(size.width) ?? i18n_default.editor.fit), size.width && size.width != "auto" ? /* @__PURE__ */ import_react125.default.createElement("div", { onClick: (e4) => { props.resize({ width: wrapQuotes("auto") @@ -119437,7 +119735,7 @@ var FrameResizer = (props) => { "ui//fold-horizontal" ) } - }) : /* @__PURE__ */ import_react124.default.createElement("div", { + }) : /* @__PURE__ */ import_react125.default.createElement("div", { onClick: (e4) => { props.resize({ width: wrapQuotes("100%") @@ -119451,9 +119749,9 @@ var FrameResizer = (props) => { "ui//unfold-horizontal" ) } - }))), props.clientSize?.height > 50 && props.resizeMode == 1 /* ResizeSelected */ && /* @__PURE__ */ import_react124.default.createElement("div", { + }))), props.clientSize?.height > 50 && props.resizeMode == 1 /* ResizeSelected */ && /* @__PURE__ */ import_react125.default.createElement("div", { className: "mk-frame-resize-label-height" - }, /* @__PURE__ */ import_react124.default.createElement("div", null, /* @__PURE__ */ import_react124.default.createElement("span", null, labelForValue(size.height) ?? i18n_default.editor.fit), size.height && size.height != "auto" ? /* @__PURE__ */ import_react124.default.createElement("div", { + }, /* @__PURE__ */ import_react125.default.createElement("div", null, /* @__PURE__ */ import_react125.default.createElement("span", null, labelForValue(size.height) ?? i18n_default.editor.fit), size.height && size.height != "auto" ? /* @__PURE__ */ import_react125.default.createElement("div", { onClick: (e4) => { props.resize({ height: wrapQuotes("auto") @@ -119465,7 +119763,7 @@ var FrameResizer = (props) => { dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//fold-vertical") } - }) : /* @__PURE__ */ import_react124.default.createElement("div", { + }) : /* @__PURE__ */ import_react125.default.createElement("div", { onClick: (e4) => { props.resize({ height: wrapQuotes("100%") @@ -119483,21 +119781,35 @@ var FrameResizer = (props) => { }; // src/core/react/components/SpaceView/Frames/ViewNodes/FrameView.tsx -var import_react140 = __toESM(require_react()); +var import_react142 = __toESM(require_react()); + +// src/core/react/components/SpaceView/Frames/EditorNodes/AudioNodeView.tsx +var import_react126 = __toESM(require_react()); +var AudioNodeView = (props) => { + const value = props.state.props.value; + const sourcePath = (0, import_react126.useMemo)(() => { + return props.superstate.ui.getUIPath(value); + }, [value]); + return props.state?.props.value?.length > 0 ? /* @__PURE__ */ import_react126.default.createElement("audio", { + controls: true, + preload: "none", + src: sourcePath + }) : /* @__PURE__ */ import_react126.default.createElement(import_react126.default.Fragment, null); +}; // src/core/react/components/SpaceEditor/SpaceActions.tsx -var import_react129 = __toESM(require_react()); +var import_react131 = __toESM(require_react()); // src/core/react/components/SpaceEditor/ActionEditor.tsx -var import_react127 = __toESM(require_react()); +var import_react129 = __toESM(require_react()); // src/core/react/components/SpaceEditor/ActionNode.tsx -var import_react126 = __toESM(require_react()); +var import_react128 = __toESM(require_react()); // src/core/react/components/SpaceEditor/BuiltinPropertyEditor.tsx -var import_react125 = __toESM(require_react()); +var import_react127 = __toESM(require_react()); var BuiltinPropertyEditor = (props) => { - const allOptions = (0, import_react125.useMemo)(() => { + const allOptions = (0, import_react127.useMemo)(() => { const options = props.fields.map((f2) => ({ id: f2.name, field: f2.name, @@ -119524,16 +119836,16 @@ var BuiltinPropertyEditor = (props) => { }; props.superstate.ui.openCustomMenu( e4.target.getBoundingClientRect(), - /* @__PURE__ */ import_react125.default.createElement(FormulaEditor, { + /* @__PURE__ */ import_react127.default.createElement(FormulaEditor, { ..._props }), { ..._props }, "bottom" ); }; - return props.command.schema.id == "formula" ? /* @__PURE__ */ import_react125.default.createElement("button", { + return props.command.schema.id == "formula" ? /* @__PURE__ */ import_react127.default.createElement("button", { onClick: (e4) => editFormula(e4) - }, "Edit Formula") : props.command.schema.id == "filter" ? /* @__PURE__ */ import_react125.default.createElement(SpaceQuery, { + }, "Edit Formula") : props.command.schema.id == "filter" ? /* @__PURE__ */ import_react127.default.createElement(SpaceQuery, { superstate: props.superstate, filters: props.actionTree.props["$function"] ?? [], setFilters: (filters) => { @@ -119548,17 +119860,17 @@ var BuiltinPropertyEditor = (props) => { fields: allOptions, sections: [], removeable: true - }) : /* @__PURE__ */ import_react125.default.createElement(import_react125.default.Fragment, null); + }) : /* @__PURE__ */ import_react127.default.createElement(import_react127.default.Fragment, null); }; // src/core/react/components/SpaceEditor/ActionNode.tsx var ActionNode = (props) => { - const [action, setAction] = import_react126.default.useState(props.actionTree?.action); - const command = (0, import_react126.useMemo)( + const [action, setAction] = import_react128.default.useState(props.actionTree?.action); + const command = (0, import_react128.useMemo)( () => props.superstate.cli.commandForAction(action), [action] ); - (0, import_react126.useEffect)(() => { + (0, import_react128.useEffect)(() => { setAction(props.actionTree?.action); }, [props.actionTree]); const selectAction = (e4, add3) => { @@ -119606,31 +119918,31 @@ var ActionNode = (props) => { } }); }; - return /* @__PURE__ */ import_react126.default.createElement("div", { + return /* @__PURE__ */ import_react128.default.createElement("div", { className: "mk-editor-actions-node" - }, /* @__PURE__ */ import_react126.default.createElement("div", { + }, /* @__PURE__ */ import_react128.default.createElement("div", { className: "mk-editor-actions-body" - }, /* @__PURE__ */ import_react126.default.createElement("div", { + }, /* @__PURE__ */ import_react128.default.createElement("div", { className: "mk-editor-actions-name" - }, /* @__PURE__ */ import_react126.default.createElement("div", { + }, /* @__PURE__ */ import_react128.default.createElement("div", { className: "mk-path-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( command ? stickerForSchema(command.schema) : "ui//plus" ) } - }), /* @__PURE__ */ import_react126.default.createElement("div", { + }), /* @__PURE__ */ import_react128.default.createElement("div", { onClick: (e4) => !command && selectAction(e4), className: "mk-editor-actions-selector" - }, command?.schema.name ?? "Select"), /* @__PURE__ */ import_react126.default.createElement("span", null), /* @__PURE__ */ import_react126.default.createElement("div", { + }, command?.schema.name ?? "Select"), /* @__PURE__ */ import_react128.default.createElement("span", null), /* @__PURE__ */ import_react128.default.createElement("div", { className: "mk-icon-small", onClick: (e4) => props.deleteTree(), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//close") } - })), command && /* @__PURE__ */ import_react126.default.createElement("div", { + })), command && /* @__PURE__ */ import_react128.default.createElement("div", { className: "mk-editor-actions-fields" - }, command.schema.type == "builtin" ? /* @__PURE__ */ import_react126.default.createElement(BuiltinPropertyEditor, { + }, command.schema.type == "builtin" ? /* @__PURE__ */ import_react128.default.createElement(BuiltinPropertyEditor, { superstate: props.superstate, command, actionTree: props.actionTree, @@ -119638,23 +119950,23 @@ var ActionNode = (props) => { fields: [...props.fields, props.prevField].filter((f2) => f2), values: props.values }) : command?.fields.map((f2, i3) => { - return /* @__PURE__ */ import_react126.default.createElement("div", { + return /* @__PURE__ */ import_react128.default.createElement("div", { className: "mk-path-context-row", key: i3 - }, /* @__PURE__ */ import_react126.default.createElement("div", { + }, /* @__PURE__ */ import_react128.default.createElement("div", { className: "mk-path-context-field" - }, /* @__PURE__ */ import_react126.default.createElement("div", { + }, /* @__PURE__ */ import_react128.default.createElement("div", { className: "mk-path-context-field-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( stickerForField(f2) ) } - }), /* @__PURE__ */ import_react126.default.createElement("div", { + }), /* @__PURE__ */ import_react128.default.createElement("div", { className: "mk-path-context-field-key" - }, f2.name)), /* @__PURE__ */ import_react126.default.createElement("div", { + }, f2.name)), /* @__PURE__ */ import_react128.default.createElement("div", { className: "mk-path-context-value" - }, /* @__PURE__ */ import_react126.default.createElement(DataTypeView, { + }, /* @__PURE__ */ import_react128.default.createElement(DataTypeView, { superstate: props.superstate, column: f2, columns: props.fields, @@ -119665,16 +119977,16 @@ var ActionNode = (props) => { props.saveTree(newTree); }, editMode: 5 /* EditModeAlways */ - }), /* @__PURE__ */ import_react126.default.createElement("div", { + }), /* @__PURE__ */ import_react128.default.createElement("div", { className: "mk-icon-small", onClick: (e4) => selectLinkedProp(e4, f2.name), dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plug") } }))); - }))), /* @__PURE__ */ import_react126.default.createElement("div", { + }))), /* @__PURE__ */ import_react128.default.createElement("div", { className: "mk-editor-actions-children" - }, props.actionTree.children.map((child, i3) => /* @__PURE__ */ import_react126.default.createElement(ActionNode, { + }, props.actionTree.children.map((child, i3) => /* @__PURE__ */ import_react128.default.createElement(ActionNode, { key: i3, prevField: command?.fields[i3], superstate: props.superstate, @@ -119692,7 +120004,7 @@ var ActionNode = (props) => { newTree.children.splice(i3, 1); props.saveTree(newTree); } - })), /* @__PURE__ */ import_react126.default.createElement("button", { + })), /* @__PURE__ */ import_react128.default.createElement("button", { onClick: (e4) => selectAction(e4, true), className: "mk-inline-button", dangerouslySetInnerHTML: { @@ -119703,12 +120015,12 @@ var ActionNode = (props) => { // src/core/react/components/SpaceEditor/ActionEditor.tsx var ActionEditor = (props) => { - const [actionTree, setActionTree] = import_react127.default.useState( + const [actionTree, setActionTree] = import_react129.default.useState( parseActionString(props.formula) ?? { action: "", props: {}, children: [] } ); - return /* @__PURE__ */ import_react127.default.createElement("div", { + return /* @__PURE__ */ import_react129.default.createElement("div", { className: "mk-editor-actions-nodes" - }, /* @__PURE__ */ import_react127.default.createElement(ActionNode, { + }, /* @__PURE__ */ import_react129.default.createElement(ActionNode, { superstate: props.superstate, prevField: null, actionTree, @@ -119719,7 +120031,7 @@ var ActionEditor = (props) => { props.saveFormula(JSON.stringify(tree)); setActionTree(tree); } - }), /* @__PURE__ */ import_react127.default.createElement(ActionTester, { + }), /* @__PURE__ */ import_react129.default.createElement(ActionTester, { type: "actions", code: JSON.stringify(actionTree), fields: props.fields, @@ -119729,7 +120041,7 @@ var ActionEditor = (props) => { }; // src/core/react/components/SpaceEditor/ScriptEditor.tsx -var import_react128 = __toESM(require_react()); +var import_react130 = __toESM(require_react()); // node_modules/@uiw/codemirror-theme-github/esm/index.js var defaultSettingsGithubLight = { @@ -119871,7 +120183,7 @@ var githubDark = githubDarkInit(); // src/core/react/components/SpaceEditor/ScriptEditor.tsx var ScriptEditor = (props) => { const { command } = props; - const value = (0, import_react128.useMemo)(() => { + const value = (0, import_react130.useMemo)(() => { if (!command) return ""; return `const ${command.schema.id} = (${command.fields.map((f2) => `${f2.name}: ${f2.type}`).join(", ")}, $api: API, $contexts) => { @@ -119885,14 +120197,14 @@ ${command.code} codeType: "script" }); }; - return /* @__PURE__ */ import_react128.default.createElement("div", null, /* @__PURE__ */ import_react128.default.createElement(esm_default, { + return /* @__PURE__ */ import_react130.default.createElement("div", null, /* @__PURE__ */ import_react130.default.createElement(esm_default, { className: "mk-editor-code", value, height: "100%", theme: githubDark, extensions: [javascript({ jsx: true })], onChange: saveCommand - }), /* @__PURE__ */ import_react128.default.createElement(ActionTester, { + }), /* @__PURE__ */ import_react130.default.createElement(ActionTester, { type: "script", code: command.code, fields: command.fields, @@ -119903,8 +120215,8 @@ ${command.code} // src/core/react/components/SpaceEditor/SpaceActions.tsx var SpaceCommand = (props) => { - const [command, setCommand] = (0, import_react129.useState)(null); - const uri = (0, import_react129.useMemo)(() => { + const [command, setCommand] = (0, import_react131.useState)(null); + const uri = (0, import_react131.useMemo)(() => { return props.superstate.spaceManager.uriByString(props.action); }, [props.action]); const saveCommand = (command2) => { @@ -119922,10 +120234,10 @@ var SpaceCommand = (props) => { () => command2 ); }; - (0, import_react129.useEffect)(() => { + (0, import_react131.useEffect)(() => { setCommand(props.superstate.cli.commandForAction(props.action)); }, [props.action]); - (0, import_react129.useEffect)(() => { + (0, import_react131.useEffect)(() => { const listener = (f2) => { if (f2.path == uri.basePath) setCommand(props.superstate.cli.commandForAction(props.action)); @@ -120020,32 +120332,32 @@ var SpaceCommand = (props) => { field ); }; - const defaultValues = (0, import_react129.useMemo)(() => { + const defaultValues = (0, import_react131.useMemo)(() => { return command?.fields.reduce((p, c3) => { return { ...p, [c3.name]: defaultValueForField(c3) }; }, {}) ?? {}; }, [command?.fields]); - return /* @__PURE__ */ import_react129.default.createElement("div", { + return /* @__PURE__ */ import_react131.default.createElement("div", { className: "mk-editor-actions" - }, command && /* @__PURE__ */ import_react129.default.createElement(import_react129.default.Fragment, null, /* @__PURE__ */ import_react129.default.createElement("div", null, /* @__PURE__ */ import_react129.default.createElement("div", { + }, command && /* @__PURE__ */ import_react131.default.createElement(import_react131.default.Fragment, null, /* @__PURE__ */ import_react131.default.createElement("div", null, /* @__PURE__ */ import_react131.default.createElement("div", { className: "mk-space-editor-title" - }, "Type"), /* @__PURE__ */ import_react129.default.createElement("div", { + }, "Type"), /* @__PURE__ */ import_react131.default.createElement("div", { className: "mk-path-context-row" - }, /* @__PURE__ */ import_react129.default.createElement("div", { + }, /* @__PURE__ */ import_react131.default.createElement("div", { className: "mk-cell-option-item", onClick: (e4) => selectType(e4) - }, /* @__PURE__ */ import_react129.default.createElement("div", null, menuItems.find((f2) => f2.value == command.schema.type)?.name), /* @__PURE__ */ import_react129.default.createElement("div", { + }, /* @__PURE__ */ import_react131.default.createElement("div", null, menuItems.find((f2) => f2.value == command.schema.type)?.name), /* @__PURE__ */ import_react131.default.createElement("div", { className: "mk-cell-option-select mk-icon-xxsmall mk-icon-rotated", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//collapse-solid") } - }))), /* @__PURE__ */ import_react129.default.createElement("div", { + }))), /* @__PURE__ */ import_react131.default.createElement("div", { className: "mk-space-editor-title" }, "Properties"), command.fields.map((f2) => { - return /* @__PURE__ */ import_react129.default.createElement("div", { + return /* @__PURE__ */ import_react131.default.createElement("div", { key: f2.name, className: "mk-path-context-row" - }, /* @__PURE__ */ import_react129.default.createElement("div", { + }, /* @__PURE__ */ import_react131.default.createElement("div", { className: "mk-path-context-field", onClick: (e4) => { const offset2 = e4.target.getBoundingClientRect(); @@ -120061,16 +120373,16 @@ var SpaceCommand = (props) => { deleteColumn: deleteProperty2 }); } - }, /* @__PURE__ */ import_react129.default.createElement("div", { + }, /* @__PURE__ */ import_react131.default.createElement("div", { className: "mk-path-context-field-icon", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker( stickerForField(f2) ) } - }), /* @__PURE__ */ import_react129.default.createElement("div", { + }), /* @__PURE__ */ import_react131.default.createElement("div", { className: "mk-path-context-field-key" - }, f2.name)), /* @__PURE__ */ import_react129.default.createElement(DataTypeView, { + }, f2.name)), /* @__PURE__ */ import_react131.default.createElement(DataTypeView, { superstate: props.superstate, initialValue: defaultValueForField(f2), column: f2, @@ -120079,20 +120391,20 @@ var SpaceCommand = (props) => { saveDefaultValueForField(f2, value); } })); - }), /* @__PURE__ */ import_react129.default.createElement("button", { + }), /* @__PURE__ */ import_react131.default.createElement("button", { className: "mk-inline-button", onClick: (e4) => newProperty(e4) - }, /* @__PURE__ */ import_react129.default.createElement("div", { + }, /* @__PURE__ */ import_react131.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - }), i18n_default.labels.newProperty)), command.schema.type == "script" ? /* @__PURE__ */ import_react129.default.createElement(ScriptEditor, { + }), i18n_default.labels.newProperty)), command.schema.type == "script" ? /* @__PURE__ */ import_react131.default.createElement(ScriptEditor, { superstate: props.superstate, command, saveCommand, values: defaultValues - }) : command.schema.type == "actions" ? /* @__PURE__ */ import_react129.default.createElement(ActionEditor, { + }) : command.schema.type == "actions" ? /* @__PURE__ */ import_react131.default.createElement(ActionEditor, { superstate: props.superstate, formula: command.code, path: uri.path, @@ -120110,7 +120422,7 @@ var SpaceCommand = (props) => { }, fields: command.fields, value: defaultValues - }) : command.schema.type == "formula" ? /* @__PURE__ */ import_react129.default.createElement(FormulaEditor, { + }) : command.schema.type == "formula" ? /* @__PURE__ */ import_react131.default.createElement(FormulaEditor, { superstate: props.superstate, formula: command.code, saveFormula: (formula) => { @@ -120121,19 +120433,19 @@ var SpaceCommand = (props) => { }, fields: command.fields, value: defaultValues - }) : /* @__PURE__ */ import_react129.default.createElement("div", null))); + }) : /* @__PURE__ */ import_react131.default.createElement("div", null))); }; // src/core/react/components/SpaceView/Editor/EmbedView/SpaceFragmentView.tsx -var import_react131 = __toESM(require_react()); +var import_react133 = __toESM(require_react()); // src/core/react/components/SpaceView/Frames/ViewNodes/FrameInstance.tsx -var import_react130 = __toESM(require_react()); +var import_react132 = __toESM(require_react()); var FrameInstanceView = (props) => { - const { saveState, instance } = (0, import_react130.useContext)(FrameInstanceContext); - return instance.root && /* @__PURE__ */ import_react130.default.createElement(FrameView, { + const { saveState, instance } = (0, import_react132.useContext)(FrameInstanceContext); + return instance.exec && /* @__PURE__ */ import_react132.default.createElement(FrameView, { superstate: props.superstate, - treeNode: instance.root, + treeNode: instance.exec, instance, saveState, source: props.source @@ -120142,12 +120454,12 @@ var FrameInstanceView = (props) => { // src/core/react/components/SpaceView/Editor/EmbedView/SpaceFragmentView.tsx var SpaceFragmentViewComponent = (props) => { - const path = (0, import_react131.useMemo)( + const path = (0, import_react133.useMemo)( () => props.superstate.spaceManager.uriByString(props.path, props.source), [props.path, props.source] ); - const [spaceFragment, setSpaceFragment] = (0, import_react131.useState)(null); - (0, import_react131.useEffect)(() => { + const [spaceFragment, setSpaceFragment] = (0, import_react133.useState)(null); + (0, import_react133.useEffect)(() => { if (path.refType == "context") { setSpaceFragment({ type: "context", @@ -120192,49 +120504,49 @@ var SpaceFragmentViewComponent = (props) => { }); } }, [path]); - return /* @__PURE__ */ import_react131.default.createElement(import_react131.default.Fragment, null, spaceFragment?.path && (spaceFragment?.type == "context" ? /* @__PURE__ */ import_react131.default.createElement(PathProvider, { + return /* @__PURE__ */ import_react133.default.createElement(import_react133.default.Fragment, null, spaceFragment?.path && (spaceFragment?.type == "context" ? /* @__PURE__ */ import_react133.default.createElement(PathProvider, { superstate: props.superstate, path: spaceFragment.path, readMode: false - }, /* @__PURE__ */ import_react131.default.createElement(SpaceProvider, { + }, /* @__PURE__ */ import_react133.default.createElement(SpaceProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react131.default.createElement(ContextMDBProvider, { + }, /* @__PURE__ */ import_react133.default.createElement(ContextMDBProvider, { superstate: props.superstate, schema: spaceFragment.contextSchema - }, /* @__PURE__ */ import_react131.default.createElement(FramesMDBProvider, { + }, /* @__PURE__ */ import_react133.default.createElement(FramesMDBProvider, { superstate: props.superstate, schema: spaceFragment.frameSchema - }, /* @__PURE__ */ import_react131.default.createElement(ContextEditorProvider, { + }, /* @__PURE__ */ import_react133.default.createElement(ContextEditorProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react131.default.createElement(ContextListContainer, { + }, /* @__PURE__ */ import_react133.default.createElement(ContextListContainer, { superstate: props.superstate, minMode: props.minMode, containerRef: props.containerRef, setView: props.setFrameSchema - })))))) : spaceFragment?.type == "frame" ? /* @__PURE__ */ import_react131.default.createElement(FrameRootProvider, { + })))))) : spaceFragment?.type == "frame" ? /* @__PURE__ */ import_react133.default.createElement(FrameRootProvider, { superstate: props.superstate, path, cols: [] - }, /* @__PURE__ */ import_react131.default.createElement(FrameInstanceProvider, { + }, /* @__PURE__ */ import_react133.default.createElement(FrameInstanceProvider, { id: props.id, superstate: props.superstate, props: {}, editable: false - }, /* @__PURE__ */ import_react131.default.createElement(FrameInstanceView, { + }, /* @__PURE__ */ import_react133.default.createElement(FrameInstanceView, { superstate: props.superstate, source: props.source - }))) : spaceFragment?.type == "action" ? /* @__PURE__ */ import_react131.default.createElement(SpaceCommand, { + }))) : spaceFragment?.type == "action" ? /* @__PURE__ */ import_react133.default.createElement(SpaceCommand, { superstate: props.superstate, action: props.path - }) : /* @__PURE__ */ import_react131.default.createElement(import_react131.default.Fragment, null))); + }) : /* @__PURE__ */ import_react133.default.createElement(import_react133.default.Fragment, null))); }; // src/core/react/components/SpaceView/Frames/EditorNodes/ContextNodeView.tsx -var import_react132 = __toESM(require_react()); +var import_react134 = __toESM(require_react()); var ContextNodeView = (props) => { const fullPath = props.state?.props?.value; - const { updateNode } = (0, import_react132.useContext)(FramesEditorRootContext); - const { id: id3 } = (0, import_react132.useContext)(FrameInstanceContext); + const { updateNode } = (0, import_react134.useContext)(FramesEditorRootContext); + const { id: id3 } = (0, import_react134.useContext)(FrameInstanceContext); const selectLink = (e4) => { showSpacesMenu( e4, @@ -120252,12 +120564,15 @@ var ContextNodeView = (props) => { props: { ...props.treeNode.node.props, value: wrapQuotes( - contextPathFromPath(props.superstate, fullPath).space + "#*" + schema + contextPathFromPath( + props.superstate, + props.superstate.spaceManager.resolvePath(fullPath, props.source) + )?.space + "#*" + schema ) } }); }; - return props.state && fullPath ? /* @__PURE__ */ import_react132.default.createElement(SpaceFragmentViewComponent, { + return props.state && fullPath ? /* @__PURE__ */ import_react134.default.createElement(SpaceFragmentViewComponent, { id: id3, source: props.source, superstate: props.superstate, @@ -120265,21 +120580,21 @@ var ContextNodeView = (props) => { minMode: props.state?.styles?.["--mk-min-mode"], containerRef: props.containerRef, setFrameSchema - }) : /* @__PURE__ */ import_react132.default.createElement("div", { + }) : /* @__PURE__ */ import_react134.default.createElement("div", { className: "mk-frame-placeholder", onClick: (e4) => selectLink(e4) }, i18n_default.labels.selectSpace); }; // src/core/react/components/SpaceView/Frames/EditorNodes/IconNodeView.tsx -var import_react133 = __toESM(require_react()); +var import_react135 = __toESM(require_react()); var IconNodeView = (props) => { const { selectionMode, selected: frameSelected, selection: selection2 - } = (0, import_react133.useContext)(FrameSelectionContext); - const { updateNode, nodes } = (0, import_react133.useContext)(FramesEditorRootContext); + } = (0, import_react135.useContext)(FrameSelectionContext); + const { updateNode, nodes } = (0, import_react135.useContext)(FramesEditorRootContext); const updateValue2 = (newValue) => { if (newValue != props.state.props?.value) { if (props.treeNode.editorProps?.linkedNode) { @@ -120300,7 +120615,7 @@ var IconNodeView = (props) => { } }; const selected = selection2?.includes(props.treeNode.node.id); - const editable = (0, import_react133.useMemo)(() => { + const editable = (0, import_react135.useMemo)(() => { if (selectionMode == 0 /* Read */) return false; if (selectionMode == 1 /* Page */) @@ -120315,49 +120630,55 @@ var IconNodeView = (props) => { return true; }, [props.treeNode, selectionMode, frameSelected, selected]); const selectIcon = () => { - props.superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react133.default.createElement(StickerModal_default, { + props.superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react135.default.createElement(StickerModal_default, { ui: props.superstate.ui, hide: _props.hide, selectedSticker: (emoji) => updateValue2(emoji) })); }; - return props.state && (props.state.props?.value?.length > 0 ? /* @__PURE__ */ import_react133.default.createElement("div", { + const [stickerType, stickerPath] = props.state.props?.value ? parseStickerString(props.state.props?.value) : [null, null]; + return props.state && (props.state.props?.value?.length > 0 ? stickerType == "image" ? /* @__PURE__ */ import_react135.default.createElement("img", { + className: "mk-frame-icon", + src: props.superstate.ui.getUIPath( + props.superstate.imagesCache.get(stickerPath) + ) + }) : /* @__PURE__ */ import_react135.default.createElement("div", { className: "mk-frame-icon", style: {}, dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker(props.state.props?.value) } - }) : editable ? /* @__PURE__ */ import_react133.default.createElement("div", { + }) : editable ? /* @__PURE__ */ import_react135.default.createElement("div", { onClick: () => selectIcon(), "aria-label": "Select Sticker", className: "mk-node-icon-placeholder", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//smile") } - }) : /* @__PURE__ */ import_react133.default.createElement(import_react133.default.Fragment, null)); + }) : /* @__PURE__ */ import_react135.default.createElement(import_react135.default.Fragment, null)); }; // src/core/react/components/SpaceView/Frames/EditorNodes/ImageNodeView.tsx -var import_react134 = __toESM(require_react()); +var import_react136 = __toESM(require_react()); var ImageNodeView = (props) => { const value = props.state.props.value; - const sourcePath = (0, import_react134.useMemo)(() => { + const sourcePath = (0, import_react136.useMemo)(() => { return props.superstate.ui.getUIPath(value); }, [value]); - const { nodes, updateNode } = (0, import_react134.useContext)(FramesEditorRootContext); - const { linkedProps } = (0, import_react134.useContext)(FrameInstanceContext); + const { nodes, updateNode } = (0, import_react136.useContext)(FramesEditorRootContext); + const { linkedProps } = (0, import_react136.useContext)(FrameInstanceContext); const { selectionMode, selected: frameSelected, selection: selection2 - } = (0, import_react134.useContext)(FrameSelectionContext); + } = (0, import_react136.useContext)(FrameSelectionContext); const selected = selection2?.includes(props.treeNode.node.id); const showModal2 = () => { if (!stringIsConst(props.treeNode.node.props.value) && !linkedProps.some( (f2) => props.treeNode.editorProps.linkedNode?.node == props.treeNode.node.schemaId && props.treeNode.editorProps.linkedNode?.prop == f2 )) return; - props.superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react134.default.createElement(ImageModal_default, { + props.superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react136.default.createElement(ImageModal_default, { superstate: props.superstate, hide: _props.hide, selectedPath: (image) => saveValue(image) @@ -120382,7 +120703,7 @@ var ImageNodeView = (props) => { } } }; - const editable = (0, import_react134.useMemo)(() => { + const editable = (0, import_react136.useMemo)(() => { if (selectionMode == 0 /* Read */) return false; if (selectionMode == 1 /* Page */) @@ -120396,7 +120717,7 @@ var ImageNodeView = (props) => { } return true; }, [props.treeNode, selectionMode, frameSelected, selected]); - return props.state?.props.value?.length > 0 ? /* @__PURE__ */ import_react134.default.createElement("img", { + return props.state?.props.value?.length > 0 ? /* @__PURE__ */ import_react136.default.createElement("img", { className: "mk-node-image", width: props.state?.styles.width, height: props.state?.styles.height, @@ -120405,7 +120726,7 @@ var ImageNodeView = (props) => { maxHeight: props.state?.styles.maxHeight }, src: sourcePath - }) : editable ? /* @__PURE__ */ import_react134.default.createElement("div", { + }) : editable ? /* @__PURE__ */ import_react136.default.createElement("div", { className: "mk-node-image-placeholder", dangerouslySetInnerHTML: { __html: props.superstate.ui.getPlaceholderImage("image-select") @@ -120415,25 +120736,25 @@ var ImageNodeView = (props) => { maxHeight: props.state?.styles.maxHeight }, onClick: (e4) => showModal2() - }) : /* @__PURE__ */ import_react134.default.createElement(import_react134.default.Fragment, null); + }) : /* @__PURE__ */ import_react136.default.createElement(import_react136.default.Fragment, null); }; // src/core/react/components/SpaceView/Frames/EditorNodes/InputNodeView.tsx -var import_react135 = __toESM(require_react()); +var import_react137 = __toESM(require_react()); var InputNodeView = (props) => { - const { selectionMode } = (0, import_react135.useContext)(FrameSelectionContext); - const { saveState, instance } = (0, import_react135.useContext)(FrameInstanceContext); - const [value, setValue] = (0, import_react135.useState)(""); + const { selectionMode } = (0, import_react137.useContext)(FrameSelectionContext); + const { saveState, instance } = (0, import_react137.useContext)(FrameInstanceContext); + const [value, setValue] = (0, import_react137.useState)(""); const state = props.state; const type = props.state.styles?.as; - (0, import_react135.useEffect)(() => { + (0, import_react137.useEffect)(() => { const linkedNode = parseLinkedNode(props.state?.props?.value); if (linkedNode) { - const node = linkedNode.node == "$root" ? instance.root.id : linkedNode.node; + const node = linkedNode.node == "$root" ? instance.exec.id : linkedNode.node; setValue(instance.state?.[node]?.props?.[linkedNode.prop]); } }, [props.state.props]); - return /* @__PURE__ */ import_react135.default.createElement("input", { + return /* @__PURE__ */ import_react137.default.createElement("input", { className: "mk-node-input", type, value: type == "checkbox" ? null : value, @@ -120475,22 +120796,22 @@ var InputNodeView = (props) => { }; // src/core/react/components/SpaceView/Frames/EditorNodes/TextNodeView.tsx -var import_react139 = __toESM(require_react()); +var import_react141 = __toESM(require_react()); // src/core/react/hooks/useEffectOnce.ts -var import_react136 = __toESM(require_react()); +var import_react138 = __toESM(require_react()); function useEffectOnce(cb) { - (0, import_react136.useEffect)(cb, []); + (0, import_react138.useEffect)(cb, []); } // src/core/react/hooks/useEventListener.ts -var import_react137 = __toESM(require_react()); +var import_react139 = __toESM(require_react()); function useEventListener(eventType, callback, element = window) { - const callbackRef = (0, import_react137.useRef)(callback); - (0, import_react137.useEffect)(() => { + const callbackRef = (0, import_react139.useRef)(callback); + (0, import_react139.useEffect)(() => { callbackRef.current = callback; }, [callback]); - (0, import_react137.useEffect)(() => { + (0, import_react139.useEffect)(() => { if (element == null) return; const handler = (e4) => callbackRef.current(e4); @@ -120500,24 +120821,24 @@ function useEventListener(eventType, callback, element = window) { } // src/core/react/hooks/useTimeout.tsx -var import_react138 = __toESM(require_react()); +var import_react140 = __toESM(require_react()); function useTimeout(callback, delay) { - const callbackRef = (0, import_react138.useRef)(callback); - const timeoutRef = (0, import_react138.useRef)(null); - (0, import_react138.useEffect)(() => { + const callbackRef = (0, import_react140.useRef)(callback); + const timeoutRef = (0, import_react140.useRef)(null); + (0, import_react140.useEffect)(() => { callbackRef.current = callback; }, [callback]); - const set = (0, import_react138.useCallback)(() => { + const set = (0, import_react140.useCallback)(() => { timeoutRef.current = setTimeout(() => callbackRef.current(), delay); }, [delay]); - const clear = (0, import_react138.useCallback)(() => { + const clear = (0, import_react140.useCallback)(() => { timeoutRef.current && clearTimeout(timeoutRef.current); }, []); - (0, import_react138.useEffect)(() => { + (0, import_react140.useEffect)(() => { set(); return clear; }, [delay, set, clear]); - const reset2 = (0, import_react138.useCallback)(() => { + const reset2 = (0, import_react140.useCallback)(() => { clear(); set(); }, [clear, set]); @@ -120543,9 +120864,9 @@ var TextNodeView = (props) => { selectable, selected: frameSelected, select - } = (0, import_react139.useContext)(FrameSelectionContext); - const fileNameRef = (0, import_react139.useRef)(null); - const { updateNode, nodes, deleteNode } = (0, import_react139.useContext)(FramesEditorRootContext); + } = (0, import_react141.useContext)(FrameSelectionContext); + const fileNameRef = (0, import_react141.useRef)(null); + const { updateNode, nodes, deleteNode } = (0, import_react141.useContext)(FramesEditorRootContext); const updateValue2 = (newValue) => { if (newValue != props.state.props?.value) { if (props.treeNode.editorProps?.linkedNode) { @@ -120618,8 +120939,8 @@ var TextNodeView = (props) => { }; useLongPress(fileNameRef, onLongPress); const selected = selection2.includes(props.treeNode.id); - const { linkedProps } = (0, import_react139.useContext)(FrameInstanceContext); - const editable = (0, import_react139.useMemo)(() => { + const { linkedProps } = (0, import_react141.useContext)(FrameInstanceContext); + const editable = (0, import_react141.useMemo)(() => { if (selectionMode == 0 /* Read */) return false; if (props.treeNode.isRef) { @@ -120639,7 +120960,7 @@ var TextNodeView = (props) => { return true; return false; }, [props.treeNode, selectionMode, frameSelected, selected, linkedProps]); - return props.state && /* @__PURE__ */ import_react139.default.createElement("div", { + return props.state && /* @__PURE__ */ import_react141.default.createElement("div", { className: `mk-frame-text`, "data-placeholder": editable || selectable ? i18n_default.labels.textPlaceholder : "", dangerouslySetInnerHTML: { @@ -120664,28 +120985,30 @@ var FrameView = (props) => { treeNode: props.treeNode, state: props.instance.state[props.treeNode.id] }; - const innerComponents = props.treeNode.node.type == "input" ? /* @__PURE__ */ import_react140.default.createElement(InputNodeView, { + const innerComponents = props.treeNode.node.type == "input" ? /* @__PURE__ */ import_react142.default.createElement(InputNodeView, { ...nodeProps - }) : props.treeNode.node.type == "text" ? /* @__PURE__ */ import_react140.default.createElement(TextNodeView, { + }) : props.treeNode.node.type == "text" ? /* @__PURE__ */ import_react142.default.createElement(TextNodeView, { ...nodeProps - }) : props.treeNode.node.type == "icon" ? /* @__PURE__ */ import_react140.default.createElement(IconNodeView, { + }) : props.treeNode.node.type == "icon" ? /* @__PURE__ */ import_react142.default.createElement(IconNodeView, { ...nodeProps - }) : props.treeNode.node.type == "image" ? /* @__PURE__ */ import_react140.default.createElement(ImageNodeView, { + }) : props.treeNode.node.type == "audio" ? /* @__PURE__ */ import_react142.default.createElement(AudioNodeView, { ...nodeProps - }) : props.treeNode.node.type == "space" ? /* @__PURE__ */ import_react140.default.createElement(ContextNodeView, { + }) : props.treeNode.node.type == "image" ? /* @__PURE__ */ import_react142.default.createElement(ImageNodeView, { + ...nodeProps + }) : props.treeNode.node.type == "space" ? /* @__PURE__ */ import_react142.default.createElement(ContextNodeView, { ...nodeProps, source: props.source - }) : props.treeNode.node.type == "content" ? /* @__PURE__ */ import_react140.default.createElement(ContentNodeView, null, props.treeNode.children.filter((f2) => f2.node.type != "slides").map((c3, i3) => /* @__PURE__ */ import_react140.default.createElement(FrameView, { + }) : props.treeNode.node.type == "content" ? /* @__PURE__ */ import_react142.default.createElement(ContentNodeView, null, props.treeNode.children.filter((f2) => f2.node.type != "slides").map((c3, i3) => /* @__PURE__ */ import_react142.default.createElement(FrameView, { superstate: props.superstate, key: i3, treeNode: c3, instance: props.instance, saveState: props.saveState, source: props.source - }, props.children)), props.children) : props.treeNode.node.type == "flow" ? /* @__PURE__ */ import_react140.default.createElement(FlowNodeView, { + }, props.children)), props.children) : props.treeNode.node.type == "flow" ? /* @__PURE__ */ import_react142.default.createElement(FlowNodeView, { ...nodeProps, source: props.source - }) : props.treeNode.children.filter((f2) => f2.node.type != "slides").map((c3, i3) => /* @__PURE__ */ import_react140.default.createElement(FrameView, { + }) : props.treeNode.children.filter((f2) => f2.node.type != "slides").map((c3, i3) => /* @__PURE__ */ import_react142.default.createElement(FrameView, { superstate: props.superstate, key: i3, treeNode: c3, @@ -120694,7 +121017,7 @@ var FrameView = (props) => { source: props.source }, props.children)); const hidden = props.instance.state[props.treeNode.id]?.styles ? props.instance.state[props.treeNode.id]?.styles?.hidden ? true : false : false; - return props.instance.state[props.treeNode.id] && !hidden && /* @__PURE__ */ import_react140.default.createElement("div", { + return props.instance.state[props.treeNode.id] && !hidden && /* @__PURE__ */ import_react142.default.createElement("div", { className: `mk-frame ${parseStylesToClass( props.instance.state[props.treeNode.id]?.styles )}`, @@ -120745,10 +121068,10 @@ var FrameView = (props) => { }; // src/core/react/components/SpaceView/Frames/EditorNodes/NewNodeView.tsx -var import_react141 = __toESM(require_react()); +var import_react143 = __toESM(require_react()); var NewNodeView = (props) => { - const ref2 = import_react141.default.createRef(); - const { spaceState } = (0, import_react141.useContext)(SpaceContext); + const ref2 = import_react143.default.createRef(); + const { spaceState } = (0, import_react143.useContext)(SpaceContext); const { updateNode, nodes, @@ -120757,10 +121080,10 @@ var NewNodeView = (props) => { saveNodes, lastCreatedId, setLastCreatedId - } = (0, import_react141.useContext)(FramesEditorRootContext); - const { selection: selection2, select } = (0, import_react141.useContext)(FrameSelectionContext); - const [type, setType] = (0, import_react141.useState)("label"); - const { instance } = (0, import_react141.useContext)(FrameInstanceContext); + } = (0, import_react143.useContext)(FramesEditorRootContext); + const { selection: selection2, select } = (0, import_react143.useContext)(FrameSelectionContext); + const [type, setType] = (0, import_react143.useState)("label"); + const { instance } = (0, import_react143.useContext)(FrameInstanceContext); const spaces2 = [...props.superstate.allSpaces(true)].filter((f2) => f2.type != "default").map((f2) => ({ name: f2.name, value: f2.path, @@ -120779,8 +121102,8 @@ var NewNodeView = (props) => { threshold: 0, keys: ["name", "value"] }; - const [query, setQuery] = (0, import_react141.useState)(""); - const suggestions = (0, import_react141.useMemo)(() => { + const [query, setQuery] = (0, import_react143.useState)(""); + const suggestions = (0, import_react143.useMemo)(() => { const menuOptions = []; const label = { name: i18n_default.frames.label.label, @@ -120888,7 +121211,7 @@ var NewNodeView = (props) => { styles: option.value.node.styles, ref: "spaces://$kit/#*" + option.value.def.id }, - instance.root.node, + instance.exec.node, true ).then((f2) => select(f2.id)); } @@ -120914,7 +121237,7 @@ var NewNodeView = (props) => { value: wrapQuotes(query) } }, - instance.root.node, + instance.exec.node, true ).then((f2) => select(f2.id)); } @@ -120941,7 +121264,7 @@ var NewNodeView = (props) => { value: wrapQuotes(option.value) } }, - instance.root.node, + instance.exec.node, true ); } @@ -120970,7 +121293,7 @@ var NewNodeView = (props) => { value: wrapQuotes(f2) } }, - instance.root.node, + instance.exec.node, true ); } @@ -120999,7 +121322,7 @@ var NewNodeView = (props) => { type: "space", props: { value: wrapQuotes(`${spaceState.path}/#^${f2}`) } }, - instance.root.node, + instance.exec.node, true ); } @@ -121011,15 +121334,15 @@ var NewNodeView = (props) => { ref2.current.blur(); ref2.current.innerHTML = ""; }; - (0, import_react141.useEffect)(() => { + (0, import_react143.useEffect)(() => { if (ref2.current && lastCreatedId && lastCreatedId == props.treeNode?.node.id) { ref2.current.focus(); setLastCreatedId(null); } }, [ref2, selection2, props.treeNode]); - return /* @__PURE__ */ import_react141.default.createElement("div", { + return /* @__PURE__ */ import_react143.default.createElement("div", { className: "mk-node-new" - }, /* @__PURE__ */ import_react141.default.createElement(Suggester, { + }, /* @__PURE__ */ import_react143.default.createElement(Suggester, { superstate: props.superstate, placeholder: i18n_default.hintText.newFrame, suggestions, @@ -121040,57 +121363,59 @@ var NewNodeView = (props) => { var defaultFrameStyles = { position: "relative" }; -var FrameEditorInner = (0, import_react142.memo)(function FrameEditorInner2(props) { +var FrameEditorInner = (0, import_react144.memo)(function FrameEditorInner2(props) { const nodeProps = { superstate: props.superstate, treeNode: props.treeNode, state: props.state }; const { treeNode } = props; - const { pathState } = (0, import_react142.useContext)(PathContext); - const { instance } = (0, import_react142.useContext)(FrameInstanceContext); - return /* @__PURE__ */ import_react142.default.createElement(import_react142.default.Fragment, null, treeNode.node.type == "new" ? /* @__PURE__ */ import_react142.default.createElement(NewNodeView, { + const { pathState } = (0, import_react144.useContext)(PathContext); + const { instance } = (0, import_react144.useContext)(FrameInstanceContext); + return /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, treeNode.node.type == "new" ? /* @__PURE__ */ import_react144.default.createElement(NewNodeView, { ...nodeProps - }) : treeNode.node.type == "input" ? /* @__PURE__ */ import_react142.default.createElement(InputNodeView, { + }) : treeNode.node.type == "input" ? /* @__PURE__ */ import_react144.default.createElement(InputNodeView, { ...nodeProps - }) : treeNode.node.type == "text" ? /* @__PURE__ */ import_react142.default.createElement(TextNodeView, { + }) : treeNode.node.type == "text" ? /* @__PURE__ */ import_react144.default.createElement(TextNodeView, { ...nodeProps - }) : treeNode.node.type == "icon" ? /* @__PURE__ */ import_react142.default.createElement(IconNodeView, { + }) : treeNode.node.type == "icon" ? /* @__PURE__ */ import_react144.default.createElement(IconNodeView, { ...nodeProps - }) : treeNode.node.type == "image" ? /* @__PURE__ */ import_react142.default.createElement(ImageNodeView, { + }) : treeNode.node.type == "audio" ? /* @__PURE__ */ import_react144.default.createElement(AudioNodeView, { ...nodeProps - }) : treeNode.node.type == "space" ? /* @__PURE__ */ import_react142.default.createElement(ContextNodeView, { + }) : treeNode.node.type == "image" ? /* @__PURE__ */ import_react144.default.createElement(ImageNodeView, { + ...nodeProps + }) : treeNode.node.type == "space" ? /* @__PURE__ */ import_react144.default.createElement(ContextNodeView, { ...nodeProps, containerRef: props.containerRef, source: pathState.path - }) : treeNode.node.type == "flow" ? /* @__PURE__ */ import_react142.default.createElement(FlowNodeView, { + }) : treeNode.node.type == "flow" ? /* @__PURE__ */ import_react144.default.createElement(FlowNodeView, { ...nodeProps, source: pathState.path, containerRef: props.containerRef - }) : treeNode.node.type == "content" ? /* @__PURE__ */ import_react142.default.createElement(ContentNodeView, { + }) : treeNode.node.type == "content" ? /* @__PURE__ */ import_react144.default.createElement(ContentNodeView, { editable: !props.treeNode.isRef }, props.treeNode.children.map( - (c3, i3) => c3.node.type == "slides" ? null : /* @__PURE__ */ import_react142.default.createElement(FrameEditorNodeView, { + (c3, i3) => c3.node.type == "slides" ? null : /* @__PURE__ */ import_react144.default.createElement(FrameEditorNodeView, { superstate: props.superstate, key: c3.id, treeNode: c3, instance: props.instance, containerRef: props.containerRef }, props.children) - ), props.children) : (treeNode.node.type == "column" || treeNode.node.type == "container") && treeNode.children.length == 0 ? null : props.treeNode.id == props.instance.root.id || treeNode.node.type == "column" || treeNode.node.type == "container" ? props.treeNode.children.map( - (c3, i3) => c3.node.type == "slides" ? null : /* @__PURE__ */ import_react142.default.createElement(FrameEditorNodeView, { + ), props.children) : (treeNode.node.type == "column" || treeNode.node.type == "container") && treeNode.children.length == 0 ? null : props.treeNode.id == props.instance.exec.id || treeNode.node.type == "column" || treeNode.node.type == "container" ? props.treeNode.children.map( + (c3, i3) => c3.node.type == "slides" ? null : /* @__PURE__ */ import_react144.default.createElement(FrameEditorNodeView, { superstate: props.superstate, key: c3.id, treeNode: c3, instance: props.instance, containerRef: props.containerRef }, props.children) - ) : /* @__PURE__ */ import_react142.default.createElement(import_react142.default.Fragment, null, /* @__PURE__ */ import_react142.default.createElement(FrameSelectionProvider, { + ) : /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, /* @__PURE__ */ import_react144.default.createElement(FrameSelectionProvider, { superstate: props.superstate, id: treeNode.id, editMode: props.editMode }, treeNode.children.map( - (c3, i3) => c3.node.type == "slides" ? null : /* @__PURE__ */ import_react142.default.createElement(FrameEditorNodeView, { + (c3, i3) => c3.node.type == "slides" ? null : /* @__PURE__ */ import_react144.default.createElement(FrameEditorNodeView, { superstate: props.superstate, key: c3.id, treeNode: c3, @@ -121107,28 +121432,28 @@ var FrameEditorNodeView = (props) => { isParentToSelection, select, selection: selection2 - } = (0, import_react142.useContext)(FrameSelectionContext); + } = (0, import_react144.useContext)(FrameSelectionContext); const { updateNode, addNode, deleteNode, nodes, selectedSlide - } = (0, import_react142.useContext)(FramesEditorRootContext); - const { setDragNode } = (0, import_react142.useContext)(WindowContext); - const { saveState, selectableNodeBounds, id: id3 } = (0, import_react142.useContext)(FrameInstanceContext); - const { dragActive } = (0, import_react142.useContext)(WindowContext); - const editMode = props.treeNode.isRef ? 0 /* Read */ : props.treeNode.id == props.instance.root.id ? selectionMode : 3 /* Group */; + } = (0, import_react144.useContext)(FramesEditorRootContext); + const { setDragNode } = (0, import_react144.useContext)(WindowContext); + const { saveState, selectableNodeBounds, id: id3 } = (0, import_react144.useContext)(FrameInstanceContext); + const { dragActive } = (0, import_react144.useContext)(WindowContext); + const editMode = props.treeNode.isRef ? 0 /* Read */ : props.treeNode.id == props.instance.exec.id ? selectionMode : 3 /* Group */; const selected = selection2.some((f2) => f2 == props.treeNode.id); const isSelectable = selectable && !props.treeNode.isRef && !selected; const state = props.instance.state[props.treeNode.id]; - const deltas = (0, import_react142.useMemo)( + const deltas = (0, import_react144.useMemo)( () => selectedSlide ? nodes.find( (f2) => f2.ref == props.treeNode.id && selectedSlide == f2.parentId ) ?? null : null, [nodes, props.treeNode, selectedSlide] ); - const treeNode = (0, import_react142.useMemo)( + const treeNode = (0, import_react144.useMemo)( () => deltas ? { ...props.treeNode, node: { @@ -121149,11 +121474,11 @@ var FrameEditorNodeView = (props) => { } : props.treeNode, [deltas, props.treeNode] ); - const { frameSchema } = (0, import_react142.useContext)(FramesMDBContext); + const { frameSchema } = (0, import_react144.useContext)(FramesMDBContext); const dragId = id3 + frameSchema.id + props.treeNode.id; - const [hover, setHover] = (0, import_react142.useState)(false); - const [isMouseOverElement, setIsMouseOverElement] = import_react142.default.useState(false); - const [isMouseOverPortal, setIsMouseOverPortal] = import_react142.default.useState(false); + const [hover, setHover] = (0, import_react144.useState)(false); + const [isMouseOverElement, setIsMouseOverElement] = import_react144.default.useState(false); + const [isMouseOverPortal, setIsMouseOverPortal] = import_react144.default.useState(false); const draggable = props.treeNode.editorProps.dragMode == 1 /* DragHandle */ || (isSelectable && !isParentToSelection || selected) && props.treeNode.editorProps.dragMode != 0; const { attributes, @@ -121172,9 +121497,9 @@ var FrameEditorNodeView = (props) => { }, disabled: !draggable }); - const ref2 = (0, import_react142.useRef)(null); + const ref2 = (0, import_react144.useRef)(null); const onLongPress = () => { - if (isSelectable && props.treeNode.id != props.instance.root.id) { + if (isSelectable && props.treeNode.id != props.instance.exec.id) { select(treeNode.node.id); return; } @@ -121191,7 +121516,7 @@ var FrameEditorNodeView = (props) => { }); }; const onClick = (e4) => { - if (isSelectable && (selectionMode != 1 /* Page */ || isParentToSelection && props.treeNode.id != props.instance.root.id)) { + if (isSelectable && (selectionMode != 1 /* Page */ || isParentToSelection && props.treeNode.id != props.instance.exec.id)) { if (e4.shiftKey) { select(treeNode.node.id, true); } else { @@ -121199,7 +121524,7 @@ var FrameEditorNodeView = (props) => { } e4.stopPropagation(); return; - } else if (props.treeNode.id == props.instance.root.id) { + } else if (props.treeNode.id == props.instance.exec.id) { select(null); } if (!selected) { @@ -121230,11 +121555,11 @@ var FrameEditorNodeView = (props) => { e4.stopPropagation(); } }; - (0, import_react142.useEffect)(() => { + (0, import_react144.useEffect)(() => { selection2.some((f2) => f2 != props.treeNode.id) && setHover(false); }, [selection2, props.treeNode]); - const [canEditLayout, setCanEditLayout] = (0, import_react142.useState)(false); - (0, import_react142.useEffect)(() => { + const [canEditLayout, setCanEditLayout] = (0, import_react144.useState)(false); + (0, import_react144.useEffect)(() => { if (selected && isTouchScreen(props.superstate.ui) && (props.treeNode.node.type == "group" || props.treeNode.node.type == "image" || selectionMode >= 3 /* Group */)) { setCanEditLayout(true); } else { @@ -121248,7 +121573,7 @@ var FrameEditorNodeView = (props) => { const computedStyle = ref2.current && getComputedStyle(ref2.current); const clientWidth = ref2.current && ref2.current.clientWidth; const clientHeight = ref2.current && ref2.current.clientHeight; - const [childNodeSizes, setChildNodeSizes] = (0, import_react142.useState)([]); + const [childNodeSizes, setChildNodeSizes] = (0, import_react144.useState)([]); const calculateRectInContainer = (rect, containerRect2) => { return { left: rect.x - containerRect2.x, @@ -121257,11 +121582,11 @@ var FrameEditorNodeView = (props) => { height: rect.height }; }; - (0, import_react142.useEffect)(() => { + (0, import_react144.useEffect)(() => { if (!ref2.current || !props.containerRef?.current) { return () => null; } - if (props.treeNode.node.parentId == props.instance.root.id) + if (props.treeNode.node.parentId == props.instance.exec.id) selectableNodeBounds.current[props.treeNode.id] = calculateRectInContainer( ref2.current.getBoundingClientRect(), props.containerRef.current.getBoundingClientRect() @@ -121280,7 +121605,7 @@ var FrameEditorNodeView = (props) => { return sizes; }); const resizeObserver = new ResizeObserver(() => { - if (props.treeNode.node.parentId == props.instance.root.id && ref2.current) + if (props.treeNode.node.parentId == props.instance.exec.id && ref2.current) selectableNodeBounds.current[props.treeNode.id] = calculateRectInContainer( ref2.current.getBoundingClientRect(), props.containerRef.current.getBoundingClientRect() @@ -121318,11 +121643,11 @@ var FrameEditorNodeView = (props) => { onDragStart: (e4) => { if (e4.active?.id == dragId) { setDragNode( - /* @__PURE__ */ import_react142.default.createElement("div", { + /* @__PURE__ */ import_react144.default.createElement("div", { style: { width: ref2.current.clientWidth } - }, /* @__PURE__ */ import_react142.default.createElement(FrameView, { + }, /* @__PURE__ */ import_react144.default.createElement(FrameView, { superstate: props.superstate, treeNode: props.treeNode, instance: props.instance, @@ -121332,7 +121657,7 @@ var FrameEditorNodeView = (props) => { } } }); - return /* @__PURE__ */ import_react142.default.createElement(import_react142.default.Fragment, null, (!hidden || !props.treeNode.isRef) && /* @__PURE__ */ import_react142.default.createElement("div", { + return /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, (!hidden || !props.treeNode.isRef) && /* @__PURE__ */ import_react144.default.createElement("div", { ref: (el) => { ref2.current = el; selectionMode > 1 /* Page */ && draggable && setDraggableNodeRef(el); @@ -121358,13 +121683,13 @@ var FrameEditorNodeView = (props) => { ...{ onClick }, ...selectionMode > 1 /* Page */ ? { ...listeners, ...attributes } : {}, style: styles2 - }, /* @__PURE__ */ import_react142.default.createElement(FrameEditorInner, { + }, /* @__PURE__ */ import_react144.default.createElement(FrameEditorInner, { ...nodeProps, containerRef: props.containerRef, editMode, instance: props.instance }, props.children)), state && props.treeNode.node.type != "new" && props.containerRef?.current && selectionMode > 0 /* Read */ && ref2.current && (0, import_react_dom10.createPortal)( - /* @__PURE__ */ import_react142.default.createElement(import_react142.default.Fragment, null, /* @__PURE__ */ import_react142.default.createElement("div", { + /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, /* @__PURE__ */ import_react144.default.createElement("div", { style: { position: "absolute", top: nodeRect.top - containerRect.top, @@ -121389,7 +121714,7 @@ var FrameEditorNodeView = (props) => { return; } } - }, props.treeNode.editorProps.resizeMode == 2 /* ResizeColumn */ && /* @__PURE__ */ import_react142.default.createElement(FrameResizer, { + }, props.treeNode.editorProps.resizeMode == 2 /* ResizeColumn */ && /* @__PURE__ */ import_react144.default.createElement(FrameResizer, { size: state?.styles, superstate: props.superstate, resizeMode: props.treeNode.editorProps.resizeMode, @@ -121398,7 +121723,7 @@ var FrameEditorNodeView = (props) => { width: clientWidth, height: clientHeight } - }), dragActive && (selectionMode == 1 /* Page */ || selectionMode == 3 /* Group */) && dropMode > 0 /* DropModeNone */ && /* @__PURE__ */ import_react142.default.createElement(FrameEditorDropZone, { + }), dragActive && (selectionMode == 1 /* Page */ || selectionMode == 3 /* Group */) && dropMode > 0 /* DropModeNone */ && /* @__PURE__ */ import_react144.default.createElement(FrameEditorDropZone, { parentId: treeNode.node.parentId, superstate: props.superstate, height: clientHeight, @@ -121407,7 +121732,7 @@ var FrameEditorNodeView = (props) => { id: dragId, mode: dropMode, insertMode: treeNode.node.type == "group" ? 1 : treeNode.node.type == "space" ? -1 : 0 - }), canEditLayout && /* @__PURE__ */ import_react142.default.createElement(import_react142.default.Fragment, null, /* @__PURE__ */ import_react142.default.createElement(FrameResizer, { + }), canEditLayout && /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, /* @__PURE__ */ import_react144.default.createElement(FrameResizer, { superstate: props.superstate, resizeMode: 1 /* ResizeSelected */, size: state?.styles, @@ -121416,14 +121741,14 @@ var FrameEditorNodeView = (props) => { width: clientWidth, height: clientHeight } - }), /* @__PURE__ */ import_react142.default.createElement(FrameCorners, { + }), /* @__PURE__ */ import_react144.default.createElement(FrameCorners, { styles: state?.styles, saveStyles, clientSize: { width: clientWidth, height: clientHeight } - }), (treeNode.node.type == "group" || treeNode.node.type == "content") && (state.styles?.layout == "row" || state.styles?.layout == "column") && /* @__PURE__ */ import_react142.default.createElement(import_react142.default.Fragment, null, /* @__PURE__ */ import_react142.default.createElement(FrameGapHandle, { + }), (treeNode.node.type == "group" || treeNode.node.type == "content") && (state.styles?.layout == "row" || state.styles?.layout == "column") && /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, /* @__PURE__ */ import_react144.default.createElement(FrameGapHandle, { childSizes: childNodeSizes, clientSize: { width: clientWidth, @@ -121444,14 +121769,14 @@ var FrameEditorNodeView = (props) => { styles: state?.styles, saveStyles, direction: state?.styles.layout == "column" ? "column" : "row" - }), /* @__PURE__ */ import_react142.default.createElement(FramePadding, { + }), /* @__PURE__ */ import_react144.default.createElement(FramePadding, { clientSize: { width: clientWidth, height: clientHeight }, styles: state?.styles, saveStyles - }))), treeNode.editorProps.dragMode == 1 /* DragHandle */ && (!isTouchScreen(props.superstate.ui) || selected) ? /* @__PURE__ */ import_react142.default.createElement("div", { + }))), treeNode.editorProps.dragMode == 1 /* DragHandle */ && (!isTouchScreen(props.superstate.ui) || selected) ? /* @__PURE__ */ import_react144.default.createElement("div", { onMouseEnter: () => { setIsMouseOverPortal(true); setHover(true); @@ -121466,7 +121791,7 @@ var FrameEditorNodeView = (props) => { style: { zIndex: hover ? "calc(var(--layer-popover) + 1)" : "var(--layer-popover)" } - }, /* @__PURE__ */ import_react142.default.createElement(FrameHoverMenu, { + }, /* @__PURE__ */ import_react144.default.createElement(FrameHoverMenu, { superstate: props.superstate, node: treeNode.node, mode: selectionMode == 1 /* Page */ ? 0 : 1, @@ -121475,10 +121800,10 @@ var FrameEditorNodeView = (props) => { dragRef: setDraggableNodeRef, attributes, listeners - })) : /* @__PURE__ */ import_react142.default.createElement(import_react142.default.Fragment, null)), selection2 && !dragActive && selected && selection2.length == 1 ? /* @__PURE__ */ import_react142.default.createElement(FrameNodeEditorContainer, { + })) : /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null)), selection2 && !dragActive && selected && selection2.length == 1 ? /* @__PURE__ */ import_react144.default.createElement(FrameNodeEditorContainer, { nodeRect, containerRect - }, /* @__PURE__ */ import_react142.default.createElement(FrameNodeEditor, { + }, /* @__PURE__ */ import_react144.default.createElement(FrameNodeEditor, { editLayout: (state2) => setCanEditLayout(state2), superstate: props.superstate, node: treeNode.node, @@ -121488,10 +121813,10 @@ var FrameEditorNodeView = (props) => { state, deleteFrame: () => deleteNode(treeNode.node), fields: propertiesForNode(treeNode.node) - })) : selection2.length > 1 && selection2[0] == treeNode.id ? /* @__PURE__ */ import_react142.default.createElement(FrameNodeEditorContainer, { + })) : selection2.length > 1 && selection2[0] == treeNode.id ? /* @__PURE__ */ import_react144.default.createElement(FrameNodeEditorContainer, { nodeRect, containerRect - }, /* @__PURE__ */ import_react142.default.createElement(FrameMultiNodeEditor, { + }, /* @__PURE__ */ import_react144.default.createElement(FrameMultiNodeEditor, { superstate: props.superstate })) : null), props.containerRef.current @@ -121500,13 +121825,13 @@ var FrameEditorNodeView = (props) => { // src/core/react/components/SpaceView/Frames/ViewNodes/FrameEditorInstance.tsx var FrameEditorInstance = (props) => { - const { spaceInfo } = (0, import_react143.useContext)(SpaceContext); - const { undoLastAction, redoAction, frameSchema } = (0, import_react143.useContext)(FramesMDBContext); - const { nodes, addNode, saveNodes, setLastCreatedId } = (0, import_react143.useContext)( + const { spaceInfo } = (0, import_react145.useContext)(SpaceContext); + const { undoLastAction, redoAction, frameSchema } = (0, import_react145.useContext)(FramesMDBContext); + const { nodes, addNode, saveNodes, setLastCreatedId } = (0, import_react145.useContext)( FramesEditorRootContext ); - const { saveState, hoverNode, setHoverNode, instance, id: id3 } = (0, import_react143.useContext)(FrameInstanceContext); - const { selectable, selectionMode, selection: selection2, select } = (0, import_react143.useContext)( + const { saveState, hoverNode, setHoverNode, instance, id: id3 } = (0, import_react145.useContext)(FrameInstanceContext); + const { selectable, selectionMode, selection: selection2, select } = (0, import_react145.useContext)( FrameSelectionContext ); const resetState = () => { @@ -121539,13 +121864,13 @@ var FrameEditorInstance = (props) => { resetState(); return; } - const overParentNode = findParent(instance.root, overId); + const overParentNode = findParent(instance.exec, overId); const overNode = overParentNode?.children.find( (f2) => f2.id == overId ); if (active.data.current.type == "node") { const activeParentNode = findParent( - instance.root, + instance.exec, active.data.current.node ); const activeNode = activeParentNode?.children.find( @@ -121555,7 +121880,7 @@ var FrameEditorInstance = (props) => { const [newNodes, deleteNodes] = dropFrame( activeNode.node, overNode, - instance.root, + instance.exec, nodes, hoverNode.direction ); @@ -121569,7 +121894,7 @@ var FrameEditorInstance = (props) => { active.data.current.context ), overNode, - instance.root, + instance.exec, nodes, hoverNode.direction ); @@ -121585,7 +121910,7 @@ var FrameEditorInstance = (props) => { } }, overNode, - instance.root, + instance.exec, nodes, hoverNode.direction ); @@ -121607,7 +121932,7 @@ var FrameEditorInstance = (props) => { } }, overNode, - instance.root, + instance.exec, nodes, hoverNode.direction ); @@ -121656,13 +121981,13 @@ var FrameEditorInstance = (props) => { } return node; }; - const handleKeyDown = (0, import_react143.useCallback)( + const handleKeyDown = (0, import_react145.useCallback)( (e4) => { if (e4.key == "ArrowUp") { if (selection2.length > 0) { const node = nodes.find((f2) => f2.id == selection2[0]); if (node) { - const parent = findParent(instance.root, node.id); + const parent = findParent(instance.exec, node.id); if (parent) { const index = parent.children.find((f2) => f2.id == node.id).node.rank; if (index > 0) { @@ -121678,7 +122003,7 @@ var FrameEditorInstance = (props) => { if (selection2.length > 0) { const node = nodes.find((f2) => f2.id == selection2[0]); if (node) { - const parent = findParent(instance.root, node.id); + const parent = findParent(instance.exec, node.id); if (parent) { const index = parent.children.find((f2) => f2.id == node.id).node.rank; if (index < parent.children.length - 1) { @@ -121707,28 +122032,28 @@ var FrameEditorInstance = (props) => { }, [selection2, nodes, undoLastAction, redoAction, saveNodes] ); - (0, import_react143.useEffect)(() => { + (0, import_react145.useEffect)(() => { props.superstate.ui.inputManager.on("keydown", handleKeyDown); return () => { props.superstate.ui.inputManager.off("keydown", handleKeyDown); }; }, [handleKeyDown]); - return /* @__PURE__ */ import_react143.default.createElement(import_react143.default.Fragment, null, instance.root && /* @__PURE__ */ import_react143.default.createElement("div", { + return /* @__PURE__ */ import_react145.default.createElement(import_react145.default.Fragment, null, instance.exec && /* @__PURE__ */ import_react145.default.createElement("div", { className: "mk-f-root", style: { position: "relative" } - }, selectionMode >= 3 /* Group */ && /* @__PURE__ */ import_react143.default.createElement("div", { + }, selectionMode >= 3 /* Group */ && /* @__PURE__ */ import_react145.default.createElement("div", { className: "mk-f-root-label", onClick: (e4) => { - select(instance.root.id); + select(instance.exec.id); e4.stopPropagation(); } - }, instance.root.node.name), /* @__PURE__ */ import_react143.default.createElement(FrameEditorNodeView, { + }, instance.exec.node.name), /* @__PURE__ */ import_react145.default.createElement(FrameEditorNodeView, { key: spaceInfo.path, superstate: props.superstate, - treeNode: instance.root, + treeNode: instance.exec, instance, containerRef: props.containerRef - }, props.children), instance.root.children.length == 0 && /* @__PURE__ */ import_react143.default.createElement(NewNodeView, { + }, props.children), instance.exec.children.length == 0 && /* @__PURE__ */ import_react145.default.createElement(NewNodeView, { superstate: props.superstate, treeNode: null, state: null @@ -121737,15 +122062,15 @@ var FrameEditorInstance = (props) => { // src/core/react/components/SpaceView/Contexts/ContextBuilder/ContextListInstance.tsx var ContextListInstance = (props) => { - const [contexts, setContexts] = (0, import_react144.useState)(props.contexts); - (0, import_react144.useEffect)( + const [contexts, setContexts] = (0, import_react146.useState)(props.contexts); + (0, import_react146.useEffect)( () => setContexts((p) => import_lodash18.default.isEqual(props.contexts, p) ? p : props.contexts), [props.contexts] ); - const { spaceInfo } = (0, import_react144.useContext)(SpaceContext); - const { dbSchema } = (0, import_react144.useContext)(ContextMDBContext); - const { setDragNode } = (0, import_react144.useContext)(WindowContext); - const ref2 = import_react144.default.useRef(null); + const { spaceInfo } = (0, import_react146.useContext)(SpaceContext); + const { dbSchema } = (0, import_react146.useContext)(ContextMDBContext); + const { setDragNode } = (0, import_react146.useContext)(WindowContext); + const ref2 = import_react146.default.useRef(null); const { attributes, listeners, @@ -121773,7 +122098,7 @@ var ContextListInstance = (props) => { onDragStart: (e4) => { if (e4.active.data.current.id == props.id) { setDragNode( - /* @__PURE__ */ import_react144.default.createElement("div", { + /* @__PURE__ */ import_react146.default.createElement("div", { dangerouslySetInnerHTML: { __html: ref2.current.innerHTML } }) ); @@ -121786,31 +122111,31 @@ var ContextListInstance = (props) => { dropListItem(dragReorder, over2, props, active2, spaceInfo); } }); - return props.editMode >= 1 /* Page */ && props.uri.authority != "$kit" ? /* @__PURE__ */ import_react144.default.createElement(FrameSelectionProvider, { + return props.editMode >= 1 /* Page */ && props.uri.authority != "$kit" ? /* @__PURE__ */ import_react146.default.createElement(FrameSelectionProvider, { superstate: props.superstate, id: props.id, editMode: props.editMode, selected: props.editMode == 3 /* Group */ - }, /* @__PURE__ */ import_react144.default.createElement(FrameInstanceProvider, { + }, /* @__PURE__ */ import_react146.default.createElement(FrameInstanceProvider, { id: props.id, superstate: props.superstate, props: props.props, propSetters: props.propSetters, contexts, editable: true - }, /* @__PURE__ */ import_react144.default.createElement(FrameEditorInstance, { + }, /* @__PURE__ */ import_react146.default.createElement(FrameEditorInstance, { superstate: props.superstate, containerRef: props.containerRef - }, props.children))) : /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, over?.id == props.id && active.data.current.type == props.type && !(active.data.current.space == spaceInfo?.path && active.data.current.schema == dbSchema?.id && active.data.current.props?._groupValue == props.props?._groupValue) && /* @__PURE__ */ import_react144.default.createElement(FrameInstanceProvider, { + }, props.children))) : /* @__PURE__ */ import_react146.default.createElement(import_react146.default.Fragment, null, over?.id == props.id && active.data.current.type == props.type && !(active.data.current.space == spaceInfo?.path && active.data.current.schema == dbSchema?.id && active.data.current.props?._groupValue == props.props?._groupValue) && /* @__PURE__ */ import_react146.default.createElement(FrameInstanceProvider, { id: props.id, superstate: props.superstate, props: props.props, propSetters: props.propSetters, contexts, editable: false - }, /* @__PURE__ */ import_react144.default.createElement(FrameInstanceView, { + }, /* @__PURE__ */ import_react146.default.createElement(FrameInstanceView, { superstate: props.superstate - })), /* @__PURE__ */ import_react144.default.createElement("div", { + })), /* @__PURE__ */ import_react146.default.createElement("div", { ref: (el) => { setDraggableNodeRef(el); ref2.current = el; @@ -121821,14 +122146,14 @@ var ContextListInstance = (props) => { transform: CSS.Transform.toString(transform), transition } - }, /* @__PURE__ */ import_react144.default.createElement(FrameInstanceProvider, { + }, /* @__PURE__ */ import_react146.default.createElement(FrameInstanceProvider, { id: props.id, superstate: props.superstate, props: props.props, propSetters: props.propSetters, contexts, editable: false - }, /* @__PURE__ */ import_react144.default.createElement(FrameInstanceView, { + }, /* @__PURE__ */ import_react146.default.createElement(FrameInstanceView, { superstate: props.superstate }, props.children)))); }; @@ -121861,20 +122186,20 @@ var dropListItem = async (dragReorder, over, props, active, spaceInfo) => { }; // src/core/react/components/SpaceView/Contexts/ContextBuilder/ContextListView.tsx -var import_react146 = __toESM(require_react()); +var import_react148 = __toESM(require_react()); // src/core/react/components/SpaceView/Contexts/ContextBuilder/FrameContainerView.tsx -var import_react145 = __toESM(require_react()); +var import_react147 = __toESM(require_react()); var FrameContainerView = (props) => { - const { selected: _selected } = (0, import_react145.useContext)(FrameSelectionContext); - return props.editMode >= 1 /* Page */ && props.uri.authority != "$kit" ? /* @__PURE__ */ import_react145.default.createElement(FramesMDBProvider, { + const { selected: _selected } = (0, import_react147.useContext)(FrameSelectionContext); + return props.editMode >= 1 /* Page */ && props.uri.authority != "$kit" ? /* @__PURE__ */ import_react147.default.createElement(FramesMDBProvider, { superstate: props.superstate, schema: props.uri.ref - }, /* @__PURE__ */ import_react145.default.createElement(FrameEditorProvider, { + }, /* @__PURE__ */ import_react147.default.createElement(FrameEditorProvider, { superstate: props.superstate, cols: props.cols, editMode: props.editMode - }, props.children)) : /* @__PURE__ */ import_react145.default.createElement(FrameRootProvider, { + }, props.children)) : /* @__PURE__ */ import_react147.default.createElement(FrameRootProvider, { superstate: props.superstate, path: props.uri, cols: props.cols @@ -121884,18 +122209,18 @@ var FrameContainerView = (props) => { // src/core/react/components/SpaceView/Contexts/ContextBuilder/ContextListView.tsx var ContextListView = (props) => { const { editSection, selectedIndex, setSelectedIndex, groupURI, itemURI } = props; - const { spaceInfo } = (0, import_react146.useContext)(SpaceContext); + const { spaceInfo } = (0, import_react148.useContext)(SpaceContext); const { predicate, filteredData: data2, editMode, sortedColumns, contextTable - } = (0, import_react146.useContext)(ContextEditorContext); - const { instance } = (0, import_react146.useContext)(FrameInstanceContext); - const { cols, dbSchema } = (0, import_react146.useContext)(ContextMDBContext); + } = (0, import_react148.useContext)(ContextEditorContext); + const { instance } = (0, import_react148.useContext)(FrameInstanceContext); + const { cols, dbSchema } = (0, import_react148.useContext)(ContextMDBContext); const groupBy2 = predicate.groupBy?.length > 0 ? cols.find((f2) => f2.name + f2.table == predicate.groupBy[0]) : null; - const groupByOptions = (0, import_react146.useMemo)(() => { + const groupByOptions = (0, import_react148.useMemo)(() => { const groupByOptions2 = instance?.state[instance?.root?.id].props?.groupOptions; if (groupByOptions2) return ensureArray(groupByOptions2); @@ -121911,11 +122236,11 @@ var ContextListView = (props) => { ]); return options; }, [groupBy2, data2, instance]); - const groupByFilter = (0, import_react146.useMemo)(() => { + const groupByFilter = (0, import_react148.useMemo)(() => { const filter2 = instance?.state[instance?.root?.id].props?.groupFilter; return filterFnTypes[filter2] ?? filterFnTypes.is; }, [instance]); - const items = (0, import_react146.useMemo)(() => { + const items = (0, import_react148.useMemo)(() => { return groupByOptions.reduce((p, c3) => { if (!groupBy2) { return c3 == "" ? { @@ -121938,7 +122263,7 @@ var ContextListView = (props) => { }; }, {}); }, [data2, groupByOptions, groupByFilter, groupBy2]); - const primaryKey = (0, import_react146.useMemo)(() => { + const primaryKey = (0, import_react148.useMemo)(() => { return cols.find((f2) => f2.primary == "true")?.name; }, [cols]); const context = { @@ -121947,7 +122272,7 @@ var ContextListView = (props) => { _key: primaryKey, _properties: sortedColumns }; - const contextMap = (0, import_react146.useMemo)(() => { + const contextMap = (0, import_react148.useMemo)(() => { return dbSchema?.primary == "true" ? data2.reduce((p, c3) => { return { ...p, @@ -121997,17 +122322,17 @@ var ContextListView = (props) => { }; }, {}); }, [data2, cols, contextTable]); - return /* @__PURE__ */ import_react146.default.createElement(FrameContainerView, { + return /* @__PURE__ */ import_react148.default.createElement(FrameContainerView, { superstate: props.superstate, uri: groupURI, editMode: editSection == "listGroup" ? editMode : 0 /* Read */, cols: [] - }, /* @__PURE__ */ import_react146.default.createElement(SortableContext, { + }, /* @__PURE__ */ import_react148.default.createElement(SortableContext, { items: Object.keys(items).map( (f2, i3) => spaceInfo.path + "listGroup" + i3 ), strategy: rectSortingStrategy - }, Object.keys(items).map((c3, i3) => /* @__PURE__ */ import_react146.default.createElement(ContextListInstance, { + }, Object.keys(items).map((c3, i3) => /* @__PURE__ */ import_react148.default.createElement(ContextListInstance, { key: "listGroup" + i3, id: spaceInfo.path + "listGroup" + i3, type: "listGroup", @@ -122024,18 +122349,18 @@ var ContextListView = (props) => { cols: [], containerRef: props.containerRef, contexts: { $context: context } - }, /* @__PURE__ */ import_react146.default.createElement(FrameContainerView, { + }, /* @__PURE__ */ import_react148.default.createElement(FrameContainerView, { uri: itemURI, superstate: props.superstate, cols: [], editMode: editSection == "listItem" ? editMode : 0 /* Read */ - }, /* @__PURE__ */ import_react146.default.createElement(SortableContext, { + }, /* @__PURE__ */ import_react148.default.createElement(SortableContext, { items: items[c3].flatMap( (f2, k2) => spaceInfo.path + "listGroup" + i3 + "_listItem" + k2 ), strategy: rectSortingStrategy }, items[c3].map((f2, j) => { - return /* @__PURE__ */ import_react146.default.createElement(ContextListInstance, { + return /* @__PURE__ */ import_react148.default.createElement(ContextListInstance, { key: "listGroup" + i3 + "_listItem" + j, id: spaceInfo.path + "listGroup" + i3 + "_listItem" + j, type: "listItem", @@ -122059,12 +122384,12 @@ var ContextListView = (props) => { // src/core/react/components/SpaceView/Contexts/ContextListContainer.tsx var ContextListContainer = (props) => { - const { dbSchema } = (0, import_react147.useContext)(ContextMDBContext); - const { predicate, editMode, setEditMode } = (0, import_react147.useContext)(ContextEditorContext); - const { frameSchema } = (0, import_react147.useContext)(FramesMDBContext); - const [editSection, setEditSection] = (0, import_react147.useState)(null); - const [selectedIndex, setSelectedIndex] = (0, import_react147.useState)(null); - const [uris, setURIs] = (0, import_react147.useState)({ + const { dbSchema } = (0, import_react149.useContext)(ContextMDBContext); + const { predicate, editMode, setEditMode } = (0, import_react149.useContext)(ContextEditorContext); + const { frameSchema } = (0, import_react149.useContext)(FramesMDBContext); + const [editSection, setEditSection] = (0, import_react149.useState)(null); + const [selectedIndex, setSelectedIndex] = (0, import_react149.useState)(null); + const [uris, setURIs] = (0, import_react149.useState)({ listView: props.superstate.spaceManager.uriByString( initiateString(predicate.listView, "spaces://$kit/#*listView") ), @@ -122075,7 +122400,7 @@ var ContextListContainer = (props) => { initiateString(predicate.listItem, "spaces://$kit/#*rowItem") ) }); - (0, import_react147.useEffect)(() => { + (0, import_react149.useEffect)(() => { const newURIs = { listView: props.superstate.spaceManager.uriByString( initiateString(predicate.listView, "spaces://$kit/#*listView") @@ -122089,30 +122414,30 @@ var ContextListContainer = (props) => { }; setURIs((p) => !import_lodash19.default.isEqual(newURIs, p) ? newURIs : p); }, [predicate]); - return /* @__PURE__ */ import_react147.default.createElement("div", { + return /* @__PURE__ */ import_react149.default.createElement("div", { className: "mk-context-container" - }, !props.minMode && /* @__PURE__ */ import_react147.default.createElement(FilterBar, { + }, !props.minMode && /* @__PURE__ */ import_react149.default.createElement(FilterBar, { superstate: props.superstate, setView: props.setView - }), predicate.view == "table" || predicate.view == "db" || dbSchema?.primary != "true" && !frameSchema ? /* @__PURE__ */ import_react147.default.createElement(TableView, { + }), predicate.view == "table" || predicate.view == "db" || dbSchema?.primary != "true" && !frameSchema ? /* @__PURE__ */ import_react149.default.createElement(TableView, { superstate: props.superstate - }) : /* @__PURE__ */ import_react147.default.createElement("div", { + }) : /* @__PURE__ */ import_react149.default.createElement("div", { className: "mk-editor-context" - }, /* @__PURE__ */ import_react147.default.createElement(FrameSelectionProvider, { + }, /* @__PURE__ */ import_react149.default.createElement(FrameSelectionProvider, { superstate: props.superstate, id: "list", editMode: editSection == "listView" ? editMode : 0 /* Read */ - }, editMode > 0 && /* @__PURE__ */ import_react147.default.createElement(ContextListEditSelector, { + }, editMode > 0 && /* @__PURE__ */ import_react149.default.createElement(ContextListEditSelector, { editSection, superstate: props.superstate, setEditSection, setEditMode - }), /* @__PURE__ */ import_react147.default.createElement(FrameContainerView, { + }), /* @__PURE__ */ import_react149.default.createElement(FrameContainerView, { superstate: props.superstate, uri: uris.listView, cols: [], editMode: editSection == "listView" ? editMode : 0 /* Read */ - }, /* @__PURE__ */ import_react147.default.createElement(ContextListInstance, { + }, /* @__PURE__ */ import_react149.default.createElement(ContextListInstance, { superstate: props.superstate, id: "listView", type: "listView", @@ -122123,7 +122448,7 @@ var ContextListContainer = (props) => { editMode: editSection == "listView" ? editMode : 0 /* Read */, cols: [], contexts: null - }, /* @__PURE__ */ import_react147.default.createElement(ContextListView, { + }, /* @__PURE__ */ import_react149.default.createElement(ContextListView, { superstate: props.superstate, containerRef: props.containerRef, editSection, @@ -122136,28 +122461,28 @@ var ContextListContainer = (props) => { // src/core/react/components/MDBView/MDBViewer.tsx var MDBViewer = (props) => { - return /* @__PURE__ */ import_react148.default.createElement(PathProvider, { + return /* @__PURE__ */ import_react150.default.createElement(PathProvider, { superstate: props.superstate, path: props.space.path, readMode: false - }, /* @__PURE__ */ import_react148.default.createElement(SpaceProvider, { + }, /* @__PURE__ */ import_react150.default.createElement(SpaceProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react148.default.createElement(ContextMDBProvider, { + }, /* @__PURE__ */ import_react150.default.createElement(ContextMDBProvider, { superstate: props.superstate, schema: props.schema - }, /* @__PURE__ */ import_react148.default.createElement(FramesMDBProvider, { + }, /* @__PURE__ */ import_react150.default.createElement(FramesMDBProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react148.default.createElement(ContextEditorProvider, { + }, /* @__PURE__ */ import_react150.default.createElement(ContextEditorProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react148.default.createElement(ContextListContainer, { + }, /* @__PURE__ */ import_react150.default.createElement(ContextListContainer, { superstate: props.superstate })))))); }; // src/core/react/components/MarkdownEditor/Backlinks.tsx -var import_react149 = __toESM(require_react()); +var import_react151 = __toESM(require_react()); var BacklinkItem = (props) => { - const [block, setBlock] = (0, import_react149.useState)([null, null]); + const [block, setBlock] = (0, import_react151.useState)([null, null]); const refreshBlock = (path) => { const fCache = props.superstate.pathsIndex.get(path); const link = [ @@ -122176,40 +122501,40 @@ var BacklinkItem = (props) => { setBlock([null, null]); } }; - (0, import_react149.useEffect)(() => { + (0, import_react151.useEffect)(() => { refreshBlock(props.path); }, []); - (0, import_react149.useEffect)(() => { + (0, import_react151.useEffect)(() => { refreshBlock(props.path); }, [props.path]); - const [collapsed, setCollapsed] = (0, import_react149.useState)(false); - return /* @__PURE__ */ import_react149.default.createElement(import_react149.default.Fragment, null, /* @__PURE__ */ import_react149.default.createElement("div", { + const [collapsed, setCollapsed] = (0, import_react151.useState)(false); + return /* @__PURE__ */ import_react151.default.createElement(import_react151.default.Fragment, null, /* @__PURE__ */ import_react151.default.createElement("div", { className: "mk-path-context-title" - }, /* @__PURE__ */ import_react149.default.createElement(CollapseToggle, { + }, /* @__PURE__ */ import_react151.default.createElement(CollapseToggle, { superstate: props.superstate, collapsed, onToggle: (c3) => setCollapsed(c3) - }), /* @__PURE__ */ import_react149.default.createElement("div", { + }), /* @__PURE__ */ import_react151.default.createElement("div", { onClick: (e4) => { props.superstate.ui.openPath(props.path, false); e4.stopPropagation(); } - }, pathNameToString(props.path))), !collapsed ? /* @__PURE__ */ import_react149.default.createElement("div", { + }, pathNameToString(props.path))), !collapsed ? /* @__PURE__ */ import_react151.default.createElement("div", { className: "mk-path-context-backlink" - }, /* @__PURE__ */ import_react149.default.createElement(NoteView, { + }, /* @__PURE__ */ import_react151.default.createElement(NoteView, { load: true, superstate: props.superstate, path: props.path, properties: { from: block[0], to: block[1] }, classname: "mk-path-context-flow" - })) : /* @__PURE__ */ import_react149.default.createElement(import_react149.default.Fragment, null)); + })) : /* @__PURE__ */ import_react151.default.createElement(import_react151.default.Fragment, null)); }; var Backlinks = (props) => { - const [collapsed, setCollapsed] = (0, import_react149.useState)( + const [collapsed, setCollapsed] = (0, import_react151.useState)( !props.superstate.settings.inlineBacklinksExpanded ); - const [backlinks, setBacklinks] = (0, import_react149.useState)([]); - (0, import_react149.useEffect)(() => { + const [backlinks, setBacklinks] = (0, import_react151.useState)([]); + (0, import_react151.useEffect)(() => { if (!props.path) return; Promise.all( @@ -122218,95 +122543,95 @@ var Backlinks = (props) => { ) ).then((bls) => setBacklinks(bls.filter((f2) => f2))); }, [props.path]); - (0, import_react149.useEffect)(() => { + (0, import_react151.useEffect)(() => { props.superstate.settings.inlineBacklinksExpanded = !collapsed; props.superstate.saveSettings(); }, [collapsed]); const toggleBacklinks = () => { setCollapsed(!collapsed); }; - (0, import_react149.useEffect)(() => { + (0, import_react151.useEffect)(() => { window.addEventListener(eventTypes.toggleBacklinks, toggleBacklinks); return () => { window.removeEventListener(eventTypes.toggleBacklinks, toggleBacklinks); }; }, [collapsed]); - return backlinks.length > 0 && props.path ? /* @__PURE__ */ import_react149.default.createElement("div", { + return backlinks.length > 0 && props.path ? /* @__PURE__ */ import_react151.default.createElement("div", { className: "mk-path-context-component mk-note-footer" - }, /* @__PURE__ */ import_react149.default.createElement("div", { + }, /* @__PURE__ */ import_react151.default.createElement("div", { className: "mk-path-context-section" - }, /* @__PURE__ */ import_react149.default.createElement("div", { + }, /* @__PURE__ */ import_react151.default.createElement("div", { onClick: (e4) => { setCollapsed(!collapsed); e4.stopPropagation(); }, className: "mk-path-context-title" - }, /* @__PURE__ */ import_react149.default.createElement("div", { + }, /* @__PURE__ */ import_react151.default.createElement("div", { className: `mk-icon-xsmall`, dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//backlink") } - }), i18n_default.labels.backlinks, /* @__PURE__ */ import_react149.default.createElement(CollapseToggleSmall, { + }), i18n_default.labels.backlinks, /* @__PURE__ */ import_react151.default.createElement(CollapseToggleSmall, { superstate: props.superstate, collapsed, onToggle: () => null - })), /* @__PURE__ */ import_react149.default.createElement("div", null, !collapsed && backlinks.map((f2, i3) => /* @__PURE__ */ import_react149.default.createElement(BacklinkItem, { + })), /* @__PURE__ */ import_react151.default.createElement("div", null, !collapsed && backlinks.map((f2, i3) => /* @__PURE__ */ import_react151.default.createElement(BacklinkItem, { path: f2, key: i3, superstate: props.superstate, source: props.path - }))))) : /* @__PURE__ */ import_react149.default.createElement(import_react149.default.Fragment, null); + }))))) : /* @__PURE__ */ import_react151.default.createElement(import_react151.default.Fragment, null); }; // src/core/react/components/SpaceView/Contexts/Header/NoteSpacesBar.tsx -var import_react151 = __toESM(require_react()); +var import_react153 = __toESM(require_react()); // src/core/react/components/SpaceView/Contexts/Header/SpaceProperties.tsx -var import_react150 = __toESM(require_react()); +var import_react152 = __toESM(require_react()); var SpaceHeaderView = (props) => { - const { pathState } = (0, import_react150.useContext)(PathContext); - const { spaceState } = (0, import_react150.useContext)(SpaceContext); - const [tab, setTab] = (0, import_react150.useState)(0); + const { pathState } = (0, import_react152.useContext)(PathContext); + const { spaceState } = (0, import_react152.useContext)(SpaceContext); + const [tab, setTab] = (0, import_react152.useState)(0); const tabs = [ { label: "Items", icon: "ui//file-stack", tab: 0 }, { label: "Lists", icon: "ui//layout-list", tab: 2 }, { label: "Actions", icon: "ui//mouse-pointer-click", tab: 3 } ]; - return /* @__PURE__ */ import_react150.default.createElement(import_react150.default.Fragment, null, /* @__PURE__ */ import_react150.default.createElement("div", { + return /* @__PURE__ */ import_react152.default.createElement(import_react152.default.Fragment, null, /* @__PURE__ */ import_react152.default.createElement("div", { className: "mk-header-space" - }, /* @__PURE__ */ import_react150.default.createElement("div", { + }, /* @__PURE__ */ import_react152.default.createElement("div", { className: "mk-tabs-space" - }, tabs.map((f2, i3) => /* @__PURE__ */ import_react150.default.createElement("div", { + }, tabs.map((f2, i3) => /* @__PURE__ */ import_react152.default.createElement("div", { key: i3, onClick: () => { openSpaceEditorModal(props.superstate, spaceState, f2.tab); }, className: `mk-path-info` - }, /* @__PURE__ */ import_react150.default.createElement("div", { + }, /* @__PURE__ */ import_react152.default.createElement("div", { "aria-label": f2.label, className: "mk-icon-small", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker(f2.icon) } - }), f2.label))), /* @__PURE__ */ import_react150.default.createElement("div", null, props.spacePathStates.map((f2, i3) => /* @__PURE__ */ import_react150.default.createElement(PathProvider, { + }), f2.label))), /* @__PURE__ */ import_react152.default.createElement("div", null, props.spacePathStates.map((f2, i3) => /* @__PURE__ */ import_react152.default.createElement(PathProvider, { key: i3, superstate: props.superstate, path: f2.path, readMode: false - }, /* @__PURE__ */ import_react150.default.createElement(SpaceProvider, { + }, /* @__PURE__ */ import_react152.default.createElement(SpaceProvider, { key: i3, superstate: props.superstate - }, /* @__PURE__ */ import_react150.default.createElement(ContextMDBProvider, { + }, /* @__PURE__ */ import_react152.default.createElement(ContextMDBProvider, { key: i3, superstate: props.superstate, path: pathState.path - }, /* @__PURE__ */ import_react150.default.createElement(ContextEditorProvider, { + }, /* @__PURE__ */ import_react152.default.createElement(ContextEditorProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react150.default.createElement(PathContextList, { + }, /* @__PURE__ */ import_react152.default.createElement(PathContextList, { superstate: props.superstate, color: "var(--tag-background)", path: pathState.path - })))))), /* @__PURE__ */ import_react150.default.createElement(PropertiesView, { + })))))), /* @__PURE__ */ import_react152.default.createElement(PropertiesView, { superstate: props.superstate, spaces: props.spaces.map((f2) => f2.path), force: true, @@ -122320,7 +122645,7 @@ var SpaceHeaderView = (props) => { // src/core/react/components/SpaceView/Contexts/Header/NoteSpacesBar.tsx var NoteSpacesBar = (props) => { - const { addToSpace, removeFromSpace, pathState } = (0, import_react151.useContext)(PathContext); + const { addToSpace, removeFromSpace, pathState } = (0, import_react153.useContext)(PathContext); const showContextMenu = (e4, path) => { const space2 = props.superstate.spacesIndex.get(path); if (!space2) @@ -122360,11 +122685,11 @@ var NoteSpacesBar = (props) => { (f2, k2) => path.startsWith(f2.path) ? -1 : path.startsWith(k2.path) ? 1 : 0 ).filter((f2) => f2); }; - const spacePathStates = (0, import_react151.useMemo)( + const spacePathStates = (0, import_react153.useMemo)( () => spacesFromPath(pathState.path), [pathState] ); - const spaces2 = (0, import_react151.useMemo)( + const spaces2 = (0, import_react153.useMemo)( () => [...props.superstate.spacesMap.get(pathState?.path) ?? []].map((f2) => props.superstate.spacesIndex.get(f2)?.space).filter((f2) => f2), [pathState] ); @@ -122406,13 +122731,13 @@ var NoteSpacesBar = (props) => { true ); }; - return /* @__PURE__ */ import_react151.default.createElement(import_react151.default.Fragment, null, /* @__PURE__ */ import_react151.default.createElement("div", { + return /* @__PURE__ */ import_react153.default.createElement(import_react153.default.Fragment, null, /* @__PURE__ */ import_react153.default.createElement("div", { className: "mk-props-contexts" - }, /* @__PURE__ */ import_react151.default.createElement("div", { + }, /* @__PURE__ */ import_react153.default.createElement("div", { className: "mk-path-context-row" - }, /* @__PURE__ */ import_react151.default.createElement("div", { + }, /* @__PURE__ */ import_react153.default.createElement("div", { className: "mk-props-contexts-space-list" - }, spacePathStates.map((f2, i3) => /* @__PURE__ */ import_react151.default.createElement("div", { + }, spacePathStates.map((f2, i3) => /* @__PURE__ */ import_react153.default.createElement("div", { key: i3, className: "mk-props-contexts-space-name", onContextMenu: (e4) => showContextMenu(e4, f2.path), @@ -122421,45 +122746,45 @@ var NoteSpacesBar = (props) => { "--tag-background": f2.label?.color, "--tag-color": "var(--color-white)" } : {} - }, /* @__PURE__ */ import_react151.default.createElement("div", { + }, /* @__PURE__ */ import_react153.default.createElement("div", { className: `mk-icon-xsmall`, dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker(f2.label?.sticker) } - }), f2.name)), /* @__PURE__ */ import_react151.default.createElement("div", { + }), f2.name)), /* @__PURE__ */ import_react153.default.createElement("div", { className: "mk-props-contexts-space-name", onClick: (e4) => showAddMenu(e4), style: { opacity: 0.5 } - }, /* @__PURE__ */ import_react151.default.createElement("span", { + }, /* @__PURE__ */ import_react153.default.createElement("span", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//plus") } - }), i18n_default.buttons.addToSpace))), pathState.type == "space" ? /* @__PURE__ */ import_react151.default.createElement(SpaceHeaderView, { + }), i18n_default.buttons.addToSpace))), pathState.type == "space" ? /* @__PURE__ */ import_react153.default.createElement(SpaceHeaderView, { superstate: props.superstate, spacePathStates, spaces: spaces2 - }) : /* @__PURE__ */ import_react151.default.createElement(import_react151.default.Fragment, null, spacePathStates.map((f2, i3) => /* @__PURE__ */ import_react151.default.createElement(PathProvider, { + }) : /* @__PURE__ */ import_react153.default.createElement(import_react153.default.Fragment, null, spacePathStates.map((f2, i3) => /* @__PURE__ */ import_react153.default.createElement(PathProvider, { key: i3, superstate: props.superstate, path: f2.path, readMode: false - }, /* @__PURE__ */ import_react151.default.createElement(SpaceProvider, { + }, /* @__PURE__ */ import_react153.default.createElement(SpaceProvider, { key: i3, superstate: props.superstate - }, /* @__PURE__ */ import_react151.default.createElement(ContextMDBProvider, { + }, /* @__PURE__ */ import_react153.default.createElement(ContextMDBProvider, { key: i3, superstate: props.superstate, path: pathState.path - }, /* @__PURE__ */ import_react151.default.createElement(ContextEditorProvider, { + }, /* @__PURE__ */ import_react153.default.createElement(ContextEditorProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react151.default.createElement(PathContextList, { + }, /* @__PURE__ */ import_react153.default.createElement(PathContextList, { superstate: props.superstate, color: "var(--tag-background)", path: pathState.path - })))))), /* @__PURE__ */ import_react151.default.createElement(PropertiesView, { + })))))), /* @__PURE__ */ import_react153.default.createElement(PropertiesView, { superstate: props.superstate, spaces: spaces2.map((f2) => f2.path), force: true, @@ -122472,14 +122797,14 @@ var NoteSpacesBar = (props) => { }; // src/core/react/components/MarkdownEditor/MarkdownHeaderView.tsx -var import_react154 = __toESM(require_react()); +var import_react156 = __toESM(require_react()); // src/core/react/components/SpaceView/TitleComponent.tsx -var import_react152 = __toESM(require_react()); +var import_react154 = __toESM(require_react()); var TitleComponent = (props) => { - const { pathState } = (0, import_react152.useContext)(PathContext); - const fileNameRef = (0, import_react152.useRef)(null); - const name317 = (0, import_react152.useMemo)( + const { pathState } = (0, import_react154.useContext)(PathContext); + const fileNameRef = (0, import_react154.useRef)(null); + const name317 = (0, import_react154.useMemo)( () => pathState ? props.superstate.settings.spacesUseAlias ? pathState?.displayName : pathState.subtype == "tag" ? stringFromTag(pathState?.name) : pathState?.name : null, [pathState] ); @@ -122532,32 +122857,32 @@ var TitleComponent = (props) => { }; const hasSticker = pathState?.metadata.property?.[props.superstate.settings.fmKeySticker]?.length > 0; const hasBanner = pathState?.metadata.property?.[props.superstate.settings.fmKeyBanner]; - return pathState && /* @__PURE__ */ import_react152.default.createElement(import_react152.default.Fragment, null, props.superstate.settings.spacesStickers && /* @__PURE__ */ import_react152.default.createElement("div", { + return pathState && /* @__PURE__ */ import_react154.default.createElement(import_react154.default.Fragment, null, props.superstate.settings.spacesStickers && /* @__PURE__ */ import_react154.default.createElement("div", { className: "mk-header-icon", style: hasBanner ? { "--label-color": "var(--mk-ui-background)" } : {} - }, hasSticker ? /* @__PURE__ */ import_react152.default.createElement(PathStickerContainer, { + }, hasSticker ? /* @__PURE__ */ import_react154.default.createElement(PathStickerContainer, { superstate: props.superstate, path: pathState.path - }) : /* @__PURE__ */ import_react152.default.createElement("button", { + }) : /* @__PURE__ */ import_react154.default.createElement("button", { className: "mk-inline-button", onClick: (e4) => props.superstate.ui.openPalette( - (_props) => /* @__PURE__ */ import_react152.default.createElement(StickerModal_default, { + (_props) => /* @__PURE__ */ import_react154.default.createElement(StickerModal_default, { ui: props.superstate.ui, hide: _props.hide, selectedSticker: (emoji) => savePathIcon(props.superstate, pathState.path, emoji) }) ) - }, /* @__PURE__ */ import_react152.default.createElement("div", { + }, /* @__PURE__ */ import_react154.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//smile") } - }), i18n_default.buttons.addIcon), /* @__PURE__ */ import_react152.default.createElement("span", null), !hasBanner && /* @__PURE__ */ import_react152.default.createElement("button", { + }), i18n_default.buttons.addIcon), /* @__PURE__ */ import_react154.default.createElement("span", null), !hasBanner && /* @__PURE__ */ import_react154.default.createElement("button", { className: "mk-inline-button", onClick: (e4) => props.superstate.ui.openPalette( - (_props) => /* @__PURE__ */ import_react152.default.createElement(ImageModal_default, { + (_props) => /* @__PURE__ */ import_react154.default.createElement(ImageModal_default, { superstate: props.superstate, hide: _props.hide, selectedPath: (image) => savePathBanner( @@ -122567,16 +122892,16 @@ var TitleComponent = (props) => { ) }) ) - }, /* @__PURE__ */ import_react152.default.createElement("div", { + }, /* @__PURE__ */ import_react154.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//mk-make-image") } - }), i18n_default.buttons.addCover)), /* @__PURE__ */ import_react152.default.createElement("div", { + }), i18n_default.buttons.addCover)), /* @__PURE__ */ import_react154.default.createElement("div", { className: "mk-title-container" - }, pathState?.subtype == "tag" ? /* @__PURE__ */ import_react152.default.createElement("div", { + }, pathState?.subtype == "tag" ? /* @__PURE__ */ import_react154.default.createElement("div", { className: "mk-title-prefix" - }, "#") : "", /* @__PURE__ */ import_react152.default.createElement("div", { + }, "#") : "", /* @__PURE__ */ import_react154.default.createElement("div", { className: "mk-inline-title inline-title", ref: fileNameRef, contentEditable, @@ -122592,11 +122917,11 @@ var TitleComponent = (props) => { }; // src/core/react/components/MarkdownEditor/BannerView.tsx -var import_react153 = __toESM(require_react()); +var import_react155 = __toESM(require_react()); var BannerView = (props) => { - const [banner, setBanner] = (0, import_react153.useState)(null); - const { pathState } = (0, import_react153.useContext)(PathContext); - (0, import_react153.useEffect)(() => { + const [banner, setBanner] = (0, import_react155.useState)(null); + const { pathState } = (0, import_react155.useContext)(PathContext); + (0, import_react155.useEffect)(() => { const banner2 = props.superstate.spaceManager.uriByString( pathState?.metadata.property?.[props.superstate.settings.fmKeyBanner] ); @@ -122606,6 +122931,7 @@ var BannerView = (props) => { setBanner(null); } }, [pathState]); + const offset2 = pathState?.metadata.property?.banner_y ?? 0; const triggerBannerContextMenu = (e4) => { e4.preventDefault(); const menuOptions = [ @@ -122614,7 +122940,7 @@ var BannerView = (props) => { value: "change", icon: "ui//image", onClick: (ev) => { - props.superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react153.default.createElement(ImageModal_default, { + props.superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react155.default.createElement(ImageModal_default, { superstate: props.superstate, hide: _props.hide, selectedPath: (image) => savePathBanner(props.superstate, pathState.path, image) @@ -122650,73 +122976,75 @@ var BannerView = (props) => { ); return false; }; - return banner ? /* @__PURE__ */ import_react153.default.createElement(import_react153.default.Fragment, null, /* @__PURE__ */ import_react153.default.createElement("div", { + return banner ? /* @__PURE__ */ import_react155.default.createElement(import_react155.default.Fragment, null, /* @__PURE__ */ import_react155.default.createElement("div", { className: `mk-space-banner`, - onContextMenu: triggerBannerContextMenu - }, !banner.refType ? /* @__PURE__ */ import_react153.default.createElement("img", { - src: props.superstate.ui.getUIPath(banner.basePath) - }) : banner.refType == "frame" ? /* @__PURE__ */ import_react153.default.createElement(import_react153.default.Fragment, null) : /* @__PURE__ */ import_react153.default.createElement(import_react153.default.Fragment, null)), /* @__PURE__ */ import_react153.default.createElement("div", { + onContextMenu: triggerBannerContextMenu, + style: { + backgroundImage: `url(${banner.scheme == "vault" ? props.superstate.ui.getUIPath(banner.basePath) : banner.fullPath})`, + backgroundPositionY: offset2.toString() + "px" + } + }), /* @__PURE__ */ import_react155.default.createElement("div", { className: `mk-spacer`, style: { "--mk-header-height": ((isTouchScreen(props.superstate.ui) ? 1 : 0) * 26 + 138 + (!props.superstate.settings.spacesStickers || props.superstate.settings.inlineContextNameLayout == "horizontal" ? 1 : 0) * 50).toString() + "px" }, onContextMenu: (e4) => e4.preventDefault() - })) : /* @__PURE__ */ import_react153.default.createElement(import_react153.default.Fragment, null); + })) : /* @__PURE__ */ import_react155.default.createElement(import_react155.default.Fragment, null); }; // src/core/react/components/MarkdownEditor/MarkdownHeaderView.tsx var MarkdownHeaderView = (props) => { - const { pathState } = (0, import_react154.useContext)(PathContext); - const [collapsed, setCollapsed] = (0, import_react154.useState)( + const { pathState } = (0, import_react156.useContext)(PathContext); + const [collapsed, setCollapsed] = (0, import_react156.useState)( !props.superstate.settings.inlineContextExpanded ); - (0, import_react154.useEffect)(() => { + (0, import_react156.useEffect)(() => { props.superstate.settings.inlineContextExpanded = !collapsed; props.superstate.saveSettings(); }, [collapsed]); - (0, import_react154.useLayoutEffect)(() => { + (0, import_react156.useLayoutEffect)(() => { props.editorView?.requestMeasure(); }, []); - return pathState && /* @__PURE__ */ import_react154.default.createElement(import_react154.default.Fragment, null, /* @__PURE__ */ import_react154.default.createElement("div", { + return pathState && /* @__PURE__ */ import_react156.default.createElement(import_react156.default.Fragment, null, /* @__PURE__ */ import_react156.default.createElement("div", { className: "mk-path-context-component" - }, /* @__PURE__ */ import_react154.default.createElement("div", { + }, /* @__PURE__ */ import_react156.default.createElement("div", { className: `mk-path-context-label ${props.superstate.settings.inlineContextNameLayout == "horizontal" ? "mk-path-context-file-horizontal" : ""}` - }, /* @__PURE__ */ import_react154.default.createElement(BannerView, { + }, /* @__PURE__ */ import_react156.default.createElement(BannerView, { superstate: props.superstate - }), /* @__PURE__ */ import_react154.default.createElement(TitleComponent, { + }), /* @__PURE__ */ import_react156.default.createElement(TitleComponent, { superstate: props.superstate, readOnly: !props.editable - }), /* @__PURE__ */ import_react154.default.createElement("div", { + }), /* @__PURE__ */ import_react156.default.createElement("div", { style: { position: "relative" } - }, /* @__PURE__ */ import_react154.default.createElement("div", { + }, /* @__PURE__ */ import_react156.default.createElement("div", { className: "mk-fold" - }, /* @__PURE__ */ import_react154.default.createElement(CollapseToggle, { + }, /* @__PURE__ */ import_react156.default.createElement(CollapseToggle, { superstate: props.superstate, collapsed, onToggle: (c3) => setCollapsed(c3) - })))), props.editable && !collapsed && /* @__PURE__ */ import_react154.default.createElement(NoteSpacesBar, { + })))), props.editable && !collapsed && /* @__PURE__ */ import_react156.default.createElement(NoteSpacesBar, { superstate: props.superstate }))); }; // src/core/react/components/Navigator/Navigator.tsx -var import_react155 = __toESM(require_react()); +var import_react157 = __toESM(require_react()); var Navigator = (props) => { - return /* @__PURE__ */ import_react155.default.createElement("div", { + return /* @__PURE__ */ import_react157.default.createElement("div", { className: "mk-sidebar" - }, /* @__PURE__ */ import_react155.default.createElement(SidebarProvider, { + }, /* @__PURE__ */ import_react157.default.createElement(SidebarProvider, { superstate: props.superstate - }, /* @__PURE__ */ import_react155.default.createElement(MainList, { + }, /* @__PURE__ */ import_react157.default.createElement(MainList, { superstate: props.superstate }))); }; // src/core/react/components/SpaceView/Editor/EmbedView/SpaceFragmentWrapper.tsx -var import_react156 = __toESM(require_react()); -var import_react157 = __toESM(require_react()); +var import_react158 = __toESM(require_react()); +var import_react159 = __toESM(require_react()); var SpaceFragmentTitleComponent = (props) => { - const { pathState } = (0, import_react157.useContext)(PathContext); - const fileNameRef = (0, import_react157.useRef)(null); + const { pathState } = (0, import_react159.useContext)(PathContext); + const fileNameRef = (0, import_react159.useRef)(null); const contentEditable = true; const onBlur = (e4) => { const newValue = e4.target.innerHTML; @@ -122750,19 +123078,19 @@ var SpaceFragmentTitleComponent = (props) => { } }; const triggerStickerMenu = (e4) => { - props.superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react156.default.createElement(StickerModal_default, { + props.superstate.ui.openPalette((_props) => /* @__PURE__ */ import_react158.default.createElement(StickerModal_default, { ui: props.superstate.ui, hide: _props.hide, selectedSticker: (emoji) => props.saveSticker(emoji) })); }; - return /* @__PURE__ */ import_react156.default.createElement("div", null, /* @__PURE__ */ import_react156.default.createElement("div", { + return /* @__PURE__ */ import_react158.default.createElement("div", null, /* @__PURE__ */ import_react158.default.createElement("div", { className: "mk-header-icon" - }), /* @__PURE__ */ import_react156.default.createElement("div", { + }), /* @__PURE__ */ import_react158.default.createElement("div", { className: "mk-title-container" - }, pathState?.subtype == "tag" ? /* @__PURE__ */ import_react156.default.createElement("div", { + }, pathState?.subtype == "tag" ? /* @__PURE__ */ import_react158.default.createElement("div", { className: "mk-title-prefix" - }, "#") : "", /* @__PURE__ */ import_react156.default.createElement("div", { + }, "#") : "", /* @__PURE__ */ import_react158.default.createElement("div", { className: "mk-inline-title inline-title", ref: fileNameRef, contentEditable, @@ -122777,8 +123105,8 @@ var SpaceFragmentTitleComponent = (props) => { }))); }; var SpaceFragmentWrapper = (props) => { - const [schema, setSchema] = import_react156.default.useState(null); - (0, import_react156.useEffect)(() => { + const [schema, setSchema] = import_react158.default.useState(null); + (0, import_react158.useEffect)(() => { const uri = props.superstate.spaceManager.uriByString(props.path); if (uri.refType == "context") { const schema2 = props.superstate.contextsIndex.get(uri.path)?.schemas.find((s4) => s4.id == uri.ref); @@ -122871,11 +123199,11 @@ var SpaceFragmentWrapper = (props) => { ); } }; - return /* @__PURE__ */ import_react156.default.createElement("div", { + return /* @__PURE__ */ import_react158.default.createElement("div", { className: "mk-editor-space-fragment markdown-source-view mod-cm6 is-readable-line-width" - }, /* @__PURE__ */ import_react156.default.createElement("div", { + }, /* @__PURE__ */ import_react158.default.createElement("div", { className: "mk-editor-header" - }, schema && /* @__PURE__ */ import_react156.default.createElement(SpaceFragmentTitleComponent, { + }, schema && /* @__PURE__ */ import_react158.default.createElement(SpaceFragmentTitleComponent, { superstate: props.superstate, readOnly: true, name: schema.name, @@ -122902,7 +123230,7 @@ var createTable2 = (object, columns) => { // src/adapters/obsidian/ui/editors/EmbedContextView.tsx var import_obsidian = require("obsidian"); -var import_react158 = __toESM(require_react()); +var import_react160 = __toESM(require_react()); var EMBED_CONTEXT_VIEW_TYPE = "mk-space-embed"; var EmbedContextView = class extends import_obsidian.ItemView { constructor(leaf, plugin) { @@ -122954,7 +123282,7 @@ var EmbedContextView = class extends import_obsidian.ItemView { this.root = this.plugin.ui.createRoot(this.contentEl); if (this.root) { this.root.render( - /* @__PURE__ */ import_react158.default.createElement(SpaceFragmentViewComponent, { + /* @__PURE__ */ import_react160.default.createElement(SpaceFragmentViewComponent, { id: this.path, superstate: this.plugin.superstate, path: this.path, @@ -122974,7 +123302,7 @@ var EmbedContextView = class extends import_obsidian.ItemView { // src/adapters/obsidian/ui/editors/markdownView/FileView.tsx var import_obsidian3 = require("obsidian"); -var import_react161 = __toESM(require_react()); +var import_react163 = __toESM(require_react()); // src/adapters/text/removemd.js function removemd(md, options) { @@ -123071,7 +123399,7 @@ var TextCacher = class { // src/adapters/obsidian/ui/editors/markdownView/FileLinkViewComponent.tsx var import_obsidian2 = require("obsidian"); -var import_react160 = __toESM(require_react()); +var import_react162 = __toESM(require_react()); // src/adapters/obsidian/filetypes/frontmatter/frontMatterKeys.ts var frontMatterKeys = (fm) => { @@ -123079,14 +123407,14 @@ var frontMatterKeys = (fm) => { }; // src/adapters/obsidian/ui/editors/markdownView/RemoteMarkdownHeaderView.tsx -var import_react159 = __toESM(require_react()); +var import_react161 = __toESM(require_react()); var RemoteMarkdownHeaderView = (props) => { const { name: name317, fm } = props; - const [collapsed, setCollapsed] = (0, import_react159.useState)(false); + const [collapsed, setCollapsed] = (0, import_react161.useState)(false); const tags3 = fm.tags ?? []; - const [values2, setValues] = (0, import_react159.useState)({}); - const [columns, setColumns] = (0, import_react159.useState)([]); - (0, import_react159.useEffect)(() => { + const [values2, setValues] = (0, import_react161.useState)({}); + const [columns, setColumns] = (0, import_react161.useState)([]); + (0, import_react161.useEffect)(() => { const newCols = []; const newValues = {}; const fmKeys = uniqCaseInsensitive(frontMatterKeys(fm)); @@ -123105,7 +123433,7 @@ var RemoteMarkdownHeaderView = (props) => { setValues(newValues); setColumns(newCols); }, []); - const pathState = (0, import_react159.useMemo)( + const pathState = (0, import_react161.useMemo)( () => ({ name: name317, path: name317, @@ -123124,39 +123452,39 @@ var RemoteMarkdownHeaderView = (props) => { }), [fm, name317] ); - return /* @__PURE__ */ import_react159.default.createElement(PathProvider, { + return /* @__PURE__ */ import_react161.default.createElement(PathProvider, { superstate: props.superstate, path: props.name, pathState, readMode: true - }, pathState.metadata.property.banner && /* @__PURE__ */ import_react159.default.createElement(BannerView, { + }, pathState.metadata.property.banner && /* @__PURE__ */ import_react161.default.createElement(BannerView, { superstate: props.superstate - }), /* @__PURE__ */ import_react159.default.createElement("div", { + }), /* @__PURE__ */ import_react161.default.createElement("div", { className: "mk-path-context-component" - }, /* @__PURE__ */ import_react159.default.createElement("div", { + }, /* @__PURE__ */ import_react161.default.createElement("div", { className: `mk-path-context-label ${props.superstate.settings.inlineContextNameLayout == "horizontal" ? "mk-path-context-file-horizontal" : ""}` - }, /* @__PURE__ */ import_react159.default.createElement(import_react159.default.Fragment, null, fm.sticker ? /* @__PURE__ */ import_react159.default.createElement("div", { + }, /* @__PURE__ */ import_react161.default.createElement(import_react161.default.Fragment, null, fm.sticker ? /* @__PURE__ */ import_react161.default.createElement("div", { className: "mk-header-icon" - }, /* @__PURE__ */ import_react159.default.createElement("div", { + }, /* @__PURE__ */ import_react161.default.createElement("div", { className: `mk-path-icon` - }, /* @__PURE__ */ import_react159.default.createElement("div", { + }, /* @__PURE__ */ import_react161.default.createElement("div", { dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker(fm.sticker) } - }))) : /* @__PURE__ */ import_react159.default.createElement(import_react159.default.Fragment, null), /* @__PURE__ */ import_react159.default.createElement("div", { + }))) : /* @__PURE__ */ import_react161.default.createElement(import_react161.default.Fragment, null), /* @__PURE__ */ import_react161.default.createElement("div", { className: "mk-inline-title inline-title" - }, pathNameToString(name317))))), !collapsed ? /* @__PURE__ */ import_react159.default.createElement("div", { + }, pathNameToString(name317))))), !collapsed ? /* @__PURE__ */ import_react161.default.createElement("div", { className: "mk-path-context-component" - }, /* @__PURE__ */ import_react159.default.createElement(import_react159.default.Fragment, null, /* @__PURE__ */ import_react159.default.createElement("div", { + }, /* @__PURE__ */ import_react161.default.createElement(import_react161.default.Fragment, null, /* @__PURE__ */ import_react161.default.createElement("div", { className: "mk-path-context-section" - }, /* @__PURE__ */ import_react159.default.createElement(import_react159.default.Fragment, null, columns.map((f2, i3) => /* @__PURE__ */ import_react159.default.createElement("div", { + }, /* @__PURE__ */ import_react161.default.createElement(import_react161.default.Fragment, null, columns.map((f2, i3) => /* @__PURE__ */ import_react161.default.createElement("div", { key: i3, className: "mk-path-context-row" - }, /* @__PURE__ */ import_react159.default.createElement("div", { + }, /* @__PURE__ */ import_react161.default.createElement("div", { className: "mk-path-context-field" - }, f2.name), /* @__PURE__ */ import_react159.default.createElement("div", { + }, f2.name), /* @__PURE__ */ import_react161.default.createElement("div", { className: "mk-path-context-value" - }, /* @__PURE__ */ import_react159.default.createElement(DataTypeView, { + }, /* @__PURE__ */ import_react161.default.createElement(DataTypeView, { superstate: props.superstate, initialValue: values2[f2.name], row: {}, @@ -123167,15 +123495,15 @@ var RemoteMarkdownHeaderView = (props) => { updateFieldValue: (fieldValue, value) => { }, contextTable: {} - })))))))) : /* @__PURE__ */ import_react159.default.createElement(import_react159.default.Fragment, null)); + })))))))) : /* @__PURE__ */ import_react161.default.createElement(import_react161.default.Fragment, null)); }; // src/adapters/obsidian/ui/editors/markdownView/FileLinkViewComponent.tsx var FileLinkViewComponent = (props) => { - const ref2 = (0, import_react160.useRef)(null); - const [markdown, setMarkdown] = (0, import_react160.useState)(""); - const [fm, setFM] = (0, import_react160.useState)({}); - (0, import_react160.useEffect)(() => { + const ref2 = (0, import_react162.useRef)(null); + const [markdown, setMarkdown] = (0, import_react162.useState)(""); + const [fm, setFM] = (0, import_react162.useState)({}); + (0, import_react162.useEffect)(() => { if (ref2.current) { import_obsidian2.MarkdownRenderer.render( props.app, @@ -123198,7 +123526,7 @@ var FileLinkViewComponent = (props) => { return () => observer.disconnect(); } }, [markdown]); - (0, import_react160.useEffect)(() => { + (0, import_react162.useEffect)(() => { fetch(props.path).then((res) => res.text()).then((f2) => { setMarkdown(f2); const match2 = f2.match(regexYaml); @@ -123208,15 +123536,15 @@ var FileLinkViewComponent = (props) => { } }); }, [props.path]); - return /* @__PURE__ */ import_react160.default.createElement("div", { + return /* @__PURE__ */ import_react162.default.createElement("div", { className: "markdown-preview-view markdown-rendered node-insert-event is-readable-line-width allow-fold-headings show-indentation-guide allow-fold-lists show-frontmatter" - }, /* @__PURE__ */ import_react160.default.createElement("div", { + }, /* @__PURE__ */ import_react162.default.createElement("div", { className: "mk-remote-header" - }, /* @__PURE__ */ import_react160.default.createElement(RemoteMarkdownHeaderView, { + }, /* @__PURE__ */ import_react162.default.createElement(RemoteMarkdownHeaderView, { superstate: props.superstate, name: "Release Notes", fm - })), /* @__PURE__ */ import_react160.default.createElement("div", { + })), /* @__PURE__ */ import_react162.default.createElement("div", { className: "markdown-preview-sizer markdown-preview-section", ref: ref2 })); @@ -123271,9 +123599,9 @@ var FileLinkView = class extends import_obsidian3.ItemView { this.destroy(); this.root = this.superstate.ui.createRoot(this.contentEl); this.root.render( - /* @__PURE__ */ import_react161.default.createElement("div", { + /* @__PURE__ */ import_react163.default.createElement("div", { className: "markdown-reading-view" - }, /* @__PURE__ */ import_react161.default.createElement(FileLinkViewComponent, { + }, /* @__PURE__ */ import_react163.default.createElement(FileLinkViewComponent, { superstate: this.superstate, path, app: this.app, @@ -123287,12 +123615,12 @@ var FileLinkView = class extends import_obsidian3.ItemView { var import_obsidian6 = require("obsidian"); // src/core/react/components/System/SystemSettings.tsx -var import_react164 = __toESM(require_react()); +var import_react166 = __toESM(require_react()); // src/core/react/components/System/SystemActions.tsx -var import_react162 = __toESM(require_react()); +var import_react164 = __toESM(require_react()); var SystemActionsEditor = (props) => { - const [selectedCommand, setSelectedCommand] = (0, import_react162.useState)(); + const [selectedCommand, setSelectedCommand] = (0, import_react164.useState)(); const saveCommand = (command) => { props.superstate.spaceManager.saveSystemCommand( selectedCommand.library, @@ -123305,89 +123633,89 @@ var SystemActionsEditor = (props) => { null ); }; - return /* @__PURE__ */ import_react162.default.createElement("div", { + return /* @__PURE__ */ import_react164.default.createElement("div", { style: { display: "flex" } - }, selectedCommand && /* @__PURE__ */ import_react162.default.createElement("div", null, /* @__PURE__ */ import_react162.default.createElement(SpaceCommand, { + }, selectedCommand && /* @__PURE__ */ import_react164.default.createElement("div", null, /* @__PURE__ */ import_react164.default.createElement(SpaceCommand, { superstate: props.superstate, action: "spaces://$actions/" + selectedCommand.library + "/#;" + selectedCommand.command.schema.id }))); }; // src/core/react/components/System/Templates.tsx -var import_react163 = __toESM(require_react()); +var import_react165 = __toESM(require_react()); var Templates = (props) => { - return /* @__PURE__ */ import_react163.default.createElement("div", null, /* @__PURE__ */ import_react163.default.createElement("h1", null, "Templates")); + return /* @__PURE__ */ import_react165.default.createElement("div", null, /* @__PURE__ */ import_react165.default.createElement("h1", null, "Templates")); }; // src/core/react/components/System/SystemSettings.tsx var SystemSettings = (props) => { - const [tab, setTab] = (0, import_react164.useState)(0); - return /* @__PURE__ */ import_react164.default.createElement("div", null, /* @__PURE__ */ import_react164.default.createElement("img", null), /* @__PURE__ */ import_react164.default.createElement("h1", null, "System Settings"), /* @__PURE__ */ import_react164.default.createElement("div", { + const [tab, setTab] = (0, import_react166.useState)(0); + return /* @__PURE__ */ import_react166.default.createElement("div", null, /* @__PURE__ */ import_react166.default.createElement("img", null), /* @__PURE__ */ import_react166.default.createElement("h1", null, "System Settings"), /* @__PURE__ */ import_react166.default.createElement("div", { className: "mk-tab-group" - }, /* @__PURE__ */ import_react164.default.createElement("div", { + }, /* @__PURE__ */ import_react166.default.createElement("div", { onClick: () => setTab(0), className: `mk-tab ${tab == 0 ? "mk-active" : ""}` - }, "System"), /* @__PURE__ */ import_react164.default.createElement("div", { + }, "System"), /* @__PURE__ */ import_react166.default.createElement("div", { onClick: () => setTab(1), className: `mk-tab ${tab == 1 ? "mk-active" : ""}` - }, "Templates"), /* @__PURE__ */ import_react164.default.createElement("div", { + }, "Templates"), /* @__PURE__ */ import_react166.default.createElement("div", { onClick: () => setTab(2), className: `mk-tab ${tab == 2 ? "mk-active" : ""}` - }, "Actions")), tab == 0 ? /* @__PURE__ */ import_react164.default.createElement("div", null, /* @__PURE__ */ import_react164.default.createElement("h1", null, "System")) : tab == 1 ? /* @__PURE__ */ import_react164.default.createElement(Templates, { + }, "Actions")), tab == 0 ? /* @__PURE__ */ import_react166.default.createElement("div", null, /* @__PURE__ */ import_react166.default.createElement("h1", null, "System")) : tab == 1 ? /* @__PURE__ */ import_react166.default.createElement(Templates, { superstate: props.superstate - }) : /* @__PURE__ */ import_react164.default.createElement(SystemActionsEditor, { + }) : /* @__PURE__ */ import_react166.default.createElement(SystemActionsEditor, { superstate: props.superstate })); }; // src/adapters/obsidian/SpaceViewContainer.tsx var import_obsidian4 = require("obsidian"); -var import_react167 = __toESM(require_react()); +var import_react169 = __toESM(require_react()); // src/core/react/components/SpaceView/SpaceHeader.tsx -var import_react165 = __toESM(require_react()); +var import_react167 = __toESM(require_react()); var SpaceHeader = (props) => { - const { readMode } = (0, import_react165.useContext)(PathContext); - const [collapsed, setCollapsed] = (0, import_react165.useState)( + const { readMode } = (0, import_react167.useContext)(PathContext); + const [collapsed, setCollapsed] = (0, import_react167.useState)( !props.superstate.settings.inlineContextExpanded ); - (0, import_react165.useEffect)(() => { + (0, import_react167.useEffect)(() => { props.superstate.settings.inlineContextExpanded = !collapsed; props.superstate.saveSettings(); }, [collapsed]); - return /* @__PURE__ */ import_react165.default.createElement(import_react165.default.Fragment, null, /* @__PURE__ */ import_react165.default.createElement(BannerView, { + return /* @__PURE__ */ import_react167.default.createElement(import_react167.default.Fragment, null, /* @__PURE__ */ import_react167.default.createElement(BannerView, { superstate: props.superstate - }), /* @__PURE__ */ import_react165.default.createElement("div", { + }), /* @__PURE__ */ import_react167.default.createElement("div", { className: "mk-space-header" - }, /* @__PURE__ */ import_react165.default.createElement("div", { + }, /* @__PURE__ */ import_react167.default.createElement("div", { className: "mk-path-context-label" - }, /* @__PURE__ */ import_react165.default.createElement(TitleComponent, { + }, /* @__PURE__ */ import_react167.default.createElement(TitleComponent, { superstate: props.superstate, readOnly: readMode - }), /* @__PURE__ */ import_react165.default.createElement("div", { + }), /* @__PURE__ */ import_react167.default.createElement("div", { style: { position: "relative" } - }, /* @__PURE__ */ import_react165.default.createElement("div", { + }, /* @__PURE__ */ import_react167.default.createElement("div", { className: "mk-fold" - }, /* @__PURE__ */ import_react165.default.createElement(CollapseToggle, { + }, /* @__PURE__ */ import_react167.default.createElement(CollapseToggle, { superstate: props.superstate, collapsed, onToggle: (c3) => setCollapsed(c3) - })))), !collapsed && /* @__PURE__ */ import_react165.default.createElement(NoteSpacesBar, { + })))), !collapsed && /* @__PURE__ */ import_react167.default.createElement(NoteSpacesBar, { superstate: props.superstate }))); }; // src/core/react/components/SpaceView/SpaceInner.tsx -var import_react166 = __toESM(require_react()); +var import_react168 = __toESM(require_react()); var SpaceInner = (props) => { - const ref2 = (0, import_react166.useRef)(null); - const { spaceState } = (0, import_react166.useContext)(SpaceContext); - return /* @__PURE__ */ import_react166.default.createElement(import_react166.default.Fragment, null, /* @__PURE__ */ import_react166.default.createElement(SpaceHeader, { + const ref2 = (0, import_react168.useRef)(null); + const { spaceState } = (0, import_react168.useContext)(SpaceContext); + return /* @__PURE__ */ import_react168.default.createElement(import_react168.default.Fragment, null, /* @__PURE__ */ import_react168.default.createElement(SpaceHeader, { superstate: props.superstate - }), spaceState && /* @__PURE__ */ import_react166.default.createElement(SpaceOuter_default, { + }), spaceState && /* @__PURE__ */ import_react168.default.createElement(SpaceOuter_default, { superstate: props.superstate, ref: ref2 - }, /* @__PURE__ */ import_react166.default.createElement(FrameEditorInstance, { + }, /* @__PURE__ */ import_react168.default.createElement(FrameEditorInstance, { containerRef: ref2, superstate: props.superstate }))); @@ -123499,17 +123827,17 @@ var SpaceViewContainer = class extends import_obsidian4.ItemView { this.root = this.ui.createRoot(this.contentEl); if (this.root) { this.root.render( - /* @__PURE__ */ import_react167.default.createElement("div", { + /* @__PURE__ */ import_react169.default.createElement("div", { className: "mk-space-view" - }, path == "spaces://$settings" ? /* @__PURE__ */ import_react167.default.createElement(SystemSettings, { + }, path == "spaces://$settings" ? /* @__PURE__ */ import_react169.default.createElement(SystemSettings, { superstate: this.superstate - }) : /* @__PURE__ */ import_react167.default.createElement(SpaceView, { + }) : /* @__PURE__ */ import_react169.default.createElement(SpaceView, { path, superstate: this.superstate, key: path - }, /* @__PURE__ */ import_react167.default.createElement("div", { + }, /* @__PURE__ */ import_react169.default.createElement("div", { className: "mk-space-scroller markdown-source-view mod-cm6 is-readable-line-width" - }, /* @__PURE__ */ import_react167.default.createElement(SpaceInner, { + }, /* @__PURE__ */ import_react169.default.createElement(SpaceInner, { superstate: this.superstate })))) ); @@ -123523,7 +123851,7 @@ var SpaceViewContainer = class extends import_obsidian4.ItemView { // src/adapters/obsidian/ui/editors/SpaceFragmentViewComponent.tsx var import_obsidian5 = require("obsidian"); -var import_react168 = __toESM(require_react()); +var import_react170 = __toESM(require_react()); var SPACE_FRAGMENT_VIEW_TYPE = "mk-space-fragment"; var SpaceFragmentView = class extends import_obsidian5.ItemView { constructor(leaf, plugin) { @@ -123575,10 +123903,10 @@ var SpaceFragmentView = class extends import_obsidian5.ItemView { this.root = this.plugin.ui.createRoot(this.contentEl); if (this.root) { this.root.render( - /* @__PURE__ */ import_react168.default.createElement(SpaceFragmentWrapper, { + /* @__PURE__ */ import_react170.default.createElement(SpaceFragmentWrapper, { superstate: this.plugin.superstate, path: this.path - }, /* @__PURE__ */ import_react168.default.createElement(SpaceFragmentViewComponent, { + }, /* @__PURE__ */ import_react170.default.createElement(SpaceFragmentViewComponent, { id: this.path, superstate: this.plugin.superstate, path: this.path, @@ -123658,6 +123986,10 @@ function getAllAbstractFilesInVault(app2) { } var openPath = async (leaf, path, plugin, flow) => { const uri = plugin.superstate.spaceManager.uriByString(path); + if (uri.scheme == "https" || uri.scheme == "http") { + window.open(uri.fullPath, "_blank"); + return; + } if (uri.scheme == "obsidian") { await leaf.setViewState({ type: uri.authority @@ -123789,7 +124121,7 @@ var getAbstractFileAtPath = (app2, path) => { // src/adapters/obsidian/ui/editors/markdownView/FlowEditorHover.tsx var import_obsidian7 = require("obsidian"); -var import_react169 = __toESM(require_react()); +var import_react171 = __toESM(require_react()); var FlowEditorHover = (props) => { const uri = props.superstate.spaceManager.uriByString(props.path); const file = getAbstractFileAtPath(props.app, uri.basePath) ?? props.app.metadataCache.getFirstLinkpathDest(uri.path, props.source ?? "/"); @@ -123890,23 +124222,23 @@ var FlowEditorHover = (props) => { defaultMenu(props.superstate.ui, menuOptions) ); }; - return /* @__PURE__ */ import_react169.default.createElement(import_react169.default.Fragment, null, file ? /* @__PURE__ */ import_react169.default.createElement("div", { + return /* @__PURE__ */ import_react171.default.createElement(import_react171.default.Fragment, null, file ? /* @__PURE__ */ import_react171.default.createElement("div", { className: "mk-flowblock-menu" - }, file instanceof import_obsidian7.TFile ? /* @__PURE__ */ import_react169.default.createElement(import_react169.default.Fragment, null, props.toggle && /* @__PURE__ */ import_react169.default.createElement("div", { + }, file instanceof import_obsidian7.TFile ? /* @__PURE__ */ import_react171.default.createElement(import_react171.default.Fragment, null, props.toggle && /* @__PURE__ */ import_react171.default.createElement("div", { "aria-label": i18n_default.buttons.toggleFlow, onClick: toggleFlow, className: `mk-hover-button ${props.toggleState ? "mk-toggle-on" : ""}`, dangerouslySetInnerHTML: { __html: !props.toggleState ? props.superstate.ui.getSticker("ui//edit-3") : props.superstate.ui.getSticker("ui//book-open") } - }), /* @__PURE__ */ import_react169.default.createElement("div", { + }), /* @__PURE__ */ import_react171.default.createElement("div", { "aria-label": i18n_default.buttons.openLink, onClick: openLink, className: "mk-hover-button", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//open-link") } - })) : /* @__PURE__ */ import_react169.default.createElement(import_react169.default.Fragment, null, /* @__PURE__ */ import_react169.default.createElement("div", { + })) : /* @__PURE__ */ import_react171.default.createElement(import_react171.default.Fragment, null, /* @__PURE__ */ import_react171.default.createElement("div", { className: "mk-icon-small mk-hover-button", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//handle") @@ -123914,7 +124246,7 @@ var FlowEditorHover = (props) => { onClick: (e4) => { showTableMenu(e4); } - }))) : /* @__PURE__ */ import_react169.default.createElement(import_react169.default.Fragment, null)); + }))) : /* @__PURE__ */ import_react171.default.createElement(import_react171.default.Fragment, null)); }; // src/adapters/obsidian/utils/flow/flowEditor.ts @@ -124834,7 +125166,7 @@ var FlowEditorSelector = class extends import_view10.WidgetType { const infoField = view.state.field(import_obsidian10.editorInfoField, false); const file = infoField.file; reactEl.render( - /* @__PURE__ */ import_react170.default.createElement(FlowEditorHover, { + /* @__PURE__ */ import_react172.default.createElement(FlowEditorHover, { app: this.plugin.app, superstate: this.plugin.superstate, toggle: true, @@ -125096,13 +125428,13 @@ var toggleMarkExtension = import_state11.EditorState.transactionFilter.of( // src/adapters/obsidian/ui/editors/markdownView/menus/inlineStylerView/InlineMenu.tsx var import_classnames9 = __toESM(require_classnames()); -var import_react172 = __toESM(require_react()); +var import_react174 = __toESM(require_react()); // src/adapters/obsidian/ui/editors/markdownView/menus/inlineStylerView/Mark.tsx -var import_react171 = __toESM(require_react()); +var import_react173 = __toESM(require_react()); var Mark = (props) => { const { i: i3, style, active, toggleMarkAction } = props; - return /* @__PURE__ */ import_react171.default.createElement("div", { + return /* @__PURE__ */ import_react173.default.createElement("div", { key: i3, "aria-label": !isTouchScreen(props.plugin.superstate.ui) ? i18n_default.styles[style.label] : void 0, className: `mk-mark ${style.mark && active ? "mk-mark-active" : ""}`, @@ -125167,7 +125499,7 @@ function resolveStyles() { var loadStylerIntoContainer = (el, plugin) => { const root = plugin.ui.createRoot(el); root.render( - /* @__PURE__ */ import_react172.default.createElement(InlineMenuComponent, { + /* @__PURE__ */ import_react174.default.createElement(InlineMenuComponent, { mobile: true, activeMarks: [], plugin @@ -125175,8 +125507,8 @@ var loadStylerIntoContainer = (el, plugin) => { ); }; var InlineMenuComponent = (props) => { - const [mode, setMode] = (0, import_react172.useState)(props.mobile ? 0 : 1); - const [colorMode, setColorMode] = (0, import_react172.useState)(null); + const [mode, setMode] = (0, import_react174.useState)(props.mobile ? 0 : 1); + const [colorMode, setColorMode] = (0, import_react174.useState)(null); const makeMenu = (e4) => { e4.preventDefault(); const cm = props.cm ?? getActiveCM(props.plugin); @@ -125224,7 +125556,7 @@ var InlineMenuComponent = (props) => { } }); }; - const makeMode = () => /* @__PURE__ */ import_react172.default.createElement(import_react172.default.Fragment, null, /* @__PURE__ */ import_react172.default.createElement("div", { + const makeMode = () => /* @__PURE__ */ import_react174.default.createElement(import_react174.default.Fragment, null, /* @__PURE__ */ import_react174.default.createElement("div", { "aria-label": !isTouchScreen(props.plugin.superstate.ui) ? i18n_default.commands.makeMenu : void 0, onMouseDown: (e4) => { makeMenu(e4); @@ -125233,7 +125565,7 @@ var InlineMenuComponent = (props) => { dangerouslySetInnerHTML: { __html: props.plugin.superstate.ui.getSticker("ui//mk-make-slash") } - }), /* @__PURE__ */ import_react172.default.createElement("div", { + }), /* @__PURE__ */ import_react174.default.createElement("div", { "aria-label": !isTouchScreen(props.plugin.superstate.ui) ? i18n_default.commands.selectStyle : void 0, onMouseDown: () => { setMode(1); @@ -125242,7 +125574,7 @@ var InlineMenuComponent = (props) => { dangerouslySetInnerHTML: { __html: props.plugin.superstate.ui.getSticker("ui//mk-make-style") } - }), /* @__PURE__ */ import_react172.default.createElement("div", { + }), /* @__PURE__ */ import_react174.default.createElement("div", { "aria-label": !isTouchScreen(props.plugin.superstate.ui) ? i18n_default.commands.image : void 0, onMouseDown: () => { const view = getActiveMarkdownView(props.plugin); @@ -125252,7 +125584,7 @@ var InlineMenuComponent = (props) => { dangerouslySetInnerHTML: { __html: props.plugin.superstate.ui.getSticker("ui//mk-make-attach") } - }), /* @__PURE__ */ import_react172.default.createElement("div", { + }), /* @__PURE__ */ import_react174.default.createElement("div", { "aria-label": !isTouchScreen(props.plugin.superstate.ui) ? i18n_default.commands.toggleKeyboard : void 0, onMouseDown: () => { const view = getActiveMarkdownView(props.plugin); @@ -125262,7 +125594,7 @@ var InlineMenuComponent = (props) => { dangerouslySetInnerHTML: { __html: props.plugin.superstate.ui.getSticker("ui//mk-make-indent") } - }), /* @__PURE__ */ import_react172.default.createElement("div", { + }), /* @__PURE__ */ import_react174.default.createElement("div", { "aria-label": !isTouchScreen(props.plugin.superstate.ui) ? i18n_default.commands.toggleKeyboard : void 0, onMouseDown: () => { const view = getActiveMarkdownView(props.plugin); @@ -125272,7 +125604,7 @@ var InlineMenuComponent = (props) => { dangerouslySetInnerHTML: { __html: props.plugin.superstate.ui.getSticker("ui//mk-make-unindent") } - }), /* @__PURE__ */ import_react172.default.createElement("div", { + }), /* @__PURE__ */ import_react174.default.createElement("div", { "aria-label": !isTouchScreen(props.plugin.superstate.ui) ? i18n_default.commands.toggleKeyboard : void 0, onMouseDown: () => { const view = getActiveMarkdownView(props.plugin); @@ -125283,7 +125615,7 @@ var InlineMenuComponent = (props) => { __html: props.plugin.superstate.ui.getSticker("ui//mk-make-keyboard") } })); - const colorsMode = () => /* @__PURE__ */ import_react172.default.createElement(import_react172.default.Fragment, null, /* @__PURE__ */ import_react172.default.createElement("div", { + const colorsMode = () => /* @__PURE__ */ import_react174.default.createElement(import_react174.default.Fragment, null, /* @__PURE__ */ import_react174.default.createElement("div", { className: "mk-mark", onMouseDown: () => { setColorMode(null); @@ -125292,7 +125624,7 @@ var InlineMenuComponent = (props) => { dangerouslySetInnerHTML: { __html: props.plugin.superstate.ui.getSticker("ui//mk-ui-close") } - }), colors.map((c3, i3) => /* @__PURE__ */ import_react172.default.createElement("div", { + }), colors.map((c3, i3) => /* @__PURE__ */ import_react174.default.createElement("div", { key: i3, onMouseDown: () => { setMode(1); @@ -125316,7 +125648,7 @@ var InlineMenuComponent = (props) => { className: "mk-color", style: { background: c3[1] } }))); - const marksMode = () => /* @__PURE__ */ import_react172.default.createElement(import_react172.default.Fragment, null, props.mobile ? /* @__PURE__ */ import_react172.default.createElement("div", { + const marksMode = () => /* @__PURE__ */ import_react174.default.createElement(import_react174.default.Fragment, null, props.mobile ? /* @__PURE__ */ import_react174.default.createElement("div", { className: "mk-mark", onMouseDown: () => { setMode(0); @@ -125324,8 +125656,8 @@ var InlineMenuComponent = (props) => { dangerouslySetInnerHTML: { __html: props.plugin.superstate.ui.getSticker("ui//mk-ui-close") } - }) : /* @__PURE__ */ import_react172.default.createElement(import_react172.default.Fragment, null), resolveStyles().map((s4, i3) => { - return /* @__PURE__ */ import_react172.default.createElement(Mark, { + }) : /* @__PURE__ */ import_react174.default.createElement(import_react174.default.Fragment, null), resolveStyles().map((s4, i3) => { + return /* @__PURE__ */ import_react174.default.createElement(Mark, { plugin: props.plugin, key: i3, i: i3, @@ -125333,9 +125665,9 @@ var InlineMenuComponent = (props) => { active: props.activeMarks.find((f2) => f2 == s4.mark) ? true : false, toggleMarkAction }); - }), props.plugin.superstate.settings.inlineStylerColors ? /* @__PURE__ */ import_react172.default.createElement(import_react172.default.Fragment, null, /* @__PURE__ */ import_react172.default.createElement("div", { + }), props.plugin.superstate.settings.inlineStylerColors ? /* @__PURE__ */ import_react174.default.createElement(import_react174.default.Fragment, null, /* @__PURE__ */ import_react174.default.createElement("div", { className: "mk-divider" - }), /* @__PURE__ */ import_react172.default.createElement("div", { + }), /* @__PURE__ */ import_react174.default.createElement("div", { "aria-label": !isTouchScreen(props.plugin.superstate.ui) ? i18n_default.styles.textColor : void 0, onMouseDown: () => { setMode(2); @@ -125349,7 +125681,7 @@ var InlineMenuComponent = (props) => { dangerouslySetInnerHTML: { __html: props.plugin.superstate.ui.getSticker("ui//mk-mark-color") } - }), /* @__PURE__ */ import_react172.default.createElement("div", { + }), /* @__PURE__ */ import_react174.default.createElement("div", { "aria-label": !isTouchScreen(props.plugin.superstate.ui) ? i18n_default.styles.highlight : void 0, onMouseDown: () => { setMode(2); @@ -125365,15 +125697,15 @@ var InlineMenuComponent = (props) => { "ui//mk-mark-highlight" ) } - })) : /* @__PURE__ */ import_react172.default.createElement(import_react172.default.Fragment, null)); - return /* @__PURE__ */ import_react172.default.createElement("div", { + })) : /* @__PURE__ */ import_react174.default.createElement(import_react174.default.Fragment, null)); + return /* @__PURE__ */ import_react174.default.createElement("div", { className: (0, import_classnames9.default)("mk-style-menu", props.mobile ? "" : "menu"), onMouseDown: (e4) => e4.preventDefault() }, mode == 0 && props.mobile ? makeMode() : mode == 2 ? colorsMode() : marksMode()); }; // src/adapters/obsidian/ui/editors/markdownView/menus/inlineStylerView/inlineStyler.tsx -var import_react173 = __toESM(require_react()); +var import_react175 = __toESM(require_react()); var cursorTooltipField = (plugin) => import_state12.StateField.define({ create: getCursorTooltips(plugin), update(tooltips2, tr) { @@ -125398,7 +125730,7 @@ var getCursorTooltips = (plugin) => (state) => { dom.className = "cm-tooltip-cursor"; const reactElement = plugin.ui.createRoot(dom); reactElement.render( - /* @__PURE__ */ import_react173.default.createElement(import_react173.default.Fragment, null, /* @__PURE__ */ import_react173.default.createElement(InlineMenuComponent, { + /* @__PURE__ */ import_react175.default.createElement(import_react175.default.Fragment, null, /* @__PURE__ */ import_react175.default.createElement(InlineMenuComponent, { plugin, cm: view, activeMarks, @@ -125468,7 +125800,7 @@ var cmExtensions = (plugin, mobile) => { }; // src/adapters/obsidian/utils/flow/markdownPost.tsx -var import_react174 = __toESM(require_react()); +var import_react176 = __toESM(require_react()); var getCMFromElement = (el, app2) => { let dom = el; while (!dom.hasClass("cm-editor") && dom.parentElement) { @@ -125495,7 +125827,7 @@ var replaceAllTables = (plugin, el, ctx) => { const link = match2[1]; const reactEl = plugin.ui.createRoot(element.parentElement); reactEl.render( - /* @__PURE__ */ import_react174.default.createElement(NoteView, { + /* @__PURE__ */ import_react176.default.createElement(NoteView, { load: true, superstate: plugin.superstate, path: link @@ -125553,7 +125885,7 @@ var replaceAllEmbed = (el, ctx, superstate, app2) => { const endPos = cm?.posAtDOM(nextDom); if (ctx.sourcePath) reactEl.render( - /* @__PURE__ */ import_react174.default.createElement(FlowEditorHover, { + /* @__PURE__ */ import_react176.default.createElement(FlowEditorHover, { app: app2, toggle: true, path: ctx.sourcePath, @@ -125617,7 +125949,7 @@ var DEFAULT_SETTINGS = { folderFrameFile: "frames", spacesFolder: "Spaces", hiddenFiles: [], - hiddenExtensions: [".mdb"], + hiddenExtensions: [".mdb", "_assets", "_blocks"], newFileLocation: "root", newFileFolderPath: "", inlineBacklinks: false, @@ -126038,7 +126370,7 @@ var MakeMDPluginSettingsTab = class extends import_obsidian11.PluginSettingTab { // src/adapters/obsidian/ui/navigator/NavigatorView.tsx var import_obsidian12 = require("obsidian"); -var import_react175 = __toESM(require_react()); +var import_react177 = __toESM(require_react()); var FILE_TREE_VIEW_TYPE = "mk-path-view"; var VIEW_DISPLAY_TEXT = "Spaces"; var ICON = "layout-grid"; @@ -126091,7 +126423,7 @@ var FileTreeView = class extends import_obsidian12.ItemView { this.destroy(); this.root = this.ui.createRoot(this.contentEl); if (this.root) { - this.root.render(/* @__PURE__ */ import_react175.default.createElement(Navigator, { + this.root.render(/* @__PURE__ */ import_react177.default.createElement(Navigator, { superstate: this.superstate })); } else { @@ -126103,7 +126435,7 @@ var FileTreeView = class extends import_obsidian12.ItemView { }; // src/adapters/obsidian/replaceMobileMainMenu.tsx -var import_react176 = __toESM(require_react()); +var import_react178 = __toESM(require_react()); var replaceMobileMainMenu = (superstate) => { if (isTouchScreen(superstate.ui)) { const header = app.workspace.containerEl.querySelector( @@ -126112,9 +126444,9 @@ var replaceMobileMainMenu = (superstate) => { header.innerHTML = ""; const reactEl = superstate.ui.createRoot(header); reactEl.render( - /* @__PURE__ */ import_react176.default.createElement(SidebarProvider, { + /* @__PURE__ */ import_react178.default.createElement(SidebarProvider, { superstate - }, /* @__PURE__ */ import_react176.default.createElement(MainMenu, { + }, /* @__PURE__ */ import_react178.default.createElement(MainMenu, { superstate })) ); @@ -126123,7 +126455,7 @@ var replaceMobileMainMenu = (superstate) => { // src/adapters/obsidian/ui/editors/MDBFileViewer.tsx var import_obsidian13 = require("obsidian"); -var import_react177 = __toESM(require_react()); +var import_react179 = __toESM(require_react()); var MDB_FILE_VIEWER_TYPE = "make-mdb-viewer"; var MDBFileViewer = class extends import_obsidian13.FileView { constructor(leaf, plugin) { @@ -126175,7 +126507,7 @@ var MDBFileViewer = class extends import_obsidian13.FileView { this.root = this.plugin.ui.createRoot(this.contentEl); if (this.root) { this.root.render( - /* @__PURE__ */ import_react177.default.createElement(MDBViewer, { + /* @__PURE__ */ import_react179.default.createElement(MDBViewer, { superstate: this.plugin.superstate, space: space2, schema @@ -126195,7 +126527,7 @@ var MDBFileViewer = class extends import_obsidian13.FileView { // src/adapters/obsidian/ui/explorer/ContextExplorerLeafView.tsx var import_obsidian14 = require("obsidian"); -var import_react178 = __toESM(require_react()); +var import_react180 = __toESM(require_react()); var ContextExplorerLeafView = class extends import_obsidian14.ItemView { constructor(leaf, superstate, ui) { super(leaf); @@ -126236,7 +126568,7 @@ var ContextExplorerLeafView = class extends import_obsidian14.ItemView { this.root = this.ui.createRoot(this.contentEl); if (this.root) this.root.render( - /* @__PURE__ */ import_react178.default.createElement(Explorer, { + /* @__PURE__ */ import_react180.default.createElement(Explorer, { superstate: this.superstate }) ); @@ -126247,18 +126579,18 @@ var ICON2 = "component"; var VIEW_DISPLAY_TEXT2 = i18n_default.views.explorer; // src/adapters/obsidian/ui/editors/ReadingModeHeader.tsx -var import_react179 = __toESM(require_react()); +var import_react181 = __toESM(require_react()); var ReadingModeHeader = (props) => { - const [path, setPath] = (0, import_react179.useState)(props.filePath); - const ref2 = (0, import_react179.useRef)(null); - (0, import_react179.useEffect)(() => { + const [path, setPath] = (0, import_react181.useState)(props.filePath); + const ref2 = (0, import_react181.useRef)(null); + (0, import_react181.useEffect)(() => { setPath(props.filePath); }, [props.filePath]); const changeActiveFile = (path2) => { if (ref2.current.closest(".mod-active")) setPath(path2); }; - (0, import_react179.useEffect)(() => { + (0, import_react181.useEffect)(() => { props.superstate.ui.eventsDispatch.addListener( "activePathChanged", changeActiveFile @@ -126270,13 +126602,13 @@ var ReadingModeHeader = (props) => { ); }; }, []); - return /* @__PURE__ */ import_react179.default.createElement("div", { + return /* @__PURE__ */ import_react181.default.createElement("div", { ref: ref2 - }, /* @__PURE__ */ import_react179.default.createElement(PathProvider, { + }, /* @__PURE__ */ import_react181.default.createElement(PathProvider, { superstate: props.superstate, path, readMode: true - }, /* @__PURE__ */ import_react179.default.createElement(MarkdownHeaderView, { + }, /* @__PURE__ */ import_react181.default.createElement(MarkdownHeaderView, { superstate: props.superstate, editable: false }))); @@ -126284,7 +126616,7 @@ var ReadingModeHeader = (props) => { // src/adapters/obsidian/utils/markdownPost.tsx var import_obsidian15 = require("obsidian"); -var import_react180 = __toESM(require_react()); +var import_react182 = __toESM(require_react()); var replaceInlineContext = (plugin, el, ctx) => { replaceMarkdownForReadingMode(el, async (dom) => { const element = dom.querySelector(".mod-header"); @@ -126310,7 +126642,7 @@ var replaceInlineContext = (plugin, el, ctx) => { const construct = (root2) => { if (ctx.sourcePath.match(urlRegex)) { root2.render( - /* @__PURE__ */ import_react180.default.createElement(RemoteMarkdownHeaderView, { + /* @__PURE__ */ import_react182.default.createElement(RemoteMarkdownHeaderView, { superstate: plugin.superstate, fm: ctx.frontmatter, name: pathToString(ctx.sourcePath) @@ -126318,7 +126650,7 @@ var replaceInlineContext = (plugin, el, ctx) => { ); } else { root2.render( - /* @__PURE__ */ import_react180.default.createElement(ReadingModeHeader, { + /* @__PURE__ */ import_react182.default.createElement(ReadingModeHeader, { superstate: plugin.superstate, filePath: ctx.sourcePath }) @@ -127453,7 +127785,7 @@ var patchWorkspace = (plugin) => { }; // src/adapters/obsidian/utils/flow/flow.tsx -var import_react181 = __toESM(require_react()); +var import_react183 = __toESM(require_react()); var modifyFlowDom = (plugin) => { if (!plugin.superstate.settings.makerMode || !plugin.superstate.settings.inlineContext || !plugin.app.workspace.activeEditor) return; @@ -127475,11 +127807,11 @@ var modifyFlowDom = (plugin) => { } const construct = (root2) => { root2.render( - /* @__PURE__ */ import_react181.default.createElement(PathProvider, { + /* @__PURE__ */ import_react183.default.createElement(PathProvider, { superstate: plugin.superstate, path: file.path, readMode: false - }, /* @__PURE__ */ import_react181.default.createElement(MarkdownHeaderView, { + }, /* @__PURE__ */ import_react183.default.createElement(MarkdownHeaderView, { superstate: plugin.superstate, editorView: editorView.cm, editable: true, @@ -127510,7 +127842,7 @@ var modifyFlowDom = (plugin) => { } const backlinksReactEl = plugin.ui.createRoot(backlinksEl); backlinksReactEl.render( - /* @__PURE__ */ import_react181.default.createElement(Backlinks, { + /* @__PURE__ */ import_react183.default.createElement(Backlinks, { superstate: plugin.superstate, path: file.path }) @@ -127521,6 +127853,7 @@ var modifyFlowDom = (plugin) => { // src/adapters/mdb/db/db.ts var import_jszip = __toESM(require_jszip_min()); +import_jszip.default.support.nodebuffer = false; var getDBFile = async (plugin, path, isRemote) => { if (isRemote) { return fetch(path).then((res) => res.arrayBuffer()); @@ -127926,7 +128259,7 @@ var getMDBTableSchemas = async (plugin, path) => { try { schemas = db.exec(`SELECT * FROM m_schema`); } catch (e4) { - console.log(e4); + console.log(e4, path); } db.close(); return (schemas[0]?.values ?? []).map((f2) => { @@ -128897,23 +129230,52 @@ var ObsidianFileSystem = class { const file = await this.getFile(path); if (!file) return; - const newPath = folder + "/" + file.filename; + let newPath = folder + "/" + file.filename; let newFile; if (file.isFolder) { + const recursiveCopy = async (folder2, newPath2) => { + const files = await this.plugin.app.vault.adapter.list(folder2); + for (const f2 of files.files) { + await this.plugin.app.vault.adapter.copy(f2, newPath2 + "/" + f2.split("/").pop()); + } + for (const f2 of files.folders) { + await this.createFolder(newPath2 + "/" + f2.split("/").pop()); + await recursiveCopy(f2, newPath2 + "/" + f2.split("/").pop()); + } + }; + if (await this.fileExists(newPath)) { + const folders = await this.plugin.app.vault.adapter.list(folder).then((g) => g.folders); + const newName = uniqueNameFromString(file.name, folders.map((f2) => f2.split("/").pop())); + newPath = folder + "/" + newName; + } newFile = await this.createFolder(newPath); + await recursiveCopy(file.path, newPath); } else if (file) { - newFile = tFileToAFile(await this.plugin.app.vault.copy(this.plugin.app.vault.getAbstractFileByPath(file.path), folder + "/" + file.filename)); + if (!await this.fileExists(folder)) { + await this.createFolder(folder); + } + try { + if (await this.fileExists(newPath)) { + const files = await this.plugin.app.vault.adapter.list(folder).then((g) => g.files); + const newName = uniqueNameFromString(file.name, files.map((f2) => pathToString(f2))); + newPath = folder + "/" + newName + "." + file.extension; + } + await this.plugin.app.vault.adapter.copy(file.path, newPath); + } catch (e4) { + } + newFile = tFileToAFile(this.plugin.app.vault.getAbstractFileByPath(newPath)); } if (!newFile) return; this.cache.set(newFile.path, { ...this.cache.get(file.path), file: newFile, - label: { ...this.cache.get(path).label, name: newFile.name }, + label: { ...this.cache.get(path)?.label, name: newFile.name }, parent: newFile.parent, type: newFile.isFolder ? "space" : "file", subtype: newFile.isFolder ? "folder" : newFile.extension }); + return newPath; } async writeTextToFile(path, content3) { const newFile = this.plugin.app.vault.getAbstractFileByPath(path); @@ -128949,8 +129311,8 @@ var ObsidianFileSystem = class { } async createFolder(path) { if (!await this.fileExists(path)) { - const newFolder = await this.plugin.app.vault.createFolder(path); - return tFileToAFile(newFolder); + await this.plugin.app.vault.adapter.mkdir(path); + return this.getFile(path); } else { return this.getFile(path); } @@ -128969,6 +129331,7 @@ var ObsidianFileSystem = class { if (!await this.fileExists(path)) { return null; } + const type = await this.plugin.app.vault.adapter.stat(path).then((f2) => f2.type); const extension = path.split(".").pop(); const folder = path.split("/").slice(0, -1).join("/"); const filename = path.split("/").pop(); @@ -128978,7 +129341,7 @@ var ObsidianFileSystem = class { name: name317, filename, parent: folder, - isFolder: false, + isFolder: type == "folder", extension }; } @@ -129942,7 +130305,9 @@ var uiIconSet = { `, "package-plus": ``, "square-kanban": ``, - "formula": `` + "formula": ``, + "clipboard-pen": ``, + "clipboard-add": `` }; // src/adapters/obsidian/ui/sticker.ts @@ -129961,7 +130326,14 @@ var stickerFromString = (sticker, plugin) => { } else if (type == "lucide") { return lucideIcon(value); } else { - return plugin.superstate.iconsCache.get(value); + let icon = plugin.superstate.iconsCache.get(value); + if (!icon) { + const alias = plugin.superstate.imagesCache.get(value); + if (alias) { + icon = plugin.superstate.iconsCache.get(alias); + } + } + return icon; } }; @@ -130172,7 +130544,7 @@ var MakeMenu = class extends import_obsidian23.EditorSuggest { // src/adapters/obsidian/ui/editors/markdownView/menus/StickerMenu.tsx var import_obsidian24 = require("obsidian"); -var import_react182 = __toESM(require_react()); +var import_react184 = __toESM(require_react()); // src/schemas/emoji.ts var emojis = { @@ -135619,7 +135991,7 @@ var StickerMenu = class extends import_obsidian24.EditorSuggest { div2.setAttribute("aria-label", value.label); const reactElement = this.plugin.ui.createRoot(div2); reactElement.render( - /* @__PURE__ */ import_react182.default.createElement(import_react182.default.Fragment, null, value.unicode.length > 0 ? emojiFromString(value.unicode) : i18n_default.commandsSuggest.noResult) + /* @__PURE__ */ import_react184.default.createElement(import_react184.default.Fragment, null, value.unicode.length > 0 ? emojiFromString(value.unicode) : i18n_default.commandsSuggest.noResult) ); el.appendChild(div2); } @@ -135650,7 +136022,7 @@ var registerEditorMenus = (plugin) => { // src/adapters/obsidian/ui/ui.tsx var import_obsidian26 = require("obsidian"); -var import_react189 = __toESM(require_react()); +var import_react191 = __toESM(require_react()); var import_client = __toESM(require_client()); // src/adapters/obsidian/utils/leaf.ts @@ -135678,8 +136050,15 @@ var modifyTabSticker = (plugin) => { return; const pathCache = plugin.superstate.pathsIndex.get(file.path); if (pathCache?.label.sticker && leaf.tabHeaderInnerIconEl) { - const icon = stickerFromString(pathCache.label.sticker, plugin); - leaf.tabHeaderInnerIconEl.innerHTML = icon; + const [stickerType, stickerPath] = parseStickerString(pathCache.label.sticker); + if (stickerType == "image") { + const path = plugin.superstate.ui.getUIPath(plugin.superstate.imagesCache.get(stickerPath)); + if (path) + leaf.tabHeaderInnerIconEl.innerHTML = ``; + } else { + const icon = stickerFromString(pathCache.label.sticker, plugin); + leaf.tabHeaderInnerIconEl.innerHTML = icon; + } } return; } else { @@ -135688,8 +136067,16 @@ var modifyTabSticker = (plugin) => { const spacePath = leaf.view.getState().path; const fileCache = plugin.superstate.pathsIndex.get(spacePath); if (fileCache?.label?.sticker && leaf.tabHeaderInnerIconEl) { - const icon = stickerFromString(fileCache.label?.sticker, plugin); - leaf.tabHeaderInnerIconEl.innerHTML = icon; + const [stickerType, stickerPath] = parseStickerString(fileCache.label.sticker); + if (stickerType == "image") { + const path = plugin.superstate.ui.getUIPath(plugin.superstate.imagesCache.get(stickerPath)); + if (!path) + return path; + leaf.tabHeaderInnerIconEl.innerHTML = ``; + } else { + const icon = stickerFromString(fileCache.label.sticker, plugin); + leaf.tabHeaderInnerIconEl.innerHTML = icon; + } } return; } @@ -135697,17 +136084,17 @@ var modifyTabSticker = (plugin) => { }; // src/core/react/hooks/useInTreeCreateRoot.tsx -var import_react183 = __toESM(require_react()); +var import_react185 = __toESM(require_react()); var import_react_dom11 = __toESM(require_react_dom()); function useInTreeCreateRoot() { - const [roots, setRoots] = (0, import_react183.useState)(/* @__PURE__ */ new Map()); - const [rootMap, setRootMap] = (0, import_react183.useState)( + const [roots, setRoots] = (0, import_react185.useState)(/* @__PURE__ */ new Map()); + const [rootMap, setRootMap] = (0, import_react185.useState)( /* @__PURE__ */ new Map() ); const getRoot = (container) => { return rootMap.get(container); }; - const createRoot2 = (0, import_react183.useCallback)( + const createRoot2 = (0, import_react185.useCallback)( (container, options) => { const root = { render: (children) => { @@ -135740,7 +136127,7 @@ function useInTreeCreateRoot() { }, [] ); - const portals = (0, import_react183.useMemo)(() => { + const portals = (0, import_react185.useMemo)(() => { return [...roots.entries()].map(([container, root]) => { return (0, import_react_dom11.createPortal)(root, container); }); @@ -135749,7 +136136,7 @@ function useInTreeCreateRoot() { } // src/adapters/obsidian/ui/WindowManager.tsx -var import_react184 = __toESM(require_react()); +var import_react186 = __toESM(require_react()); var WindowManager = (props) => { const sensors = useSensors( useSensor(MouseSensor, { @@ -135768,13 +136155,13 @@ var WindowManager = (props) => { }) ); const { createRoot: createRoot2, portals, getRoot } = useInTreeCreateRoot(); - (0, import_react184.useEffect)(() => { + (0, import_react186.useEffect)(() => { props.ui.createRoot = createRoot2; props.ui.getRoot = getRoot; props.ui.manager.eventsDispatch.dispatchEvent("windowReady", null); }, [createRoot2]); - const [dragActive, setDragActive] = import_react184.default.useState(false); - return /* @__PURE__ */ import_react184.default.createElement(DndContext, { + const [dragActive, setDragActive] = import_react186.default.useState(false); + return /* @__PURE__ */ import_react186.default.createElement(DndContext, { sensors, onDragStart: () => { setDragActive(true); @@ -135792,13 +136179,13 @@ var WindowManager = (props) => { strategy: MeasuringStrategy.Always } } - }, /* @__PURE__ */ import_react184.default.createElement(WindowProvider, { + }, /* @__PURE__ */ import_react186.default.createElement(WindowProvider, { dragActive }, portals)); }; // src/core/react/components/UI/Modals/modalWrapper.tsx -var import_react185 = __toESM(require_react()); +var import_react187 = __toESM(require_react()); var ModalWrapper = (props) => { const { setNodeRef, isOver } = useDroppable({ id: "_modal", @@ -135811,26 +136198,26 @@ var ModalWrapper = (props) => { } } }); - return /* @__PURE__ */ import_react185.default.createElement("div", { + return /* @__PURE__ */ import_react187.default.createElement("div", { className: `mk-modal-container`, ref: setNodeRef - }, /* @__PURE__ */ import_react185.default.createElement(ModalInner, { + }, /* @__PURE__ */ import_react187.default.createElement(ModalInner, { ui: props.ui, hide: props.hide, className: props.className }, props.children)); }; var ModalInner = (props) => { - const ref2 = import_react185.default.useRef(null); + const ref2 = import_react187.default.useRef(null); const { setNodeRef, isOver } = useDroppable({ id: "_modalInner", data: { id: "_modalInner" } }); - const [isPending, startTransition] = (0, import_react185.useTransition)(); - (0, import_react185.useEffect)(() => { + const [isPending, startTransition] = (0, import_react187.useTransition)(); + (0, import_react187.useEffect)(() => { startTransition(() => null); }, []); - (0, import_react185.useEffect)(() => { + (0, import_react187.useEffect)(() => { const onKeyDown = (e4) => { if (e4.key == "Escape") { props.hide(); @@ -135863,7 +136250,7 @@ var ModalInner = (props) => { props.ui.inputManager.off("keydown", onKeyDown); }; }, [props.hide]); - return /* @__PURE__ */ import_react185.default.createElement("div", { + return /* @__PURE__ */ import_react187.default.createElement("div", { className: `${props.className}`, style: !isPending ? {} : {}, ref: (el) => { @@ -135874,7 +136261,7 @@ var ModalInner = (props) => { }; // src/adapters/obsidian/ui/modal.tsx -var import_react186 = __toESM(require_react()); +var import_react188 = __toESM(require_react()); var showModal = (props) => { const portalElement = document.createElement("div"); if (isTouchScreen(props.ui.manager)) { @@ -135896,35 +136283,35 @@ var showModal = (props) => { const root = props.ui.createRoot(portalElement); const hide = hideFunction(root); root.render( - /* @__PURE__ */ import_react186.default.createElement(ModalWrapper, { + /* @__PURE__ */ import_react188.default.createElement(ModalWrapper, { ui: props.ui.manager, hide: () => hide(), className: `${props.isPalette ? "mk-palette" : "mk-modal"} ${props.className ? props.className : ""}` - }, !props.isPalette && /* @__PURE__ */ import_react186.default.createElement("div", { + }, !props.isPalette && /* @__PURE__ */ import_react188.default.createElement("div", { className: "mk-modal-header" - }, props.title && /* @__PURE__ */ import_react186.default.createElement("div", { + }, props.title && /* @__PURE__ */ import_react188.default.createElement("div", { className: "mk-modal-title" - }, props.title), /* @__PURE__ */ import_react186.default.createElement("div", { + }, props.title), /* @__PURE__ */ import_react188.default.createElement("div", { className: "mk-x-small", dangerouslySetInnerHTML: { __html: props.ui.getSticker("ui//close") }, onClick: () => hide() - })), /* @__PURE__ */ import_react186.default.createElement(props.fc, { + })), /* @__PURE__ */ import_react188.default.createElement(props.fc, { hide: () => hide() })) ); }; // src/core/react/components/UI/Modals/HiddenFiles.tsx -var import_react187 = __toESM(require_react()); +var import_react189 = __toESM(require_react()); var HiddenPaths = (props) => { const { superstate } = props; - const ref2 = (0, import_react187.useRef)(null); - const [hiddenPaths, setHiddenPaths] = (0, import_react187.useState)( + const ref2 = (0, import_react189.useRef)(null); + const [hiddenPaths, setHiddenPaths] = (0, import_react189.useState)( superstate.settings.hiddenFiles ); - const [hiddenExtensions, setHiddenExtensions] = (0, import_react187.useState)( + const [hiddenExtensions, setHiddenExtensions] = (0, import_react189.useState)( superstate.settings.hiddenExtensions ); const saveExtension = (value) => { @@ -135965,7 +136352,7 @@ var HiddenPaths = (props) => { setHiddenPaths(superstate.settings.hiddenFiles); setHiddenExtensions(superstate.settings.hiddenExtensions); }; - (0, import_react187.useEffect)(() => { + (0, import_react189.useEffect)(() => { props.superstate.eventsDispatcher.addListener( "settingsChanged", settingsChanged @@ -135996,57 +136383,57 @@ var HiddenPaths = (props) => { searchable: true }); }; - return /* @__PURE__ */ import_react187.default.createElement("div", { + return /* @__PURE__ */ import_react189.default.createElement("div", { className: "modal-content" - }, /* @__PURE__ */ import_react187.default.createElement("div", { + }, /* @__PURE__ */ import_react189.default.createElement("div", { className: "setting-item setting-item-heading" - }, i18n_default.labels.hiddenFilePattern), /* @__PURE__ */ import_react187.default.createElement("div", { + }, i18n_default.labels.hiddenFilePattern), /* @__PURE__ */ import_react189.default.createElement("div", { className: "setting-item-description" - }, i18n_default.descriptions.hiddenFileOptions), /* @__PURE__ */ import_react187.default.createElement("div", null, hiddenExtensions.map((f2, index) => /* @__PURE__ */ import_react187.default.createElement("div", { + }, i18n_default.descriptions.hiddenFileOptions), /* @__PURE__ */ import_react189.default.createElement("div", null, hiddenExtensions.map((f2, index) => /* @__PURE__ */ import_react189.default.createElement("div", { key: index, className: "mobile-option-setting-item" - }, /* @__PURE__ */ import_react187.default.createElement("span", { + }, /* @__PURE__ */ import_react189.default.createElement("span", { className: "mobile-option-setting-item-name" - }, f2), /* @__PURE__ */ import_react187.default.createElement("div", { + }, f2), /* @__PURE__ */ import_react189.default.createElement("div", { className: "clickable-icon mobile-option-setting-item-option-icon", "aria-label": i18n_default.buttons.delete, dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//close") }, onClick: () => removeExtension(index) - })))), /* @__PURE__ */ import_react187.default.createElement("div", { + })))), /* @__PURE__ */ import_react189.default.createElement("div", { className: "setting-item" - }, /* @__PURE__ */ import_react187.default.createElement("input", { + }, /* @__PURE__ */ import_react189.default.createElement("input", { placeholder: i18n_default.labels.addExtension, type: "text", ref: ref2 - }), /* @__PURE__ */ import_react187.default.createElement("button", { + }), /* @__PURE__ */ import_react189.default.createElement("button", { onClick: (e4) => addExtension() - }, i18n_default.buttons.add)), /* @__PURE__ */ import_react187.default.createElement("div", { + }, i18n_default.buttons.add)), /* @__PURE__ */ import_react189.default.createElement("div", { className: "setting-item setting-item-heading" - }, i18n_default.subViews.filesAndFolders), /* @__PURE__ */ import_react187.default.createElement("div", { + }, i18n_default.subViews.filesAndFolders), /* @__PURE__ */ import_react189.default.createElement("div", { className: "setting-item-description" - }, i18n_default.labels.hiddenFileSpecific), /* @__PURE__ */ import_react187.default.createElement("div", null, hiddenPaths.map((f2, index) => /* @__PURE__ */ import_react187.default.createElement("div", { + }, i18n_default.labels.hiddenFileSpecific), /* @__PURE__ */ import_react189.default.createElement("div", null, hiddenPaths.map((f2, index) => /* @__PURE__ */ import_react189.default.createElement("div", { key: index, className: "mobile-option-setting-item" - }, /* @__PURE__ */ import_react187.default.createElement("span", { + }, /* @__PURE__ */ import_react189.default.createElement("span", { className: "mobile-option-setting-item-name" - }, f2), /* @__PURE__ */ import_react187.default.createElement("div", { + }, f2), /* @__PURE__ */ import_react189.default.createElement("div", { className: "clickable-icon mobile-option-setting-item-option-icon", "aria-label": i18n_default.buttons.delete, dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//close") }, onClick: () => removeItem(index) - })))), /* @__PURE__ */ import_react187.default.createElement("div", { + })))), /* @__PURE__ */ import_react189.default.createElement("div", { className: "setting-item" - }, /* @__PURE__ */ import_react187.default.createElement("button", { + }, /* @__PURE__ */ import_react189.default.createElement("button", { onClick: (e4) => addMenu(e4) }, "+ ", i18n_default.buttons.addFile))); }; // src/adapters/obsidian/ui/showMainMenu.tsx -var import_react188 = __toESM(require_react()); +var import_react190 = __toESM(require_react()); var showMainMenu = (el, superstate, app2) => { const toggleSections = (collapse) => { const spaces2 = superstate.waypoints[superstate.settings.currentWaypoint].paths; @@ -136092,7 +136479,7 @@ var showMainMenu = (el, superstate, app2) => { onClick: () => { superstate.ui.openModal( "Rename System", - (props) => /* @__PURE__ */ import_react188.default.createElement(InputModal, { + (props) => /* @__PURE__ */ import_react190.default.createElement(InputModal, { value: "", saveLabel: "Rename System", hide: props.hide, @@ -136110,7 +136497,7 @@ var showMainMenu = (el, superstate, app2) => { onClick: () => { superstate.ui.openModal( i18n_default.labels.hiddenFiles, - (props) => /* @__PURE__ */ import_react188.default.createElement(HiddenPaths, { + (props) => /* @__PURE__ */ import_react190.default.createElement(HiddenPaths, { superstate, close: props.hide }) @@ -136377,12 +136764,18 @@ var ObsidianUI = class { this.createRoot = () => null; this.getRoot = () => null; this.root = (0, import_client.createRoot)(newDiv); - this.root.render(/* @__PURE__ */ import_react189.default.createElement(WindowManager, { + this.root.render(/* @__PURE__ */ import_react191.default.createElement(WindowManager, { ui: this })); } }; +// src/core/utils/parser.tsx +var parseSortStrat = (str) => { + const [a4, b2] = str.split("_"); + return { field: a4, asc: b2 == "asc", group: true }; +}; + // src/adapters/obsidian/utils/migration.ts var import_obsidian27 = require("obsidian"); var migrate09 = async (plugin) => { @@ -136650,19 +137043,19 @@ var CLIManager = class { }; // src/core/react/components/Blink/Blink.tsx -var import_react191 = __toESM(require_react()); +var import_react193 = __toESM(require_react()); // src/core/react/components/Blink/BlinkComponent.tsx -var import_react190 = __toESM(require_react()); +var import_react192 = __toESM(require_react()); var BlinkComponent = (props) => { - const [previewPath, setPreviewPath] = (0, import_react190.useState)(null); - const [query, setQuery] = (0, import_react190.useState)(""); - const [index, setIndex] = (0, import_react190.useState)(0); + const [previewPath, setPreviewPath] = (0, import_react192.useState)(null); + const [query, setQuery] = (0, import_react192.useState)(""); + const [index, setIndex] = (0, import_react192.useState)(0); const onChange = (query2) => { setQuery(query2); }; - const [filters, setFilters] = (0, import_react190.useState)([]); - const queries = (0, import_react190.useMemo)(() => { + const [filters, setFilters] = (0, import_react192.useState)([]); + const queries = (0, import_react192.useMemo)(() => { return query.length > 0 ? [ { type: "any", @@ -136680,7 +137073,7 @@ var BlinkComponent = (props) => { ...filters ] : filters; }, [query, filters]); - const [suggestions, setFilteredPaths] = (0, import_react190.useState)([]); + const [suggestions, setFilteredPaths] = (0, import_react192.useState)([]); const saveQuerySpace = (e4) => { showSpacesMenu( e4, @@ -136698,7 +137091,7 @@ var BlinkComponent = (props) => { true ); }; - (0, import_react190.useEffect)(() => { + (0, import_react192.useEffect)(() => { props.superstate.runner.run({ type: "search", path: "", @@ -136714,7 +137107,7 @@ var BlinkComponent = (props) => { ) ); }, [queries]); - (0, import_react190.useEffect)(() => { + (0, import_react192.useEffect)(() => { const path = suggestions[index]?.value; if (!path || path == previewPath) return; @@ -136781,8 +137174,8 @@ var BlinkComponent = (props) => { suggestionActive: "mk-active", suggestionDisabled: "mk-disabled" }; - const ref2 = import_react190.default.useRef(null); - (0, import_react190.useEffect)(() => { + const ref2 = import_react192.default.useRef(null); + (0, import_react192.useEffect)(() => { ref2.current?.focus(); }, [ref2.current]); const metadataProperties = allMetadata(props.superstate); @@ -136798,30 +137191,30 @@ var BlinkComponent = (props) => { value: f2 }; }); - return /* @__PURE__ */ import_react190.default.createElement(import_react190.default.Fragment, null, /* @__PURE__ */ import_react190.default.createElement("div", { + return /* @__PURE__ */ import_react192.default.createElement(import_react192.default.Fragment, null, /* @__PURE__ */ import_react192.default.createElement("div", { "data-placeholder": i18n_default.labels.blinkPlaceholder, onInput: (e4) => onChange(e4.currentTarget.innerText), onKeyDown: (e4) => keyDown(e4), className: "mk-input-large mk-border-bottom", ref: ref2, contentEditable: true - }), /* @__PURE__ */ import_react190.default.createElement("div", { + }), /* @__PURE__ */ import_react192.default.createElement("div", { className: "mk-blink-filters" - }, /* @__PURE__ */ import_react190.default.createElement("div", { + }, /* @__PURE__ */ import_react192.default.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: props.superstate.ui.getSticker("ui//filter") } - }), /* @__PURE__ */ import_react190.default.createElement(SpaceQuery, { + }), /* @__PURE__ */ import_react192.default.createElement(SpaceQuery, { superstate: props.superstate, filters, setFilters, fields: allOptions, sections: allSections - })), /* @__PURE__ */ import_react190.default.createElement("div", { + })), /* @__PURE__ */ import_react192.default.createElement("div", { className: `mk-blink-suggester`, style: {} - }, /* @__PURE__ */ import_react190.default.createElement(SelectMenuSuggestions_default, { + }, /* @__PURE__ */ import_react192.default.createElement(SelectMenuSuggestions_default, { expanded: false, addKeyword: "Create", options: suggestions, @@ -136836,31 +137229,31 @@ var BlinkComponent = (props) => { allowNew: false, ui: props.superstate.ui, isDisclosureMenu: false - }), /* @__PURE__ */ import_react190.default.createElement(BlinkPathWrapper, { + }), /* @__PURE__ */ import_react192.default.createElement(BlinkPathWrapper, { superstate: props.superstate, path: previewPath }))); }; var BlinkPathWrapper = (props) => { - const ref2 = import_react190.default.useRef(null); - return /* @__PURE__ */ import_react190.default.createElement("div", { + const ref2 = import_react192.default.useRef(null); + return /* @__PURE__ */ import_react192.default.createElement("div", { className: "mk-blink-preview", ref: ref2 - }, /* @__PURE__ */ import_react190.default.createElement(PathView, { + }, /* @__PURE__ */ import_react192.default.createElement(PathView, { id: "blink", superstate: props.superstate, path: props.path, containerRef: ref2, styles: {} - }), /* @__PURE__ */ import_react190.default.createElement("div", { + }), /* @__PURE__ */ import_react192.default.createElement("div", { className: "mk-blink-properties" - }, /* @__PURE__ */ import_react190.default.createElement("div", { + }, /* @__PURE__ */ import_react192.default.createElement("div", { className: "mk-blink-properties-header" - }, "Properties"), /* @__PURE__ */ import_react190.default.createElement(PathProvider, { + }, "Properties"), /* @__PURE__ */ import_react192.default.createElement(PathProvider, { path: props.path, superstate: props.superstate, readMode: false - }, /* @__PURE__ */ import_react190.default.createElement(ContextPropertiesView, { + }, /* @__PURE__ */ import_react192.default.createElement(ContextPropertiesView, { superstate: props.superstate, editable: false })))); @@ -136869,7 +137262,7 @@ var BlinkPathWrapper = (props) => { // src/core/react/components/Blink/Blink.tsx var openBlinkModal = (superstate) => { superstate.ui.openPalette( - (props) => /* @__PURE__ */ import_react191.default.createElement(BlinkComponent, { + (props) => /* @__PURE__ */ import_react193.default.createElement(BlinkComponent, { superstate, hide: props.hide }), @@ -136878,39 +137271,39 @@ var openBlinkModal = (superstate) => { }; // src/core/test/TestComponent.tsx -var import_react192 = __toESM(require_react()); +var import_react194 = __toESM(require_react()); var openTestModal = (superstate) => { - superstate.ui.openModal("Tests", (props) => /* @__PURE__ */ import_react192.default.createElement(TestComponent, { + superstate.ui.openModal("Tests", (props) => /* @__PURE__ */ import_react194.default.createElement(TestComponent, { superstate })); }; var TestInputComponent = (props) => { - const [value, setValue] = (0, import_react192.useState)(""); - return /* @__PURE__ */ import_react192.default.createElement("div", null, /* @__PURE__ */ import_react192.default.createElement("input", { + const [value, setValue] = (0, import_react194.useState)(""); + return /* @__PURE__ */ import_react194.default.createElement("div", null, /* @__PURE__ */ import_react194.default.createElement("input", { onChange: (e4) => setValue(e4.target.value) - }), /* @__PURE__ */ import_react192.default.createElement("button", { + }), /* @__PURE__ */ import_react194.default.createElement("button", { onClick: () => props.action(value) }, props.children)); }; var TestActionComponent = (props) => { - return /* @__PURE__ */ import_react192.default.createElement("div", null, /* @__PURE__ */ import_react192.default.createElement("button", { + return /* @__PURE__ */ import_react194.default.createElement("div", null, /* @__PURE__ */ import_react194.default.createElement("button", { onClick: () => props.action() }, props.children)); }; var TestToggleSection = (props) => { - const [expanded, setExpanded] = (0, import_react192.useState)(false); - return /* @__PURE__ */ import_react192.default.createElement("div", null, /* @__PURE__ */ import_react192.default.createElement("h2", { + const [expanded, setExpanded] = (0, import_react194.useState)(false); + return /* @__PURE__ */ import_react194.default.createElement("div", null, /* @__PURE__ */ import_react194.default.createElement("h2", { onClick: () => setExpanded((f2) => !f2) - }, props.section), expanded && /* @__PURE__ */ import_react192.default.createElement("div", null, props.children)); + }, props.section), expanded && /* @__PURE__ */ import_react194.default.createElement("div", null, props.children)); }; var TestComponent = (props) => { const { superstate } = props; - const [space2, setSpace] = (0, import_react192.useState)(null); - const [path, setPath] = (0, import_react192.useState)(null); - const [sticker, setSticker] = (0, import_react192.useState)(null); - const [image, setImage] = (0, import_react192.useState)(null); - const [output, setOutput] = (0, import_react192.useState)(""); - (0, import_react192.useEffect)(() => { + const [space2, setSpace] = (0, import_react194.useState)(null); + const [path, setPath] = (0, import_react194.useState)(null); + const [sticker, setSticker] = (0, import_react194.useState)(null); + const [image, setImage] = (0, import_react194.useState)(null); + const [output, setOutput] = (0, import_react194.useState)(""); + (0, import_react194.useEffect)(() => { superstate.eventsDispatcher.addListener( "spaceStateUpdated", (payload) => { @@ -136928,50 +137321,50 @@ var TestComponent = (props) => { } ); }, []); - return /* @__PURE__ */ import_react192.default.createElement("div", { + return /* @__PURE__ */ import_react194.default.createElement("div", { className: "mk-layout-row", style: { fontSize: "10px" } - }, /* @__PURE__ */ import_react192.default.createElement("div", null, /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }, /* @__PURE__ */ import_react194.default.createElement("div", null, /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => setOutput( JSON.stringify(superstate.spaceManager.uriByString(value)) ) - }, "URI"), /* @__PURE__ */ import_react192.default.createElement(TestToggleSection, { + }, "URI"), /* @__PURE__ */ import_react194.default.createElement(TestToggleSection, { section: "Space" - }, /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }, /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => setSpace(superstate.spacesIndex.get(value)) - }, "Select Space"), /* @__PURE__ */ import_react192.default.createElement("p", null, space2?.path ?? "No Selected Space", /* @__PURE__ */ import_react192.default.createElement("button", { + }, "Select Space"), /* @__PURE__ */ import_react194.default.createElement("p", null, space2?.path ?? "No Selected Space", /* @__PURE__ */ import_react194.default.createElement("button", { onClick: () => setSpace(superstate.spacesIndex.get(space2.path)) - }, "Refresh"), /* @__PURE__ */ import_react192.default.createElement("button", { + }, "Refresh"), /* @__PURE__ */ import_react194.default.createElement("button", { onClick: () => setPath(superstate.pathsIndex.get(space2.path)) - }, "Set Path")), space2 && /* @__PURE__ */ import_react192.default.createElement("div", null, "Contexts ", space2.contexts?.map((f2) => f2), superstate.getSpaceItems(space2.path).map((f2, i3) => /* @__PURE__ */ import_react192.default.createElement("div", { + }, "Set Path")), space2 && /* @__PURE__ */ import_react194.default.createElement("div", null, "Contexts ", space2.contexts?.map((f2) => f2), superstate.getSpaceItems(space2.path).map((f2, i3) => /* @__PURE__ */ import_react194.default.createElement("div", { key: i3 - }, f2.path, " ", /* @__PURE__ */ import_react192.default.createElement("button", { + }, f2.path, " ", /* @__PURE__ */ import_react194.default.createElement("button", { onClick: () => setSpace(superstate.spacesIndex.get(f2.path)) - }, "Set Space"), /* @__PURE__ */ import_react192.default.createElement("button", { + }, "Set Space"), /* @__PURE__ */ import_react194.default.createElement("button", { onClick: () => setPath(superstate.pathsIndex.get(f2.path)) - }, "Set Path"), /* @__PURE__ */ import_react192.default.createElement("button", { + }, "Set Path"), /* @__PURE__ */ import_react194.default.createElement("button", { onClick: () => navigator.clipboard.writeText(f2.path) - }, "Copy"))))), /* @__PURE__ */ import_react192.default.createElement(TestToggleSection, { + }, "Copy"))))), /* @__PURE__ */ import_react194.default.createElement(TestToggleSection, { section: "Path" - }, /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }, /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => setPath(superstate.pathsIndex.get(value)) - }, "Select Path"), /* @__PURE__ */ import_react192.default.createElement("p", null, path?.path ?? "No Selected Path"), path && /* @__PURE__ */ import_react192.default.createElement("div", null, "Sticker", /* @__PURE__ */ import_react192.default.createElement("div", { + }, "Select Path"), /* @__PURE__ */ import_react194.default.createElement("p", null, path?.path ?? "No Selected Path"), path && /* @__PURE__ */ import_react194.default.createElement("div", null, "Sticker", /* @__PURE__ */ import_react194.default.createElement("div", { dangerouslySetInnerHTML: { __html: superstate.ui.getSticker(path?.label.sticker) }, style: { height: "50px", width: "50px" } - }), "Banner", /* @__PURE__ */ import_react192.default.createElement("img", { + }), "Banner", /* @__PURE__ */ import_react194.default.createElement("img", { src: superstate.ui.getUIPath(path?.metadata.banner), style: { height: "50px", width: "50px" } - }))), /* @__PURE__ */ import_react192.default.createElement("h2", null, "Sticker"), /* @__PURE__ */ import_react192.default.createElement("div", { + }))), /* @__PURE__ */ import_react194.default.createElement("h2", null, "Sticker"), /* @__PURE__ */ import_react194.default.createElement("div", { dangerouslySetInnerHTML: { __html: superstate.ui.getSticker(sticker) }, style: { height: "50px", width: "50px" } - }), /* @__PURE__ */ import_react192.default.createElement("h2", null, "Image"), /* @__PURE__ */ import_react192.default.createElement("img", { + }), /* @__PURE__ */ import_react194.default.createElement("h2", null, "Image"), /* @__PURE__ */ import_react194.default.createElement("img", { src: superstate.ui.getUIPath(image), style: { height: "50px", width: "50px" } - }), /* @__PURE__ */ import_react192.default.createElement("h2", null, "Output"), /* @__PURE__ */ import_react192.default.createElement("div", null, output)), /* @__PURE__ */ import_react192.default.createElement("div", null, /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }), /* @__PURE__ */ import_react194.default.createElement("h2", null, "Output"), /* @__PURE__ */ import_react194.default.createElement("div", null, output)), /* @__PURE__ */ import_react194.default.createElement("div", null, /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => { try { parse3(value, { @@ -136982,56 +137375,56 @@ var TestComponent = (props) => { setOutput(e4); } } - }, "Acorn"), /* @__PURE__ */ import_react192.default.createElement(TestToggleSection, { + }, "Acorn"), /* @__PURE__ */ import_react194.default.createElement(TestToggleSection, { section: "Space" - }, /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }, /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => superstate.spaceManager.createSpace(value, space2.path, {}) - }, "Create Space"), /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }, "Create Space"), /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => superstate.spaceManager.renameSpace(space2.path, value) - }, "Rename Space"), /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }, "Rename Space"), /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => removeSpace(superstate, value) - }, "Delete Space"), /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }, "Delete Space"), /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => saveSpaceMetadataValue(props.superstate, space2.path, "contexts", [ value ]) - }, "Set Space Context"), /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }, "Set Space Context"), /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => removeSpace(superstate, value) - }, "Remove Space Context"), /* @__PURE__ */ import_react192.default.createElement(TestActionComponent, { + }, "Remove Space Context"), /* @__PURE__ */ import_react194.default.createElement(TestActionComponent, { action: () => savePathBanner(superstate, space2.path, image) - }, "Set Space Banner"), /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }, "Set Space Banner"), /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => updatePrimaryAlias(superstate, space2.path, [], value) - }, "Set Space Alias"), /* @__PURE__ */ import_react192.default.createElement(TestActionComponent, { + }, "Set Space Alias"), /* @__PURE__ */ import_react194.default.createElement(TestActionComponent, { action: () => savePathSticker(superstate, space2.path, sticker) - }, "Set Space Sticker")), /* @__PURE__ */ import_react192.default.createElement(TestToggleSection, { + }, "Set Space Sticker")), /* @__PURE__ */ import_react194.default.createElement(TestToggleSection, { section: "Path" - }, /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }, /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => newPathInSpace(superstate, space2, "md", value) - }, "Create Path"), /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }, "Create Path"), /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => superstate.spaceManager.copyPath(path.path, value) - }, "Copy Path"), /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }, "Copy Path"), /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => superstate.spaceManager.renamePath( path.path, movePath(path.path, value) ) - }, "Move Path"), /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }, "Move Path"), /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => deletePath(superstate, value) - }, "Delete Path"), /* @__PURE__ */ import_react192.default.createElement(TestInputComponent, { + }, "Delete Path"), /* @__PURE__ */ import_react194.default.createElement(TestInputComponent, { action: (value) => pinPathToSpaceAtIndex(superstate, space2, value) - }, "Pin Path")), /* @__PURE__ */ import_react192.default.createElement(TestToggleSection, { + }, "Pin Path")), /* @__PURE__ */ import_react194.default.createElement(TestToggleSection, { section: "Modals" - }, /* @__PURE__ */ import_react192.default.createElement("button", { - onClick: () => superstate.ui.openPalette((props2) => /* @__PURE__ */ import_react192.default.createElement(ImageModal_default, { + }, /* @__PURE__ */ import_react194.default.createElement("button", { + onClick: () => superstate.ui.openPalette((props2) => /* @__PURE__ */ import_react194.default.createElement(ImageModal_default, { hide: props2.hide, superstate, selectedPath: (value) => setImage(value) })) - }, "Set Image"), /* @__PURE__ */ import_react192.default.createElement("button", { - onClick: () => superstate.ui.openPalette((props2) => /* @__PURE__ */ import_react192.default.createElement(StickerModal_default, { + }, "Set Image"), /* @__PURE__ */ import_react194.default.createElement("button", { + onClick: () => superstate.ui.openPalette((props2) => /* @__PURE__ */ import_react194.default.createElement(StickerModal_default, { hide: props2.hide, ui: superstate.ui, selectedSticker: (value) => setSticker(value) })) - }, "Set Sticker")), /* @__PURE__ */ import_react192.default.createElement("div", null, /* @__PURE__ */ import_react192.default.createElement("h2", null, "Menus")), /* @__PURE__ */ import_react192.default.createElement("div", null, /* @__PURE__ */ import_react192.default.createElement("h2", null, "Modals")))); + }, "Set Sticker")), /* @__PURE__ */ import_react194.default.createElement("div", null, /* @__PURE__ */ import_react194.default.createElement("h2", null, "Menus")), /* @__PURE__ */ import_react194.default.createElement("div", null, /* @__PURE__ */ import_react194.default.createElement("h2", null, "Modals")))); }; // src/adapters/image/imageAdapter.ts @@ -137599,6 +137992,9 @@ var MakeMDPlugin = class extends import_obsidian29.Plugin { } async loadSettings() { this.superstate.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); + if (this.superstate.settings.hiddenExtensions.length == 1 && this.superstate.settings.hiddenExtensions[0] == ".mdb") { + this.superstate.settings.hiddenExtensions = DEFAULT_SETTINGS.hiddenExtensions; + } const userConfig = safelyParseJSON(await defaultConfigFile(this)); this.superstate.settings.newFileFolderPath = userConfig.newFileFolderPath; this.superstate.settings.newFileLocation = userConfig.newFileLocation; diff --git a/manifest.json b/manifest.json index 843b253..752b143 100755 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "make-md", "name": "MAKE.md", - "version": "0.9.13", + "version": "0.9.14", "minAppVersion": "0.16.0", "description": "Make.md brings powerful and modern note-taking features to Obsidian. Capture, organize and connect information with more flexibility without any code.", "author": "MAKE.md", diff --git a/styles.css b/styles.css index db54e50..5d769d2 100644 --- a/styles.css +++ b/styles.css @@ -40,6 +40,9 @@ body { --mk-color-yellow: #f7b731; --mk-color-charcoal: #4b6584; --mk-color-teal: #2d98da; + --mk-color-pink: #FC489F; + --mk-color-brown: #68381E; + --mk-color-gray: #8392A4; --mk-color-base-0: var(--color-base-00); --mk-color-base-10: var(--color-base-10); --mk-color-base-20: var(--color-base-20); @@ -270,12 +273,10 @@ body { overflow-x: auto; font-size: 15px; } -body:not(.is-mobile) .mk-view-selector, body:not(.is-mobile) .mk-view-options { opacity: 0; transition: all 0.2s ease; } -.mk-context-container:hover .mk-view-selector, .mk-context-container:hover .mk-view-options { opacity: 1; } @@ -299,6 +300,7 @@ body:not(.is-mobile) .mk-view-options { } .mk-table-selector button, .mk-view-config button { + padding: 4px 8px; font-size: max(13px, 1em); gap: 8px; font-weight: var(--font-medium); @@ -317,7 +319,6 @@ body:not(.is-mobile) .mk-view-config button:hover { display: flex; gap: 8px; align-items: center; - flex-wrap: wrap; margin-bottom: 8px; } .mk-view-config input { @@ -890,6 +891,11 @@ body:not(.is-mobile) .mk-frame-props-editor { overflow-y: scroll; animation: .15s ease-out 0s 1 fadeInFromNone; width: 100%; + height: 100%; +} +.mk-path-view iframe { + width: 100%; + height: 100%; } .mk-editor-frame-node-container { display: flex; @@ -1644,7 +1650,7 @@ body:not(.is-mobile) .mk-main-menu-button:hover { width: 16px; height: 16px; } -.cm-active.mk-placeholder:before { +.cm-focused .cm-active.mk-placeholder:before { content: attr(data-ph); color: var(--mk-ui-text-tertiary); position: absolute; @@ -2902,7 +2908,8 @@ body.is-mobile .sidebar-toggle-button { width: 18px; height: 18px; } -.workspace-tab-header-inner-icon svg { +.workspace-tab-header-inner-icon svg, +.workspace-tab-header-inner-icon img { width: var(--icon-size); height: var(--icon-size); } @@ -3084,7 +3091,8 @@ body:not(.is-mobile) .mk-folder-buttons button:hover { font-family: emoji; align-items: center; } -.mk-path-icon svg { +.mk-path-icon svg, +.mk-path-icon img { width: var(--icon-size); height: var(--icon-size); color: var(--icon-color) !important; @@ -3638,7 +3646,11 @@ body:not(.is-mobile) .mk-tree-wrapper .mk-folder-buttons { align-items: center; margin-bottom: 4px; } +.mk-node-link:hover .mk-collapse { + opacity: 1; +} .mk-node-link .mk-collapse { + opacity: 0; width: 24px !important; height: 24px !important; } @@ -4353,13 +4365,6 @@ body:not(.is-mobile) .markdown-source-view.mod-cm6.is-readable-line-width .mk-sp .mk-cell-file-item .mk-cell-file-name:hover { background: var(var(--mk-ui-active-hover)); } -.mk-cell-file .mk-path-icon { - margin-right: 4px; - align-items: center; - display: flex; - width: 24px; - border-radius: 4px; -} .mk-cell-file-new .mk-cell-file-name { padding: 4px !important; background: none !important;